A data storage method, device, computing equipment and readable storage medium

By combining shared storage classes and file caching, the problems of low efficiency in cross-process sharing and large object data storage are solved, achieving efficient data access and processing.

CN116225328BActive Publication Date: 2026-02-17CHEZHI HULIAN BEIJING SCI & TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310184021.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-02-17
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

In existing technologies, data storage performance affects the speed of data retrieval, especially when sharing data across processes and storing large object data, resulting in low efficiency and an inability to effectively improve data processing speed.

Method used

Shared storage classes are used to store cross-process shared data, file caches are used to store large object data, and basic data is stored separately according to data type and business type. Lightweight storage classes are used to store basic data to improve access efficiency.

Benefits of technology

It enables cross-process data interaction, improves data access efficiency, reduces file size, and enhances data reading speed and overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225328B_ABST
    Figure CN116225328B_ABST
Patent Text Reader

Abstract

The application discloses a data storage method and device, a computing device and a readable storage medium, and relates to the computer field.The data storage method comprises the following steps: detecting whether to-be-stored data is cross-process shared data; if the to-be-stored data is cross-process shared data, storing the to-be-stored data by using a shared storage class; if the to-be-stored data is non-cross-process shared data, obtaining the type of the to-be-stored data; when the to-be-stored data is a reference type or a large object data type, storing the to-be-stored data by using a file cache; and when the to-be-stored data is a basic data type and is not a large object data type, storing the to-be-stored data by using a lightweight storage class, wherein the large object data type is a data type whose memory occupation exceeds a preset value.The application supports the storage of multiple types of data, and can improve the data access efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more particularly to a data storage method, apparatus, computing device, and readable storage medium. Background Technology

[0002] For applications running on a terminal, we often need to store some of their data and then retrieve and display it when needed, such as application configuration parameters, images, and text data generated during application runtime. However, data storage performance directly affects the speed of data retrieval, and consequently, the speed of data processing. Therefore, how to store data is particularly important. Summary of the Invention

[0003] Therefore, the present invention provides a data storage method, apparatus, computing device, and readable storage medium in an attempt to solve or at least alleviate the problems mentioned above.

[0004] According to one aspect of the present invention, a data storage method is provided, comprising: detecting whether the data to be stored is cross-process shared data; if the data to be stored is cross-process shared data, storing the data to be stored using a shared storage class; if the data to be stored is not cross-process shared data, obtaining the type of the data to be stored; and when the data to be stored is a reference type or a large object data type, storing the data to be stored using a file cache; when the data to be stored is a basic data type and not a large object data type, storing the data to be stored using a lightweight storage class; wherein the large object data type is a data type whose memory usage exceeds a preset value.

[0005] Optionally, in the data storage method according to the present invention, the shared storage class is ContentProvider, and the lightweight storage class is SharedPreferences.

[0006] Optionally, in the data storage method according to the present invention, a lightweight storage class is used to store the data to be stored, including: obtaining the business type to which the data to be stored belongs, and storing the data to be stored in a file corresponding to the business type.

[0007] Optionally, the data storage method according to the present invention further includes: after storing the data to be stored, saving the data to be stored into memory.

[0008] Optionally, in the data storage method according to the present invention, detecting whether the data to be stored is cross-process shared data includes: detecting whether the data to be stored is marked with a first identifier; if so, determining that the data to be stored is cross-process shared data, otherwise, determining that the data to be stored is non-cross-process shared data; and when obtaining the type of the data to be stored, determining whether the data to be stored is a large object data type by detecting whether the data to be stored is marked with a second identifier.

[0009] Optionally, in the data storage method according to the present invention, storing the data to be stored using a shared storage class includes: creating a shared storage class and writing the data to be stored into the created shared storage class; and obtaining the business type to which the data to be stored belongs, and setting a Uniform Resource Identifier for the data to be stored according to the business type.

[0010] Optionally, in the data storage method according to the present invention, the data to be stored is application data, and the business type is obtained by dividing the application based on business lines or functions.

[0011] According to another aspect of the present invention, a data storage device is provided, comprising: a data detection unit adapted to detect whether the data to be stored is cross-process shared data; a first storage unit adapted to use a shared storage class to store the data to be stored if the data to be stored is cross-process shared data; a type acquisition unit adapted to acquire the type of the data to be stored if the data to be stored is not cross-process shared data; and a second storage unit adapted to use a file cache to store the data to be stored when the data to be stored is a reference type or a large object data type, and to use a lightweight storage class to store the data to be stored when the data to be stored is a basic data type and not a large object data type, wherein the large object data type is a data type whose memory usage exceeds a preset value.

[0012] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the data storage method according to the present invention.

[0013] According to another aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the data storage method according to the present invention.

[0014] In summary, this invention supports the storage of various data types. By using shared storage classes to store cross-process shared data, cross-process data access is enabled, facilitating data interaction between processes. Furthermore, for data that consumes a large amount of memory, this invention uses file storage in a local cache, which improves access efficiency.

[0015] In addition, for basic data types, this invention will save them in different files according to the business type of the data. This can reduce file size, speed up file reading, and thus further improve access efficiency and performance. Attached Figure Description

[0016] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0017] Figure 1 A structural block diagram of a computing device 100 according to an embodiment of the present invention is shown;

[0018] Figure 2 A flowchart of a data storage method 200 according to an embodiment of the present invention is shown;

[0019] Figure 3 A schematic diagram of a data reading method according to an embodiment of the present invention is shown;

[0020] Figure 4 A schematic diagram of a data storage method according to yet another embodiment of the present invention is shown;

[0021] Figure 5 A structural diagram of a data storage device 500 according to an embodiment of the present invention is shown. Detailed Implementation

[0022] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0023] This invention provides a data storage method that supports storing multiple types of data. This data storage method can be executed in a computing device. Figure 1A block diagram of the physical components (i.e., hardware) of a computing device 100 is shown. In a basic configuration, the computing device 100 includes at least one processing unit 102 and a system memory 104. According to one aspect, depending on the configuration and type of the computing device, the processing unit 102 may be implemented as a processor. The system memory 104 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, the system memory 104 includes an operating system 105 and a program module 106, the program module 106 including a data storage module 120 configured to execute the data storage method 200 of the present invention.

[0024] According to one aspect, operating system 105 is, for example, suitable for controlling the operation of computing device 100. Furthermore, examples are practiced in conjunction with graphics libraries, other operating systems, or any other applications, and are not limited to any particular application or system. Figure 1 The basic configuration is illustrated by the components within the dashed lines 108. According to one aspect, the computing device 100 has additional features or functions. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 1 The image is shown by removable storage 109 and non-removable storage 110.

[0025] As stated above, according to one aspect, a program module is stored in system memory 104. According to one aspect, the program module may include one or more applications. The present invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc.

[0026] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 1Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operated via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 100. Embodiments of the invention can also be practiced using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be practiced within a general-purpose computer or in any other circuit or system.

[0027] According to one aspect, computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 114, such as a display, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver and / or transceiver circuitry; Universal Serial Bus (USB), parallel and / or serial ports.

[0028] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 104, removable storage 109, and non-removable storage 110 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computing device 100. According to one aspect, any such computer storage medium can be part of computing device 100. Computer storage media does not include carrier waves or other transmitted data signals.

[0029] According to one aspect, a communication medium is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, a communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.

[0030] Figure 2 A data storage method according to an embodiment of the present invention is shown, method 200 being adapted for use in a computing device (e.g., Figure 1 Executed in the computing device 100 shown. Figure 2 As shown, method 200 begins at 210.

[0031] In step 210, it is detected whether the data to be stored is cross-process shared data. The data to be stored can be application data, specifically application configuration data, data generated during application runtime, etc., which are not limited in this invention.

[0032] Regarding cross-process shared data, this section provides an explanation. It refers to data that supports sharing among multiple processes. Furthermore, for data that supports sharing among multiple processes (i.e., cross-process shared data), in some embodiments, it can be pre-labeled with a first identifier. This allows the determination of whether the data to be stored is cross-process shared data by detecting whether it is labeled with the first identifier. Specifically, if the data to be stored is labeled with the first identifier, it is determined to be cross-process shared data; otherwise, it is determined to be non-cross-process shared data. According to one embodiment of the present invention, the first identifier can be `dataBase`. Thus, when the data to be stored is labeled with `dataBase`, it is determined to be cross-process shared data; otherwise, it is determined to be non-cross-process shared data.

[0033] If the data to be stored is cross-process shared data, then proceed to step 220 and use a shared storage class to store the data. In some embodiments, the shared storage class can be used to store the data as follows: Create a shared storage class and write the data to be stored into the created shared storage class. Further, the shared storage class can be a ContentProvider; in this case, create a ContentProvider and write the data to be stored into the created ContentProvider.

[0034] It should be noted that when using shared storage to store data, a Uniform Resource Identifier (URI) must also be set for the data. This URI can be set based on the business type to which the data belongs, thus differentiating between different businesses. Specifically, the business type of the data to be stored is obtained, and then a URI is set for the data based on that business type. Furthermore, as mentioned above, the data to be stored can be application data. Therefore, in some embodiments, the business type can be divided based on the application's business line or function. For example, when the data to be stored is WeChat application data, the business type could include chat, Moments, Wallet, etc. It should be noted that this is merely an example and is not intended to limit the scope of the invention.

[0035] The above describes the case where the data to be stored is cross-process shared data. The following describes the case where the data to be stored is not cross-process shared data. Specifically, if the data to be stored is not cross-process shared data, then step 230 is executed to obtain the type of the data to be stored. Specifically, it detects whether the data to be stored is a basic data type, a reference type, or a large object data type. Here, we will first explain the large object data type. A large object data type refers to a data type whose memory usage exceeds a preset value. For example, when the preset value is 3KB, data with a memory usage exceeding 3KB is considered large object data. Of course, this is just an example, and the present invention does not limit the preset value. In specific embodiments, those skilled in the art can limit it according to actual needs.

[0036] For large object data, a second identifier can be used beforehand. This allows us to determine whether the data to be stored is a large object data type by checking if it is marked with the second identifier. Specifically, if the data to be stored is marked with the second identifier, it is determined to be a large object data type; otherwise, it is determined not to be a large object data type. In some embodiments, the second identifier can be disk. Thus, if the data to be stored is marked with disk, it is determined to be a large object data type; otherwise, it is determined not to be a large object data type. Additionally, reference types refer to data types represented by actual value references (similar to pointers). There are four main categories and eight basic data types: integer (byte, short, int, long), floating-point (float, double), boolean (boolean), and character (char). These are easily distinguishable and will not be elaborated upon here.

[0037] Then, proceeding to step 240, when the data to be stored is a reference type or a large object data type, a file cache is used to store the data; when the data to be stored is a basic data type and not a large object data type, a lightweight storage class is used to store the data. Details are as follows.

[0038] When storing data to be stored using file caching (i.e., storing data to a local cache using files), according to one embodiment of the present invention, DiskLruCache can be used to save the data to be stored to the file cache. The storage directory can be / data / data / package name / cache / file name. Of course, this is just an example, and the present invention does not limit it.

[0039] When storing data to be stored using a lightweight storage class, according to one embodiment of the present invention, SharedPreferences can be used (i.e., the lightweight storage class can be SharedPreferences). Furthermore, the data to be stored can be stored according to the business type to which it belongs. Specifically, the business type to which the data to be stored belongs is obtained, and the data to be stored is stored in a file corresponding to that business type. For example, when the data to be stored is chat data from a WeChat application, it is stored in a file corresponding to the chat business type. By distinguishing the business type to which the data belongs and storing each data in different files, the size of a single file can be avoided from becoming too large, thus speeding up file storage and retrieval, thereby improving performance.

[0040] In addition, regardless of which method is used to store the data (i.e., shared storage, file caching, or lightweight storage), the data can also be saved to memory. A HashMap can be used for this purpose, allowing the data to be retrieved directly from memory when needed later, thus improving performance and efficiency. Conversely, when the application containing the data exits or is uninstalled, the data must be cleared from memory.

[0041] It should also be noted that for any data, regardless of which of the above methods is used for storage, an identifier key can be set when storing it. The present invention does not limit how to set the identifier key. For example, when using SharedPreferences for storage, the business type can be used as the identifier key.

[0042] The above is an explanation of data storage; the following section will combine... Figure 3The data reading process is described below. Specifically, when reading any data, the key used when saving the data is first used to read it from memory. If the data is found, it is used directly, and the process ends. If the data is not found in memory, data is read from different files based on the key. If the data is found, it is used directly and stored in memory for future reading. If the data is not found in a file, it indicates that the data was not saved before, and the default value can be used directly. This invention does not limit the default value.

[0043] To better understand this invention, the following is combined with... Figure 4 The data storage method of the present invention will be illustrated by a specific example, wherein the data to be stored is data from a certain application. The details are as follows.

[0044] 410. Check if the data to be stored is shared across processes. If so, proceed to 420; otherwise, proceed to 430.

[0045] 420. Use ContentProvider to store the data to be stored. Specifically, define the URI based on the business type of the data to be stored, create a Provider, and write the data according to the key. Then proceed to 460.

[0046] 430. Get the type of the data to be stored. If the data to be stored is a basic data type, proceed to 440. If the data to be stored is a reference type or a large object data type, proceed to 450.

[0047] 440. Use SharedPreferences to store the data to be stored. Specifically, store the data to be stored in the SharedPreferences file corresponding to its business type. Then proceed to 460.

[0048] 450. Use file caching to store the data to be stored. Specifically, you can use DiskLruCache to save the data to be stored to the file cache. Additionally, you can select a key as the filename. For example, when the data to be stored is a chat log with someone, you can use that person as the filename. Then proceed to 460.

[0049] 460, save the data to be stored into memory, then proceed to 470.

[0050] 470. When the application to which the data to be stored belongs exits, the data to be stored will be cleared from memory.

[0051] For specific details regarding the data storage method in this embodiment, please refer to the above-described data storage method. Figure 1 and Figure 2The description will not be repeated here.

[0052] The present invention also provides a data storage device. Figure 5 A structural block diagram of a data storage device 500 according to an embodiment of the present invention is shown, suitable for residing in a computing device 100. For example... Figure 5 As shown, the data storage device 500 includes a data detection unit 510, a first storage unit 520, a type acquisition unit 530, and a second storage unit 540.

[0053] The data detection unit 510 is suitable for detecting whether the data to be stored is cross-process shared data.

[0054] The first storage unit 520 is adapted to use a shared storage class to store the data to be stored if the data to be stored is cross-process shared data.

[0055] The type acquisition unit 530 is adapted to acquire the type of the data to be stored if the data to be stored is not cross-process shared data.

[0056] The second storage unit 540 is suitable for using a file cache to store the data to be stored when the data to be stored is a reference type or a large object data type, and for using a lightweight storage class to store the data to be stored when the data to be stored is a basic data type and not a large object data type. The large object data type is a data type whose memory usage exceeds a preset value.

[0057] The specific details of the data storage device 500 according to the present invention have been described in the paper. Figures 1 to 4 The details are disclosed in the description, and will not be repeated here.

[0058] In summary, this invention supports the storage of various data types. By using shared storage classes to store cross-process shared data, cross-process data access is enabled, facilitating data interaction between processes. Furthermore, for data that consumes a large amount of memory, this invention uses files to store it in a local cache, improving access efficiency. Additionally, for basic data types, this invention stores them in different files based on their business type, reducing the size of the SharedPreferences file and further improving access efficiency.

[0059] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0060] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the data storage method of the present invention according to instructions in the program code stored in the memory.

[0061] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0062] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0063] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0064] It should be understood that, in order to simplify this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0065] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0066] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0067] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.

[0068] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.

[0069] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0070] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A data storage method, comprising: Check whether the data to be stored is shared across processes; If the data to be stored is cross-process shared data, then a shared storage class is used to store the data to be stored; If the data to be stored is not shared across processes, then obtain the type of the data to be stored; When the data to be stored is a reference type or a large object data type, a file cache is used to store the data to be stored. When the data to be stored is a basic data type and not a large object data type, a lightweight storage class is used to store the data to be stored. The large object data type is a data type whose memory usage exceeds a preset value. The method further includes: pre-labeling the large object data with a second identifier, and determining whether the data to be stored is a large object data type by detecting whether the data to be stored is labeled with the second identifier.

2. The method as described in claim 1, wherein, The shared storage class is ContentProvider, and the lightweight storage class is SharedPreferences.

3. The method as described in claim 1, wherein, The use of a lightweight storage class to store the data to be stored includes: Obtain the business type to which the data to be stored belongs, and store the data to be stored in a file corresponding to that business type.

4. The method according to any one of claims 1-3, further comprising: After storing the data to be stored, save the data to be stored into memory.

5. The method of claim 4, wherein, The detection of whether the data to be stored is cross-process shared data includes: Detect whether the data to be stored is marked with a first identifier; If so, the data to be stored is determined to be cross-process shared data; otherwise, the data to be stored is determined to be non-cross-process shared data. When obtaining the type of the data to be stored, it is determined whether the data to be stored is a large object data type by detecting whether the data to be stored is marked with a second identifier.

6. The method of claim 4, wherein, The method of storing the data to be stored using a shared storage class includes: Create a shared storage class and write the data to be stored into the created shared storage class; and Obtain the business type to which the data to be stored belongs, and set a Uniform Resource Identifier for the data to be stored according to the business type.

7. The method of claim 3, wherein, The data to be stored is application data, and the business type is obtained by dividing the application based on business lines or functions.

8. A data storage device, comprising: A data detection unit is suitable for detecting whether the data to be stored is cross-process shared data. The first storage unit is adapted to store the data to be stored using a shared storage class if the data to be stored is cross-process shared data; The type acquisition unit is adapted to acquire the type of the data to be stored if the data to be stored is non-cross-process shared data; as well as The second storage unit is adapted to use a file cache to store the data to be stored when the data to be stored is a reference type or a large object data type, and to use a lightweight storage class to store the data to be stored when the data to be stored is a basic data type and not a large object data type, wherein the large object data type is a data type whose memory usage exceeds a preset value. The device is also adapted to pre-label the large object data with a second identifier, and to determine whether the data to be stored is a large object data type by detecting whether the data to be stored is labeled with the second identifier.

9. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-7.

10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Data dispatching method and device for CAN bus

    CN104346227A

  • File sharing method and device

    CN106503069A

  • Method and device for classifying and storing data

    CN107729406A

  • Method, apparatus and system for storing data

    CN109254733A

  • Data storage method and device and data downloading method and device

    CN111399756A