WO2023226314A1 - 应用的缓存可伸缩处理方法、装置、设备及介质 - Google Patents

应用的缓存可伸缩处理方法、装置、设备及介质 Download PDF

Info

Publication number
WO2023226314A1
WO2023226314A1 PCT/CN2022/130596 CN2022130596W WO2023226314A1 WO 2023226314 A1 WO2023226314 A1 WO 2023226314A1 CN 2022130596 W CN2022130596 W CN 2022130596W WO 2023226314 A1 WO2023226314 A1 WO 2023226314A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
storage medium
target application
cache
read
Prior art date
Application number
PCT/CN2022/130596
Other languages
English (en)
French (fr)
Inventor
杨正
Original Assignee
杨正
卢聪
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杨正, 卢聪 filed Critical 杨正
Publication of WO2023226314A1 publication Critical patent/WO2023226314A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0897Caches characterised by their organisation or structure with two or more cache hierarchy levels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement

Definitions

  • the present application relates to the field of communication processing technology, and in particular to an applied caching scalable processing method, device, equipment and medium.
  • the storage of the terminal is limited, and complete application data needs to be downloaded when installing an application.
  • Some applications have large application data and occupy more storage space, making it impossible for the terminal to install more applications.
  • a lot of data will gradually accumulate during the use of the application, so the amount of data gradually increases with the use of the application, resulting in the terminal's storage space becoming smaller and smaller.
  • the first aspect of this application provides a scalable cache processing method for applications.
  • the method includes:
  • the data located in the local storage medium of the terminal is cleared through the corresponding cache component; wherein, after clearing, all data retained in the local storage medium is at least the Start the data in the running package to at least ensure the startup of the target application;
  • the cloud storage medium In response to the read request of the target application, obtain the data corresponding to the read request from the cloud storage medium and/or the local storage medium through the corresponding cache component to support the operation of the target application; wherein, The cloud storage medium stores original data that supports the operation of the target application.
  • the data located in the local storage medium of the terminal is cleared through the corresponding cache component, including:
  • the storage space release event is a partial clearing event
  • clear the data to be cleared in the local storage medium, and the data to be cleared is data determined based on the reading frequency and/or the latest reading time
  • the method further includes:
  • the local storage medium includes a memory, write the data cleared from the memory to a local storage medium with a corresponding response priority lower than that of the memory;
  • initialize multiple cache components corresponding to the target application including:
  • the performance configuration parameters include the version identification of the operating system of the terminal and/or the current performance configuration parameters of the memory on the terminal;
  • the plurality of cache components are initialized, wherein the number of the plurality of cache components is adapted to the performance configuration parameters.
  • initialize the multiple cache components including:
  • cache components corresponding to the multiple external memories are initialized.
  • the method also includes:
  • the interface layer includes a file system model, a sandbox model or a file interface model
  • the interface layer is used to receive the I/O request and the storage space release event issued by the target application.
  • the plurality of cache components have respective response priorities, wherein a cache component with a higher response priority corresponds to a storage medium with a faster response speed.
  • the method further includes at least one of the following:
  • the data read from the storage medium corresponding to the cache component with low response priority is written to the storage medium corresponding to the cache component with high response priority.
  • the data to be written is sequentially written to the corresponding storage medium in order of the response priorities of the multiple cache components from high to low, including:
  • the data to be written is read from the storage medium corresponding to the cache component with the highest response priority, and the data to be written is written to the corresponding storage medium through the cache component with a low response priority. .
  • each storage medium stores data supporting the operation of the target application in data block granularity, and the data blocks are obtained by dividing the original data of the target application into blocks; the method further includes:
  • each storage medium stores data that supports the operation of the target application in data block granularity.
  • the data blocks are obtained by dividing the original data of the target application into blocks.
  • the method further includes:
  • the target data blocks among the multiple pre-read data blocks that do not exist in the storage medium corresponding to the cache component with the highest response priority in order from high to low response priority, the target data blocks will be retrieved from the corresponding storage media through the remaining cache components in order. Read the target data block;
  • the data blocks required for the read request are sequentially read from the corresponding storage medium in order of the response priorities of the multiple cache components from high to low.
  • the data blocks with the block identifiers are sequentially read from the corresponding storage media in order of the response priorities of the multiple cache components from high to low.
  • the method before starting the target application based on the startup run package of the target application, the method further includes:
  • the method also includes:
  • the multiple interfaces include from high to low according to response priority: content distribution network CDN interface, point-to-point transmission P2P interface and origin site interface;
  • a second aspect of the embodiment of the present application provides an application caching scalable processing device, where the device includes:
  • An initialization module configured to start the target application based on the startup run package of the target application, and initialize multiple cache components corresponding to the target application; the multiple cache components respectively correspond to respective storage media, and the storage media contains Data that supports the operation of the target application is stored;
  • a cleaning module configured to respond to a storage space release event on the terminal and clear the data in the local storage medium of the terminal through the corresponding cache component; wherein all the data remaining in the local storage medium after clearing The data is at least the data in the startup and running package to at least ensure the startup of the target application;
  • a response module configured to respond to the read request of the target application and obtain the data corresponding to the read request from the cloud storage medium and/or the local storage medium through the corresponding cache component to support the target application. operation; wherein, the cloud storage medium stores original data that supports the operation of the target application.
  • An embodiment of the present application also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes, the caching of the application as described in the first aspect is implemented. Scalable processing methods.
  • An embodiment of the present application also discloses a computer-readable storage medium, which stores a computer program that causes the processor to execute the caching scalable processing method of an application as described in the first aspect of the present application.
  • An embodiment of the present application also discloses a computer program product, which includes a computer program/instruction.
  • the computer program/instruction is executed by a processor, the cache scalable processing method for an application described in the first aspect is implemented.
  • the target application can be started based on the startup run package of the target application and multiple cache components can be initialized. Since each cache component corresponds to its own storage medium, the terminal needs to be When the storage space is released, the data in the local storage medium on the terminal can be cleared through the corresponding cache component. During the clearing process, all the data retained in the local storage medium of the terminal is at least the data in the startup package. . In this way, when only the data in the startup package is left on the terminal, the target application can be guaranteed to start normally. Later, when the target application is running, the data corresponding to the read request can be obtained from the original data of the cloud storage medium and/or the retained data of the local storage medium through the corresponding cache component, thereby supporting the operation of the target application.
  • the startup and running package when clearing the data in the local storage medium, only the data in the startup and running package can be cleared locally on the terminal. Since the amount of data in the startup and running package is very small, it occupies very little space in the local storage medium. For example, The startup and running packages of some target applications are only tens of kb, which can free up more storage space, so that the terminal can install more applications and store more data, such as multimedia data.
  • the startup run package is used to start the target application.
  • the target application can be guaranteed to start normally on the terminal, and when subsequently responding to the read request of the target application, the original data and/or The required data is read from the data retained in the local storage medium. Therefore, the cleaning of the data does not affect the normal use of the target application.
  • Figure 1 is a diagram of the software and hardware environment in which an application cache scalable processing method is executed in an embodiment of the present application;
  • Figure 2a shows the software and hardware environment diagram when the interface layer is a file system model
  • Figure 2b shows the software and hardware environment diagram when the interface layer is a sandbox model/file interface model
  • Figure 3 is a step flow chart of an application caching scalable processing method in an embodiment of the present application
  • Figure 4 is a flow chart of the steps of data pre-reading in the implementation of this application.
  • Figure 5 is a flow chart of steps for producing original fragment files in the implementation of this application.
  • Figure 6 is a schematic diagram of an exemplary data block description table in the implementation of the present application.
  • Figure 7 is a structural block diagram of an application running device based on multi-level caching in an embodiment of the present application.
  • Embodiments of the present invention can be applied to various operating systems of terminals.
  • the terminals include PC terminals and mobile terminals.
  • the operating systems include PC-side operating systems such as Windows, Linux, Unix, and virtual machine simulation systems, and mobile terminals. Operating systems such as Android, IOS, etc.
  • the target application in the embodiment of the present invention may refer to an application with a larger software installation package and data package, such as 3D games, PS and other applications; wherein, the target application may be a PC-side application or a mobile terminal application.
  • Program Application, APP
  • a mobile terminal as an example, the method and system of the embodiment of the present invention will be described below.
  • this application proposes a technical solution for cleaning data on the terminal more thoroughly without affecting the normal use of the application.
  • the inventor first made the original data of the target application into Start the running package and multiple original shard files.
  • the startup running package is used to start the target application, and the original shard files store the data required for the target application to run.
  • the original shard files can be initially saved in the cloud storage medium for Download and use the target application.
  • this application can obtain the startup and running package of the target application, start the target application through the startup and running package, and initialize multiple cache components corresponding to the target application.
  • Each cache component corresponds to a storage medium.
  • the data required by the target application can be read from the original data of the cloud storage medium and/or the data retained in the local storage medium to support the operation of the target application. In this way, the normal operation of the target application can be ensured while the data is cleaned more thoroughly and more space is released, and sufficient storage space is provided for installing new applications and storing new data. Users do not have to uninstall installed applications or Purchase a new terminal or a new memory card to optimize the user experience and reduce the user's purchase cost.
  • the number of initialized cache components can be adapted to the performance configuration parameters of the terminal's operating system and the terminal's storage device. In this way, the number of cache components can match the performance configuration of the terminal, so that the number of cache components can increase or decrease with different performance configurations of the terminal, thereby achieving scalability of the cache components to flexibly adapt to a variety of terminals.
  • Improvement point 2 While improving the I/O response speed of the target application, in order to improve the stability of the I/O response of the target application, a solution is proposed to store the original data of the target application in data blocks, that is, original fragmented files. is the data of the target application stored in data block granularity.
  • each logical file of the target application is saved into three physical files (original data file, incremental data file, and metadata file (storing attribute information of the logical file)), thereby obtaining the target
  • the original image package of the application allows the original data of the target application to be migrated to three physical files. This eliminates the need to analyze the runtime environment that the target application depends on and modularize the splitting work, greatly reducing labor costs and time. cost.
  • each logical file corresponds to three types of physical files, which doubles the number of files in the original image package.
  • this application divides the original data of the target application into blocks, and divides all the obtained data blocks into multiple original fragmented files, thereby storing the original data at the granularity of data blocks.
  • the original data in multiple logical files of the target application is redistributed to multiple original fragmented files.
  • the corresponding original fragmented files can be read from the corresponding original fragmented files. data blocks and writes corresponding data blocks to avoid generating a large number of file handles, thus improving the stability of I/O response.
  • Improvement point 3 Multiple cache components can have their own response priorities and can respond to the I/O requests of the target application according to their respective response priorities to reduce the component level depth of data access and improve the I/O response speed of the target application. .
  • the data when the target application issues a read request, the data can be read from the storage medium with a fast response speed and returned to the target application first.
  • the data can be read back to the target application.
  • Data can be read from the storage medium with the second fastest response speed and returned to the application. Therefore, when reading data, the data is read from the corresponding storage medium in order from high to low response speed, thereby improving the target The I/O response speed of the application.
  • Improvement point 4 In order to further improve the I/O response speed of the target application, the cache component corresponding to the storage medium with the fastest response speed has been improved, mainly reflected in: based on the historical trajectory of data reading of the target application, predicting the target application The data to be read next time is written in advance from other storage media to the storage medium with the fastest response speed, thereby helping to further improve the I/O response speed of the target application.
  • the embodiments of this application respectively focus on the software and hardware environment applied in this application (section 1.1), the scalable processing of multi-level cache (sections 2.1 to 3.1), I The specific process of /O response (Section 4.1) and the I/O response based on the original fragmented file (Section 5.1) are explained respectively.
  • FIG. 1 a schematic diagram of the software and hardware environment in which the cache scalable processing method of the target application of the present application is applied is shown.
  • the software and hardware environment shown in Figure 1 includes a multi-level cache system (the dotted box in Figure 1 shows the multi-level cache system), interface layer, application manager and cache stack manager.
  • the multi-level cache system includes a native interface conversion component, a file block manager, a first cache component, a second cache component, a third cache component, a fourth cache component and a fragmented file I/O splitter.
  • the fragmented file I/O splitter is communicatively connected with the third cache component and the fourth cache component respectively.
  • the number of cache components may vary. Figure 1 only illustrates the case of four cache components. It can be understood that in some other cases, there may be three or more cache components. Of course, the number of cache components is at least two, that is, including a cache component corresponding to the cloud storage medium and an external cache component on the terminal. Store the corresponding cache component.
  • multiple cache components have respective response priorities, and the cache component with a high response priority corresponds to a storage medium with a fast response speed.
  • the first cache component, the second cache component, and the third cache component correspond to the local storage on the terminal. media
  • the fourth cache component corresponds to cloud storage media. Partial data of the target application is stored in the local storage medium, while all original data of the target application is stored in the cloud storage medium.
  • Figure 1 exemplarily shows that the first cache component corresponds to the memory of the terminal, the second cache component corresponds to the first external memory of the terminal, and the third cache component corresponds to the second external memory of the terminal.
  • the cache stack manager can be understood as the process that starts and maintains the multi-level cache system;
  • the interface layer can be understood as the communication bridge between the target application and the multi-level cache system, used to transfer the data read requests of the target application, Data write requests, data modification requests, etc. are sent to the multi-level cache system, and the multi-level cache system responds to the above-mentioned data read requests, data write requests, data modification requests, and data cleaning requests.
  • the application manager can monitor and maintain the target application and the multi-level cache system. Specifically, it can be used to manage the multi-level cache system and the processes of the target application and maintain communication with them.
  • the interface layer is communicatively connected with the native interface conversion component.
  • the native interface conversion component serves as the upper-layer component of the file block manager.
  • the file block manager serves as the upper-layer component of the first cache component.
  • the first cache component serves as the third cache component.
  • the upper-layer component of the second cache component, the second cache component serves as the upper-layer component of the sliced file I/O splitter, and the sliced file I/O splitter serves as the upper-layer component of the third cache component and the fourth cache component.
  • the native interface conversion component is responsible for receiving file I/O requests redirected by the interface layer. It can be oriented to different operating systems, used to undertake the file I/O interface specifications corresponding to different operating systems, and convert various files into The I/O interface specification is converted into a unified interface specification and connected to the file block manager.
  • the file block manager is an upper-layer component of multiple cache components. It is used to connect data requests from target applications and manage data in multiple original shard files. For example, when receiving a read request, the file block manager can determine the data corresponding to the read request, and then convert the read request into a read request that can be recognized by the cache component based on the corresponding data, thereby ranking the read request from high to high according to the response priority. Sent to multiple cache components in the lowest order to obtain the corresponding data.
  • Each cache component corresponds to a storage medium, and each cache component has its own data path between it and the storage medium.
  • the cache component can manage and maintain the data in the storage medium through its corresponding data path, and respond to the data. Process the request and process the data in the storage medium through the corresponding data path, such as reading, writing, and clearing the data in the storage medium.
  • the cache component can establish intra-system paths with adjacent upper-layer components and lower-layer components according to the upper-lower hierarchy relationship.
  • the fragmented file I/O splitter is a lower-layer component of the second cache component and an upper-layer component of the third cache component and the fourth cache component. It implements the local storage medium and cloud storage medium in the terminal. processing of data.
  • the complete data of multiple original fragmented files is stored in the cloud storage medium, and the data downloaded from the original fragmented files to the terminal can first be stored in the local cache component corresponding to the lower response priority located on the terminal.
  • the fragmented file I/O splitter can also manage the incremental data area, which stores data written by the target application.
  • the original fragmented files stored in the second external memory corresponding to the third cache component include the downloaded partial data
  • the cloud storage medium corresponding to the fourth cache component stores original data of multiple original fragmented files.
  • the fragmented file I/O splitter receives the read request issued by the second cache component, it can read the required data from the storage medium corresponding to the third cache component and/or the fourth cache component, and will read the required data from the storage medium.
  • the data read from the storage medium is integrated and returned to the second cache component.
  • the fourth cache component can actually be called a data combiner, which is the lower component of the fragmented file I/O splitter.
  • the consolidator can read the data required by the target application from different servers, and combine the data read from different servers and return it to the fragmented file I/O splitter.
  • the collection of different servers is called cloud storage media in this application.
  • the cache stack manager can be used to initialize each component in the above-mentioned multi-level cache system.
  • the specific introduction is as follows:
  • the cache stack description file is used to describe each component that needs to be initialized by the target application.
  • the target application can be started, and each component in the multi-level cache system shown in Figure 1 is initialized based on the cache stack description file. For example, through the started cache stack manager, the initialization tasks of multiple cache components are completed. .
  • the target application can be run.
  • the interface layer sends the read requests, write requests and subsequent data cleaning requests issued by the target application to the native interface conversion component, through the native interface conversion component After conversion, it is sent to the file block manager.
  • the file block manager sends the above request to the corresponding cache component to execute the above request.
  • an interface layer connected to the target application can be created; then, a data path is established between the interface layer and the native interface conversion component so that the native interface
  • the conversion component receives the data processing request redirected by the interface layer through the data path; and establishes a data path between the native interface conversion component and the file block manager, so that the file block manager receives the data sent by the native interface conversion component through the corresponding data path.
  • the redirected data processing request when initializing the native interface conversion component of the target application based on the cache stack description file, an interface layer connected to the target application can be created; then, a data path is established between the interface layer and the native interface conversion component so that the native interface
  • the conversion component receives the data processing request redirected by the interface layer through the data path; and establishes a data path between the native interface conversion component and the file block manager, so that the file block manager receives the data sent by the native interface conversion component through the corresponding data path.
  • the redirected data processing request when initializing the native interface conversion component of the target
  • performance configuration parameters of the terminal may be obtained, and the multiple cache components may be initialized based on the performance configuration parameters.
  • the performance configuration parameters include the version identifier of the terminal's operating system and/or the current performance configuration parameters of the memory and external storage on the terminal.
  • the number of multiple cache components is adapted to the performance configuration parameters.
  • the performance configuration parameters of the terminal can be used to indicate the software and hardware performance status of the terminal, where the version identifier of the operating system can be used to indicate the version of the operating system of the terminal.
  • the operating system can be Android, IOS, Windows, Linux , MacOSX, etc., as well as operating systems corresponding to PlayStation, Xbox, Nintendo Switch and other hardware platforms. Different operating systems may occupy different storage spaces and provide operating environments with different performance for terminals.
  • the current performance configuration parameters of the memory on the terminal can include: the current remaining capacity of the memory on the terminal (some system configurations will use a part of the memory space as supplementary video memory for the integrated graphics card, or use a part of the memory space as the read and write cache of the SSD), memory Frequency, number of bits, IO response delay and other parameters. It can reflect the memory performance of the terminal, and the performance of the memory affects the running performance of the terminal's applications.
  • the terminal's performance configuration parameters can be reported to the server where the target application is located through the application manager, and caches corresponding to different performance configuration parameters are pre-stored in the server.
  • Stack description file Different cache stack description files are used to guide the initialization of a corresponding number of cache components on the terminal with corresponding performance configuration parameters.
  • a cache stack description file adapted to the performance configuration parameters of the terminal can be downloaded from the server, and a corresponding number of cache components can be initialized based on the downloaded cache stack description file.
  • a standard cache stack description file is stored in the server.
  • different terminals can download the cache stack description file from the server.
  • the description item corresponding to the cache component in can be set to be initialized according to the performance configuration parameters of the terminal, and specify the type and number of cache components to be initialized for different performance configuration parameters. In this way, when initializing cache components, the number and type of cache components to be initialized can be determined based on the performance configuration parameters of the terminal, and a corresponding number of cache components can be initialized based on the cache stack description file and performance configuration parameters.
  • the cache component corresponding to the cloud storage medium is necessary.
  • the greater the number of cache components may mean: the more cache components corresponding to the local storage medium of the terminal, the more types of local storage media may be available ( Different types of storage media may have different response speeds).
  • the probability that the local storage medium successfully responds to the request of the target application can be improved. Due to the terminal's The data path between the local storage medium and the target application is a local path of the terminal, and the communication path is short, which can improve the response speed to the target application.
  • the local storage medium of the terminal may include the terminal's memory and multiple external memories.
  • the multiple external memories may include solid state drives, mechanical hard drives, external USB devices, memory cards, etc.
  • the number of cache components initialized when the terminal's performance configuration parameters represent good performance is greater than the number of initialized cache components used when the performance configuration parameters represent poor terminal performance.
  • multiple cache components when multiple cache components are initialized based on the performance configuration parameters, it can be determined based on the performance configuration parameters whether the memory, external storage and/or operating system of the terminal meet the target conditions. When the target conditions are met, initialization and multiple cache components are performed. cache components corresponding to each external memory and the memory of the terminal; when the target conditions are not met, initialize the cache components corresponding to the multiple external memories.
  • the target condition may be any one or more of multiple conditions such as the operating system being the target version of the operating system, the number of CPU instruction set bits of the terminal being the target number of bits, and the remaining capacity of the terminal's memory being no less than the target capacity. combination of conditions.
  • the initialized cache component includes a cache component corresponding to the memory, which can also be called a memory cache component, and multiple external memories on the corresponding terminal can initialize corresponding cache components respectively.
  • a cache component corresponding to the memory which can also be called a memory cache component
  • multiple external memories on the corresponding terminal can initialize corresponding cache components respectively.
  • the target conditions are that the version of the operating system is Linux, the current remaining capacity of the memory is not less than 60%, the CPU instruction set is 64-bit, and there are both solid-state drives and mechanical hard drives, then if this condition is met, it represents the performance of the terminal.
  • four cache components can be initialized, for example, a memory cache component corresponding to the memory, a temporary cache component corresponding to the first external memory (solid state drive) on the terminal, and a local cache component corresponding to the second external memory (mechanical hard drive).
  • a caching component and a cloud caching component corresponding to the cloud storage medium can be initialized, for example, a memory cache component corresponding to the memory,
  • the cache component corresponding to one of the multiple external memories can be determined as a temporary cache component matched with the memory cache component, where the memory cache component is an upper-layer component adjacent to the temporary cache component, The two can be used together and are indispensable.
  • the first cache component is the memory cache component
  • the second cache component is the temporary cache component.
  • the cleared data can be written to the temporary cache component. In this way, when responding to the I/O request of the target application, it can be read from the temporary cache component.
  • the data originally in the memory can ensure the I/O response speed of the target application while ensuring that the memory space is not occupied too much.
  • multiple applications are generally installed on a terminal, and the multiple applications may be installed at different times. Therefore, as the terminal continues to install applications, the storage resources of the terminal are continuously occupied. Therefore, the terminal The performance configuration parameters may be different at different times. Therefore, for applications installed at different times, the number of cache components initialized may also be different.
  • the initialized cache component can include a memory cache component and a temporary cache component; for applications whose installation time is later, the occupancy rate of storage resources on the terminal is relatively higher, and the remaining capacity of the memory is also relatively reduced. Therefore, for applications whose installation time is later, For subsequent applications, the initialized cache components may not include memory cache components and temporary cache components.
  • the number of initialized cache components of applications with different installation times can also be different.
  • the terminal can also make some applications responsive while installing as many applications as possible. The speed is guaranteed and the terminal's storage resources are fully utilized.
  • the number of multiple cache components to be initialized can be determined based on the performance configuration parameters of the terminal. In this way, the multiple initialized cache components can be consistent with the operating system of the terminal.
  • the version is adapted to the performance configuration of memory and external storage, which means that terminals with different operating system versions have different numbers of initialized cache components, and terminals with different storage performance configurations can also have different numbers of initialized cache components. Therefore, the number of cache components can be scalable for different types of terminals, and can also be different for terminals with different installation times, thereby improving the adaptability between the multi-level cache system and the terminals.
  • the remaining cache components correspond to the local storage medium of the terminal.
  • the local storage media utilized by the level caching system can be different. For example, when the target conditions are met, the terminal's memory and multiple external memories are used to respond to the target application. When the target conditions are not met, the multiple external memories of the terminal are used to respond to the target application. In this way, the utilization can be configured based on the terminal's performance. Appropriate storage media can fully respond to the target application and achieve full utilization and scheduling of the terminal's storage resources.
  • the interface layer can be understood as a communication bridge between the target application and the multi-level cache system.
  • the interface layer is used to receive I/O requests and storage space release events issued by the target application, that is, to receive the target application.
  • the interface layer can be a file system model, a sandbox model or a file interface model.
  • the corresponding interface layer type can be determined based on the terminal operating system parameters.
  • the operating system parameters of the terminal can be obtained, and based on the operating system parameters, an interface layer corresponding to the target application can be created.
  • the operating system parameter is used to indicate the version of the operating system on the terminal, and the operating system parameter may be the version identifier of the operating system.
  • different operating systems provide different program running environments for the terminal, such as The system architecture, hardware configuration, software layering model, and permission management design are different, so different interface layers need to be implemented; and different interface layers have different intrusiveness to the operating system and development difficulty. Therefore, in order to enable the multi-level cache system to achieve the purpose of supporting the target application to run stably in the operating environment provided by the operating system through matching interface layers, matching interface layers can be initialized for terminals of different operating systems.
  • the initialized interface layer can be a file interface model; when the operating system parameters indicate that the operating system is Windows, Linux, In the case of Android and MacOSX systems, the initialized interface layer can be a file system model; in the case where the operating system parameters indicate that the operating system is an Xbox host operating system, the initialized interface layer can be a sandbox model or a file interface model.
  • Figure 2a shows a software and hardware environment diagram when the interface layer is a file system model
  • Figure 2b shows a software and hardware environment diagram when the interface layer is a sandbox model/file interface model.
  • the file system model also known as File System Model
  • File System Model is based on kernel file system takeover. It has non-hijacking of the operating system and no forced modification of memory contents. It will not cause stability problems and has the ability to effectively control applications. It has the advantages of non-intrusiveness, high stability, and no code learning and adjustment costs.
  • file system model Another advantage of the file system model is that it can take over the read and write requests of memory-mapped files; in the related design of the operating system, the file system model is a component implemented in the kernel state and can take over application file reading and writing as well as File Mapping I/O ( (initiated by MMU-memory manager), and the sandbox model and file interface model are components implemented at the application layer, so they can only take over application file read and write requests; therefore, the file system model is used in application file IO
  • the request handling aspect is the most adaptable solution.
  • the sandbox model also known as the Sandbox Model, is a mechanism that implements file access interface hijacking based on the File Hooking Layer.
  • This mechanism scans the relevant file access interfaces in the memory when the application process is initialized, and then modifies the file access
  • the binary entry code of the interface redirects and transforms the original function; without the need for engineers to pay attention to the file data access library and related interfaces that the application depends on, the goal of taking over file read and write requests can be achieved, which has the advantage of low code learning costs and low adjustment costs.
  • the file interface model is linked and called by the core components of the application (eg. 3D graphics engine, file compression/decompression library, video encoding and decoding library, resource parsing library of multiple formats, etc.); although there is a certain amount of code learning and adjustment costs , but this method has the best system portability.
  • the core components of the application eg. 3D graphics engine, file compression/decompression library, video encoding and decoding library, resource parsing library of multiple formats, etc.
  • a data path is established between the interface layer and the native interface conversion component.
  • the native interface conversion component can receive the data processing request redirected by the interface layer, and the data processing request is
  • the target application running in the operating system is sent to the interface layer, where the native interface conversion component is used to convert various file I/O interface specifications into a unified interface specification and connect to the file block manager.
  • a data path is also established between the native interface conversion component and the file block manager.
  • the file block manager can receive the data processing request converted by the native interface conversion component.
  • the communication architecture between the multi-level cache system and the target application is established through the interface layer, native interface conversion component and file block manager, as well as the data paths between each other, thereby successfully realizing multi-level cache system support and respond to the target application.
  • multiple interfaces are configured between the cloud storage medium and the corresponding fourth cache component.
  • the multiple interfaces may have their own response priorities, and the response speeds of different interfaces may also be different. And different interfaces can obtain the data in the original shard files on the corresponding server. Through the setting of multiple interfaces, the probability of the terminal successfully downloading the data of the target application from the cloud storage medium can be improved, thereby ensuring the stable operation of the target application.
  • multiple interfaces can be created between the corresponding caching components and cloud storage media; the multiple interfaces include, from high to low according to response priority: content distribution network CDN interface, point-to-point transmission P2P interface and origin site interface.
  • content distribution network CDN interface point-to-point transmission P2P interface
  • origin site interface origin site interface
  • the cloud storage medium may include multiple data sources (such as servers), and the multiple data sources include CDN (Content Delivery Network, content distribution network) data sources and P2P data sources.
  • CDN Content Delivery Network, content distribution network
  • P2P data sources include CDN (Content Delivery Network, content distribution network) data sources and P2P data sources.
  • the CDN interface corresponds to the CDN data source
  • the P2P interface corresponds to the P2P data source
  • the origin site interface corresponds to the storage medium on the initial site that stores the data blocks of the target application.
  • CDN the basic principle of CDN is to widely deploy multiple cache servers in various regions, distribute these cache servers to areas or network areas where user access data is relatively concentrated, and use global load technology to load the user's access requests when users access the website. Points to the nearest cache server that is working properly, and the cache server directly responds to user requests.
  • the CDN interface can be loaded by the cache stack manager and register its own interface table with the cache stack manager through xxx_ITF_uuid.
  • the P2P data source is a P2P transmission component based on the BitTorrent or MagNet communication protocol, which can save the download traffic of the CDN data source.
  • the P2P interface is loaded by the cache stack manager and its initialization interface (ITF_Initialize) is called. The specific process is: initialize the internal data structure and register its own interface table with the cache stack manager through xxx_ITF_uuid.
  • the fourth cache component If the acquisition is successful, then Return to the fourth cache component; if the acquisition is still unsuccessful, another data acquisition request is encapsulated corresponding to the unsuccessful data, and then the original shards are obtained from the origin site (the server that initially stores the original shard files) through the origin site interface. Obtain the remaining data from the file. If it is successfully obtained, the remaining data will be returned to the fourth cache component; if the remaining data is not successfully obtained, the fourth cache component can return information that the data has failed to be read, and the target application will reinitiate the read. ask.
  • the origin site the server that initially stores the original shard files
  • the response priority of the P2P interface can be adjusted to be higher than the response priority of the CDN interface. Therefore, the process of processing target application read requests based on the response priority will be adjusted to: first try to read from the P2P data source Obtain data from the original shard file of the CDN data source, then obtain data from the original shard file of the CDN data source, and finally obtain data from the original shard file of the origin site data source; although the adjustment of the response priority will cause the fourth
  • the cache component processes read requests at a reduced speed, but it will save a lot of traffic costs by giving priority to trying to obtain data from P2P data sources.
  • fault tolerance network anomalies
  • the target application can be run in response to the event that the cache stack manager completes the initialization of the multi-level cache system; and the process of the target application and the cache stack manager can be monitored; when an exception occurs in the process of the target application, or When an exception occurs in the cache stack manager, end the process of the target application and the process of the cache stack manager.
  • the application manager can monitor the process and cache stack manager of the target application. Specifically, the application manager can establish a connection with the target application based on the PID information (Process Identifier, process identifier) of the target application. A listening channel, and establishing a listening channel with the cache stack manager based on the PID information of the cache stack manager to monitor the status of the cache stack manager and the target application.
  • PID information Provided by the application manager.
  • a listening channel and establishing a listening channel with the cache stack manager based on the PID information of the cache stack manager to monitor the status of the cache stack manager and the target application.
  • both will be ended.
  • the configuration of the target application and the cache corresponding to the local storage medium can be restored.
  • the state of the data managed by the component thereby ensuring the overall consistency of the configuration of the target application and the state of the data managed by the cache component corresponding to the local storage medium.
  • the application manager can notify the cache stack manager to exit normally. After waiting for a period of time (loop check 30s), if the cache stack manager still has not exited, it can notify the cache stack manager through the operating system API (Application Programming Interface (Application Programming Interface) forcefully terminates the cache stack manager.
  • the operating system API Application Programming Interface (Application Programming Interface) forcefully terminates the cache stack manager.
  • FIG. 3 a step flow chart of the caching scalable processing method of the target application of the present application is shown. As shown in Figure 3, it may specifically include the following steps:
  • Step S301 Start the target application based on the startup run package of the target application, and initialize multiple cache components corresponding to the target application.
  • multiple cache components correspond to respective storage media
  • the storage media stores data that supports the operation of the target application.
  • the storage medium at least includes a cloud storage medium and a local storage medium of the terminal.
  • the cloud storage medium includes original data that supports the operation of the target application, that is, includes all original data of the target application.
  • the local storage medium includes the target application.
  • Part or all of the data generally includes data downloaded from cloud storage media, and the downloaded data is generally partial data.
  • the startup and running package of the target application can be downloaded from the server.
  • the user can download and start it from the corresponding server through the application manager. Run the package.
  • the startup package contains a very small amount of data. It contains the most basic files for starting the target application.
  • the startup package detects whether the target application has been registered, configured and installed in the current system. Completed. If the registration, configuration and installation have not yet been completed, the target application is completed. During the installation process, the basic application registration, installation, configuration and interaction between the target application and the terminal's operating system are completed. Then the target application is started and initialized with Multiple cache components corresponding to the target application; otherwise, directly start the target application and initialize multiple cache components corresponding to the target application.
  • the target application can be started through the startup package.
  • multiple cache components of the target application can be initialized.
  • the initialization process can refer to the above section 1.3.
  • the cache stack description file of the target application can be obtained.
  • the cache stack description file can include multiple, different cache stack description files for terminals with different performance configurations. Therefore, when downloading the target application, the cache stack description file can be obtained.
  • a data path can be established between each cache component and the corresponding storage medium to establish a communication connection between the cache component and the storage medium.
  • the cache stack description file is used to indicate which components in the multi-level cache system need to be initialized.
  • the "name” field in the cache stack description file represents the name of the current component
  • the "type” field represents the type of the current component.
  • I/O filter means that this component is necessary in the data I/O process;
  • Bopass filter means that this component is not necessary in the data I/O process.
  • the "id” field represents the uuid of the current component. The cache stack manager needs to check the validity: the uuid of the top-level and secondary filter components must be globally unique.
  • the "path” field represents the relative path of the current component; the “components” field only exists for the "aggregated I/O filter” component, which represents the dependent (secondary) component description of the current component.
  • Its structure is a composite array, including The dependent I/O components included in this aggregate I/O filter; among them, I/O filters at the same level: bottom-up when built, top-down when destroyed; I/O filters at different levels: built Time is from the inside out, and time of destruction is from the outside in.
  • Step S302 In response to the storage space release event for the terminal, clear the data located in the local storage medium of the terminal through the corresponding cache component.
  • all the data retained in the local storage medium after clearing is at least the data in the startup run package, so as to at least ensure the startup of the target application.
  • clearing includes proportional clearing and extreme clearing.
  • all the data retained in the local storage medium after clearing is the data in the startup run package to at least ensure the startup of the target application.
  • this application in order to prevent the target application from occupying too much storage space in the local storage medium on the terminal, so that the terminal can install more applications and provide faster response speed, this application periodically clears the local storage medium. data to free up more storage space on the terminal for storing data of other applications and/or storing other multimedia data.
  • the storage space release event can be triggered for the terminal.
  • the storage space release event for the local storage medium can be triggered.
  • Storage space release event can also be triggered based on the user's data cleaning operation. For example, the user enters the application manager and triggers the operation on the interface provided by the application manager. The data of the target application is cleaned, so that the storage space release event is triggered.
  • the user can specify the local storage media to be cleaned, and can also specify the degree of data cleaning.
  • the cache component corresponding to the local storage medium to be cleared can clear the data in the local storage medium.
  • part or all of the data in the local storage media can be cleared.
  • the data in the three cache components can be cleared, or the data in only one or two cache components among the three cache components can be cleared.
  • the data purging in this application includes purging data according to proportion and extreme purging.
  • proportional purging the proportion can be specified by the user, while extreme purging means that the least data is retained in all local storage media.
  • the minimum data is Start running the data in the package.
  • the startup running package only includes the application registration with the operating system, configuration information components, startup program components, and multi-level cache system-related components. It does not include the data of the executable components of the application itself and the data of the resource package. Therefore, , occupying very little space on the local storage medium.
  • the data of the start-up and run package occupies a small storage space, the data of the target application can be cleaned to the maximum extent on the terminal. Moreover, since the start-up and run package is used to start the target application, the existence of the start-up and run package will not It will affect the startup and use of the target application.
  • Step S303 In response to the read request of the target application, obtain the data corresponding to the read request from the cloud storage medium and/or the retained data of the local storage medium through the corresponding cache component to support the operation of the target application.
  • the cloud storage medium stores all original data that supports the operation of the target application.
  • the data corresponding to the read request can be obtained from the local storage medium and/or the cloud storage medium. Data to support the normal operation of the target application.
  • the cloud storage medium always stores all the original data required by the target application.
  • the terminal side can ensure that the target application is started by starting the run package, the read request of the target application can be guaranteed through multiple cache components. be successfully executed to support the operation of the target application.
  • the startup and running package when clearing the data in the local storage medium, only the data in the startup and running package can be cleared locally in the terminal. Since the amount of data in the startup and running package is very small, the local data occupied by the startup and running package is very small. The space of the storage medium is very small. For example, the startup and running packages of some target applications are only tens of kb, which can release more storage space, so that the terminal can install more applications and store more data, such as multimedia data. On the other hand, the startup run package is used to start the target application.
  • the target application can be guaranteed to start normally on the terminal, and when subsequently responding to the read request of the target application, the target application can be read from the cloud storage medium and/or the local storage medium.
  • the required data is read from the application, so cleaning the data does not affect the normal use of the target application.
  • using the application caching scalable processing method of this application can free up more space for the terminal to install more applications and store more while retaining many applications and not affecting user use. multimedia data, thereby solving the pain points faced by terminal technology.
  • this application in order to prevent the target application from occupying too much storage space of the storage medium in the terminal, so that the terminal can install more applications and provide faster response speed, this application periodically clears multiple cache components located in the terminal.
  • the data in the local storage medium frees up more storage space on the terminal that can be used to store data for other applications.
  • data cleaning involves two situations: partial clearing and complete clearing.
  • partial clearing the data that is not frequently read in the local storage medium will be cleared, and in the case of complete clearing, the local storage will be cleared.
  • complete clearing the local storage will be cleared.
  • the storage space release event is a partial clearing event
  • the data to be cleared in the local storage medium is cleared, and the data to be cleared is data determined based on the reading frequency and/or the latest reading time.
  • the data in the local storage medium whose reading frequency is less than the target frequency and/or the latest reading time is earlier than the preset reading time can be cleared, or the reading frequency is less than the target frequency and/or the latest reading time can be cleared Data that is older than the preset read time and meets the target ratio is purged.
  • the target ratio may be a ratio specified by the user, reflecting the ratio of the amount of data to be cleared to the amount of original data. For example, if the target ratio is 40%, it means that 40% of the data needs to be cleared. Among them, the user can also specify the local storage medium to be cleared. For example, if the memory corresponding to the first cache component is specified as the object of data cleaning, the memory will be cleaned according to the target ratio. In practice, all local storage media can be cleaned, so that a target ratio can be specified for each local storage medium. Different local storage media can correspond to different target ratios, or can also correspond to the same target ratio, thereby achieving the goal of cleaning each local storage medium. Cleaning of target application data in local storage media.
  • the data may not be cleared according to the target proportion.
  • data whose reading frequency is less than the target frequency and/or whose latest reading time is earlier than the preset reading time may be used as data to be cleared. Clear. For example, you can clear all data whose reading frequency is less than the target frequency, or clear all data whose latest reading time is earlier than the preset reading time, or clear all data whose reading frequency is less than the target frequency and whose latest reading time is earlier than the preset reading time. All data at the preset reading time are cleared.
  • the data in each local storage medium can also be comprehensively sorted according to frequency and recent reading time. Specifically, corresponding weights can be set for the reading frequency and reading time, and then, according to the data The reading frequency and reading time and their corresponding weights are used to obtain the sorting score corresponding to each data, and the data are sorted according to the sorting score.
  • the top-ranked data can refer to the data that the user reads more often. In this way, The data of the target proportion can be cleared according to the sorting from back to front; in this way, the data of the target proportion can be cleared according to the reading frequency and reading time.
  • the read frequency can be understood as the number of reads.
  • a doubly linked list can be maintained in the memory cache component.
  • the header of the doubly linked list The data identifier of the "most recently accessed" data is stored, and the data identifier of the "most recently accessed” data is stored at the end of the table.
  • the data identifier of the corresponding data is changed from the current value of the doubly linked list. The position is taken out and put into the head of the linked list, so that the data identifier closer to the head of the linked list indicates that the data has been accessed more recently.
  • the data corresponding to multiple data identifiers in the tail of the linked list can be determined as the data to be cleared (the data blocks are traversed from the tail of the linked list to the head of the linked list and counted, and at the same time proportional to the total number of all data blocks in the linked list calculation), and the proportion of the data to be cleared to all the data in the linked list is the target proportion. If the target proportion is 40%, then 40% of the data that is not frequently accessed will be cleared.
  • the local storage medium when it includes a memory, that is, when it includes a memory cache component corresponding to the memory and a temporary cache component corresponding to the first external memory, during the process of cleaning the data, you can Perform different processing on data in memory and other local storage media to ensure the I/O response of the target application.
  • the data cleared from the memory can be written to the corresponding local storage medium with a response priority lower than that of the memory; for the remaining local storage media except the memory, the data cleared from the remaining local storage media with the target Characteristic data is written into the incremental data area.
  • the target feature representation data is data written by the target application, and the incremental data area may be located in the local storage medium with the lowest response priority.
  • the memory corresponds to the memory cache component, which has the highest response priority.
  • the subordinate component of the memory cache component is the temporary cache component, which corresponds to the first external memory on the terminal (the response priority is lower than that of the memory).
  • Local storage media such as solid-state drives, when the data belonging to the target application in the memory is cleared, the data eliminated from the memory can be written to the first external memory. In this case, when a read request from the target application comes, if the data corresponding to the read request exists in the first external memory, the data can be read from the first external memory.
  • the first external storage can be a local storage medium that is not subject to data cleaning, or it can be a local storage medium that is subject to data cleaning. If data cleaning is not performed, the first external memory is eliminated from the memory to the third external storage medium. The data in the first external memory does not need to be cleaned. This ensures the response speed of the next data read request of the target application; if data cleaning is performed, the data with the target in the first external memory will be eliminated from the memory. Characteristic data will be written to the incremental data area, thus ensuring that the user's various configurations of the target application and archived data will not be lost.
  • the data to be cleaned is data written by the target application
  • the data can be written into the incremental data area, as shown in Figure 1, for example.
  • the incremental data area can be located in the second external memory.
  • the incremental data area is a data area that will not be cleared. That is to say, the data written by the user will not be cleared. It can ensure that the data written by the user will not be deleted due to Loss due to cleaning, for example, to ensure that the user's graphics, peripherals, game-related configurations or archives are not lost.
  • the data belonging to the target application in one or more local storage media can be cleaned in a targeted manner.
  • the data can be cleaned according to the target proportion, or according to the reading frequency and/or the latest reading time.
  • Dynamic data cleaning thus enabling data cleaning to be carried out according to the actual needs of users, achieving the purpose of dynamic data cleaning, thereby freeing up more storage space for the terminal.
  • extreme cleanup that is, after cleanup, the data retained in all local storage media is only the startup running package.
  • the target application stored in it Either all the data will be cleared, or the rest of the data except the startup package will be cleared.
  • the local storage medium where the startup and running package is located is generally the storage medium corresponding to the cache component with a lower response priority. Therefore, the local storage medium with the lowest response priority is Storage media can clear the rest of the data except the startup package.
  • all data of the target application in the local storage media can be cleared. For example, as shown in Figure 1, all data of the target application in the memory and the first external memory can be cleared. Only the startup and running package is retained in the second external memory, and all other data is cleared.
  • the space of the local storage medium can be cleared regularly, and data with low access times and/or earlier access times can be cleared from the local storage medium, so that the local storage medium can store data with high access times and/or earlier access times. /or access data that is more recent.
  • the occupancy rate of the local storage medium can be reduced.
  • the occupancy of the memory can be reduced, thus ensuring the memory's response to other applications. speed, thereby improving the stability of the terminal's operating system.
  • the first external memory and the second external memory are cleaned regularly, a certain proportion of frequently used data can be retained in the first external memory and the second external memory.
  • the storage capacity will be reduced to the ratio specified by the user. In this way, if the user wants to download and run a new application, the freed space can be used by the new application to store corresponding data, thereby ensuring that the new application and the target application can run at the same time.
  • the user can also specify to clean up the data belonging to the new application in the local storage medium, thereby freeing up storage space for other applications. Dynamically satisfy the stable operation of each application.
  • multiple cache components have respective response priorities, wherein a cache component with a higher response priority corresponds to a storage medium with a faster response speed.
  • multiple cache components can respond to the I/O request of the target application according to their respective response priorities, so as to sequentially read or write the data corresponding to the I/O request in their corresponding storage media. In this way, the cache component can respond to write requests from the target application and read requests from the target application.
  • the data to be written can be sequentially written to the corresponding storage medium in order of the response priorities of the multiple cache components from high to low.
  • the data corresponding to the write request in response to the write request, can be written to the corresponding storage medium step by step.
  • an incremental data area can be set in any storage medium corresponding to the cache components except the cache component with the highest response priority. After passing the cache component with the highest response priority, the data to be written will be After the incoming data is written to the storage medium corresponding to the cache component with the highest response priority, the data to be written can be read out through the cache component corresponding to the incremental data area and written to the incremental data area.
  • the incremental data area may be set in the first external memory.
  • the first cache component has the highest response priority.
  • the first cache component can write the data to be written into its corresponding memory. If an incremental data area is set in the first external memory, the second cache component will read the data from the memory. Read the data to be written in, and then write it to the incremental data area.
  • the incremental data area can mirror the directory of the original fragmented file. When writing, the data to be written is written to the data to be written. In the incremental shard file to which the data belongs,
  • the data to be written can be written to the storage medium corresponding to the cache component with the highest response priority through the cache component with the highest response priority in order from high to low response priority. ; And read the data to be written from the storage medium corresponding to the cache component with the highest response priority, and write the data to be written into the corresponding storage medium through the cache component with the lowest response priority.
  • the next-level cache component of the cache component with the highest response priority reads from the storage medium corresponding to the cache component with the highest response priority.
  • the data to be written is read from the data to be written, and the data to be written is written to its corresponding storage medium.
  • the next level cache component of the next level cache component reads the data to be written from the storage corresponding to the next level cache component.
  • the data to be written is read from the medium and written to its corresponding storage medium, and so on, to achieve the step-by-step writing of data.
  • each storage medium can include the data corresponding to the write request of the target application. data.
  • the data flag bits of the data can be updated.
  • the data flag bits can include "0" and “1”; among them, “0” means clean; “1” means “Dirty” indicates that the data has been written.
  • the data block when writing data, the data block can be written to the storage medium with the highest response priority, and then the data to be written is extracted from the storage medium with the highest response priority and written to In other storage media or incremental data areas, since the efficiency of writing to the storage medium with the highest response priority is significantly higher than the efficiency of writing to other storage media, the user's write request can be responded to quickly, thereby optimizing the user's experience.
  • the read request of the target application can be responded to by the cache components in order from high to low according to the response priorities of the multiple cache components. Obtain the data corresponding to the read request from the corresponding storage medium.
  • the data when all the required data is read from one or more storage media, the data can be returned to the target application; when all the required data is not read from one or more storage media, the data can be returned to the target application. Returns information about data reading failure.
  • the software and hardware environment shown in Figure 1 is used as an example for introduction, in which the first cache The component corresponds to the memory of the terminal, the second cache component corresponds to the first external memory of the terminal, the third cache component corresponds to the second external memory of the terminal, and the fourth cache component corresponds to the cloud storage medium.
  • the following process can be followed:
  • the data not obtained from the memory is obtained from the first external memory
  • the data that is not successfully obtained from the second external storage is obtained from the cloud storage medium.
  • this application adopts a multi-level cache component architecture, which can reduce the data access process when reading data, thereby improving the I/O response speed of the target application.
  • the data read from the storage medium corresponding to the cache component with low response priority can also be written to the storage medium corresponding to the cache component with high response priority.
  • the data read from the storage medium corresponding to the cache component with low response priority must not exist in the storage medium corresponding to the cache component with high response priority.
  • the data read from the second external memory does not exist in the first external memory and the main memory.
  • the data read from the storage medium with low response priority can be written to the storage medium corresponding to the cache component with high response priority.
  • it can be written to the storage medium corresponding to all cache components with high response priority, or it can be written to the storage medium corresponding to any cache component with high response priority.
  • data read from the second external storage can be written to the first external storage and the internal memory, or can be written to the first external storage or the internal memory.
  • the application when the application obtains data from the second external storage or the cloud storage medium, it can write the data obtained from the second external storage or the cloud storage medium into the memory; when obtaining the data from the cloud storage medium When data is obtained from the cloud storage medium, the data obtained from the cloud storage medium is written to the second external memory.
  • the data obtained from the second external storage or cloud storage medium can be written into the memory; or, when the data is only obtained from the cloud storage medium, the data obtained from the cloud storage medium can be obtained from the cloud storage medium.
  • the data is written to the internal memory and the second external memory.
  • data obtained from a storage medium with a low response priority can be moved to a storage medium with a high response priority, so that the data can be moved step by step to a storage medium with a fast response speed, so that as the data
  • the probability of shortening the data access process will increase, thereby improving the I/O response speed during the running of the target application.
  • the first external storage only retains the data eliminated from the memory. As the running time of the target application becomes longer, more and more data are eliminated from the memory, thus greatly improving the efficiency between the first external storage and the memory. The probability that the data can be successfully read.
  • the data obtained from the cloud storage medium can be written to the second external memory, it can be guaranteed that the next time it is read, it can be read directly from the second external memory, reducing the need for subsequent readings.
  • the access process of reading data at one time improves the I/O response speed.
  • each storage medium stores data that supports the operation of the target application in the granularity of data blocks.
  • the data blocks are obtained by dividing all the original data of the target application into blocks.
  • all data blocks obtained after the original data of the target application are divided into blocks can be obtained, and all data blocks can be divided to obtain multiple original fragmented files; and multiple original fragmented files and startup running packages can be uploaded to
  • the cloud storage medium is used for target application downloading.
  • Each original fragmented file includes some data blocks in the original data of the target application.
  • the original data in multiple logical files of the target application is redistributed to the original fragmented files.
  • the corresponding data can be read from the corresponding original fragmented files. blocks and writes corresponding data blocks, thereby improving the stability of I/O response.
  • the storage medium with the highest response priority is the memory, then the downloaded data blocks are scattered and stored in the memory, while the first external memory and the second external memory of the terminal are
  • the original fragmented file directory structure is used as the basis to store downloaded data blocks.
  • the resulting file is called a cache fragment file, that is, the downloaded data blocks are correspondingly stored in the cache fragment file, where the first external memory
  • the directory structure of the cached fragmented files in the second external storage is consistent with the directory structure of the original fragmented files stored in the cloud storage medium.
  • the terminal that produces the original fragmented files can be other terminals, such as the terminal of the producer of the target application.
  • the data content in each logical file can be obtained based on the logical files of the target application, and then the data content in each logical file can be obtained based on the logical files of the target application.
  • For the data content of each logical file determine how much data there is, and determine how many data blocks it needs to divide into according to the amount of data; then, according to the determined number of data blocks, divide the data content of each logical file into blocks to obtain multiple data block, and then multiple data blocks are divided into shards.
  • the specific division strategy can be specified by the producer to obtain multiple original shard files, and then the startup and running package and multiple original shard files are packaged and uploaded to cloud storage. stored in the media. In this way, all original data of the target application is retained in the cloud storage medium.
  • the target application data stored in the local storage medium is initially downloaded from the cloud storage medium.
  • the read request is generally made for multiple data blocks, and the target application is stored in the local storage medium. Part of the application data block. Therefore, when all data blocks need to be read from one or more storage media, they need to be read at the data block granularity, and then the read data blocks are encapsulated and returned to the target application.
  • At least one second data block corresponding to the data to be written can be sequentially written in multiple storage media in order of response priority from high to low.
  • the original data When a write request comes, the original data generally needs to be updated, that is, the original data is rewritten. In this way, at least one data block can be written to multiple storage media in order from high to low response priority.
  • the logical file and writing location corresponding to the data to be written can be determined, and at least one data block into which the data to be written is divided is determined based on the logical file and writing location corresponding to the data to be written, In each storage medium, data blocks are written.
  • the data flag bit of the written data block can be updated to "1", "1" means “dirty”; in this way, the data flag bits of the data blocks stored in each storage medium are all " 1", during subsequent data cleaning, the data blocks with the data flag bit "1" can be moved to the incremental data area.
  • the data when writing data, can also be written to the storage medium with the highest response priority first, and then written to the incremental data area. In this way, when writing the data block, You can also only write the second data block in the storage medium with the highest response priority and the incremental data area, and update the data flag bit of the data block synchronously. In this way, when reading the data block, if the data block in the memory is Clean, you can read data blocks directly from the incremental data area instead of reading data blocks from other storage media. In this way, the reading efficiency of dirty data blocks can be improved.
  • the data blocks required for the read request can be read from the corresponding storage medium in order from high to low according to the respective response priorities of the multiple cache components. All the retrieved data blocks are encapsulated and returned to the target application.
  • the requested data since the original data of the target application is divided into blocks and stored in the original fragmented file, for a read request, the requested data generally includes multiple data blocks. Therefore, it is necessary to read from multiple storage media. Remove all required data blocks. Correspondingly, you can try to read all data blocks from multiple storage media in order from high to low response priority. In this way, for a storage medium, in response to a read request, it is possible to read from the storage medium. All data blocks required for the read request have been taken out, or some of the data blocks required for all the data blocks have been read.
  • the remaining data blocks that have not been obtained are obtained from the corresponding storage medium through the next-level cache component; for example, the remaining data blocks are read from the first external memory through the temporary cache component. data block;
  • the fourth cache component reads this part of the data blocks from the cloud storage medium until all the data blocks are read and the reading is completed, or all the storage media are traversed and the reading is completed.
  • the data blocks read through the third cache component and the fourth cache component can be packaged by the fragmented file I/O splitter and uploaded to the temporary cache component.
  • the temporary cache component uploads the packaged data and the data blocks obtained by itself to the memory cache component.
  • the memory cache component encapsulates the packaged data, the data blocks uploaded by the temporary cache component and the data blocks obtained by itself and returns them to target application.
  • this application adopts a multi-level cache component architecture.
  • it is preferential to read data from storage media with fast response speed. block so that data can be read from a storage medium with a fast response speed as much as possible, thereby reducing the data access process and thereby improving the I/O response speed of the target application.
  • the target application is generally identified by the logical file of the target application. , data location and data length to indicate the data that needs to be read; in this way, the read request issued by the target application carries the logical file identifier of the target application and the data range to be read, and the read request needs to be redirected to
  • the read request is converted into a request that the data block can be read in the original/cache shard file of the storage medium (the original shard file exists in the cloud storage medium, and the cache shard file is stored in the local storage medium), so that the converted
  • the read request can be recognized by the cache component to clarify which original shard file or which data block in the cache shard file needs to be read, so that the stored data block can be successfully read from the storage medium.
  • a correspondence relationship between the original data of the target application and the data blocks in the storage medium can be established.
  • This correspondence relationship can be understood as a data correspondence relationship. Then, based on this data correspondence relationship, the read request corresponding to data block.
  • each block of data to be read corresponding to the read request can be determined based on the data correspondence relationship in response to the read request of the target application.
  • each data block in all original fragmented files can be given a globally unique identifier, such as a block identifier, to uniquely identify a data block.
  • a globally unique identifier such as a block identifier
  • the data correspondence relationship can be downloaded when downloading the startup run package, and the one-to-one mapping relationship between the original data in the logical file of the target application and the data blocks in the original fragmented file is recorded in the data correspondence relationship; where According to the number of data blocks, the original data in the logical file can determine an identifier in the logical file for each divided data block. For example, if the original data in the logical file needs to be divided into 10 data blocks, it will be The 10 data blocks set their identities in the logical file, such as 1, 2, and 3. The data blocks in the original fragmented files have globally unique block identifiers, that is, the block identifiers of the data blocks in different original fragmented files are different.
  • the target application has a total of 10 logical files. According to the data content of the 10 logical files, it is determined that they need to be divided into 1000 data blocks. Then each unique block identifier will be set for the 1000 data blocks.
  • the block identifier of one of the data blocks is "55", which is referred to as data block 55
  • the data block 55 corresponds to a data block with the identifier 3 in logical file 4, which is referred to as data block f4b3 (file_4/block_3)
  • the data Block 55 forms a mapping relationship with the data block f4b3 in the logical file 4, and this mapping relationship is the data corresponding relationship.
  • the read request can be converted into a read request containing the block identifier, and then the read request is sent to multiple cache components in sequence.
  • the components' respective response priorities are in order from high to low, and based on the read request, data blocks are read out from the corresponding storage media in sequence.
  • the data of the target application is stored in the local storage medium at the granularity of data blocks.
  • the data to be read next by the target application can be predicted, and the data to be read can be stored in advance in the storage corresponding to the cache component with the highest response priority.
  • the data can be read from the storage medium corresponding to the cache component with the highest response priority, thereby improving the response speed.
  • FIG. 4 a flow chart of data pre-reading steps according to the embodiment of the present application is shown. As shown in Figure 4, it includes the following steps:
  • Step S401 Based on the data read from multiple historical read requests of the target application, determine multiple pre-read data blocks to be read next time.
  • the data read by each I/O thread of the target application can be monitored and recorded, thereby forming a data reading trace of each I/O thread, and the reading trace can reflect each I/O thread.
  • the rules of data reading by the O thread for example, whether to read data forward or read data back and forth, can determine the rules of data reading.
  • multiple pre-read data blocks to be read by the I/O thread next can be determined.
  • each I/O thread j can be recorded, where the data read each time is composed of multiple data blocks. From this, each I/O thread j can be determined The block identifier of the data block read each time and the number of data blocks read can form a data block reading track of I/O thread j.
  • the data block reading trace can be used to learn the data reading rules of each I/O thread. For example, if the data block reading trace reflects that the I/O thread always swings back and forth in a small range of data block areas, for example When reading for the first time, data block 3 to data block 5 are read. When reading for the second time, data block 4 to data block 6 are read. When reading for the third time, data block 5 to data block 5 are read. Data block 7 indicates that the data reading is swinging back and forth. From this, it can be predicted that three data blocks will be read next time, and the three data blocks are data block 6 to data block 8.
  • the first time of reading is to read data block 3 to data block 5
  • the second time of reading is to read data block 6 to data block 8
  • the third time of reading is to read data Block 9 to data block 12
  • Step S402 Among the multiple pre-read data blocks, the target data blocks that do not exist in the storage medium corresponding to the cache component with the highest response priority are sequentially passed through the remaining cache components from the corresponding cache component in order from high to low response priority. Read the target data block from the storage medium.
  • Step S403 Write the read target data block into the storage medium corresponding to the cache component with the highest response priority, so that when the next read request hits multiple pre-read data blocks, the cache component with the highest response priority will correspond to Multiple read-ahead data blocks are read from the storage medium.
  • the storage medium After determining multiple pre-read data blocks to be pre-read, it can be determined whether there are multiple pre-read data blocks in the storage medium corresponding to the cache component with the highest response priority. If multiple pre-read data blocks are determined, If all the data blocks exist in the storage medium, you do not need to perform the operation and wait for the next read request to arrive. If multiple read-ahead data blocks are hit, multiple read-ahead data blocks can be read from the storage medium.
  • the target data blocks that do not exist in the storage medium will be processed through the remaining cache components in order of response priority from high to low. Read the target data block from the storage medium, and then store the read target data block in the storage medium corresponding to the cache component with the highest response priority. Therefore, when the next read request comes, if multiple read-ahead data are hit block, just read multiple read-ahead data blocks from the storage medium.
  • the first cache component is a memory cache component
  • its corresponding storage medium is the memory of the terminal
  • the second cache component is a temporary cache component, which The corresponding storage medium is the first external storage of the terminal.
  • the memory cache component can determine whether the data blocks to be read are all in the memory based on the number of data blocks to be read next by I/O thread j (j is an integer greater than or equal to 1) and the corresponding data block identifiers. , if it does not exist, determine the target data blocks that do not exist in the memory among the multiple read-ahead data blocks, encapsulate the read-ahead request for these target data blocks that do not exist in the memory, and send the read-ahead request to the temporary cache component.
  • the temporary cache component first instructs the fragmented file I/O splitter to read the target data block from the second external memory through the third cache component. If the target data block does not exist in the second external memory, it then instructs The fragmented file I/O splitter reads the target data block from the original fragmented file of the cloud storage medium through the fourth cache component.
  • the temporary cache component can feed back to the memory cache component, and then the memory cache component writes the read target data block into the memory.
  • the data blocks in the memory are stored discretely.
  • I/O thread j issues the next read request, if it hits the pre-read data block, it can directly read the pre-read data block from the memory. This can shorten the data access process and improve I/O response speed, if the pre-read data block is not hit, it can be read according to the response priority order of multiple cache components.
  • each storage medium stores data that supports the running of the target application at the granularity of data blocks
  • the data blocks are obtained by dividing all the original data of the target application into blocks. Therefore, when clearing the data in the local storage medium, Clearing can also be performed at the granularity of data blocks.
  • the data blocks to be cleared in the local storage medium are cleared, and the data blocks to be cleared are data blocks determined based on the reading frequency and/or the latest reading time.
  • the data blocks in the local storage medium whose reading frequency is less than the target frequency and/or the latest reading time is earlier than the preset reading time can be cleared, or the reading frequency is less than the target frequency and/or the latest reading time can be cleared. Data blocks that are older than the preset read time and meet the target ratio are cleared.
  • the process of clearing the data blocks in the local storage medium can be described in the above sections 3.1.1 and 3.1.2.
  • a doubly linked list can be maintained in the memory cache component, and the header of the doubly linked list
  • the block identifier of the "most recently accessed" data block is stored, and the block identifier of the "most recently accessed” data block is stored at the end of the table; when a data block is hit by a read request, the block identifier of the corresponding data block is changed from The current position of the doubly linked list is taken out and placed in the head of the linked list, so that the block identifier closer to the head of the linked list indicates that the data block has been accessed more recently.
  • the data blocks corresponding to the multiple block identifiers at the end of the linked list can be determined as the data blocks to be cleared, and the proportion of the data blocks to be cleared to all the data in the linked list is the target ratio.
  • the target ratio is 40%, then clear 40% of the data that is not frequently accessed.
  • FIG. 5 a flow chart of steps for producing an original fragmented file is shown. As shown in Figure 5, it may specifically include the following steps:
  • Step S501 Determine the number of divided data blocks based on the data content in the logical file of the target application, and establish a data correspondence relationship based on the number of divided data blocks.
  • Step S502 In response to a file production request initiated for the target application, create multiple empty original fragmented files based on the data correspondence; wherein each original fragmented file corresponds to one of the multiple logical files described in the data correspondence. Multiple data blocks; the number of data blocks allocated in each original slice file is specified by the author of the original image package.
  • Step S503 Read the data content of each logical file of the target application, and based on the data correspondence, write the read data content into the corresponding original fragmented file in blocks.
  • the multiple original fragment files, cache stack description files, and startup and running packages can be packaged and uploaded to the server.
  • the file block manager pre-creates the data correspondence.
  • the file block manager can read and display the data content of each logical file of the target application and the attributes of the logical file. After that, determine each The data content needs to be divided into data blocks and the number of data blocks allocated for each original fragmented file. Afterwards, the file block manager generates data correspondences based on the divided data blocks and the number of data blocks allocated to each original fragmented file.
  • a data path is established between the file block manager and the third cache component.
  • the original data in the logical file of the target application is written to the empty original fragmented file in the local second external storage. Therefore, a file block manager and a third cache can be established.
  • the data path between components (the cache component corresponding to the second external memory). Through this data path, the file block manager can divide the original data read from the logical file of the target application into blocks and write it to the second external memory. in the empty original slice file.
  • the file block manager when writing, since the file block manager has pre-made the data correspondence, when reading the data content of the target application, it can determine the identity of the logical file to which the data content belongs, and then determine the data through the data correspondence.
  • the content needs to be written to the original fragmented file and the globally unique block identifier given to the data block, so that the read data content can be written in blocks to the corresponding original fragmented file through the data path.
  • the configuration file of the target application (such as the cache stack description file) is created, stored in the same level directory of the original fragmented file, and packaged together into the original image package, and then The original image package and startup run package are packaged and uploaded to the OSS-object storage or large-scale distributed file system of the origin server, and then preheated to cache servers in different regions through the CDN system, thus achieving multiple
  • the raw data of the target application is stored in the data source.
  • an implementation method of data correspondence is provided.
  • data correspondence can be established through relationship entries.
  • the specific process is as follows:
  • each unique identifier uniquely represents a data block; among them, the number of entries included in the blocks table is the same as the total number of data blocks of the target application.
  • One entry corresponds to one data block, and the logical file identifier and block identifier can be corresponding Write to the corresponding field of an entry in the blocks table.
  • the data block description table is the data correspondence relationship.
  • the file block manager can create a nodex entry for the attribute information of each logical file/directory, and then write the attribute information of each logical file/directory into the corresponding field of the nodex entry.
  • a nodex table composed of multiple nodex table entries is obtained.
  • the attribute information of the logical file/directory includes the logical file identification and the type, size, creation, modification, access time and other information of the logical file.
  • FIG. 6 a schematic diagram of the data block description table of the present application is shown, including a nodex table and a blocks table.
  • the blocks table is a table composed of three columns on the left side of Figure 6, and the nodex table is a table composed of 9 columns on the right side of Figure 6.
  • each entry in the nodex table contains relevant attribute information of each logical file; nodeid represents a globally unique logical file identifier, which is used to index the attributes corresponding to the logical file in the blocks table and nodex table ( File attribute information, data block distribution information), parentid refers to the nodeid of the parent logical file, and other fields are regular attributes.
  • dblkid in the blocks table refers to the block identifier (unique identifier) of the data block in the original fragmented file
  • blockid refers to the identifier inside the logical file (starting from the 0 starting address of the logical file);
  • c/a/mtime refers to Creation/access/modification time.
  • the modification time can be represented by a timestamp (the timestamp is not specifically shown in Figure 6, and is represented by *); valid/allocsize refers to the validity of the logic file and the allocated capacity (as shown in Figure 6).
  • the unit is bytes and can be used to determine the number of data blocks).
  • the file block manager also provides how to create, delete, open, close, data read and write processes for logical files.
  • the logical file creation process insert an entry in the nodex table, and set the nodeid of the entry to the nodeid of the logical file.
  • Other attributes are based on file type, size, creation/modification/access time, and user (group) ownership. and other information settings (file descriptors are generally created when the file is opened and destroyed when the file is closed).
  • Logical file deletion process Set the nodeid & blockid of all entries in the blocks table that are equal to the nodeid of the logical file to 0xfffffff, and keep the dblkid unchanged; then search the nodex table for the entry corresponding to the nodeid of the logical file, and delete it.
  • the opening process of a logical file Create a file descriptor of a logical file in the memory, and then search the nodex table for the nodeid corresponding to the nodeid of the logical file; if it is not found, destroy the file descriptor and return failure; if it is found , the relevant attributes are read into the file descriptor, a virtual file handle corresponding to the file descriptor is created, the virtual file handle points to the file descriptor, and then the virtual file handle is returned to the application program.
  • Logical file closing process write the attribute information of the logical file into the nodex entry corresponding to the nodeid of the logical file, destroy the file descriptor in the memory, and delete the virtual file handle.
  • the data writing process of logical files first allocate writable data block entries in the blocks table that match the number of data blocks for this write request, and search for entries with nodeid&blockid of 0xfffffff (indicating idle); until enough tables are searched After updating the number of entries, the nodeid of the relevant table entry is the nodeid of the corresponding logical file, and the blockid is the blockid of the data block corresponding to the logical file. Then the write request is converted into a write request of dblkid and then sent to the memory cache component first to complete the write request.
  • the data reading process of the logical file first find the relevant entry corresponding to the nodeid of the logical file in the blocks table, then determine the dblkid according to the blockid of the read request, and finally convert the read request into a read request with dblkid and send it to the memory cache component first for completion.
  • the read request first find the relevant entry corresponding to the nodeid of the logical file in the blocks table, then determine the dblkid according to the blockid of the read request, and finally convert the read request into a read request with dblkid and send it to the memory cache component first for completion.
  • the read request first find the relevant entry corresponding to the nodeid of the logical file in the blocks table, then determine the dblkid according to the blockid of the read request, and finally convert the read request into a read request with dblkid and send it to the memory cache component first for completion. The read request.
  • the producer of the target application can produce the startup and running package and the original image package according to the process of 5.1.4 above, and upload the cache stack description file separately (it does not need to be encapsulated in the original image package) ), the cache stack description file can have corresponding cache stack description files for terminals with different performance configurations.
  • the terminal When the terminal wants to download and install the target application, the terminal uploads the identification of the target application and the performance parameters of the terminal to the server. Then, it can receive the startup run package and the corresponding cache stack description file issued by the server, and download the original image package.
  • the terminal starts the target application based on the startup run package, and then initializes the multi-level cache system shown in Figure 1 based on the cache stack description file.
  • the four cache components shown in Figure 1 are taken as an example.
  • the end user starts to use the target application. Since the original data of the target application is made into multiple original fragmented files and stored in the cloud storage medium, after the target application is started, part of the data can be downloaded locally from the terminal, or Obtain the required data from the original image package of the cloud storage medium to support the operation of the application. Since the startup package contains very little data, the target application can be started quickly, and the data required to run the target application can be obtained in the original image package or in locally downloaded data to support the operation of the application, so that the target application can Be launched and used quickly, optimizing user experience.
  • the data stored in the local storage medium (memory, first external memory and second external memory) in the terminal can be Clean the data of the target application.
  • the memory, the first external memory, and the second external memory can be cleaned.
  • the cleaning ratio of each storage medium can also be specified, where the ratio can be any ratio.
  • this ratio is automatically generated by the application manager based on the performance configuration of the current operating system and hardware platform, or can be specified by the user.
  • the storage medium can free up more storage space for storing data of other applications and other multimedia data, thereby allowing the terminal to Run and install more applications, store more data.
  • the target application when the target application issues a read request, it can first read data from a storage medium with a fast response speed, such as memory, and return it to the target application.
  • a storage medium with a fast response speed such as memory
  • Fast storage media such as reading data from the first external memory and returning it to the target application. Therefore, when reading data, the data is read from the corresponding storage media in order from high to low response speed, thereby improving The I/O response speed of the target application.
  • the data blocks and the number of data blocks to be read next by the target application are predicted, and the predicted data blocks are written in advance from storage media other than memory to In the memory, the data block can be read directly from the memory the next time it is read, thereby helping to further improve the I/O response speed of the target application.
  • each original fragmented file includes some data blocks in the original data of the target application.
  • the original data in multiple logical files of the target application is redistributed to multiple original fragmented files.
  • the corresponding data block and the corresponding data block are written, thereby improving the stability of the I/O response.
  • this application also provides a data processing device.
  • a structural block diagram of a data processing device is disclosed.
  • the device may include the following modules:
  • Initialization module 701 is used to start the target application based on the startup run package of the target application, and initialize multiple cache components corresponding to the target application; the multiple cache components respectively correspond to respective storage media, and the storage media Data that supports the operation of the target application is stored in it;
  • the cleaning module 702 is configured to respond to a storage space release event on the terminal and clear the data located in the local storage medium of the terminal through the corresponding cache component; wherein the data remaining in the local storage medium after clearing All data is at least the data in the startup and running package to at least ensure the startup of the target application;
  • Response module 703 configured to respond to the read request of the target application and obtain the data corresponding to the read request from the cloud storage medium and/or the local storage medium through the corresponding cache component to support the target The operation of the application; wherein, the original data supporting the operation of the target application is stored in the cloud storage medium.
  • the cleaning module 702 includes:
  • a first cleaning unit configured to clear the data to be cleared in the local storage medium when the storage space release event is a partial clearing event.
  • the data to be cleared is based on the reading frequency and/or the most recent read. time-determined data;
  • the second cleaning unit is configured to clear all data in the local storage medium except the startup run package when the storage space release event is an extreme cleaning event.
  • the device also includes:
  • a first writing module configured to write the data cleared from the memory into a local storage medium with a corresponding response priority lower than the memory when the local storage medium includes a memory
  • the second writing module is configured to write the cleared data with target characteristics in the remaining local storage media except the memory into the incremental data area; wherein the target characteristics represent The data block is data written by the target application.
  • initialization module 701 includes:
  • a parameter acquisition unit configured to acquire performance configuration parameters of the terminal;
  • the performance configuration parameters include the version identification of the operating system of the terminal and/or the current performance configuration parameters of the memory on the terminal;
  • An initialization unit configured to initialize the plurality of cache components based on the performance configuration parameters, wherein the number of the plurality of cache components is adapted to the performance configuration parameters.
  • the initialization unit includes:
  • a first initialization subunit configured to initialize cache components corresponding to multiple external memories and the memory of the terminal when it is determined that the memory of the terminal and/or the operating system meets the target conditions based on the performance configuration parameters
  • the second initialization subunit is configured to initialize cache components corresponding to the plurality of external memories when it is determined based on the performance configuration parameters that the memory of the terminal and/or the operating system does not meet the target condition.
  • the device also includes:
  • a system parameter acquisition module used to acquire operating system parameters of the terminal, where the operating system parameters are used to indicate the version of the operating system on the terminal;
  • An interface layer initialization module configured to create an interface layer corresponding to the target application based on the operating system parameters, where the interface layer includes a file system model, a sandbox model or a file interface model;
  • the interface layer is used to receive the I/O request and the storage space release event issued by the target application.
  • the plurality of cache components have respective response priorities, wherein a cache component with a higher response priority corresponds to a storage medium with a faster response speed, and the device further includes at least one of the following:
  • the first sequential writing module is configured to respond to the write request of the target application and sequentially write the data to be written to the corresponding storage medium in order of the response priorities of the multiple cache components from high to low. ;
  • a sequential reading module configured to respond to the read request of the target application and obtain the read request from the corresponding storage medium through the cache component in order of the response priorities of the multiple cache components from high to low. corresponding data;
  • the second sequential writing module is used to write the data read from the storage medium corresponding to the cache component with low response priority into the storage medium corresponding to the cache component with high response priority.
  • write modules in the first order including:
  • the first writing unit is configured to write the data to be written to the cache component corresponding to the highest response priority through the cache component with the highest response priority in order of response priority from high to low. storage media;
  • the second writing unit is used to read the data to be written from the storage medium corresponding to the cache component with the highest response priority, and to write the data to be written through the cache component with a low response priority. Write to the corresponding storage medium.
  • each storage medium stores data supporting the operation of the target application at the granularity of data blocks, where the data blocks are obtained by dividing the original data of the target application into blocks; the device further includes:
  • the data block reading module is configured to respond to the read request of the target application and sequentially read the data of the read request from the corresponding storage medium in order from high to low according to the respective response priorities of the multiple cache components. required data block;
  • the data block encapsulation module is used to encapsulate all the read data blocks and return them to the target application.
  • each storage medium stores data that supports the operation of the target application in data block granularity.
  • the data blocks are obtained by dividing the original data of the target application into blocks.
  • the device further includes:
  • a pre-read data block determination module configured to determine multiple pre-read data blocks to be read next based on the data read from multiple historical read requests of the target application
  • the pre-read data block acquisition module is used to obtain the target data blocks among multiple pre-read data blocks that do not exist in the storage medium corresponding to the cache component with the highest response priority, in order from high to low response priority.
  • the remaining cache components read the target data block from the corresponding storage medium;
  • a pre-read data block writing module configured to write the read target data block into the storage medium corresponding to the cache component with the highest response priority, so that the next read request hits the multiple pre-read data blocks.
  • the cache component has the highest response priority
  • the plurality of read-ahead data blocks are read from the storage medium corresponding to the cache component with the highest response priority.
  • the data block reading module includes:
  • a block identification determination unit configured to respond to a read request of the target application and determine the respective block identification of each data block required by the read request based on the data correspondence; the data correspondence is used to characterize the original The correspondence between data and data blocks in the storage medium;
  • a data block reading unit is configured to sequentially read the data blocks with the block identifiers from the corresponding storage medium in order from high to low response priorities of the multiple cache components.
  • the device also includes:
  • a data dividing module used to divide all data blocks obtained after the original data of the target application is divided into blocks, and obtain multiple original fragmented files
  • a data upload module configured to upload the plurality of original fragmented files and the startup run package to the cloud storage medium for downloading and use by the target application.
  • the device also includes:
  • the interface creation module is used to create multiple interfaces between the corresponding cache component and the cloud storage medium; the multiple interfaces include, from high to low according to response priority: content distribution network CDN interface, point-to-point transmission P2P interface and origin site interface;
  • a data download module configured to, when reading data from the cloud storage medium, sequentially download data from the cloud storage medium through the multiple interfaces in order from high to low response priorities of the multiple interfaces. Get the corresponding data.
  • the device embodiment is similar to the method embodiment, so the description is relatively simple. For relevant information, please refer to the method embodiment.
  • An embodiment of the present application also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes, the cache scalable processing of the application is implemented. Methods, apparatus, equipment and media.
  • Embodiments of the present application also disclose a computer-readable storage medium, the computer program stored therein enables the processor to execute the caching scalable processing method, device, equipment and medium of the application as described in the present application.
  • An embodiment of the present application also discloses a computer program product, which includes a computer program/instruction, which when executed by a processor implements the caching scalable processing method, device, equipment and medium for the application.
  • the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment.
  • embodiments of the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, embodiments of the present application 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.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine such that the instructions are executed by the processor of the computer or other programmable data processing terminal device. Means are generated for implementing the functions specified in the process or processes of the flowchart diagrams and/or the block or blocks of the block diagrams.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the The instruction means implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, so that a series of operating steps are performed on the computer or other programmable terminal equipment to produce computer-implemented processing, thereby causing the computer or other programmable terminal equipment to perform a computer-implemented process.
  • the instructions executed on provide steps for implementing the functions specified in a process or processes of the flow diagrams and/or a block or blocks of the block diagrams.
  • any reference signs placed between parentheses shall not be construed as limiting the claim.
  • the word “comprising” does not exclude the presence of elements or steps not listed in a claim.
  • the word “a” or “an” preceding an element does not exclude the presence of a plurality of such elements.
  • the present disclosure may be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the element claim enumerating several means, several of these means may be embodied by the same item of hardware.
  • the use of the words first, second, third, etc. does not indicate any order. These words can be interpreted as names.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例提供了一种应用的缓存可伸缩处理方法、装置、设备及介质,所述方法包括:基于目标应用的启动运行包启动目标应用,并初始化与目标应用对应的多个缓存组件;多个缓存组件分别对应各自的存储介质,存储介质中存储有支持目标应用运行的数据;响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于终端的本地存储介质中的数据进行清除;其中,经清除后本地存储介质中留存的全部数据最少为启动运行包中的数据,以至少保证目标应用的启动;响应于目标应用的读请求,通过对应的缓存组件,从云存储介质和/或本地存储介质中获取读请求对应的数据,以支持目标应用的运行;其中,云储存介质中存储有支持目标应用运行的原始数据。

Description

应用的缓存可伸缩处理方法、装置、设备及介质
本申请要求在2022年5月23日提交中国专利局、申请号为202210562146.X、发明名称为“应用的缓存可伸缩处理方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信处理技术领域,特别是涉及一种应用的缓存可伸缩处理方法、装置、设备及介质。
背景技术
目前随着各类应用的普及,用户一般会在终端下载各类应用以进行使用,例如,在手机上会安装很多APP。
然而,终端的存储是有限的,在安装应用时便需要下载完整的应用数据,而有些应用的应用数据较大,会占据较多的存储空间,使得终端无法安装更多的应用。而在应用使用过程中也会逐渐累积到很多数据,因此数据量是随着应用的使用而逐渐增多,导致终端的存储空间越来越小。
实际中,用户为了使得终端可以安装更多的应用或存储更多的数据,往往会对终端进行数据清理。相关技术中,在进行数据清理时,数据清理有限,并不能释放较大的存储空间,如果清理较多数据又会影响应用的正常使用,甚至如果要清理更多的数据,就必须要卸载应用,但是用户往往不希望卸载应用。
因此,如何在保留众多应用、且不影响用户正常使用应用的情况下,为终端腾出较大的空间,是目前终端技术面临的一个痛点。
概述
鉴于上述问题,提出了本申请实施例,以便克服上述问题或者至少部分地解决上述问题。
为了解决上述问题,本申请的第一方面,提供一种应用的缓存可伸缩处 理方法,所述方法包括:
基于目标应用的启动运行包启动所述目标应用,并初始化与所述目标应用对应的多个缓存组件;所述多个缓存组件分别对应各自的存储介质,所述存储介质中存储有支持所述目标应用运行的数据;
响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除;其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动;
响应于所述目标应用的读请求,通过对应的缓存组件,从云存储介质、和/或所述本地存储介质中获取所述读请求对应的数据,以支持所述目标应用的运行;其中,所述云储存介质中存储有支持所述目标应用运行的原始数据。
可选地,响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除,包括:
在所述存储空间释放事件为部分清除的事件时,清除所述本地存储介质中待清除的数据,所述待清除的数据为基于读取频次和/或最近读取时间确定的数据;
在所述存储空间释放事件为极限清理的事件时,清除所述本地存储介质中除所述启动运行包外的全部数据。
可选地,多个缓存组件具有各自的响应优先级,在所述存储空间释放事件为部分清除的事件的情况下,所述方法还包括:
在所述本地存储介质包括内存的情况下,将从所述内存中清除的数据写入到对应的响应优先级低于所述内存的本地存储介质中;
对除所述内存外的其余本地存储介质,将所述其余本地存储介质中清除的具有目标特征的数据写入增量数据区中;其中,所述目标特征表征所述数据块是被所述目标应用写入的数据。
可选地,初始化与所述目标应用对应的多个缓存组件,包括:
获取所述终端的性能配置参数;所述性能配置参数包括所述终端的操作系统的版本标识和/或所述终端上内存的当前性能配置参数;
基于所述性能配置参数,初始化所述多个缓存组件,其中,所述多个缓存组件的数量与所述性能配置参数适配。
可选地,基于所述性能配置参数,初始化所述多个缓存组件,包括:
基于所述性能配置参数确定所述终端的内存和/或所述操作系统满足目标条件时,初始化与多个外存和所述终端的内存各自对应的缓存组件;
基于所述性能配置参数确定所述终端的内存和/或所述操作系统不满足所述目标条件时,初始化与所述多个外存各自对应的缓存组件。
可选地,所述方法还包括:
获取所述终端的操作系统参数,所述操作系统参数用于指示所述终端上的操作系统的版本;
基于所述操作系统参数,创建与所述目标应用对应的接口层,所述接口层包括文件系统模型、沙盒模型或文件接口模型;
其中,所述接口层用于接收所述目标应用发出的I/O请求和所述存储空间释放事件。
可选地,所述多个缓存组件具有各自的响应优先级,其中,响应优先级越高的缓存组件对应响应速度越快的存储介质,所述方法还包括以下至少一者:
响应所述目标应用的写请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中;
响应所述目标应用的读请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次通过所述缓存组件从对应的存储介质中获取所述读请求对应的数据;
将从响应优先级低的缓存组件对应的存储介质中读取到的数据,写入到响应优先级高的缓存组件对应的存储介质中。
可选地,按照所述多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中,包括:
按照响应优先级从高到低的顺序,通过响应优先级最高的缓存组件,将所述待写入的数据写入到所述响应优先级最高的缓存组件对应的存储介质;
从所述响应优先级最高的缓存组件对应的存储介质中读取所述待写入的数据,并通过响应优先级低的缓存组件将所述待写入的数据写入到对应的存储介质中。
可选地,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的;所述方法还包括:
响应于所述目标应用的读请求,按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取所述读请求所需的数据块;
将读取出的全部数据块封装后返回给所述目标应用。
可选地,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的,所述方法还包括:
基于所述目标应用的多个历史读请求所读取到的数据,确定下一次所要读取的多个预读数据块;
对多个预读数据块中未存在于响应优先级最高的缓存组件对应的存储介质中的目标数据块,按照响应优先级从高到低的顺序,依次通过其余的缓存组件从相应的存储介质中读取所述目标数据块;
将读取到的所述目标数据块写入所述响应优先级最高的缓存组件对应的存储介质,以在下一次读请求命中所述多个预读数据块时,从所述响应优先级最高的缓存组件对应的存储介质中读取所述多个预读数据块。
可选地,响应于所述目标应用的读请求,按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取所述读请求所需的数据块,包括:
响应于所述目标应用的读请求,基于数据对应关系,确定所述读请求所需的每个数据块各自的块标识;所述数据对应关系用于表征所述原始数据与所述存储介质中的数据块之间的对应关系;
按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取具有所述块标识的所述数据块。
可选地,在基于目标应用的启动运行包启动所述目标应用之前,所述方法还包括:
对所述目标应用的原始数据被分块后得到的全部数据块,将所述全部数据块进行划分,得到多个原始分片文件;
将所述多个原始分片文件和所述启动运行包上传至所述云存储介质,以供所述目标应用下载使用。
可选地,所述方法还包括:
创建对应的缓存组件与所述云存储介质之间的多种接口;多种接口按照响应优先级从高到低包括:内容分发网络CDN接口、点对点传输P2P接口和源站接口;
在从所述云存储介质中读取数据时,按照所述多种接口的响应优先级从高到低的顺序,依次通过所述多种接口从所述云存储介质中获取对应的数据。
本申请实施例的第二方面,提供一种应用的缓存可伸缩处理装置,所述装置包括:
初始化模块,用于基于目标应用的启动运行包启动所述目标应用,并初始化与所述目标应用对应的多个缓存组件;所述多个缓存组件分别对应各自的存储介质,所述存储介质中存储有支持所述目标应用运行的数据;
清理模块,用于响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除;其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动;
响应模块,用于响应于所述目标应用的读请求,通过对应的缓存组件,从云存储介质、和/或所述本地存储介质中获取所述读请求对应的数据,以支持所述目标应用的运行;其中,所述云储存介质中存储有支持所述目标应用运行的原始数据。
本申请实施例还公开了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行时实现如第一方 面所述的应用的缓存可伸缩处理方法。
本申请实施例还公开了一种计算机可读存储介质,其存储的计算机程序使得处理器执行如本申请第一方面所述的应用的缓存可伸缩处理方法。
本申请实施例还公开了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现第一方面所述的应用的缓存可伸缩处理方法。
采用本申请实施例的应用的缓存可伸缩处理方法,可以基于目标应用的启动运行包启动目标应用并初始化多个缓存组件,其中,由于每个缓存组件分别对应各自的存储介质,在需要对终端的存储空间进行释放时,可以通过相应的缓存组件将终端上本地存储介质中的数据进行清除,在清除的过程中,终端的本地存储介质中所留存的全部数据最少为启动运行包中的数据。这样,在终端上只剩启动运行包中的数据的情况下,可以保证目标应用的正常启动。之后,在目标应用运行时,又可以通过相应的缓存组件,从云存储介质的原始数据和/或本地存储介质的留存数据中获取读请求对应的数据,从而支持目标应用的运行。
采用本申请实施例的应用的缓存可伸缩处理方法,具有以下方面的优点:
一方面,在清除本地存储介质中的数据时,可以清除到终端本地仅剩启动运行包中的数据,由于启动运行包的数据量很小,因此占用的本地存储介质的空间很小,例如,有些目标应用的启动运行包仅几十kb,从而可以释放出更多的存储空间,这样终端便可以安装更多的应用、存储更多的数据,如多媒体数据。
另一方面,启动运行包是用于启动目标应用的,如此,可以保证目标应用在终端上的正常启动,且在后续响应目标应用的读请求时,可以从云存储介质的原始数据和/或本地存储介质留存的数据中读取所需的数据,因此,对数据的清理又不影响目标应用的正常使用。
综上,采用本申请的应用的缓存可伸缩处理方法,可以在保留众多应用、且不影响用户使用的情况下,为终端腾出较大的空间以用于安装更多的应用 和存储较多的多媒体数据,从而解决了终端技术面临的痛点。
附图简述
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例中一种应用的缓存可伸缩处理方法所运行的软硬件环境图;
图2a示出了接口层为文件系统模型时的软硬件环境图;
图2b示出了接口层为沙盒模型/文件接口模型时的软硬件环境图;
图3是本申请实施例中一种应用的缓存可伸缩处理方法的步骤流程图;
图4是本申请实施中的数据预读的步骤流程示图;
图5是本申请实施中制作原始分片文件的步骤流程图;
图6是本申请实施中示例性的数据块描述表的示意图;
图7是本申请实施例中基于多级缓存的应用运行装置的结构框图。
详细描述
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本发明实施例可以应用于终端的各种操作系统中,所述终端包括PC端和移动终端,操作系统包括PC端的操作系统如Windows,Linux,Unix,以及虚拟机仿真系统等,还包括移动终端的操作系统如安卓、IOS等。
本发明实施例中的目标应用可以是指软件安装包和数据包较大的应用程序,如3D游戏、PS等应用程序;其中,目标应用可以是PC端的应用程序,也可以是移动终端的应用程序(Application,APP);下面以移动终端为例,对本发明实施例的方法和系统进行说明。
当前,在安装3D游戏、PS等应用程序时,这些应用程序一般会占据终端较大的存储空间,使得终端无法安装更多的应用。而在应用使用过程中也会逐渐累积很多数据,因此数据量是随着应用的使用而逐渐增多,导致终端的空闲存储空间越来越小。一般而言,当用户在安装新的应用或需要在终端存储较大的多媒体数据(如图片、视频)时,由于已安装应用对存储空间的占据,使得新的应用或需要存储的多媒体数据无法得到足够空间,进而导致安装失败或存储失败的问题。
相关技术中,用户为了有足够的空间安装新的应用或存储新的数据,一般会对终端上的数据进行数据清理,然而在进行数据清理时,数据清理是有限的,并不能释放较大的存储空间。例如,在对手机上的微信进行数据清理时,仅能清理一些无关紧要的数据(如聊天数据),然而聊天数据一般占据的空间还没有支持微信运行的原始数据占据的空间大,但是这部分原始数据又是无法清理的,一旦清理会导致微信的不可使用。因此,用户往往会舍弃新的应用的安装,或卸载部分已安装的应用,无论哪一种,都降低了用户的使用体验;还有些用户为了能安装更多的应用,往往会升级终端设备,如购买新的存储空间更大的终端,如购置新手机,或添置存储卡。但是,如此一来又必然导致用户的购买成本的升高。
有鉴于此,本申请为解决上述技术问题,提出了一种在终端上清理数据更彻底且不影响应用正常使用的技术方案,为实现该方案,本发明人首先将目标应用的原始数据制作成启动运行包和多个原始分片文件,启动运行包用于启动目标应用,而原始分片文件中存储目标应用运行所需的数据,原始分片文件最初可以保存在云端存储介质中,以供目标应用下载使用。
基于此,本申请可以获取目标应用的启动运行包,通过启动运行包启动目标应用,并初始化与目标应用对应的多个缓存组件,每个缓存组件对应一个存储介质,当需要清理终端的数据时,可以通过缓存组件清理到终端上最少只剩目标应用的启动运行包中的数据。而对于目标应用的后续运行,又可以从云存储介质的原始数据和/或本地存储介质中留存的数据读取出目标应用所需的数据,以支持目标应用的运行。如此,可以在数据清理更彻底、释 放空间更多的情况下,保证目标应用的正常运行,为安装新的应用和存储新的数据提供足够的存储空间,用户不必卸载已安装的应用,也不必购买新的终端或新的存储卡,从而优化了用户的使用体验、降低用户的购买成本。
更进一步地,本申请围绕上述技术构思,还提供了以下四个改进点:
改进点1:初始化的多个缓存组件的数量,可以与终端的操作系统、终端的存储设备的性能配置参数适配。这样,缓存组件的数量可以匹配终端的性能配置,使得缓存组件的数量可以随着终端的性能配置的不同而增多或减少,从而达到缓存组件的可伸缩,以灵活适应多种终端。
改进点2:在提高目标应用的I/O响应速度的同时,为了能提高目标应用的I/O响应的稳定性,提出了按数据块存储目标应用的原始数据的方案,即原始分片文件中是以数据块粒度存储的目标应用的数据。
相关技术中,是将目标应用的每个逻辑文件的数据保存到3个物理文件中(原始数据文件、增量数据文件,元数据文件(存放逻辑文件的属性信息)),由此,得到目标应用的原始镜像包,使得目标应用的原始数据被迁移至三种物理文件中,如此,免去对目标应用所依赖运行时环境的解析,以及模块化拆分工作,大大降低了人工成本和时间成本。然而,每个逻辑文件都对应3种物理文件,使得原始镜像包中的文件的数量便成倍增加,当目标应用需要读取或写入数据时,便会产生大量的文件句柄,很容易就达到了系统的句柄数上限,会导致目标应用的异常崩溃。
因此,本申请对目标应用的原始数据进行分块,将得到的全部数据块划分到多个原始分片文件中,从而是以数据块的粒度存储原始数据。如此,目标应用的多个逻辑文件中的原始数据便被重新分配到多个原始分片文件中,这样,在读取和写入数据时,便可以到对应的原始分片文件中读取相应的数据块和写入相应的数据块,避免产生大量的文件句柄,从而提高了I/O响应的稳定性。
改进点3:多个缓存组件可以具有各自的响应优先级,可以按照各自的响应优先级响应目标应用的I/O请求,以降低数据访问的组件层级深度,提高目标应用的I/O响应速度。
在该改进点3中,当目标应用发出读请求时,可以优先从响应速度快的存储介质中读取数据返回给目标应用,在从响应速度快的存储介质中读取不到数据时,又可以从响应速度次级快的存储介质中读取数据返回给应用,由此在读取数据时,是按照响应速度从高到低的顺序从对应的存储介质中读取数据,从而提高了目标应用的I/O响应速度。
改进点4:为进一步提高目标应用的I/O响应速度,对响应速度最快的存储介质对应的缓存组件进行了改进,主要体现在:基于目标应用的数据读取的历史轨迹,预测目标应用下一次要读的数据,从而提前从其他存储介质中,将预测的数据写入到该响应速度最快的存储介质中,从而帮助进一步提高目标应用的I/O响应速度。
为充分说明本申请的目标应用的缓存可伸缩处理方法,本申请实施例分别从本申请所应用的软硬件环境(1.1节)、多级缓存的可伸缩处理(2.1节~3.1节)、I/O响应具体过程(4.1节)、基于原始分片文件的I/O响应(5.1节)进行分别说明。
1.1,本申请所应用的软硬件环境。
参照图1所示,示出了本申请的目标应用的缓存可伸缩处理方法所应用的软硬件环境的示意图。其中,在图1所示的软硬件环境中,包括多级缓存系统(图1中虚线框所示为多级缓存系统)、接口层、应用程序管理器和缓存栈管理器。
其中,多级缓存系统包括原生接口转换组件、文件块管理器、第一缓存组件、第二缓存组件、第三缓存组件、第四缓存组件和分片文件I/O分流器。其中,分片文件I/O分流器分别与第三缓存组件和第四缓存组件通信连接。当然,随着终端的不同,缓存组件的数量可以有所变化,图1仅示例性给出了四个缓存组件的情况。可以理解的是,在其他一些情况中,缓存组件也可以有三个或更多个,当然,缓存组件的数量至少为两个,即包括与云存储介质对应的缓存组件和与终端上的一个外存对应的缓存组件。
其中,多个缓存组件具有各自的响应优先级,响应优先级高的缓存组件对应响应速度快的存储介质,其中,第一缓存组件、第二缓存组件、第三缓 存组件对应终端上的本地存储介质,第四缓存组件对应云存储介质。在本地存储介质中存储有目标应用的部分数据,而在云存储介质中存储有目标应用的全部原始数据。如图1所示,图1示例性示出第一缓存组件对应终端的内存,第二缓存组件对应终端的第一外存,第三缓存组件对应终端的第二外存。
其中,缓存栈管理器可以理解为是启动并维护多级缓存系统的进程;接口层可以理解为是目标应用与多级缓存系统之间的通信桥梁,用于将目标应用的数据读取请求、数据写入请求、数据修改请求等发送给多级缓存系统,多级缓存系统进而响应上述的数据读取请求、数据写入请求、数据修改请求和数据清理的请求。应用程序管理器可以对目标应用和多级缓存系统进行监控和维护,具体而言,可以用于负责管理多级缓存系统以及目标应用的进程并与它们保持通信。
其中,如图1所示,接口层与原生接口转换组件通信连接,原生接口转换组件作为文件块管理器的上层组件,文件块管理器作为第一缓存组件的上层组件,第一缓存组件作为第二缓存组件的上层组件,第二缓存组件作为分片文件I/O分流器的上层组件,分片文件I/O分流器作为第三缓存组件和第四缓存组件的上层组件。
下面,对多级缓存系统中的各个组件的功能进行详细介绍:
1.1.1,原生接口转换组件。原生接口转换组件用于负责接收被接口层重定向的文件I/O请求,可以面向不同的操作系统,用于承接不同的操作系统对应的文件I/O接口规范,并将各种不同的文件I/O接口规范转换成统一的接口规范对接到文件块管理器。
1.1.2,文件块管理器。文件块管理器是多个缓存组件的上层组件,用于对接目标应用的数据请求,并管理多个原始分片文件中的数据。例如,文件块管理器在接收到读请求时,可以确定读请求对应的数据,进而根据对应的数据将读请求转换为缓存组件可识别的读请求,从而将该读请求按照响应优先级从高到低的顺序发送给多个缓存组件,以获取对应的数据。
1.1.3,缓存组件。每个缓存组件对应一个存储介质,其中,每个缓存组件与存储介质之间具有各自的数据通路,缓存组件可以通过各自对应的数据 通路对存储介质中的数据进行管理、维护,并响应于数据处理请求,通过相应的数据通路对存储介质中的数据进行处理,如对存储介质中的数据进行读处理、写处理、清除处理等。其中,缓存组件按照上下层级关系,又可以与相邻的上层组件和下层组件建立系统内通路。
1.1.4,分片文件I/O分流器。
如图1所示,分片文件I/O分流器是第二缓存组件的下层组件,是第三缓存组件和第四缓存组件的上层组件,实现对终端中的本地存储介质和云存储介质中的数据的处理。实际中,多个原始分片文件的完整数据存储在云存储介质中,而从原始分片文件中下载到终端的数据可以先存储在位于终端上的响应优先级较低的缓存组件对应的本地存储介质中,因此,在本地存储介质中存储的是多个原始分片文件中的部分数据。其中,分片文件I/O分流器还可以管理增量数据区,增量数据区中存储目标应用所写入的数据。
例如,第三缓存组件所对应的第二外存中存储的原始分片文件包含下载的部分数据,第四缓存组件所对应的云存储介质中存储的是多个原始分片文件的原始数据。当分片文件I/O分流器接收到第二缓存组件下发的读请求时,可以从第三缓存组件和/或第四缓存组件对应的存储介质中读取出需要的数据,并将从该存储介质中读取出的数据整合后返回给第二缓存组件。
1.1.5,第四缓存组件。
第四缓存组件实际可以称为数据合流器,是分片文件I/O分流器的下层组件,在通过上述的第一缓存组件至第三缓存组件均无法成功读取到数据时,则通过数据合流器可以从不同服务器中读取目标应用所需要的数据,并将从不同服务器所读取到的数据合流返回给分片文件I/O分流器。其中,不同服务器的集合在本申请中称为云存储介质。
本实施例中,可以在获取到启动运行包之后,通过缓存栈管理器进行上述多级缓存系统中各个组件的初始化,具体介绍如下:
1.2,多级缓存系统中相应组件的具体初始化过程。
具体实施时,可以先在服务器中下载目标应用的启动运行包和缓存栈描述文件,该缓存栈描述文件用于描述目标应用需要初始化的各个组件。当下 载完成启动运行包之后可以启动目标应用,基于缓存栈描述文件初始化图1所示的多级缓存系统中的各个组件,例如,通过启动的缓存栈管理器,完成多个缓存组件的初始化任务。
初始化多级缓存系统完成后,便可以运行目标应用,在运行目标应用时,接口层将目标应用发出的读请求、写请求以及后续的数据清理请求发送给原生接口转换组件,经由原生接口转换组件进行转换后发送给文件块管理器,文件块管理器将上述请求发送给相应的缓存组件执行上述的请求。
示例地,可以在基于缓存栈描述文件,初始化目标应用的原生接口转换组件时,创建与目标应用对接的接口层;接着,建立接口层与原生接口转换组件之间的数据通路,以使原生接口转换组件通过该数据通路接收接口层重定向的数据处理请求;并建立原生接口转换组件与文件块管理器之间的数据通路,以使文件块管理器通过对应的数据通路接收原生接口转换组件发送的重定向的数据处理请求。
1.3,多个缓存组件的初始化(对应改进点1)。
在一种实施例中,可以获取所述终端的性能配置参数,并基于所述性能配置参数,初始化所述多个缓存组件。其中,性能配置参数包括终端的操作系统的版本标识和/或终端上内存、外存的当前性能配置参数,多个缓存组件的数量与性能配置参数适配。
本实施例中,终端的性能配置参数可以用于指示终端的软硬件性能状态,其中,操作系统的版本标识可以用于指示终端的操作系统的版本,操作系统可以是Android、IOS、Windows、Linux、MacOSX等,以及PlayStation、Xbox、Nintendo Switch等硬件平台对应的操作系统。不同的操作系统所占的存储空间可以不同,且为终端提供了性能不同的操作环境。
其中,终端上内存的当前性能配置参数可以包括:终端上内存的当前剩余容量(有些系统配置会将一部分内存空间作为集成显卡的补充显存,或者将一部分内存空间作为SSD的读写缓存)、内存的频率、位数、IO响应延迟等参数。其可以反映终端的内存性能,而内存的性能影响终端对应用的运行性能。
在一种可选的示例中,在终端安装目标应用之前,可以先将终端的性能配置参数通过应用程序管理器上报给目标应用所在的服务器,在服务器中预先存储有对应不同性能配置参数的缓存栈描述文件,不同的缓存栈描述文件用于指导在相应性能配置参数的终端上初始化相应数量的缓存组件。在下载安装目标应用时,可以从服务器上下载与本终端的性能配置参数适配的缓存栈描述文件,从而基于下载的缓存栈描述文件,初始化相应数量的缓存组件。
在又一种可选的示例中,在服务器中存储有一个标准的缓存栈描述文件,在下载安装目标应用时,不同终端均可以从服务器中下载该缓存栈描述文件,在该缓存栈描述文件中对应于缓存组件的描述项可以设置为依据终端的性能配置参数初始化,并规定不同性能配置参数所要初始化的缓存组件的类型和数量。如此,在初始化缓存组件时,可以基于本终端的性能配置参数,确定初始化的缓存组件的数量和类型,从而基于缓存栈描述文件和性能配置参数,初始化相应数量的缓存组件。
其中,云存储介质对应的缓存组件是必须的,缓存组件的数量越多可以是指:与终端的本地存储介质对应的缓存组件越多,即可利用的本地存储介质的种类可能也越多(不同种类的存储介质其响应速度可能不一样)。这样,在响应目标应用的读请求时,在向云存储介质请求数据之前,可以经过更多的本地存储介质的响应,因此,可以提高本地存储介质成功响应目标应用的请求的概率,由于终端的本地存储介质与目标应用之间的数据通路是终端本地的通路,通信路径短,由此可以提高对目标应用的响应速度。
实际中,终端的本地存储介质可以包括终端的内存和多个外存,多个外存可以包括固态硬盘、机械硬盘以及外接的USB设备、存储卡等。
其中,终端的性能配置参数表征终端的性能较优时所初始化的缓存组件的数量,多于性能配置参数表征终端的性能较差时所初始化的缓存组件的数量。
具体实施时,在基于所述性能配置参数,初始化多个缓存组件时,可以基于性能配置参数确定终端的内存、外存和/或操作系统是否满足目标条件,在满足目标条件时,初始化与多个外存和所述终端的内存各自对应的缓存组 件;在不满足目标条件时,初始化与多个外存各自对应的缓存组件。
其中,目标条件可以是操作系统为目标版本的操作系统、终端的CPU指令集位数为目标位数、终端的内存的剩余容量不低于目标容量等多个条件的任一一种或多种条件的组合。其中,目标条件包含的内容越多,则终端的性能配置参数需要达到更高要求,才能初始化较多数量的缓存组件。
其中,在满足目标条件时,初始化的缓存组件中包括与内存对应的缓存组件,又可以称为内存缓存组件,而对应终端上的多个外存可以分别初始化对应的缓存组件。示例地,若目标条件为操作系统的版本是Linux,内存的当前剩余容量不低于60%,CPU指令集是64位,同时存在固态硬盘和机械硬盘,则满足该条件的,表征终端的性能较优,则可以初始化四个缓存组件,例如,与内存对应的内存缓存组件、与终端上第一外存(固态硬盘)对应的临时缓存组件,与第二外存(机械硬盘)对应的本地缓存组件和与云存储介质对应的云缓存组件。
在一种示例中,可以将多个外存中的一个外存对应的缓存组件确定为与内存缓存组件配套的临时缓存组件,其中,该内存缓存组件是与临时缓存组件相邻的上层组件,二者可以是配套使用缺一不可的。如图1所示,第一缓存组件即为内存缓存组件,第二缓存组件即为临时缓存组件。其中,当内存缓存组件对应的内存中的数据被清理时,可以将被清理的数据写入到临时缓存组件,如此,在响应目标应用的I/O请求时,可以从临时缓存组件中读取原本在内存中的数据,这样,在保证内存的空间不被占用过多的情况下,还能保证对目标应用的I/O响应速度。
当然,需要说明的是,一个终端上一般会安装多个应用,其中,多个应用可以是不同时间安装的,因此,随着终端不断地安装应用,终端的存储资源被不断占用,因此,终端的性能配置参数在不同的时间,可能是不一样的,因此,对于不同时间安装的应用,其初始化的缓存组件的数量也可以是不同的。
例如,对于安装时间靠前的应用,由于这些应用在安装时,终端上的存储资源的占用率相对较低,终端的内存的剩余容量相对较高,由此,对于安 装时间在前的应用,其初始化的缓存组件中可以包括内存缓存组件和临时缓存组件;对于安装时间在后的应用,终端上的存储资源的占用率相对升高,内存的剩余容量相对也降低,因此,对于安装时间在后的应用,其初始化的缓存组件中可以不包括内存缓存组件和临时缓存组件。
这样,对于同一个终端而言,安装时间不同的应用,其初始化的缓存组件的数量也可以是不同的,如此,使得终端在尽可能地多安装应用的情况下,也可以使得部分应用的响应速度得到保证,达到了对终端的存储资源的充分利用。
采用此种实施方式时,由于在初始化目标应用的多级缓存系统时,可以基于终端的性能配置参数,决定初始化多个缓存组件的数量,如此,初始化的多个缓存组件可以与终端的操作系统版本和内存、外存的性能配置相适配,这意味着不同操作系统版本的终端其初始化的缓存组件的数量不同,且不同存储性能配置的终端,其初始化的缓存组件的数量也可以不同,因此,可以做到缓存组件的数量相对于不同类型的终端可伸缩,相对于不同安装时间下的终端也可以不同,从而提高多级缓存系统与终端之间的适应性。
又由于,除与云存储介质对应的缓存组件(云缓存组件)外的其余缓存组件,对应着终端的本地存储介质,当基于终端的性能配置参数进行缓存组件的初始化时,不同终端上的多级缓存系统所利用的本地存储介质可以是不同的。如在满足目标条件时,利用了终端的内存和多个外存去响应目标应用,在不满足目标条件时,利用终端的多个外存去响应目标应用,这样,可以基于终端的性能配置利用合适的存储介质去充分响应目标应用,达到对终端的存储资源的充分利用和调度。
1.4,接口层的初始化。
在一种实施例中,接口层可以理解为是目标应用与多级缓存系统之间的通信桥梁,接口层用于接收目标应用发出的I/O请求和存储空间释放事件,即用于接收目标应用的读请求、写请求、数据清理请求。其中,接口层可以为文件系统模型、沙盒模型或文件接口模型。
实际中,为了使得多级缓存系统可以与终端的操作系统充分适配,以提 高多级缓存系统对不同终端的可移植性,可以依据终端的操作系统参数确定对应的接口层的类型。具体实施时,可以获取所述终端的操作系统参数,并基于所述操作系统参数,创建与目标应用对应的接口层。
本实施例中,操作系统参数用于指示终端上的操作系统的版本,其操作系统参数可以是操作系统的版本标识,如上所述,不同的操作系统为终端提供的程序运行环境具有差别,如在系统架构、硬件配置、软件分层模型、权限管理设计各不一样,因此需要实现不同的接口层;而不同的接口层对操作系统的侵入性、开发难度都有差别。因此,为了使得多级缓存系统可以通过匹配的接口层,达到支持目标应用在操作系统提供的运行环境中稳定运行的目的,可以为不同操作系统的终端初始化匹配的接口层。
其中,在操作系统参数指示操作系统为PlayStation、Nintendo Switch等对应的主机操作系统以及IOS系统的情况下,其初始化的接口层可以为文件接口模型;在操作系统参数指示操作系统为Windows、Linux、Android、MacOSX系统的情况下,其初始化的接口层可以为文件系统模型;在操作系统参数指示操作系统为Xbox主机操作系统的情况下,其初始化的接口层可以为沙盒模型或文件接口模型。
具体地,参照图2a和图2b所示,图2a示出了接口层为文件系统模型的软硬件环境图,图2b示出了接口层为沙盒模型/文件接口模型时的软硬件环境图。
如图2a所示,文件系统模型,又称File System Model,是基于内核文件系统接管,对操作系统具有非劫持、不存在强制修改内存内容的操作,不会导致稳定性问题,具有对应用程序非侵入性、稳定性高、无代码学习调整成本的优势。文件系统模型的另一个优势是可以接管内存映射文件的读写请求;在操作系统的相关设计中,文件系统模型是内核态实现的组件,可以接管应用程序文件读写以及File Mapping I/O(由MMU—内存管理器发起)的请求,而沙盒模型以及文件接口模型都是在应用层实现的组件,所以只能接管应用程序文件读写的请求;因此,文件系统模型在应用程序文件IO请求的处理方面是适应性最好的方案。
如图2b所示,沙盒模型,又称Sandbox Model,是基于File Hooking Layer实现文件访问接口劫持的机制,该机制在应用程序进程初始化时,在内存中扫描相关文件访问接口,然后修改文件访问接口的二进制入口代码,重定向并改造原功能;无需工程师关注应用程序依赖的文件数据访问库以及相关接口,便可达到接管文件读写请求的目标,具有代码学习成本和调整成本低的优势。
其中,文件接口模型由应用程序核心组件(eg.3D图形引擎,文件压缩/解压库,视频编解码库,多种格式的资源解析库等)链接并调用;虽有一定的代码学习,调整成本,但这种方式系统可移植性最好。
其中,如图1所示,在接口层与原生接口转换组件之间建立有数据通路,通过该数据通路,原生接口转换组件可以接收接口层所重定向的数据处理请求,而该数据处理请求是运行于操作系统中的目标应用发送给接口层的,其中,原生接口转换组件用于将各种不同的文件I/O接口规范转换成统一的接口规范对接到文件块管理器。
其中,原生接口转换组件与文件块管理器之间也建立有数据通路,通过该数据通路,文件块管理器可以接收由原生接口转换组件所转换后的数据处理请求。由此,通过接口层、原生接口转换组件和文件块管理器,以及相互之间的数据通路,建立起了多级缓存系统与目标应用之间的通信架构,从而成功实现了多级缓存系统支持并响应目标应用。
1.5,与云存储介质对应的缓存组件的初始化。
如图1所示,在云存储介质与对应的第四缓存组件之间配置有多个接口,该多个接口可以具有各自的响应优先级,不同的接口其响应速度也可以是不一样的,且不同的接口可以获取相应服务器上的原始分片文件中的数据。通过多个接口的设置,可以提高终端成功从云存储介质中下载目标应用的数据的概率,从而保证目标应用的稳定运行。
具体实施时,可以创建对应的缓存组件与云存储介质之间的多种接口;多种接口按照响应优先级从高到低包括:内容分发网络CDN接口、点对点传输P2P接口和源站接口。这样,在从云存储介质中读取数据时,可以按照 多种接口的响应优先级从高到低的顺序,依次通过多种接口从云存储介质中获取对应的数据。需要说明的是,响应优先级越高的接口对应的数据获取速度越快。
本实施例中,云存储介质可以包括多个数据源(例如服务器),多个数据源包括CDN(Content Delivery Network,内容分发网络)数据源和P2P数据源。其中,CDN接口对应该CDN数据源,P2P接口对应该P2P数据源;源站接口对应存储所述目标应用的数据块的初始站点上的存储介质。
其中,CDN的基本原理是在各个地区广泛部署多个缓存服务器,将这些缓存服务器分布到用户访问数据相对集中的地区或网络区域中,在用户访问网站时,利用全局负载技术将用户的访问请求指向距离最近的工作正常的缓存服务器上,由该缓存服务器直接响应用户请求。相应地,CDN接口可以由缓存栈管理器加载,通过xxx_ITF_uuid向缓存栈管理器注册自己的接口表。
其中,P2P数据源是基于BitTorrent或者MagNet通信协议实现的P2P传输组件,可以节省CDN数据源的下载流量。当应用程序的下载用户量到达千万、亿级规模时,可以为企业用户(应用商店服务提供商)节省大量的流量成本,提高企业用户的粘性。P2P接口由缓存栈管理器加载并调用其初始化接口(ITF_Initialize),具体过程是:初始化内部数据结构,通过xxx_ITF_uuid向缓存栈管理器注册自己的接口表。
其中,在按照多种接口的响应优先级从高到低的顺序,依次通过多种接口从云存储介质中获取数据时,由于CDN接口的响应优先级高于P2P接口,P2P接口的响应优先级高于源站接口;因此,可以先通过CDN接口从CDN数据源的原始分片文件中获取数据,即从距离最近的缓存服务器上获取原始分片文件中的数据,若成功获取到,则直接返回给第四缓存组件;若未成功获取,则对应未成功获取的数据,封装数据获取请求,并通过P2P接口从P2P数据源的原始分片文件中获取请求对应的数据,若成功获取,则返回给第四缓存组件;若仍未成功获取,则对应未成功获取的数据,又封装一个数据获取请求,之后通过源站接口从源站(初始存放原始分片文件的服务器) 的原始分片文件中获取剩余的数据,若成功获取到,则将剩余数据返回给第四缓存组件;若未成功获取到剩余数据,第四缓存组件可以返回读取数据失败的信息,由目标应用重新发起读请求。
另外,为了节省流量成本,可以将P2P接口的响应优先级调整到高于CDN接口的响应优先级,由此,根据响应优先级处理目标应用读请求的流程会调整为:先尝试从P2P数据源的原始分片文件中获取数据,再从CDN数据源的原始分片文件中获取数据,最后从源站数据源的原始分片文件中获取数据;虽然所述响应优先级的调整会导致第四缓存组件处理读请求的速度有所降低,但是通过优先尝试从P2P数据源中获取数据的方式会节省大量流量成本。
采用此种实施方式时,由于可以通过不同接口从多种数据源中获取数据,可以最大限度地容错(网络异常),提高终端成功从云存储介质中下载目标应用所需的数据的概率,从而提高了对目标应用的I/O响应的稳定性。
1.6,目标应用和多级缓存系统的监控维护。
本实施例中,可以响应于缓存栈管理器对多级缓存系统的初始化完成的事件,运行目标应用;并对目标应用的进程和缓存栈管理器进行监控;在目标应用的进程出现异常,或缓存栈管理器出现异常时,结束目标应用的进程和缓存栈管理器的进程。
具体实施时,应用程序管理器可以对目标应用的进程和缓存栈管理器进行监控,具体而言,应用程序管理器可以基于目标应用的PID信息(Process Identifier,进程识别符)建立与目标应用的监听通道,以及,基于缓存栈管理器的PID信息建立与缓存栈管理器的监听通道,以监听缓存栈管理器和目标应用的状态。
如果目标应用和缓存栈管理器中的任一者出现异常或崩溃,则将二者全部结束,在结束目标应用和缓存栈管理器时,可以恢复目标应用的配置和与本地存储介质对应的缓存组件所管理的数据的状态,从而保证目标应用的配置以及与本地存储介质对应的缓存组件所管理的数据的状态的整体一致性。
实际中,当用户正常退出目标应用时,应用程序管理器可以通知缓存栈 管理器正常退出,等待一段时间后(循环检查30s),如果缓存栈管理器依旧未退出,可以通过操作系统API(Application Programming Interface,应用程序接口)强制终止缓存栈管理器。
2.1,目标应用的缓存可伸缩处理方法的详细说明
参照图3所示,示出了本申请的目标应用的缓存可伸缩处理方法的步骤流程图,如图3所示,具体可以包括以下步骤:
步骤S301:基于目标应用的启动运行包启动目标应用,并初始化与目标应用对应的多个缓存组件。
其中,多个缓存组件分别对应各自的存储介质,存储介质中存储有支持目标应用运行的数据。具体而言,存储介质至少包括云存储介质和终端的本地存储介质,在云存储介质中包括支持目标应用运行的原始数据,即包括目标应用的全部的原始数据,在本地存储介质中包括目标应用的部分或全部数据,一般而言,是包括从云存储介质中下载的数据,而下载的数据一般是部分的数据。
本实施例中,在未安装目标应用时,可以从服务器中下载目标应用的启动运行包,具体地,当用户需要在终端上安装目标应用时,可以通过应用程序管理器从相应服务器中下载启动运行包。其中,启动运行包所含的数据量极少,其包含启动目标应用的最基本的文件,在终端利用启动运行包运行目标应用时,启动运行包检测目标应用是否已经在当前系统中注册配置安装完成,如果还未注册配置安装,则完成目标应用在安装过程中,基本的针对目标应用的应用程序注册、安装、配置以及目标应用与终端的操作系统交互动作,然后启动目标应用,并初始化与目标应用对应的多个缓存组件;否则,直接启动目标应用,并初始化与目标应用对应的多个缓存组件。
因此,当启动运行包下载完成时,便可以通过启动运行包启动目标应用,当目标应用启动时,便可以初始化目标应用的多个缓存组件,其初始化的过程可以参照上述1.3节所述,具体地,可以获取目标应用的缓存栈描述文件,在一种实施例中,缓存栈描述文件可以包括多个,不同的缓存栈描述文件针对不同性能配置的终端,由此,在下载目标应用的启动运行包时,便可以将 终端的性能配置参数发送给服务器,从而获取适配终端自身的缓存栈描述文件,进而依据该缓存栈描述文件初始化多个缓存组件。
可以理解的是,在初始化多个缓存组件的过程中,可以建立每个缓存组件与对应的存储介质之间的数据通路,以建立起缓存组件与存储介质之间的通信连接。
其中,缓存栈描述文件用于指示需要初始化多级缓存系统中哪些组件,比如,缓存栈描述文件中的“name”字段表示当前组件的命名,“type”字段表示当前组件的类型,缓存栈管理器需要合法性检查:其value可以是“I/O_filter”或“by-path_filter”或“cluster_I/O_filter”,分别表示“I/O过滤器”、“旁路过滤器”和“聚合I/O过滤器”。
其中,“I/O过滤器”表示此组件是数据I/O过程中必须的;“旁路过滤器”表示此组件是数据I/O过程中非必要的。“id”字段表示当前组件的uuid,缓存栈管理器需要合法性检查:顶级、次级过滤器组件的uuid必须全局唯一。“path”字段表示当前组件的相对路径;“components”字段只有“聚合I/O过滤器”的组件存在该字段,表示当前组件的依赖(次级)组件描述,其结构为一个复合数组,包括该聚合I/O过滤器包含的依赖I/O组件;其中,同级别的I/O过滤器:构建时自下而上,销毁时自上而下;不同级别的I/O过滤器:构建时自内而外,销毁时自外而内。
步骤S302:响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于终端的本地存储介质中的数据进行清除。
其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动。具体而言,清除包括按比例清除以及极限清除,在极限清除的情况下经清除后所述本地存储介质中留存的全部数据为启动运行包中的数据,以至少保证目标应用的启动。
本实施例中,为了避免目标应用占用终端上的本地存储介质太多的存储空间,以使终端可以安装更多的应用程序和提供更快的响应速度,本申请通过定期清除本地存储介质中的数据,以为终端腾出更多的存储空间用于存储其他应用程序的数据和/或存储其他的多媒体数据。
其中,存储空间释放事件可以是针对终端触发的,一种示例中,在检测到某一本地存储介质的剩余存储容量低于该本地存储介质的目标容量时,便可以触发针对该本地存储介质的存储空间释放事件;在另一种示例中,存储空间释放事件也可以是基于用户的数据清理操作所触发的,例如,用户进入应用程序管理器,在应用程序管理器提供的界面上,触发对目标应用的数据清理,如此,存储空间释放事件被触发。其中,用户可以指定待清理的本地存储介质,也可以指定数据清理的程度。进而,与待清理的本地存储介质对应的缓存组件可以将本地存储介质中的数据进行清除。
具体实施时,可以对部分或全部的本地存储介质中的数据进行清除,例如,如图1所述,本地存储介质有三个,对应第一缓存组件至第三缓存组件,当需要进行数据清除时,可以对三个缓存组件中的数据进行清除,也可以仅对三个缓存组件中的一个或两个缓存组件的数据进行清除。
其中,在清除本地存储介质中存储的数据时,对一个本地存储介质而言,可以清除掉该本地存储介质中的全部数据,也可以清除掉该本地存储介质中的部分数据,总体而言,清理的极限可以是所有本地存储介质中所留下的数据为启动运行包中的数据。也就是说,本申请的数据清除包括按照比例清除数据以及极限清除,在按照比例清除中,比例可以由用户指定,而极限清除是所有本地存储介质中留存的数据最少,该最少的数据即为启动运行包中的数据。
其中,启动运行包仅包括应用程序向操作系统注册、配置信息的组件、启动程序组件、以及多级缓存系统相关组件,并不包括应用程序本身的可执行组件的数据以及资源包的数据,因此,占用的本地存储介质的空间很小。
例如,如图1所示,在该极限清理下,第一缓存组件至第三缓存组件对应的本地存储介质中的所有剩余数据仅为启动运行包中的数据,此种情况下,第一缓存组件和第二缓存组件对应的本地存储介质中可以没有目标应用的数据,而在第三缓存组件对应的第二外存中仅含启动运行包。当然,也可以是第二外存中不含启动运行包,而在第一外存中含启动运行包。
由于启动运行包的数据占据很小的存储空间,因此,可以实现在终端上 对目标应用的数据的最大限度清理,又由于启动运行包用于启动目标应用,有启动运行包的存在,便不会影响目标应用的启动和使用。
步骤S303:响应于目标应用的读请求,通过对应的缓存组件,从云存储介质,和/或本地存储介质的留存数据中获取读请求对应的数据,以支持目标应用的运行。
其中,云储存介质中存储有支持目标应用运行的全部原始数据。
本实施例中,在依据存储空间释放事件,对本地存储介质中的数据进行清理后,若接收到目标应用的读请求,则可以从本地存储介质和/或云存储介质中获取读请求对应的数据,以支持目标应用的正常运行。
其中,进行数据清理后,在本地存储介质所留存的全部数据不仅包括启动运行包,也包括目标应用所需的其他数据的情况下,若本地存储介质中存在读请求对应的数据,则可以从本地存储介质中读取所需的数据返回给目标应用即可;若本地存储介质中不存在读请求对应的数据,则可以从云存储介质中读取所需的数据返回给目标应用即可;若本地存储介质中存在部分读请求对应的数据,则可以先从本地存储介质中读取已存在的数据,再将剩余不存在的数据,构造新的读请求,发送给云存储介质对应的缓存组件,获取剩余的读请求对应的数据,最后将从本地存储介质中获取的数据与从云存储介质中获取的数据拼接成读请求对应的完整数据响应,返回给目标应用。
其中,进行数据清理后,在本地存储介质所留存的全部数据仅包含启动运行包的情况下,则在接收到目标应用的读请求时,可以直接从云存储介质中读取所需的数据返回给目标应用。
无论哪一种情况,云存储介质中始终存储有目标应用所需的全部的原始数据,只要在终端侧能保证通过启动运行包启动目标应用,通过多个缓存组件便能保证目标应用的读请求被成功执行,以支持目标应用的运行。
需要说明的是,以上的数据清理,可以是指对数据进行删除。
采用本申请实施例的技术方案,一方面,在清除本地存储介质中的数据时,可以清除到终端本地仅剩启动运行包中的数据,由于启动运行包的数据量很小,因此占用的本地存储介质的空间很小,例如,有些目标应用的启动 运行包仅几十kb,从而可以释放出更多的存储空间,这样终端便可以安装更多的应用存储更多的数据,如多媒体数据。另一方面,启动运行包是用于启动目标应用的,如此,可以保证目标应用在终端上的正常启动,且在后续响应目标应用的读请求时,可以从云存储介质和/或本地存储介质中读取所需的数据,因此,对数据的清理又不影响目标应用的正常使用。
综上,采用本申请的应用的缓存可伸缩处理方法,可以在保留众多应用、且不影响用户使用的情况下,为终端腾出更多的空间以用于安装更多的应用和存储较多的多媒体数据,从而解决了终端技术面临的痛点。
下面,对本申请如何进行数据清理进行详细阐述
3.1,数据清理的过程。
本实施例中,为了避免目标应用占用终端中存储介质太多的存储空间,以使终端可以安装更多的应用程序和提供更快的响应速度,本申请通过位于终端的多个缓存组件定期清除本地存储介质中的数据,以为终端腾出更多的存储空间可以用于存储其他应用程序的数据。
其中,数据清理涉及到部分清除和彻底清除两种情况,其中,按部分清除的情况下,会清除掉本地存储介质中不常读取的数据,而彻底清除的情况下,会清除掉本地存储介质中除启动运行包外的全部数据,对两种清理情况分别说明如下:
3.1.1,部分清除的情况。
具体实施时,在存储空间释放事件为部分清除的事件时,清除所述本地存储介质中待清除的数据,所述待清除的数据为基于读取频次和/或最近读取时间确定的数据。
具体实施时,可以将本地存储介质中读取频次少于目标频次和/或最近读取时间早于预设读取时间的数据清除,或将读取频次少于目标频次和/或最近读取时间早于预设读取时间且符合目标比例的数据清除。
其中,目标比例可以是由用户指定的比例,反映被清除的数据量占原数据量的比例,如目标比例为40%,则表示需清除掉40%的数据。其中,用户还可以指定待清除的本地存储介质,如指定第一缓存组件对应的内存作为数 据清理的对象,则对内存按照目标比例进行数据清理。实际中,可以对全部的本地存储介质均进行清理,这样可以为每个本地存储介质指定目标比例,不同的本地存储介质可以对应不同的目标比例,也可以对应相同的目标比例,从而实现对各个本地存储介质中目标应用的数据的清理。
在一种示例中,可以不按照目标比例清除,此种情况下,可以将读取频次少于目标频次,和/或最近读取时间早于预设读取时间的数据作为待清除的数据进行清除。例如,可以将读取频次少于目标频次的数据全部清除,或者将最近读取时间早于预设读取时间的数据全部清除,或者将读取频次少于目标频次且最近读取时间早于预设读取时间的数据全部清除。
在一种示例中,也可以对每个本地存储介质中的数据按照频次和最近读取时间进行综合排序,具体地,可以为读取频次和读取时间分别设置对应的权重,之后,根据数据的读取频次和读取时间以及各自对应的权重,获取每个数据对应的排序得分,按照排序得分对各数据进行排序,排序靠前的数据可以是指用户越常读取的数据,如此,可以按照排序,从后向前清除掉目标比例的数据;这样,做到了按照读取频次、读取时间清除掉目标比例的数据。
其中,读取频次可以理解为是读取次数,以对内存中的数据进行清理为例,在确定内存中待清除的数据时,可以在内存缓存组件中维护一个双向链表,双向链表的表头存放“最近被访问过”的数据的数据标识,表尾存放“最久未被访问过”的数据的数据标识;当某个数据被读请求命中后,将对应数据的数据标识从双向链表的当前位置取出,放入链表头,这样越靠近链表头的数据标识表示该数据越近期被访问过。当需要清理内存时,可以将链表尾中的多个数据标识对应的数据确定为待清除的数据(从链表尾向链表头遍历数据块并计数,并同时与链表中所有数据块的总数进行比例的计算),且待清除的数据占链表中的全部数据的比例为目标比例,如目标比例是40%,则清除掉不常访问的40%的数据。
当然,如上所述,也可以同时记录每个数据被读取的次数和每次被读取的时间,并分别为读取次数和读取时间设置权重,如读取次数设置权重为0.8,读取时间的权重设置为0.2,如此,便是重点偏向读取次数淘汰数据。
在一种实施例中,在本地存储介质包括内存的情况下,即包括与内存对应的内存缓存组件和第一外存对应的临时缓存组件的情况下,在对数据进行清理的过程中,可以对内存和其他本地存储介质中的数据进行不同的处理,以保证目标应用的I/O响应。
具体实施时,可以将从内存中清除的数据写入到对应的响应优先级低于内存的本地存储介质中;并对除内存外的其余本地存储介质,将其余本地存储介质中清除的具有目标特征的数据写入增量数据区中。
其中,目标特征表征数据是被目标应用写入的数据,增量数据区可以位于响应优先级最低的本地存储介质中。
本实施例中,内存对应的是内存缓存组件,其响应优先级最高,内存缓存组件的下级组件是临时缓存组件,该临时缓存组件对应终端上的第一外存(响应优先级低于内存的本地存储介质),如固态硬盘,当内存中属于目标应用的数据被清理时,从内存淘汰的数据可以写入到第一外存中。此种情况下,当目标应用的读请求到来时,若读请求对应的数据存在于第一外存中,则可以从第一外存中读取出数据即可。
当然,上述情况下,第一外存可以是不被执行数据清理的本地存储介质,也可以是被执行数据清理的本地存储介质,如果是不被执行数据清理的情况下,从内存淘汰到第一外存中的数据可以不被清理,如此,保证了下一次目标应用的数据读取请求的响应速度;如果是被执行数据清理的情况下,从内存淘汰到第一外存中的具有目标特征的数据会被写入到增量数据区中,如此,保证了用户对目标应用的各种配置以及存档数据不会丢失。
其中,在对除内存外的其余本地存储介质进行数据清理时,若被清理的数据是被目标应用写入的数据,则可以将该数据写入增量数据区中,例如图1所示,增量数据区可以位于第二外存中,该增量数据区是不会被清理的数据区,也就是说,用户写入的数据不会被清除掉,可以保证用户写入的数据不因清理而丢失,例如,保证用户的图形、外设、游戏性相关配置或存档不被丢失。
采用此种实施方式时,可以针对性对一个或多个本地存储介质中属于目 标应用的数据进行清理,其中,可以按照目标比例清理数据,也可以按照读取频次和/或最近读取时间进行动态的数据清理,由此,可以实现数据清理按照用户的实际需求进行,达到动态数据清理的目的,从而为终端腾出较多的存储空间。
3.1.2,彻底清除的情况。
在所述存储空间释放事件为极限清理的事件时,清除本地存储介质中除启动运行包外的全部数据。
其中,极限清理的事件可以理解为是极限的数据清理,即清理后,全部的本地存储介质所留存的数据仅为启动运行包,此时,对于一个本地存储介质而言,其存储的目标应用的数据要么全部被清理,要么清除掉除启动运行包外的其余数据。
具体而言,由于启动运行包需要持久存储在终端本地,因此,启动运行包所在的本地存储介质一般是响应优先级较低的缓存组件对应的存储介质,由此,对响应优先级最低的本地存储介质,可以清除启动运行包外的其余数据。对其余响应优先级的本地存储介质,可以清除本地存储介质中目标应用的全部数据。示例地,如图1所示,可以清除掉内存和第一外存中目标应用的所有数据,第二外存中仅保留启动运行包,而其他数据全部被清理。
采用本实施方式时,一方面,可以定期清理本地存储介质的空间,将访问次数不高和/或访问时间较早的数据从本地存储介质中清除,以使得本地存储介质可以存放访问次数高和/或访问时间较近的数据。另一方面,由于定期清理本地存储介质中的数据,由此,可以降低对本地存储介质的占用率,当定期清理内存时,便可以降低对内存的占用,从而保证内存对其他应用程序的响应速度,从而提高终端的操作系统的稳定性。再一方面,当定期清理第一外存和第二外存时,可以在第一外存和第二外存中保留一定比例的高频使用的数据,第一外存和第二外存使用的存储量就会缩减到用户指定的比例。这样,如果用户要下载并运行一个新的应用程序,可以使腾出的这部分空间,供新的应用程序存储对应的数据,从而同时保证新的应用程序和目标应用程序的运行。
当然,新的应用程序在初始化有本申请的多级缓存系统时,也可以由用户指定对本地存储介质中属于新的应用程序的数据的清理,从而又为其他应用程序腾出存储空间,从而动态满足各个应用程序的稳定运行。
4.1,基于多级缓存系统的I/O请求响应过程(对应改进点3)。
本实施例中,多个缓存组件具有各自的响应优先级,其中,响应优先级越高的缓存组件对应响应速度越快的存储介质。其中,多个缓存组件可以按照各自的响应优先级响应目标应用的I/O请求,以依次在各自对应的存储介质中读取或写入I/O请求对应的数据。这样,缓存组件可以响应目标应用的写请求和目标应用的读请求。
4.1.1,对于写请求的响应。
可以响应于目标应用的写请求,按照多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中。
具体实施时,可以针对写请求,将写请求对应的数据逐级写入到对应的存储介质中。在一种可选示例中,可以在除响应优先级最高的缓存组件外的其余缓存组件对应的任一存储介质中,设置增量数据区,在通过响应优先级最高的缓存组件,将待写入的数据写入到响应优先级最高的缓存组件对应的存储介质后,可以通过增量数据区对应的缓存组件又读取出待写入的数据,并写入到增量数据区中。
示例地,如图1所示,增量数据区可以设置在第一外存中。响应优先级最高的是第一缓存组件,第一缓存组件可以将待写入的数据写入到自身对应的内存中,在第一外存中设置增量数据区,则第二缓存组件从内存中读取待写入的数据,然后写入到增量数据区,增量数据区可以镜像原始分片文件的目录,写入时,将该待写入的数据对应写到该待写入的数据所属的增量分片文件中,
在又一种可选示例中,可以按照响应优先级从高到低的顺序,通过响应优先级最高的缓存组件,将待写入的数据写入到响应优先级最高的缓存组件对应的存储介质;并从响应优先级最高的缓存组件对应的存储介质中读取所述待写入的数据,并通过响应优先级低的缓存组件将待写入的数据写入到对 应的存储介质中。
在将待写入的数据写入到响应优先级最高的缓存组件对应的存储介质时,该响应优先级最高的缓存组件的下一级缓存组件又从响应优先级最高的缓存组件对应的存储介质中读取该待写入的数据,并将该待写入的数据写入到自身对应的存储介质中,下一级缓存组件的再下一级缓存组件又从下一级缓存组件对应的存储介质中读取该待写入的数据,并写入到自身对应的存储介质中,以此类推,达到数据的逐级写入,这样,每个存储介质中均可以包括目标应用写请求对应的数据。
当然,在将写请求对应的数据写入到存储介质后,可以更新该数据的数据标志位,数据标志位可以包括“0”和“1”;其中,“0”表示干净;“1”表示“脏”,表征数据被写入。
此种情况下,在需要读取数据时,可以先根据要读取的数据的数据标志位,确定数据是否是写入的数据,若是,则从对应的本地存储介质中读取数据,具体而言,在待写入的数据写入到增量数据区的情况下,可以直接从增量数据区中读取数据;若否,则从本地存储介质中读取原始数据。
采用本实施方式时,由于在写入数据时,可以将数据块写入到响应优先级最高的存储介质中,之后再从响应优先级最高的存储介质中提取出待写入的数据写入到其他存储介质或增量数据区中,由于写入到响应优先级最高的存储介质的效率明显高于写入到其他存储介质的效率,因此,可以使得用户的写请求被快速响应,从而优化用户体验。
4.1.2,对于读请求的响应。
具体而言,在多个缓存组件具有各自的响应优先级的情况下,可以响应所述目标应用的读请求,按照多个缓存组件的响应优先级从高到低的顺序,依次通过缓存组件从对应的存储介质中获取读请求对应的数据。
本实施例中,可以按照响应优先级从高到低的顺序,依次尝试通过每个缓存组件从相应存储介质中获取读请求对应的数据,具体实施时,可以按照响应优先级由高到低的顺序,从多个存储介质中依次尝试读取所需的数据。
其中,在一个或多个存储介质中读取到所需的全部数据时,可以向目标 应用返回数据;在从一个或多个存储介质中未读取到所需的全部数据时,向目标应用返回数据读取失败的信息。
相应地,在按照响应优先级由高到低的顺序,从多个存储介质中依次尝试读取所需的数据时,以图1所示的软硬件环境为例进行介绍,其中,第一缓存组件对应的是终端的内存,第二缓存组件对应终端的第一外存,第三缓存组件对应终端的第二外存,第四缓存组件对应云存储介质,具体可以按照以下过程进行:
首先,从内存中获取数据;
若未从内存中成功获取到全部的数据,则从所述第一外存中获取从内存中未获取到的数据;
若从第一外存中未成功获取到所需的数据,则从所述第二外存中获取从第一外存中未成功获取的数据;
若从第二外存中未成功获取到所需的数据,则从云存储介质中获取从第二外存中未成功获取的数据。
由此,可以看出,本申请采取多级缓存组件的架构,在读取数据时,可以减少数据访问的流程,从而提高目标应用的I/O响应速度。
在一种示例中,还可以将从响应优先级低的缓存组件对应的存储介质中读取到的数据,写入到响应优先级高的缓存组件对应的存储介质中。
在采用上述的按照响应优先级进行数据读取的实施方式时,响应优先级低的缓存组件对应的存储介质中读取到的数据,必然不存在于响应优先级高的缓存组件对应的存储介质中,如从第二外存中读取的数据不存在于第一外存和内存中。
因此,可以将响应优先级低的存储介质中读取到的数据,写入到响应优先级高的缓存组件对应的存储介质中。其中,可以写入到响应优先级高的所有缓存组件对应的存储介质中,也可以写入到响应优先级高的任一缓存组件对应的存储介质中。例如,可以将第二外存中读取的数据写入到第一外存和内存中,也可以写入到第一外存或内存中。
在一种实施例中,如上述3.1.1节所述,考虑到本申请的临时缓存组件 (与第一外存对应的缓存组件)所对应的第一外存中的数据是内存中淘汰的数据,因此,本申请可以在从第二外存或所述云存储介质中获取到数据时,将从第二外存或云存储介质中获取的数据写入到内存中;在从云存储介质中获取到数据时,将从云存储介质中获取的数据写入到第二外存中。
本申请实施例中,可以将从第二外存或云存储介质中获取到的数据写入到内存中;或者,在仅从云存储介质中获取到数据时,将从云存储介质中获取到的数据写入到内存和第二外存中。
采用本实施方式时,可以将从响应优先级低的存储介质中获取的数据移动到响应优先级高的存储介质中,使得数据可以逐级移动至响应速度快的存储介质中,从而随着数据访问次数的增多,数据访问流程被缩短的概率会提高,由此提高了目标应用运行期间的I/O响应速度。并且,一方面,可以保证第一外存只保留内存淘汰的数据,随着目标应用运行时间变长,从内存淘汰的数据越来越多,由此极大提高了从第一外存和内存中便可以成功读取到数据的概率。另一方面,由于可以将从云存储介质中获取到的数据写入到第二外存中,由此可以保证下一次读取时,便可以从第二外存中直接读取,减少了下一次读取数据的访问流程,提高I/O响应速度。
5.1,以数据块粒度存储目标应用的原始数据(对应改进点2)
5.1.1,原始分片文件的制作。
如上述改进点2所述,在提高目标应用的I/O响应速度的同时,为了能提高目标应用的I/O响应的稳定性,对原始分片文件的制作过程也进行了改进。主要体现在:每个存储介质中以数据块粒度存储支持目标应用运行的数据,数据块是对所述目标应用的全部原始数据进行分块后得到的。
具体实施时,可以获取目标应用的原始数据被分块后得到的全部数据块,将全部数据块进行划分,得到多个原始分片文件;并将多个原始分片文件和启动运行包上传至所述云存储介质,以供目标应用下载使用。
其中,每个原始分片文件中包括目标应用的原始数据中的部分数据块。如此,目标应用的多个逻辑文件中的原始数据便被重新分配到原始分片文件中,这样,在读取和写入数据时,便可以到对应的原始分片文件中读取相应 的数据块和写入相应的数据块,从而提高I/O响应的稳定性。相应地,在此种情况下,若响应优先级最高的存储介质是内存,则在内存中分散存储着下载下来的各个数据块,而在终端的第一外存和第二外存中是以原始分片文件目录结构作为基础,存储下载下来的数据块。其中,下载下来的数据块按照相应目录结构存储到本地存储介质中后,所形成的文件称为缓存分片文件,即下载的数据块对应存储到缓存分片文件中,其中,第一外存和第二外存中的缓存分片文件的目录结构,与云存储介质中存储的原始分片文件的目录结构保持一致。
其中,制作原始分片文件的终端可以是其他终端,如目标应用的出品方的终端,在制作原始分片文件时,可以基于目标应用的逻辑文件获取每个逻辑文件中的数据内容,进而根据每个逻辑文件的数据内容,确定有多少数据量,根据数据量确定需要划分为多少数据块;之后,根据确定的数据块数量,对每个逻辑文件的数据内容进行分块,得到多个数据块,之后,对多个数据块进行分片划分,具体划分策略可以由制作者指定,从而得到多个原始分片文件,进而将启动运行包和多个原始分片文件一起打包上传到云存储介质中进行存储。如此,云存储介质中保留目标应用的全部原始数据。
本实施例中,本地存储介质中存储的目标应用的数据最初是从云存储介质中下载得到的,需要说明的是,读请求一般针对多个数据块进行,而本地存储介质中存储的是目标应用的部分数据块。由此,在需要从一个或多个存储介质中读取全部的数据块时,便是需要以数据块粒度进行读取,然后将读取到的数据块封装后再返还给目标应用。
具体来说,对原始分片文件的制作的详细过程可以参见后续5.1.5所描述的内容。
5.1.2,基于原始分片文件的数据I/O响应和数据清理
5.1.2.1,基于原始分片文件的数据写入。
在上述4.1.1中对于写请求的响应过程中,可以按照响应优先级从高到低的顺序,在多个存储介质中依次写入待写入的数据所对应的至少一个第二数据块。
当写请求来临时,一般是需要对原始数据进行更新,即将原始数据重写,如此,可以按照响应优先级从高到低的顺序,在多个存储介质中依次写入至少一个数据块。
具体地,可以确定待写入的数据所对应的逻辑文件和写入位置,根据待写入的数据对应的逻辑文件和写入位置,确定该待写入的数据被划分的至少一个数据块,在各个存储介质中,将数据块写入。
其中一种示例中,可以将写入后的数据块的数据标志位更新为“1”,“1”表示“脏”;这样,各个存储介质中所存储的数据块的数据标志位均为“1”,后续在进行数据清理时,可以将数据标志位为“1”的数据块移动到增量数据区中。
在另一种示例中,由于在写入数据时,也可以将数据先写入到响应优先级最高的存储介质中,再写入到增量数据区中,这样,在写入数据块时,也可以仅在响应优先级最高的存储介质中和增量数据区中写入第二数据块,并同步更新数据块的数据标志位,如此,在读取数据块时,若内存的数据块被清理,则可以直接从增量数据区中读取数据块,而不再从其他存储介质中读取数据块。这样,可以提高对脏数据块的读取效率。
5.1.2.2,基于原始分片文件的数据读取。
在上述4.1.2中对于读请求的响应过程中,可以按照多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取读请求所需的数据块,将读取出的全部数据块封装后返回给所述目标应用。
由于将目标应用的原始数据进行分块后存储到原始分片文件中,如此,对于一个读请求而言,所请求的数据一般包括多个数据块,由此,需要从多个存储介质中读取出所需的全部数据块。相应地,可以按照响应优先级由高到低的顺序,从多个存储介质中依次尝试读取全部数据块,这样,对一个存储介质而言,响应于读请求,可能从该存储介质中读取出了读请求所需的全部数据块,或者读取出了所需的全部数据块中的部分数据块。
具体过程如下:
首先,通过响应优先级最高的缓存组件,从对应的存储介质中获取所需 数据块;如,通过内存缓存组件从内存中读取出数据块;
若未成功获取到全部的数据块,则通过下一级缓存组件,从对应的存储介质中获取未获取到的剩余数据块;如,通过临时缓存组件从第一外存中读取出剩余的数据块;
若未成功获取到全部的剩余数据块,即仍有部分数据块未获取到,则通过再下一级缓存组件,从对应的存储介质中获取这部分数据块,如,通过第三缓存组件从第二外存中读取这部分数据块;
若在获取这部分数据块的过程中,仍然存在未读到的数据块,则针对这部分未读到的数据块,通过再下一级的缓存组件,从相应存储介质中获取,如,通过第四缓存组件从云存储介质中读取这部分数据块,直到读取出全部数据块结束读取,或者遍历完全部的存储介质结束读取。
需要说明的是,若读取到全部的数据块,则可以通过响应优先级最高的缓存组件将这些数据块封装后返回给目标应用。如图1所示,在包括四个缓存组件的情况下,通过第三缓存组件和第四缓存组件读取到的数据块可以由分片文件I/O分流器打包后上传给临时缓存组件,临时缓存组件又将打包的数据和自身获取到的数据块上传给内存缓存组件,之后,由内存缓存组件将打包的数据、临时缓存组件上传的数据块和自身获取的数据块一起封装后返回给目标应用。
经过以上过程,获取了读请求对应的数据块,由此,可以看出,本申请采取多级缓存组件的架构,在读取数据时,由于是优先从响应速度快的存储介质中读取数据块,由此可以实现尽可能地从响应速度快的存储介质中读取到数据,从而可以减少数据访问的流程,从而提高目标应用的I/O响应速度。
在一种具体实施例中,由于原始分片文件中存储的是数据块,而数据块是目标应用的原始数据被分块后得到的,实际中,目标应用一般是通过目标应用的逻辑文件标识、数据位置和数据长度来指示需要读取的数据;这样,目标应用发出的读请求中,携带的是目标应用的逻辑文件标识和待读的数据范围,需要将读请求进行重定向,以将读请求转换为可以在存储介质的原始/缓存分片文件中(原始分片文件存在于云存储介质,本地存储介质中存储的 是缓存分片文件)读取数据块的请求,以使转换后的读请求可以被缓存组件所识别,以明确需要读取哪一原始分片文件或缓存分片文件中的哪一数据块,从而成功从存储介质中读取存储的数据块。
具体而言,可以建立目标应用的原始数据与存储介质中的数据块之间的对应关系,该对应关系可以理解为是数据对应关系,之后,基于这一数据对应关系,确定读请求所对应的数据块。
具体实施时,在依次从对应存储介质中读取读请求所需的数据块时,可以响应于目标应用的读请求,基于数据对应关系,确定读请求对应的待读数据被划分后的每个数据块的块标识;并按照多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取具有块标识的数据块。
具体地,可以为所有原始分片文件中的每个数据块赋予全局唯一标识,例如块标识,用于唯一标识一个数据块。这样,转换后的读请求中可以携带块标识以明确指示出需要读取哪一原始分片文件中的哪一数据块。
其中,数据对应关系可以在下载启动运行包时一并下载,在数据对应关系中记录有目标应用的逻辑文件中的原始数据与原始分片文件中的数据块之间的一一映射关系;其中,逻辑文件中的原始数据按照数据块数量,可以为每个划分出的数据块确定一个在逻辑文件中的标识,例如,逻辑文件中的原始数据需要被划分为10个数据块,则会为10个数据块设置其在逻辑文件中的标识,如1、2、3。而在原始分片文件中的数据块是具有全局唯一的块标识,也就是不同原始分片文件中的数据块的块标识各不相同。
示例地,目标应用共有10个逻辑文件,按照10个逻辑文件的数据内容,确定需要划分为1000个数据块,则会为1000个数据块设置各自唯一的块标识。例如,其中一个数据块的块标识为“55”,简称数据块55,而该数据块55对应逻辑文件4中的一个标识为3的数据块,简称数据块f4b3(file_4/block_3);则数据块55与逻辑文件4中的数据块f4b3形成映射关系,该映射关系即为数据对应关系。
在确定出要读的数据在原始分片文件中的块标识后,便可以将读请求转换为包含块标识的读请求,然后将该读请求依次发送给多个缓存组件,则按 照多个缓存组件各自的响应优先级从高到低的顺序,基于该读请求,依次从对应存储介质中读取出数据块。
5.1.3,基于原始分片文件的数据预读(对应改进点4)。
由于将目标应用的原始数据分块后,存储到原始分片文件中,这样,在本地存储介质中是以数据块为粒度存储目标应用的数据。在一种实施例中,为了提高对目标应用的读请求的响应速度,可以预测目标应用下一次要读取的数据,并提前将要读取的数据存放到响应优先级最高的缓存组件对应的存储介质中,当下一次读请求命中预读的数据时,从响应优先级最高的缓存组件对应的存储介质中读取数据即可,从而提高了响应速度。
参照图4所示,示出了本申请实施例的数据预读步骤流程图,如图4所示,包括以下步骤:
步骤S401:基于所述目标应用的多个历史读请求所读取到的数据,确定下一次所要读取的多个预读数据块。
本实施例中,可以对目标应用的每个I/O线程所读取的数据进行监控并记录,从而形成每个I/O线程的数据读取轨迹,该读取轨迹可以反映每个I/O线程进行数据读取的规律,例如,是向前读取数据还是前后摆动读取数据,由此,可以确定数据读取的规律。由此,可以基于每个I/O线程的读取轨迹,确定该I/O线程下一次要读取的多个预读数据块。
具体而言,可以记录每个I/O线程j每次所读取的数据,其中,每次所读取的数据是由多个数据块构成的,由此,可以确定每个I/O线程每次所读取数据块的块标识和读取的数据块的数量,由此,可以形成I/O线程j的数据块读取轨迹。
其中,通过数据块读取轨迹可以获知每个I/O线程进行数据读取的规律,例如,若数据块读取轨迹反映I/O线程总是在小范围的数据块区域中来回摆动,例如第一次读取时,是读取数据块3至数据块5,第二次读取时,是读取数据块4至数据块6,第三次读取时,是读取数据块5至数据块7,则表征数据读取是来回摆动的。由此,可以预测下一次读取三个数据块,三个数据块是数据块6至数据块8。
又例如,第一次读取时,是读取数据块3至数据块5,第二次读取时,是读取数据块6至数据块8,第三次读取时,是读取数据块9至数据块12,则表征数据读取是始终向前读取的。由此,根据预测读取历史轨迹中最大数据范围的原则,可以预测下一次读取四个数据块,四个数据块是数据块13至数据块16。
当然,以上仅是示例性说明,实际情况中,不同I/O线程读取数据的轨迹是不同的,情况也是复杂的,但是用户的操作具有一定的规律性,也就是说,虽然不同I/O线程读取数据的轨迹是不同的,但是每个I/O线程读取数据还是具有一定的规律性,依靠这一规律性,便可以预测每个I/O线程下一次所要读取的数据块数量和对应的块标识,由此可以确定出下一次要读取的多个预读数据块。
步骤S402:对多个预读数据块中未存在于响应优先级最高的缓存组件对应的存储介质中的目标数据块,按照响应优先级从高到低的顺序,依次通过其余的缓存组件从相应的存储介质中读取所述目标数据块。
步骤S403:将读取到的目标数据块写入响应优先级最高的缓存组件对应的存储介质,以在下一次读请求命中多个预读数据块时,从所述响应优先级最高的缓存组件对应的存储介质中读取出多个预读数据块。
本实施例中,在确定出要预读的多个预读数据块后,可以确定在响应优先级最高的缓存组件对应的存储介质中是否存在多个预读数据块,若确定多个预读数据块全部存在于该存储介质中,则可以不进行操作,等待下一次读请求到来,若命中多个预读数据块,从该存储介质中读取出多个预读数据块即可。
若多个预读数据块中未全部存在于该存储介质中,则对于未存在于该存储介质中的目标数据块,按照响应优先级从高到低的顺序,依次通过其余的缓存组件从相应的存储介质中读取目标数据块,之后,将读取到的目标数据块存储到响应优先级最高的缓存组件对应的存储介质中,从而下一次读请求到来时,若命中多个预读数据块,从该存储介质中读取出多个预读数据块即可。
在一种实施例中,如图1所示,包括四个缓存组件,其中,第一缓存组件为内存缓存组件,其对应的存储介质为终端的内存,第二缓存组件为临时缓存组件,其对应的存储介质为终端的第一外存。则以该示例为例,对如何预读进行说明:
其中,内存缓存组件可以针对I/O线程j(j为大于或等于1的整数)下一次所要读取的数据块数量和对应的数据块标识,确定这些要读的数据块是否都在内存中,若不存在,则确定多个预读数据块中未存在于内存的目标数据块,并针对这些未存在于内存的目标数据块,封装预读请求,将预读请求发送给临时缓存组件。
然后,临时缓存组件先指示通过分片文件I/O分流器,通过第三缓存组件从第二外存中读取出目标数据块,若第二外存中不存在目标数据块,则再指示分片文件I/O分流器通过第四缓存组件从云存储介质的原始分片文件中读取出目标数据块。
在读取出目标数据块后,便可以由临时缓存组件反馈给内存缓存组件,之后,内存缓存组件将读取出的目标数据块写入到内存中。其中,在内存中的数据块是离散存放的。
这样,当I/O线程j发出下一次的读请求时,若命中了预读数据块,则可以直接从内存中读取出预读数据块即可,由此,可以缩短数据访问流程,提高I/O响应速度,若未命中预读数据块,则可以按照多个缓存组件的响应优先级顺序进行读取即可。
采用本实施方式时,一方面,由于预先预测了目标应用下一次要读取的数据,并提前将这些数据放入到响应速度最快的存储介质中,从而下一次读取时,可以直接从响应速度最快的存储介质中读取数据,提高了对目标应用的响应速度。另一方面,由于可以同时对多个I/O线程的数据读取轨迹进行监控,并同时为多个I/O线程预读出相应数据块放置到内存中,从而提高了多I/O线程运行时数据访问的响应速度。
5.1.4,基于原始分片文件的数据清理。
由于每个存储介质中以数据块粒度存储支持目标应用运行的数据,数据 块是对目标应用的全部原始数据进行分块后得到的,因此,可以在对本地存储介质中的数据进行清除时,也可以按照数据块的粒度进行清除。
具体而言,在存储空间释放事件为部分清除的事件时,清除本地存储介质中待清除的数据块,待清除的数据块为基于读取频次和/或最近读取时间确定的数据块。
在存储空间释放事件为极限清理的事件时,清除本地存储介质中除启动运行包外的全部数据块。
具体实施时,可以将本地存储介质中读取频次少于目标频次和/或最近读取时间早于预设读取时间的数据块清除,或将读取频次少于目标频次和/或最近读取时间早于预设读取时间且符合目标比例的数据块清除。其中,对本地存储介质中的数据块进行清除的过程可以参照上述3.1.1节和3.1.2节的内容所述。
其中,在按目标比例清除的情况下,以对内存中的数据块进行清除为例,在确定内存中待清除的数据块时,可以在内存缓存组件中维护一个双向链表,双向链表的表头存放“最近被访问过”的数据块的块标识,表尾存放“最久未被访问过”的数据块的块标识;当某个数据块被读请求命中后,将对应数据块的块标识从双向链表的当前位置取出,放入链表头,这样越靠近链表头的块标识表示该数据块越近期被访问过。当需要清理内存时,可以将链表尾中的多个块标识对应的数据块确定为待清除的数据块,且待清除的数据块占链表中的全部数据的比例为目标比例,如目标比例是40%,则清除掉不常访问的40%的数据。
采用此种实施方式时,可以从更细致的角度进行数据清除,从而使得数据清除较为彻底,可以精确达到用户想要的清除比例,释放出的存储空间更能满足用户的需求。
5.1.5,原始分片文件制作的详细过程。
参照图5所示,示出了制作原始分片文件的步骤流程图,如图5所示,具体可以包括以下步骤:
步骤S501:基于目标应用的逻辑文件中的数据内容,确定划分的数据 块数量,并基于划分的数据块数量,建立数据对应关系。
步骤S502:响应于针对目标应用发起的文件制作请求,基于数据对应关系,创建多个空的原始分片文件;其中,每个原始分片文件对应数据对应关系中所描述的多个逻辑文件中的多个数据块;每个原始分片文件中分配的数据块数量由原始镜像包的制作者指定。
步骤S503:读取目标应用的每个逻辑文件的数据内容,并基于数据对应关系,将读取的数据内容分块写入到相应的原始分片文件中。
写入完成后,可以将得到的多个原始分片文件、缓存栈描述文件、启动运行包一并打包上传到服务器。
其中,以图1所示的软硬件环境为例,对本申请的原始分片文件的制作进行示例性说明:
首先,由文件块管理器预先制作好数据对应关系,这一过程中,可以由文件块管理器读取并展示目标应用的各个逻辑文件的数据内容,和逻辑文件的属性,之后,确定每个数据内容需要被划分的数据块和每个原始分片文件被分配的数据块数量。之后,文件块管理器根据被划分的数据块和每个原始分片文件被分配的数据块数量,生成数据对应关系。
在初始化文件块管理器和多个缓存组件时,建立文件块管理器与第三缓存组件之间的数据通路。在需要制作原始分片文件时,是将目标应用的逻辑文件中的原始数据写入到本地的第二外存的空的原始分片文件中,因此,可以建立文件块管理器与第三缓存组件(第二外存对应的缓存组件)之间的数据通路,通过该数据通路,文件块管理器可以将从目标应用的逻辑文件中读取的原始数据分块后写入到第二外存的空的原始分片文件中。
具体在写入时,由于文件块管理器预先制作好了数据对应关系,则在读取到目标应用的数据内容时,可以确定数据内容所属的逻辑文件的标识,接着通过数据对应关系确定该数据内容需要写入到的原始分片文件以及该数据块所赋予的全局唯一的块标识,从而通过该数据通路将读取的数据内容分块写入到相应的原始分片文件中。
当所有逻辑文件/目录枚举并写入完毕后,再创建目标应用的配置文件 (如缓存栈描述文件),并存放于原始分片文件的同级目录中,一起打包成原始镜像包,进而将原始镜像包和启动运行包打包上传到源站服务器的OSS-对象存储或者大规模分布式文件系统中,再通过CDN系统预热到不同地区的缓存服务器上,由此便实现了在多个数据源中存储目标应用的原始数据。
在一种实施例中,给出了数据对应关系的一种实现方式,在该实现方式中,可以通过关系表项建立数据对应关系,具体过程如下:
首先,创建nodex表,并将每一个逻辑文件的属性信息写入nodex表对应的字段中;其中,属性信息包括逻辑文件的文件标识。
接着,基于每个逻辑文件的数据内容,确定每个逻辑文件所需要的数据块数量,并基于数据块数量,创建blocks表,blocks表中分配有多个唯一标识符(上述所述的块标识),每个唯一标识符唯一表征一个数据块;其中,blocks表中包括的表项数量与目标应用总的数据块数量相同,一个表项对应一个数据块,可以将逻辑文件标识和块标识对应写入到blocks表中的一条表项的对应字段中。
之后,将逻辑文件的文件标识以及逻辑文件中的数据在该逻辑文件中的标识,写入到blocks表中相应的块标识所在的表项中;并将写入完成后的blocks表和nodex表整合为数据块描述表,该数据块描述表即为数据对应关系。
本实施例中,文件块管理器可以针对每一个逻辑文件/目录的属性信息创建一条nodex表项,再将每一个逻辑文件/目录的属性信息写入到该条nodex表项的相应字段中,由此得到了由多条nodex表项构成的nodex表。其中,逻辑文件/目录的属性信息包括逻辑文件标识和逻辑文件的类型、大小、创建、修改、访问时间等信息。
参照图6所示,示出了本申请的数据块描述表的示意图,包括nodex表和blocks表。blocks表为图6左侧三列所构成的表,nodex表为图6右侧9列所构成的表。如图6所示,nodex表中的每个表项包含每个逻辑文件的相关属性信息;nodeid代表全局唯一的逻辑文件标识,用于在blocks表以及nodex表中索引该逻辑文件对应的属性(文件属性信息、数据块分布信息), parentid指代父逻辑文件的nodeid,其他字段为常规属性。
blocks表中的dblkid指代原始分片文件中数据块的块标识(唯一标识符),blockid指代逻辑文件内部的标识(从逻辑文件的0起始地址开始);c/a/mtime指代创建/访问/修改时间,实际中该修改时间可以用时间戳表示(图6中未具体示出时间戳,以*作为示意);valid/allocsize指代logic file有效以及所分配的容量大小(以字节为单位,可以用于确定数据块个数)。
这样,当读请求携带逻辑文件标识和数据块标识时,便可以根据blocks表查找读请求在原始分片文件中对应的一个数据块。
当然,在一些实施例中,文件块管理器相应地还提供了如何进行逻辑文件的创建、删除、打开、关闭、数据读取和写入流程。
其中,逻辑文件的创建流程:在nodex表中插入一条表项,并设置该表项的nodeid为逻辑文件的nodeid,其他属性按照文件类型,大小,创建/修改/访问时间,归属用户(组)等信息设置(文件描述符一般在打开文件的时候创建,关闭文件的时候销毁)。
逻辑文件的删除流程:将blocks表中与逻辑文件的nodeid相等的所有表项的nodeid&blockid设置为0xffffffff,dblkid保持不变;然后在nodex表中查找与逻辑文件的nodeid对应的表项,并删除。
逻辑文件的打开流程:在内存中建立一个逻辑文件的文件描述符,然后在nodex表中查找与逻辑文件的nodeid对应的nodex表项;如果找不到就销毁文件描述符,返回失败;如果找到,就将相关属性读入文件描述符,创建一个与该文件描述符对应的虚拟文件句柄,该虚拟文件句柄指向所述文件描述符,然后向应用程序返回该虚拟文件句柄。
逻辑文件的关闭流程:将该逻辑文件的属性信息写入到与该逻辑文件的nodeid对应的nodex表项中,销毁内存中的文件描述符,删除虚拟文件句柄。
逻辑文件的数据写流程:先在blocks表中分配与本次写请求的数据块个数相匹配的可写数据块表项,查找nodeid&blockid为0xffffffff(表示空闲)的表项;待搜索到足够表项数后,更新相关表项的nodeid为对应逻辑文件的nodeid,blockid为逻辑文件对应数据块的blockid,然后将写请求转换为dblkid 的写请求后优先发送给内存缓存组件完成该写请求。
逻辑文件的数据读流程:先在blocks表中查找与逻辑文件的nodeid对应的相关表项,然后根据读请求的blockid确定dblkid,最后将读请求转换为dblkid的读请求优先发送给内存缓存组件完成该读请求。
6.1,对本申请的应用的缓存可伸缩处理方法进行示例性介绍。
下面,以图1所示的软硬件环境,对本申请的应用的缓存可伸缩处理方法进行简单地示例性描述。
首先,由目标应用的出品方,或有制作条件的其他终端,按照上述5.1.4的过程制作好启动运行包和原始镜像包,并单独上传缓存栈描述文件(可以不封装于原始镜像包中),该缓存栈描述文件可以针对不同性能配置的终端有对应的缓存栈描述文件。
当终端要下载安装目标应用时,终端向服务器上传目标应用的标识和终端的性能参数,接着,可以接收服务器下发的启动运行包和对应的缓存栈描述文件,并可下载原始镜像包。
接着,终端基于启动运行包启动目标应用,然后基于缓存栈描述文件,初始化图1所示的多级缓存系统,这里以多个缓存组件为图1所示的四个为例。
之后,终端用户开始使用目标应用,由于目标应用的原始数据被制作为多个原始分片文件存放在云存储介质,因此,在目标应用启动后,可以从终端本地已经下载完成的部分数据,或者云存储介质的原始镜像包中获取所需的数据以支持应用的运行。由于启动运行包所含的数据极少,可以快速启动目标应用,而目标应用运行所需的数据可以在原始镜像包中或在本地已下载的数据中获取以支持应用的运行,使得目标应用可以被快速启动和使用,优化用户体验。
随着目标应用的使用,在各个存储介质中均具有目标应用的数据,且累积越来越多,则可以对终端中本地存储介质(内存、第一外存和第二外存)中所存储的目标应用的数据进行清理。具体地,可以对内存、第一外存和第二外存中的一个或多个进行清理,清理时,也可以指定每个存储介质清理的 比例,其中,该比例可以是任一比例,另外,该比例由应用程序管理器根据当前操作系统以及硬件平台的性能配置自动生成,也可以由用户指定。
当需要进行极限清除时,则清除掉内存、第一外存和第二外存中的除启动运行包外的所有数据。由此,释放了巨大的存储空间,从而为终端安装其他应用和存储其他数据提供了支持。
综上所述,本申请实施例的技术方案具有以下优点:
(1)可以帮助终端运行和安装更多的应用程序。
由于终端的多个缓存组件可以定期清除相应存储介质中属于目标应用的数据,以为存储介质腾出更多的存储空间用于存储其他应用程序的数据和存储其他的多媒体数据,由此使得终端可以运行和安装更多的应用程序,存储更多的数据。
(2)提高了目标应用的I/O响应速度。
一方面,由于目标应用发出读请求时,可以优先从响应速度快的存储介质,如内存中读取数据返回给目标应用,在从内存中读取不到数据时,又可以从响应速度次级快的存储介质,如第一外存中读取数据返回给目标应用,由此在读取数据时,是按照响应速度从高到低的顺序从对应的存储介质中读取数据,从而提高了目标应用的I/O响应速度。
另一方面,由于基于目标应用的数据读取的历史轨迹,预测目标应用下一次要读的数据块和数据块的数量,从而提前从内存以外的存储介质中,将预测的数据块写入到内存中,以便下一次读取时,可以从内存中直接读取数据块,从而帮助进一步提高目标应用的I/O响应速度。
(3)提高了目标应用的I/O响应稳定性。
由于将目标应用的原始数据按照数据块的粒度进行分块存储,得到多个原始分片文件,每个原始分片文件中包括目标应用的原始数据中的部分数据块。如此,目标应用的多个逻辑文件中的原始数据便被重新分配到多个原始分片文件中,这样,可以在读取和写入数据时,便可以到对应的原始分片文件中读取相应的数据块和写入相应的数据块,从而提高I/O响应的稳定性。
基于相同的发明构思,本申请还提供一种数据处理装置,参照图7所示, 公开了一种数据处理装置的结构框图,所述装置可以包括以下模块:
初始化模块701,用于基于目标应用的启动运行包启动所述目标应用,并初始化与所述目标应用对应的多个缓存组件;所述多个缓存组件分别对应各自的存储介质,所述存储介质中存储有支持所述目标应用运行的数据;
清理模块702,用于响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除;其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动;
响应模块703,用于响应于所述目标应用的读请求,通过对应的缓存组件,从云存储介质、和/或所述本地存储介质中获取所述读请求对应的数据,以支持所述目标应用的运行;其中,所述云储存介质中存储有支持所述目标应用运行的原始数据。
可选地,清理模块702,包括:
第一清理单元,用于在所述存储空间释放事件为部分清除的事件时,清除所述本地存储介质中待清除的数据,所述待清除的数据为基于读取频次和/或最近读取时间确定的数据;
第二清理单元,用于在所述存储空间释放事件为极限清理的事件时,清除所述本地存储介质中除所述启动运行包外的全部数据。
可选地,所述装置还包括:
第一写入模块,用于在所述本地存储介质包括内存的情况下,将从所述内存中清除的数据写入到对应的响应优先级低于所述内存的本地存储介质中;
第二写入模块,用于对除所述内存外的其余本地存储介质,将所述其余本地存储介质中清除的具有目标特征的数据写入增量数据区中;其中,所述目标特征表征所述数据块是被所述目标应用写入的数据。
可选地,初始化模块701,包括:
参数获取单元,用于获取所述终端的性能配置参数;所述性能配置参数包括所述终端的操作系统的版本标识和/或所述终端上内存的当前性能配置 参数;
初始化单元,用于基于所述性能配置参数,初始化所述多个缓存组件,其中,所述多个缓存组件的数量与所述性能配置参数适配。
可选地,初始化单元,包括:
第一初始子单元,用于基于所述性能配置参数确定所述终端的内存和/或所述操作系统满足目标条件时,初始化与多个外存和所述终端的内存各自对应的缓存组件;
第二初始子单元,用于基于所述性能配置参数确定所述终端的内存和/或所述操作系统不满足所述目标条件时,初始化与所述多个外存各自对应的缓存组件。
可选地,所述装置还包括:
系统参数获取模块,用于获取所述终端的操作系统参数,所述操作系统参数用于指示所述终端上的操作系统的版本;
接口层初始化模块,用于基于所述操作系统参数,创建与所述目标应用对应的接口层,所述接口层包括文件系统模型、沙盒模型或文件接口模型;
其中,所述接口层用于接收所述目标应用发出的I/O请求和所述存储空间释放事件。
可选地,所述多个缓存组件具有各自的响应优先级,其中,响应优先级越高的缓存组件对应响应速度越快的存储介质,所述装置还包括以下至少一者:
第一顺序写模块,用于响应所述目标应用的写请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中;
顺序读模块,用于响应所述目标应用的读请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次通过所述缓存组件从对应的存储介质中获取所述读请求对应的数据;
第二顺序写模块,用于将从响应优先级低的缓存组件对应的存储介质中读取到的数据,写入到响应优先级高的缓存组件对应的存储介质中。
可选地,第一顺序写模块,包括:
第一写入单元,用于按照响应优先级从高到低的顺序,通过响应优先级最高的缓存组件,将所述待写入的数据写入到所述响应优先级最高的缓存组件对应的存储介质;
第二写入单元,用于从所述响应优先级最高的缓存组件对应的存储介质中读取所述待写入的数据,并通过响应优先级低的缓存组件将所述待写入的数据写入到对应的存储介质中。
可选地,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的;所述装置还包括:
数据块读取模块,用于响应于所述目标应用的读请求,按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取所述读请求所需的数据块;
数据块封装模块,用于将读取出的全部数据块封装后返回给所述目标应用。
可选地,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的,所述装置还包括:
预读数据块确定模块,用于基于所述目标应用的多个历史读请求所读取到的数据,确定下一次所要读取的多个预读数据块;
预读数据块获取模块,用于对多个预读数据块中未存在于响应优先级最高的缓存组件对应的存储介质中的目标数据块,按照响应优先级从高到低的顺序,依次通过其余的缓存组件从相应的存储介质中读取所述目标数据块;
预读数据块写入模块,用于将读取到的所述目标数据块写入所述响应优先级最高的缓存组件对应的存储介质,以在下一次读请求命中所述多个预读数据块时,从所述响应优先级最高的缓存组件对应的存储介质中读取所述多个预读数据块。
可选地,数据块读取模块,包括:
块标识确定单元,用于响应于所述目标应用的读请求,基于数据对应关系,确定所述读请求所需的每个数据块各自的块标识;所述数据对应关系用于表征所述原始数据与所述存储介质中的数据块之间的对应关系;
数据块读取单元,用于按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取具有所述块标识的所述数据块。
可选地,所述装置还包括:
数据划分模块,用于对所述目标应用的原始数据被分块后得到的全部数据块,将所述全部数据块进行划分,得到多个原始分片文件;
数据上传模块,用于将所述多个原始分片文件和所述启动运行包上传至所述云存储介质,以供所述目标应用下载使用。
可选地,所述装置还包括:
接口创建模块,用于创建对应的缓存组件与所述云存储介质之间的多种接口;多种接口按照响应优先级从高到低包括:内容分发网络CDN接口、点对点传输P2P接口和源站接口;
数据下载模块,用于在从所述云存储介质中读取数据时,按照所述多种接口的响应优先级从高到低的顺序,依次通过所述多种接口从所述云存储介质中获取对应的数据。
需要说明的是,装置实施例与方法实施例相近,故描述的较为简单,相关之处参见方法实施例即可。
本申请实施例还公开了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行时实现如所述的应用的缓存可伸缩处理方法、装置、设备及介质。
本申请实施例还公开了一种计算机可读存储介质,其存储的计算机程序使得处理器执行如本申请所述的应用的缓存可伸缩处理方法、装置、设备及介质。
本申请实施例还公开了一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现所述的应用的缓存可伸缩处理方法、装置、设备及介质。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种应用的缓存可伸缩处理方法、装置、设备、介质及产品,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味 着,结合实施例描述的特定特征、结构或者特性包括在本公开的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本公开的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本公开可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
最后应说明的是:以上实施例仅用以说明本公开的技术方案,而非对其限制;尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本公开各实施例技术方案的精神和范围。

Claims (16)

  1. 一种应用的缓存可伸缩处理方法,其特征在于,所述方法包括:
    基于目标应用的启动运行包启动所述目标应用,并初始化与所述目标应用对应的多个缓存组件;所述多个缓存组件分别对应各自的存储介质,所述存储介质中存储有支持所述目标应用运行的数据;
    响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除;其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动;
    响应于所述目标应用的读请求,通过对应的缓存组件,从云存储介质、和/或所述本地存储介质中获取所述读请求对应的数据,以支持所述目标应用的运行;其中,所述云储存介质中存储有支持所述目标应用运行的原始数据。
  2. 根据权利要求1所述的方法,其特征在于,响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除,包括:
    在所述存储空间释放事件为部分清除的事件时,清除所述本地存储介质中待清除的数据,所述待清除的数据为基于读取频次和/或最近读取时间确定的数据;
    在所述存储空间释放事件为极限清理的事件时,清除所述本地存储介质中除所述启动运行包外的全部数据。
  3. 根据权利要求2所述的方法,其特征在于,多个缓存组件具有各自的响应优先级,在所述存储空间释放事件为部分清除的事件的情况下,所述方法还包括:
    在所述本地存储介质包括内存的情况下,将从所述内存中清除的数据写入到对应的响应优先级低于所述内存的本地存储介质中;
    对除所述内存外的其余本地存储介质,将所述其余本地存储介质中清除的具有目标特征的数据写入增量数据区中;其中,所述目标特征表征所述数据块是被所述目标应用写入的数据。
  4. 根据权利要求1所述的方法,其特征在于,初始化与所述目标应用对应的多个缓存组件,包括:
    获取所述终端的性能配置参数;所述性能配置参数包括所述终端的操作系统的版本标识和/或所述终端上内存的当前性能配置参数;
    基于所述性能配置参数,初始化所述多个缓存组件,其中,所述多个缓存组件的数量与所述性能配置参数适配。
  5. 根据权利要求4所述的方法,其特征在于,基于所述性能配置参数,初始化所述多个缓存组件,包括:
    基于所述性能配置参数确定所述终端的内存和/或所述操作系统满足目标条件时,初始化与多个外存和所述终端的内存各自对应的缓存组件;
    基于所述性能配置参数确定所述终端的内存和/或所述操作系统不满足所述目标条件时,初始化与所述多个外存各自对应的缓存组件。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    获取所述终端的操作系统参数,所述操作系统参数用于指示所述终端上的操作系统的版本;
    基于所述操作系统参数,创建与所述目标应用对应的接口层,所述接口层包括文件系统模型、沙盒模型或文件接口模型;
    其中,所述接口层用于接收所述目标应用发出的I/O请求和所述存储空间释放事件。
  7. 根据权利要求1所述的方法,其特征在于,所述多个缓存组件具有各自的响应优先级,其中,响应优先级越高的缓存组件对应响应速度越快的存储介质,所述方法还包括以下至少一者:
    响应所述目标应用的写请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中;
    响应所述目标应用的读请求,按照所述多个缓存组件的响应优先级从高到低的顺序,依次通过所述缓存组件从对应的存储介质中获取所述读请求对应的数据;
    将从响应优先级低的缓存组件对应的存储介质中读取到的数据,写入到 响应优先级高的缓存组件对应的存储介质中。
  8. 根据权利要求7所述的方法,其特征在于,按照所述多个缓存组件的响应优先级从高到低的顺序,依次将待写入的数据写入到对应的存储介质中,包括:
    按照响应优先级从高到低的顺序,通过响应优先级最高的缓存组件,将所述待写入的数据写入到所述响应优先级最高的缓存组件对应的存储介质;
    从所述响应优先级最高的缓存组件对应的存储介质中读取所述待写入的数据,并通过响应优先级低的缓存组件将所述待写入的数据写入到对应的存储介质中。
  9. 根据权利要求1-8任一所述的方法,其特征在于,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的;所述方法还包括:
    响应于所述目标应用的读请求,按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取所述读请求所需的数据块;
    将读取出的全部数据块封装后返回给所述目标应用。
  10. 根据权利要求1-8任一所述的方法,其特征在于,每个存储介质中以数据块粒度存储支持所述目标应用运行的数据,所述数据块是对所述目标应用的原始数据进行分块后得到的,所述方法还包括:
    基于所述目标应用的多个历史读请求所读取到的数据,确定下一次所要读取的多个预读数据块;
    对多个预读数据块中未存在于响应优先级最高的缓存组件对应的存储介质中的目标数据块,按照响应优先级从高到低的顺序,依次通过其余的缓存组件从相应的存储介质中读取所述目标数据块;
    将读取到的所述目标数据块写入所述响应优先级最高的缓存组件对应的存储介质,以在下一次读请求命中所述多个预读数据块时,从所述响应优先级最高的缓存组件对应的存储介质中读取所述多个预读数据块。
  11. 根据权利要求9所述的方法,其特征在于,响应于所述目标应用的读请求,按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从 对应存储介质中读取所述读请求所需的数据块,包括:
    响应于所述目标应用的读请求,基于数据对应关系,确定所述读请求所需的每个数据块各自的块标识;所述数据对应关系用于表征所述原始数据与所述存储介质中的数据块之间的对应关系;
    按照所述多个缓存组件各自的响应优先级从高到低的顺序,依次从对应存储介质中读取具有所述块标识的所述数据块。
  12. 根据权利要求9所述的方法,其特征在于,在基于目标应用的启动运行包启动所述目标应用之前,所述方法还包括:
    对所述目标应用的原始数据被分块后得到的全部数据块,将所述全部数据块进行划分,得到多个原始分片文件;
    将所述多个原始分片文件和所述启动运行包上传至所述云存储介质,以供所述目标应用下载使用。
  13. 根据权利要求1-8任一或10-12任一项所述的方法,其特征在于,所述方法还包括:
    创建对应的缓存组件与所述云存储介质之间的多种接口;多种接口按照响应优先级从高到低包括:内容分发网络CDN接口、点对点传输P2P接口和源站接口;
    在从所述云存储介质中读取数据时,按照所述多种接口的响应优先级从高到低的顺序,依次通过所述多种接口从所述云存储介质中获取对应的数据。
  14. 一种应用的缓存可伸缩处理装置,其特征在于,所述装置包括:
    初始化模块,用于基于目标应用的启动运行包启动所述目标应用,并初始化与所述目标应用对应的多个缓存组件;所述多个缓存组件分别对应各自的存储介质,所述存储介质中存储有支持所述目标应用运行的数据;
    清理模块,用于响应于对终端进行的存储空间释放事件,通过对应的缓存组件将位于所述终端的本地存储介质中的数据进行清除;其中,经清除后所述本地存储介质中留存的全部数据最少为所述启动运行包中的数据,以至少保证所述目标应用的启动;
    响应模块,用于响应于所述目标应用的读请求,通过对应的缓存组件,从云存储介质、和/或所述本地存储介质中获取所述读请求对应的数据,以支持所述目标应用的运行;其中,所述云储存介质中存储有支持所述目标应用运行的原始数据。
  15. 一种电子设备,其特征在于,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行时实现如权利要求1-13任一项所述的应用的缓存可伸缩处理方法。
  16. 一种计算机可读存储介质,其特征在于,其存储的计算机程序使得处理器执行如权利要求1-13任一项所述的应用的缓存可伸缩处理方法。
PCT/CN2022/130596 2022-05-23 2022-11-08 应用的缓存可伸缩处理方法、装置、设备及介质 WO2023226314A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210562146.X 2022-05-23
CN202210562146.XA CN115048149A (zh) 2022-05-23 2022-05-23 应用的缓存可伸缩处理方法、装置、设备及介质

Publications (1)

Publication Number Publication Date
WO2023226314A1 true WO2023226314A1 (zh) 2023-11-30

Family

ID=83160002

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/130596 WO2023226314A1 (zh) 2022-05-23 2022-11-08 应用的缓存可伸缩处理方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN115048149A (zh)
WO (1) WO2023226314A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115048149A (zh) * 2022-05-23 2022-09-13 杨正 应用的缓存可伸缩处理方法、装置、设备及介质
CN115617770B (zh) * 2022-11-17 2023-03-28 达芬骑动力科技(北京)有限公司 一种用于车辆状态信号数据存储的数据磁盘存储管理方法
CN116028388B (zh) * 2023-01-17 2023-12-12 摩尔线程智能科技(北京)有限责任公司 高速缓存方法、装置、电子设备、存储介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337986A1 (en) * 2013-05-08 2014-11-13 Nintendo Co., Ltd. Information processing system, information processing apparatus, computer-readable storage medium having stored therein information processing program, and data providing method
CN106844032A (zh) * 2017-01-23 2017-06-13 努比亚技术有限公司 一种终端应用的存储处理方法和装置
CN108089890A (zh) * 2016-11-21 2018-05-29 杨正 一种基于磁盘的应用运行方法及系统
WO2018120705A1 (zh) * 2016-12-29 2018-07-05 深圳前海弘稼科技有限公司 一种数据处理方法、装置及系统
CN115048149A (zh) * 2022-05-23 2022-09-13 杨正 应用的缓存可伸缩处理方法、装置、设备及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337986A1 (en) * 2013-05-08 2014-11-13 Nintendo Co., Ltd. Information processing system, information processing apparatus, computer-readable storage medium having stored therein information processing program, and data providing method
CN108089890A (zh) * 2016-11-21 2018-05-29 杨正 一种基于磁盘的应用运行方法及系统
WO2018120705A1 (zh) * 2016-12-29 2018-07-05 深圳前海弘稼科技有限公司 一种数据处理方法、装置及系统
CN106844032A (zh) * 2017-01-23 2017-06-13 努比亚技术有限公司 一种终端应用的存储处理方法和装置
CN115048149A (zh) * 2022-05-23 2022-09-13 杨正 应用的缓存可伸缩处理方法、装置、设备及介质

Also Published As

Publication number Publication date
CN115048149A (zh) 2022-09-13

Similar Documents

Publication Publication Date Title
WO2023226314A1 (zh) 应用的缓存可伸缩处理方法、装置、设备及介质
CA3027756C (en) Systems and methods for efficient distribution of stored data objects
CN106506587B (zh) 一种基于分布式存储的Docker镜像下载方法
US9348842B2 (en) Virtualized data storage system optimizations
US8171099B1 (en) Network acceleration device having persistent in-memory cache
US7644108B1 (en) Network acceleration device cache supporting multiple historical versions of content
US20080147974A1 (en) Multi-level caching system
JP4955677B2 (ja) 領域を解放するための、ストレージボリューム上のファイルから代替ロケーションへのデータの移動
US10601901B2 (en) Methods, systems, and media for stored content distribution and access
US20110167113A1 (en) Method for managing object-based storage system
CN113032335A (zh) 文件访问方法、装置、设备及存储介质
US11489911B2 (en) Transmitting data including pieces of data
CN112711564B (zh) 合并处理方法以及相关设备
US10846265B2 (en) Method and apparatus for accessing file, and storage system
CN116955219A (zh) 一种数据镜像方法、装置、主机及存储介质
CN110784534A (zh) 数据服务方法、装置、系统及电子设备
CN112948336B (zh) 数据加速方法及缓存单元、电子设备及存储介质
US20200272568A1 (en) Adaptive retrieval of objects from remote storage
TW202205106A (zh) 內容提供商系統及用於內容提供商系統的方法
US10848555B2 (en) Method and apparatus for logical mirroring to a multi-tier target node
JP2018538637A (ja) アプリケーションの実行を加速する方法及びデバイス
JP5494363B2 (ja) ファイル管理プログラム,ファイル管理方法およびファイル管理装置
Cassell Building Efficient Software to Support Content Delivery Services
CN117950569A (zh) 数据处理方法、装置、设备、存储介质及程序产品
RU150421U1 (ru) Система размещения и извлечения файлов выделенных серверов

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22943501

Country of ref document: EP

Kind code of ref document: A1