CN111722927B - Data cache management method, system, device and medium - Google Patents

Data cache management method, system, device and medium Download PDF

Info

Publication number
CN111722927B
CN111722927B CN202010537745.7A CN202010537745A CN111722927B CN 111722927 B CN111722927 B CN 111722927B CN 202010537745 A CN202010537745 A CN 202010537745A CN 111722927 B CN111722927 B CN 111722927B
Authority
CN
China
Prior art keywords
data
cache
map object
managed
byte sequence
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010537745.7A
Other languages
Chinese (zh)
Other versions
CN111722927A (en
Inventor
高瑞胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010537745.7A priority Critical patent/CN111722927B/en
Publication of CN111722927A publication Critical patent/CN111722927A/en
Application granted granted Critical
Publication of CN111722927B publication Critical patent/CN111722927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data cache management method, which comprises the following steps: acquiring data to be managed from a storage device; sequencing a plurality of attributes of data to be managed according to a preset sequence to generate a corresponding byte sequence; storing the byte sequence into a cache; responding to a request of a requester for acquiring data in a cache, and acquiring a byte sequence corresponding to the data to be acquired based on the request; sequentially analyzing the corresponding byte sequences according to the preset sequence of the attributes to obtain the corresponding attributes; and encapsulating the plurality of analyzed attributes into an object for the requester to use. The invention also discloses a system, a computer device and a readable storage medium. The scheme provided by the invention caches the data into the byte sequence, encapsulates the requested data into high-level programming language objects by designing the object encapsulator when the cached data is requested, and releases the objects after using up, thereby saving the memory size occupied by the high-level programming language objects.

Description

Data cache management method, system, device and medium
Technical Field
The present invention relates to the field of data management, and in particular, to a data cache management method, system, device, and storage medium.
Background
In the current social internet development, users and application data are rapidly increased, particularly, for a storage system, the system is complex, a plurality of objects needing to be managed are provided, and management software often utilizes cache to improve software response speed in order to improve user experience.
At present, for data caching of storage management software, a common practice is to encapsulate managed data into high-level programming language objects, put the high-level programming language objects into a memory, monitor whether the managed data changes, and update the corresponding high-level programming language objects when the managed data changes.
Taking Java as an example, for example, a volume in a storage system has 44 attributes, 1 volume data is packaged into a high-level programming language Java object, at least 44 references are required, each reference has 4 bytes, and a total of 167 bytes is required, if 6 ten thousand volumes are required, about 10M is required, only 30M of memory may be required for storing the volume data, but in order to store the objects, an additional 33% of capacity is required. For a storage system, the system itself has complex services, needs many memories to process the services, and management software belongs to an auxiliary service, and is not allowed to occupy too much memory unless the storage system has more memories, but in order to adapt to different customers, a storage manufacturer generally provides a small memory (e.g., 4GB, 8 GB) storage device.
Disclosure of Invention
In view of the above, in order to overcome at least one aspect of the above problems, an embodiment of the present invention provides a data cache management method, including the following steps:
acquiring data to be managed from a storage device;
sequencing the plurality of attributes of the data to be managed according to a preset sequence to generate a corresponding byte sequence;
storing the byte sequence into a cache;
responding to a request of a requester for acquiring the data in the cache, and acquiring a byte sequence corresponding to the data to be acquired based on the request;
sequentially analyzing the corresponding byte sequences according to the preset sequence of the attributes to obtain the corresponding attributes;
and encapsulating the plurality of analyzed attributes into an object for the requester to use.
In some embodiments, sorting the plurality of attributes of the data to be managed in a preset order to generate a corresponding byte sequence, further includes:
taking the type of the data to be managed as a key, and taking the data map object as a value to create a cache map object;
taking IDs of multiple data of the same type in the data to be managed as keys, and taking a byte sequence as a value to be placed in the same data map object;
and storing the data map object and the cache map object into the cache.
In some embodiments, in response to receiving a request for obtaining data in the cache from a requester, obtaining a byte sequence corresponding to the data to be obtained based on the request, further includes:
judging whether the request comprises the type and the ID of the data to be acquired;
and responding to the request including the type and the ID of the data to be acquired, acquiring a corresponding data map object in the cache map object according to the type of the data to be acquired, and acquiring a corresponding byte sequence in the corresponding data map object according to the ID of the data to be acquired.
In some embodiments, further comprising:
and responding to the request that only the type of the data to be acquired is included, acquiring the corresponding data map object at the cache map object according to the type of the data to be acquired, and taking all byte sequences in the corresponding data map object as the corresponding byte sequences.
In some embodiments, further comprising:
and releasing the object to release the occupied memory after the object is used.
In some embodiments, further comprising:
in response to the fact that the data to be managed are monitored to be deleted in the storage device, deleting the data in the corresponding data map object according to the type and the ID of the deleted data;
in response to the fact that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the corresponding data map object according to the type and the ID of the modified data;
and in response to monitoring that newly added data to be managed is newly added, storing the byte sequence corresponding to the newly added data into the corresponding data map object according to the type and the ID of the newly added data.
In some embodiments, in response to monitoring that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the data map object according to the type and ID of the modified data, further including:
and replacing the original byte sequence of the data map object with the byte sequence corresponding to the modified data.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a data cache management system, including:
the acquisition module is configured to acquire data to be managed from the storage device;
a generation module configured to sort the plurality of attributes of the data to be managed in a preset order to generate a corresponding byte sequence;
a cache module configured to store the byte sequence in a cache;
a first response module, configured to, in response to receiving a request for a requester to obtain data in the cache, obtain, based on the request, a byte sequence corresponding to the data to be obtained;
the analysis module is configured to sequentially analyze the corresponding byte sequences according to a preset sequence of the attributes to obtain the corresponding attributes;
an encapsulation module configured to encapsulate the parsed attributes into an object for use by the requestor.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer apparatus, including:
at least one processor; and
a memory storing a computer program operable on the processor, wherein the processor executes the program to perform any of the steps of the data cache management method described above.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, performs the steps of any one of the data cache management methods described above.
The invention has one of the following beneficial technical effects: the scheme provided by the invention caches the data into the byte sequence, encapsulates the requested data into high-level programming language objects by designing the object encapsulator when the cached data is requested, and releases the objects after using up, thereby saving the memory size occupied by the high-level programming language objects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data cache management method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of requesting data in a cache according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a process of storing data into a cache according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a data cache management system according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In the embodiment of the present invention, the data refers to data managed by management software.
According to an aspect of the present invention, an embodiment of the present invention provides a data cache management method, as shown in fig. 1, which may include the steps of: s1, acquiring data to be managed from storage equipment; s2, sequencing the attributes of the data to be managed according to a preset sequence to generate a corresponding byte sequence; s3, storing the byte sequence into a cache; s4, responding to a request of a requester for acquiring the data in the cache, and acquiring a byte sequence corresponding to the data to be acquired based on the request; s5, sequentially analyzing the corresponding byte sequences according to the preset sequence of the attributes to obtain the corresponding attributes; s6, packaging the analyzed attributes into an object for the requester to use.
The scheme provided by the invention caches the data into the byte sequence, encapsulates the requested data into high-level programming language objects by designing the object encapsulator when the cached data is requested, and releases the objects after using up, thereby saving the memory size occupied by the high-level programming language objects.
In some embodiments, in step S1, the data to be managed is obtained from the storage device, and specifically, the data to be managed may determine uniqueness according to a type (e.g., drive, volume, enclosure, host, etc.) and an ID.
In some embodiments, step S2 is to sort the multiple attributes of the data to be managed according to a preset order to generate a corresponding byte sequence, specifically, the byte sequence of the data is obtained by sequentially storing different attributes according to a specified order (which can be customized), the attributes of the data to be managed may include double, float, integer, pool, char, byte, string, and the like, where 1 double occupies 8 bytes; 1 float takes 4 bytes; 1 integer occupies 4 bytes; 1 boul occupies 1 byte; 1 char occupies 1 byte; 1 byte occupies 1 byte; string ends with the character '\ 0'. Thus, after the multiple attributes of the data to be managed are sequenced according to the preset sequence, a corresponding byte sequence can be obtained, for example, after the multiple attributes of the data to be managed are sequenced according to the preset sequence, the multiple attributes are double, float, integer, pool, char, byte and string, then the first 8-bit byte in the obtained byte sequence represents the double attribute of the data to be managed, the next 4-bit byte represents the float attribute of the data to be managed, the next 4-bit byte represents the integer attribute of the data to be managed, and so on.
It should be noted that, since the byte number occupied by string is uncertain, the string is ended with a character '\0' when it is determined.
In some embodiments, step S2, sorting the plurality of attributes of the data to be managed according to a preset order to generate a corresponding byte sequence, further includes:
taking the type of the data to be managed as a key, and taking a data map object as a value to create a cache map object;
taking IDs of multiple data of the same type in the data to be managed as keys, and taking a byte sequence as a value to be placed in the same data map object;
and storing the data map object and the cache map object into the cache.
Specifically, the data of the same type may have different IDs, so that a TreeMap object (referred to as a "data Map object" and keys are stored in ascending order) may be established for each type of data, the keys are IDs of multiple data of the same type, and the value is a byte sequence of corresponding data. Then, a Map object (called a "cache Map object") is established, key is the type of data (such as drive, volume, enclosure, host, etc.), and value is the corresponding "data Map object". In some embodiments, a "cache Map object" may be created at the time of startup of the management software, and a blank "data Map object" may be created for each type of data and stored in the "cache Map object".
In some embodiments, in response to receiving a request for a requester to obtain data in the cache, obtaining a byte sequence corresponding to the data to be obtained based on the request, further includes:
judging whether the request comprises the type and the ID of the data to be acquired;
and responding to the request including the type and the ID of the data to be acquired, acquiring a corresponding data map object in the cache map object according to the type of the data to be acquired, and acquiring a corresponding byte sequence in the corresponding data map object according to the ID of the data to be acquired.
In some embodiments, further comprising:
and responding to the request that only the type of the data to be acquired is included, acquiring the corresponding data map object at the cache map object according to the type of the data to be acquired, and taking all byte sequences in the corresponding data map object as the corresponding byte sequences.
Specifically, as shown in fig. 2, when the data in the cache is requested, the specific process may be: when the data in the cache is requested, acquiring a corresponding data Map object from the cache Map object according to the type of the requested data; if the request has the data ID, acquiring the corresponding byte sequence from the data Map object, otherwise acquiring the byte sequences corresponding to all the data IDs of the type; and then, acquiring a corresponding object wrapper according to the data type, and for each byte sequence, wrapping the byte sequence into a high-level programming language object according to the attribute sequence and the occupied byte size. And finally, transferring the packaged high-level programming language object to the requester.
In some embodiments, further comprising:
and releasing the object to release the occupied memory after the object is used.
Specifically, when data in the cache is requested, an object wrapper is used to sequentially parse the attributes of the data according to the sequence of the attributes in the cache byte order, and wrap the attributes into a high-level programming language object (such as a Java object) for use by a requester, and after the high-level programming language object is used, the memory occupied by the object is released (if the high-level programming language object is Java, the memory can be processed by a JVM, and active release is not required). This saves the memory size occupied by the high-level programming language object itself.
In some embodiments, further comprising:
in response to the fact that the data to be managed are deleted in the storage device in the monitored mode, deleting the data in the corresponding data map object according to the type and the ID of the deleted data;
in response to the fact that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the corresponding data map object according to the type and the ID of the modified data;
and in response to monitoring that newly added data to be managed is newly added, storing the byte sequence corresponding to the newly added data into the corresponding data map object according to the type and the ID of the newly added data.
In some embodiments, in response to monitoring that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the corresponding data map object according to the type and ID of the modified data, further comprising:
and replacing the original byte sequence of the data map object with the byte sequence corresponding to the modified data.
Specifically, as shown in fig. 3, whether the data changes is monitored (initially, all the data are considered to have changes, that is, all the data to be managed are stored in the cache), and the changed data are updated into the cache (if the cache does not exist, the changed data are added into the cache, and if the actual data are deleted, the changed data are deleted from the cache). In some embodiments, a corresponding "data Map object" may be obtained from a "cache Map object" according to a changed data type, if the data is deleted, the data is deleted from the "data Map object", if the data is newly added, each attribute of the data is stored into a byte order according to a specified sequence, the data ID and the byte order are stored into the "data Map object" as a key value pair, if the data is modified, the corresponding byte order is obtained from the "data Map object" according to the data ID, and the latest data is stored into the byte order according to the specified sequence.
It should be noted that, whether the data changes may be monitored by the management software, or the storage device may notify that the data changes occur in the cache, where the newly added data may be newly added data to be managed (that is, if there is newly added data in the storage device, but the newly added data does not need to be managed, the newly added data does not need to be stored in the cache);
the scheme provided by the invention caches the data into the byte sequence, encapsulates the requested data into high-level programming language objects by designing the object encapsulator when the cached data is requested, and releases the objects after using up, thereby saving the memory size occupied by the high-level programming language objects.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a data cache management system 400, as shown in fig. 4, including:
an obtaining module 401, where the obtaining module 401 is configured to obtain data to be managed from a storage device;
a generating module 402, where the generating module 402 is configured to sort the multiple attributes of the data to be managed according to a preset order to generate a corresponding byte sequence;
a caching module 403, wherein the caching module 403 is configured to store the byte sequence into a cache;
a first response module 404, where the first response module 404 is configured to, in response to receiving a request for a requester to obtain data in the cache, obtain, based on the request, a byte sequence corresponding to the data to be obtained;
an analysis module 405, where the analysis module 405 is configured to sequentially analyze the corresponding byte sequences according to a preset sequence of the plurality of attributes to obtain the plurality of corresponding attributes;
an encapsulation module 406, the encapsulation module 406 configured to encapsulate the parsed plurality of attributes into an object for use by the requestor.
In some embodiments, the generation module 402 is further configured to:
taking the type of the data to be managed as a key, and taking the data map object as a value to create a cache map object;
taking IDs of multiple data of the same type in the data to be managed as keys, and taking a byte sequence as a value to be placed in the same data map object;
and storing the data map object and the cache map object into the cache.
In some embodiments, the first response module 404 is further configured to:
judging whether the request comprises the type and the ID of the data to be acquired;
and responding to the request including the type and the ID of the data to be acquired, acquiring a corresponding data map object in the cache map object according to the type of the data to be acquired, and acquiring a corresponding byte sequence in the corresponding data map object according to the ID of the data to be acquired.
In some embodiments, the first response module 404 is further configured to:
and responding to the request that only the type of the data to be acquired is included, acquiring the corresponding data map object at the cache map object according to the type of the data to be acquired, and taking all byte sequences in the corresponding data map object as the corresponding byte sequences.
In some embodiments, further comprising a second response module configured to:
and releasing the object to release the occupied memory after the object is used.
In some embodiments, further comprising a third response module configured to:
in response to the fact that the data to be managed are deleted in the storage device in the monitored mode, deleting the data in the corresponding data map object according to the type and the ID of the deleted data;
in response to monitoring that the data to be managed is modified in the storage device, updating a corresponding byte sequence in the corresponding data map object according to the type and ID of the modified data;
and in response to monitoring that newly added data to be managed is newly added, storing the byte sequence corresponding to the newly added data into the corresponding data map object according to the type and the ID of the newly added data.
In some embodiments, the third response module is further configured to:
and replacing the original byte sequence of the data map object with the byte sequence corresponding to the modified data.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 5, an embodiment of the present invention further provides a computer apparatus 501, comprising:
at least one processor 520; and
the memory 510, the memory 510 stores a computer program 511 that can be executed on the processor, and the processor 520 executes the program to perform the steps of any of the above data cache management methods.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 6, an embodiment of the present invention further provides a computer-readable storage medium 601, where the computer-readable storage medium 601 stores computer program instructions 610, and the computer program instructions 610, when executed by a processor, perform the steps of any of the above data cache management methods.
Finally, it should be noted that, as those skilled in the art can understand, all or part of the processes in the methods of the embodiments described above can be implemented by instructing relevant hardware through a computer program, and the program may be stored in a computer readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
In addition, the apparatuses, devices, and the like disclosed in the embodiments of the present invention may be various electronic terminal devices, such as a mobile phone, a Personal Digital Assistant (PDA), a tablet computer (PAD), a smart television, and the like, or may be a large terminal device, such as a server, and the like, and therefore the scope of protection disclosed in the embodiments of the present invention should not be limited to a specific type of apparatus, device. The client disclosed by the embodiment of the invention can be applied to any one of the electronic terminal devices in the form of electronic hardware, computer software or a combination of the electronic hardware and the computer software.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the functions defined above in the methods disclosed in the embodiments of the present invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, where the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A data cache management method is characterized by comprising the following steps:
acquiring data to be managed from a storage device;
sequencing the plurality of attributes of the data to be managed according to a preset sequence to generate a corresponding byte sequence;
storing the byte sequence into a cache;
responding to a request of a requester for acquiring the data in the cache, and acquiring a byte sequence corresponding to the data to be acquired based on the request;
sequentially analyzing the corresponding byte sequences according to the preset sequence of the attributes to obtain the corresponding attributes;
and encapsulating the plurality of analyzed attributes into an object for the requester to use.
2. The method of claim 1, wherein the plurality of attributes of the data to be managed are ordered in a preset order to generate a corresponding byte sequence, further comprising:
taking the type of the data to be managed as a key, and taking the data map object as a value to create a cache map object;
taking IDs of multiple data of the same type in the data to be managed as keys, and taking a byte sequence as a value to be placed in the same data map object;
and storing the data map object and the cache map object into the cache.
3. The method of claim 2, wherein in response to receiving a request for a requestor to obtain data in the cache, obtaining a byte sequence corresponding to data to be obtained based on the request, further comprising:
judging whether the request comprises the type and the ID of the data to be acquired;
and responding to the request including the type and the ID of the data to be acquired, acquiring a corresponding data map object in the cache map object according to the type of the data to be acquired, and acquiring a corresponding byte sequence in the corresponding data map object according to the ID of the data to be acquired.
4. The method of claim 3, further comprising:
and responding to the request that only the type of the data to be acquired is included, acquiring the corresponding data map object at the cache map object according to the type of the data to be acquired, and taking all byte sequences in the corresponding data map object as the corresponding byte sequences.
5. The method of claim 1, further comprising:
and releasing the object to release the occupied memory after the object is used.
6. The method of claim 2, further comprising:
in response to the fact that the data to be managed are deleted in the storage device in the monitored mode, deleting the data in the corresponding data map object according to the type and the ID of the deleted data;
in response to the fact that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the corresponding data map object according to the type and the ID of the modified data;
and in response to the monitoring of the newly added data to be managed, storing the byte sequence corresponding to the newly added data into the corresponding data map object according to the type and the ID of the newly added data.
7. The method of claim 6, wherein in response to monitoring that the data to be managed is modified in the storage device, updating the corresponding byte sequence in the corresponding data map object according to the type and ID of the modified data, further comprising:
and replacing the original byte sequence in the data map object with the byte sequence corresponding to the modified data.
8. A data cache management system, comprising:
an acquisition module configured to acquire data to be managed from a storage device;
a generation module configured to sort the plurality of attributes of the data to be managed according to a preset order to generate a corresponding byte sequence;
a caching module configured to store the byte sequence in a cache;
a first response module, configured to, in response to receiving a request for a requester to obtain data in the cache, obtain, based on the request, a byte sequence corresponding to the data to be obtained;
the analysis module is configured to sequentially analyze the corresponding byte sequences according to a preset sequence of the attributes to obtain the corresponding attributes;
an encapsulation module configured to encapsulate the parsed attributes into an object for use by the requestor.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to any of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.
CN202010537745.7A 2020-06-12 2020-06-12 Data cache management method, system, device and medium Active CN111722927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010537745.7A CN111722927B (en) 2020-06-12 2020-06-12 Data cache management method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010537745.7A CN111722927B (en) 2020-06-12 2020-06-12 Data cache management method, system, device and medium

Publications (2)

Publication Number Publication Date
CN111722927A CN111722927A (en) 2020-09-29
CN111722927B true CN111722927B (en) 2022-12-06

Family

ID=72566710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010537745.7A Active CN111722927B (en) 2020-06-12 2020-06-12 Data cache management method, system, device and medium

Country Status (1)

Country Link
CN (1) CN111722927B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784139A (en) * 2021-01-13 2021-05-11 多点(深圳)数字科技有限公司 Query method, query device, electronic equipment and computer readable medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181872A (en) * 2019-11-19 2020-05-19 视联动力信息技术股份有限公司 Data processing method and device
CN111221826A (en) * 2020-01-04 2020-06-02 苏州浪潮智能科技有限公司 Method, system, device and medium for processing shared cache synchronization message

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017600A1 (en) * 2008-07-15 2010-01-21 Viasat, Inc. Secure neighbor cache preload

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181872A (en) * 2019-11-19 2020-05-19 视联动力信息技术股份有限公司 Data processing method and device
CN111221826A (en) * 2020-01-04 2020-06-02 苏州浪潮智能科技有限公司 Method, system, device and medium for processing shared cache synchronization message

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
J2ME中面向对象的持久存储管理研究;卜登立等;《计算机工程》;20100605(第11期);全文 *

Also Published As

Publication number Publication date
CN111722927A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110019080B (en) Data access method and device
CN107733972A (en) A kind of short linking analytic method, device and equipment
CN111177043A (en) Method, system, device and medium for accelerating reading of field replaceable unit information
CN113553300B (en) File processing method and device, readable medium and electronic equipment
CN110620657A (en) Webpage word processing method, system and device
US20230198957A1 (en) Method to anonymize client mac addresses for cloud reporting
CN111722927B (en) Data cache management method, system, device and medium
CN111831915A (en) Method, device, electronic equipment and storage medium for responding to data query request
CN113253999B (en) Plug-in data access method, data source management system and interface access method
CN113163255B (en) Video playing method, device, terminal and storage medium
CN112511629B (en) Data compression method and system for account tree of MPT structure
CN111309264B (en) Method, system, device and medium for making directory quota compatible with snapshot
JP2004171258A (en) Permission token management system and program
CN111367861A (en) File caching method, system, device and medium
CN104378393A (en) Resource sharing method and corresponding device
CN113760390A (en) Page file loading method, device, equipment and storage medium
CN111881220A (en) Data operation method and device under list storage, electronic equipment and storage medium
CN113296854A (en) Data loading method and system, electronic equipment and storage medium
CN104750728A (en) Method and device for controlling web page request mode
CN111159146B (en) Processing method and device for embedded database
CN114138510A (en) Operation log generation method and related device
CN109948094B (en) WEB page loading method and device
CN113901273A (en) Data processing method and device
CN107346305B (en) Local caching method and device based on Velocity block instruction
CN117033827A (en) Data thermal updating method, system, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant