CN109669878B - Simplest cache data operation method - Google Patents

Simplest cache data operation method Download PDF

Info

Publication number
CN109669878B
CN109669878B CN201811450407.9A CN201811450407A CN109669878B CN 109669878 B CN109669878 B CN 109669878B CN 201811450407 A CN201811450407 A CN 201811450407A CN 109669878 B CN109669878 B CN 109669878B
Authority
CN
China
Prior art keywords
cache
key
write
hardware
writing
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
CN201811450407.9A
Other languages
Chinese (zh)
Other versions
CN109669878A (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.)
Global Digital Group Co Ltd
Original Assignee
Globaltour Group 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 Globaltour Group Ltd filed Critical Globaltour Group Ltd
Priority to CN201811450407.9A priority Critical patent/CN109669878B/en
Publication of CN109669878A publication Critical patent/CN109669878A/en
Application granted granted Critical
Publication of CN109669878B publication Critical patent/CN109669878B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0817Cache consistency protocols using directory methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a method for operating data in a simplest cache region, which comprises the following steps: separating the service logic from the concrete cache operation, when reading and writing the hardware data, the service logic program does not process the problem of cache reading and writing consistency, and the consistency of the cache area and the hardware data is kept through the operation of a cache area management program; packaging the buffer operation; when reading and writing data, checking the cache in the packaged operation, and starting cache initialization operation if the hardware data is not read into the cache; if the data is written, the parameter is provided with a specific hardware-writing method reference or execution body. According to the method, the cache dependence is configured first, the read-write logic of the cache region is independently encapsulated, the consistency judgment and the cache read-write are not concerned by the service logic program, the efficiency of program development when the cache access is designed is effectively improved, and the consistency of the cache read-write is ensured.

Description

Simplest cache data operation method
Technical Field
The invention relates to the fields of computer software technology, computing hardware technology and high performance, and particularly provides a simplest operation method for caching data, which simplifies a program and avoids the phenomenon of inconsistent reading and writing in a cache region.
Background
The role of the cache is to help the hardware run faster. The cache region read-write consistency means that when the cache is read, the data in the cache read by the service is real data in hardware; when writing the cache, the service is written into the cache region and the hardware, and the data of the cache region and the hardware are consistent. The traditional reading and writing method is that whether a key exists or not is judged, if the key does not exist, the data of the cache target is read, then the data is placed in a cache region, if the key exists, the cached data is read and written, and after the data is written, the data is written into a cache again. At present, most programs are complex in read-write logic to a cache, and the programs read and write through key values, wherein the keys are references, names or indexes to read and write values. Due to the complexity of the read-write logic of the cache, the efficiency of program development is not high when the cache access is designed, and the read-write consistency in the cache is difficult to ensure.
Disclosure of Invention
The invention aims to solve the problems and provides a method for operating the most simplified cache data, which can effectively improve the efficiency of program development when designing cache access and ensure the consistency of cache reading and writing.
A method for simplifying the operation of buffer data includes separating service logic from concrete buffer operation, using service logic program not to process the problem of buffer read-write consistency when hardware data is read-written, using buffer management program to operate to keep the consistency of buffer and hardware data.
The cache management program operation comprises the following steps:
dividing the cache into several basic types;
configuring the names, types, initialization methods and key writing hardware methods of all keys;
and declaring several basic operation methods for the cache type, encapsulating read-write consistency check in the operation methods, and executing the operation methods.
Further, the method comprises the following steps:
configuring a dependency relationship between keys;
triggering the dependency check between the keys, if the key depends on other keys, the built write operation affects other keys, so other keys are initialized.
Furthermore, any key belongs to one of several basic cache region types, the key reading operation method only comprises the reading operation of the cache region, the key writing operation needs to be carried out in the cache region corresponding to the key and hardware corresponding to the key, and the key reading and writing operation is completed by a cache region management program.
Further, the hardware write method or the execution body to the key may be bound at the time of configuration, or may be incorporated into the operation method provided by the buffer in a parameter manner.
Further, the operation method parameters include values, methods written to hardware, or references to executables, i.e., encapsulation of the executed operation.
Further, the operating method performs the steps of:
checking whether a key exists, and if the key does not exist, initializing the key value pair of the cache region of the key;
reading or writing key values;
if the method is a write operation, the key-associated or parametrically brought-in method or executable of the write hardware is executed before the write.
The invention has the beneficial effects that: according to the method, the cache dependence is configured first, the read-write logic of the cache region is independently encapsulated, the consistency judgment and the cache read-write are not needed to be concerned by the service logic program, the efficiency of program development during the design of cache access can be effectively improved, and the consistency of the cache read-write is ensured.
Drawings
FIG. 1 is a flow diagram of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The system comprises two types of operations of reading and writing on hardware, any one key operation comprises initialization of a key, when data represented by the key is read, the data can be read from the buffer only if the buffer is initialized, when the data represented by the key is written, the buffer needs to be initialized, and then the writing operation is executed.
According to the cache region data operation method, when the hardware data is read and written, the problem of cache read-write consistency is not solved by a service logic program, and the consistency of the cache region and the hardware data is kept through the operation of a cache region management program.
The cache is divided into a limited number of basic types, and the data format of each cache type is specified, wherein the types comprise a key-single value type, a key-list type, a key-set type and a key-index type.
Defining key attributes, configuring names, types, initialization methods and key write-in hardware methods of all keys;
configuring the dependency relationship between keys, and triggering the initialization of the dependency item by the change of the dependency item, for example, for the same table, all records of the table can be used as a key value pair A, all the records can also be used as a key value pair B, and B depends on A.
The basic operation method of the buffer area is defined, the parameter of the operation method comprises a key, and if the operation method is a setting method, the value, the method written into hardware or the reference of an executive body are also included.
The method comprises the following steps of packaging read-write consistency check in an operation method, wherein the basic operation method comprises the following specific implementation flows:
1) calling a cache region, and inputting a key to acquire the type of the cache region;
2) checking whether a key exists, and if the key does not exist, initializing the key value pair of the cache region of the key;
3) performing reading/writing key values;
4) if the method is a write operation, executing a method or an execution body for writing hardware associated with the key in the parameter or brought in a parameter mode before writing, then triggering tolerance check between the keys, if the condition that the write operation of the key affects other keys is detected, initializing other keys, and clearing a dependence cache; if the operation is a read operation, directly reading data from the cache region;
5) returning to the application program, and ending the operation.
For example, we can specify key types such as key value type simple type (one key corresponds to one value), list type (one key corresponds to an ordered list of values), set type (one key corresponds to multiple unordered and non-repeated values), index type (one key corresponds to a secondary key value pair), and the like.
If the technology is used for database buffering, in order to quickly query data, an index type key value type is used for representing the buffering of a list, an index type key with the name of keyName can be configured, a secondary index of the index type key is an id number, an initialization function of the index type key obtains all rows of the list, and then a key object of the index type, namely cacheForMap (keyName), is obtained through a key value of the key in a program; get (id1) to obtain the line information with id 1.
Although the present invention has been described with reference to the above embodiments, the scope of the present invention is not limited thereto, and any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the scope of the present invention without departing from the concept of the present invention.

Claims (3)

1. A method for operating the most simplified cache data is characterized in that a service logic and a specific cache operation are separated, when hardware data is read and written, a service logic program does not process the problem of cache read-write consistency, the consistency of a cache area and the hardware data is kept through the operation of a cache area management program, and the operation of the cache area management program specifically comprises the following steps:
dividing the cache into several basic types;
configuring the names, types, initialization methods and key writing hardware methods of all keys;
declaring a basic operation method for the cache type, encapsulating read-write consistency check in the operation method, and executing the operation method;
the parameters include: at least one of a value, a method of writing to hardware, or a reference to an executable, the so-called executable being an encapsulation of an executed operation;
any key belongs to one of several basic cache region types, the key reading operation method only comprises the reading operation of the cache region, the key writing operation needs to be written into the cache region corresponding to the key and hardware corresponding to the key, and the key reading and writing operation is completed by a cache region management program;
the operating method comprises the following steps:
checking whether a key exists, and if the key does not exist, initializing the key value pair of the cache region of the key;
reading or writing key values;
if the method is a write operation, the key-associated or parametrically brought-in method or executable of the write hardware is executed before the write.
2. The method of claim 1, further comprising:
configuring a dependency relationship between keys;
the dependency check between keys is triggered, and if the key depends on other keys, the write operation of the key affects the other keys, so the other keys are initialized.
3. The method of claim 1, wherein the hardware write method or the execution entity to the key can be bound at configuration time or parametrically brought into the operation method provided by the buffer.
CN201811450407.9A 2018-11-30 2018-11-30 Simplest cache data operation method Active CN109669878B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811450407.9A CN109669878B (en) 2018-11-30 2018-11-30 Simplest cache data operation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811450407.9A CN109669878B (en) 2018-11-30 2018-11-30 Simplest cache data operation method

Publications (2)

Publication Number Publication Date
CN109669878A CN109669878A (en) 2019-04-23
CN109669878B true CN109669878B (en) 2021-04-02

Family

ID=66144685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811450407.9A Active CN109669878B (en) 2018-11-30 2018-11-30 Simplest cache data operation method

Country Status (1)

Country Link
CN (1) CN109669878B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111241455B (en) * 2020-01-22 2023-08-25 抖音视界有限公司 Data processing apparatus, computer device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN108052551A (en) * 2017-11-28 2018-05-18 北京航天云路有限公司 A kind of method for a large amount of time series datas of storage realized on REDIS

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101146127B (en) * 2007-10-30 2010-06-09 金蝶软件(中国)有限公司 A client buffer update method and device in distributed system
US8768902B2 (en) * 2010-06-11 2014-07-01 Microsoft Corporation Unified concurrent changes to data, schema, and application
CN103959253B (en) * 2011-12-01 2018-07-17 英特尔公司 Hardware based memory migration and re-synchronization method and system
CN103116618B (en) * 2013-01-28 2015-09-30 南开大学 Based on Telefile mirror method and the system of the lasting buffer memory of client
CN103218402B (en) * 2013-03-19 2016-07-06 上海宝信软件股份有限公司 General database data structure and data mover system and method thereof
CN104156396B (en) * 2014-07-16 2017-12-01 成都康赛信息技术有限公司 The method and system of database performance are improved under big data environment
CN107038222B (en) * 2017-03-24 2020-02-28 福建天泉教育科技有限公司 Database cache implementation method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN108052551A (en) * 2017-11-28 2018-05-18 北京航天云路有限公司 A kind of method for a large amount of time series datas of storage realized on REDIS

Also Published As

Publication number Publication date
CN109669878A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
US11556396B2 (en) Structure linked native query database management system and methods
US6061689A (en) Object aggregation representation of relational database rows having nontraditional datatypes
US8364909B2 (en) Determining a conflict in accessing shared resources using a reduced number of cycles
CN108536761A (en) Report data querying method and server
CN106844682B (en) Method for interchanging data, apparatus and system
US20150161012A1 (en) Backup of in-memory databases
US11693912B2 (en) Adapting database queries for data virtualization over combined database stores
EP2797013B1 (en) Database update execution according to power management schemes
US20050246685A1 (en) Object oriented ADN and method of converting a non-object oriented computer language to an object oriented computer language
US20070250517A1 (en) Method and Apparatus for Autonomically Maintaining Latent Auxiliary Database Structures for Use in Executing Database Queries
CN111367989B (en) Real-time data index calculation system and method
US20180300147A1 (en) Database Operating Method and Apparatus
CN103699655B (en) Method and device for internationalizing databases and method and system for converting data
CN102289513A (en) Method and system for obtaining internal files of virtual machine
CN104423982A (en) Request processing method and device
US5890160A (en) Object representation of relational database cells having nontraditional large object datatypes
CN103617167A (en) Universal metadata/ relation mapping frame
CN109669878B (en) Simplest cache data operation method
CN109960709B (en) Database driver processing method, device, equipment and storage medium
CN114443615A (en) Database management system, related apparatus, method and medium
CN112970011A (en) Recording pedigrees in query optimization
CN114443680A (en) Database management system, related apparatus, method and medium
CN109086170A (en) A kind of data base backup recovery method and device
US11048664B2 (en) Log destaging from fixed-size log portion
CN103150408B (en) Real-time data base finds data base the System and method for accessed according to calling the roll

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 518001 no.01-03, 17th floor, block B, building 10, Shenzhen Bay science and technology ecological park, No.10, Gaoxin South 9th Road, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: Global Digital Group Co.,Ltd.

Address before: 518001 no.01-03, 17th floor, block B, building 10, Shenzhen Bay science and technology ecological park, No.10, Gaoxin South 9th Road, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Patentee before: GLOBALTOUR Group Ltd.