WO2020181810A1 - 应用于集群内多级缓存的数据处理方法和装置 - Google Patents
应用于集群内多级缓存的数据处理方法和装置 Download PDFInfo
- Publication number
- WO2020181810A1 WO2020181810A1 PCT/CN2019/117410 CN2019117410W WO2020181810A1 WO 2020181810 A1 WO2020181810 A1 WO 2020181810A1 CN 2019117410 W CN2019117410 W CN 2019117410W WO 2020181810 A1 WO2020181810 A1 WO 2020181810A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- host
- cache
- local cache
- service data
- version information
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
Definitions
- This application relates to the technical field of multi-level caching, and in particular to a data processing method, device, computer equipment and storage medium applied to multi-level caching in a cluster.
- a distributed system such as a financial system or a living mall system, it usually includes a cluster composed of multiple hosts.
- Each host in the cluster serves as an application node and accesses the same database.
- Each host is locally equipped with a local cache. The inventor realizes that the host first obtains data from the local cache during transaction processing. When the data in the local cache fails to be normally obtained, then obtains the data from the database.
- each host Locally cached data often fails at the same time due to data aging and other reasons. At this time, each host needs to retrieve data from the database separately, and a large amount of data frequently accesses the database, which reduces the transaction processing speed.
- the purpose of this application is to provide a data processing method, device, computer equipment and storage medium applied to a multi-level cache in a cluster to solve the above-mentioned problems in the prior art.
- this application provides a data processing method applied to multi-level cache in a cluster.
- the cluster includes a first host and a second host, the local cache of the first host is the first local cache, the local cache of the second host is the second local cache, and the data processing The method is applied to the first host and includes: executing an instruction to read the required business data from the first local cache; when the business data cannot be read from the first local cache, executing the read business from the network cache system Data instruction; when the business data cannot be read from the network cache system, access the database to read the business data; after the access database reads the business data, write the business data into the first local cache and network cache system , Where, after the network cache system is written with the business data, it publishes the message of the write operation to the second host, and the second host is used to monitor the message published by the network cache system; when the message of the write operation is monitored, the business data is written To the second local cache.
- the present application provides a data processing device applied to a multi-level cache in a cluster.
- the cluster includes a first host and a second host.
- the local cache of the first host is the first local cache
- the local cache of the second host is the second local cache. Both the first host and the second host include the multi-level application in the cluster.
- the data processing device includes a first reading module, a second reading module, a third reading module, a first writing module, a monitoring module, and a second writing module.
- a reading module is used to read the required business data from the first local cache; the second reading module of the first host is used when the first reading module cannot read the business data from the first local cache , Read business data from the network cache system; the third reading module of the first host is used to access the database to read the business data when the second reading module cannot read the business data from the network cache system; first The first writing module of the host is used to write the business data into the first local cache and network cache system after the third reading module accesses the database to read the business data; the monitoring module of the second host is used to monitor the network The message issued by the caching system, where the network caching system publishes the message of the write operation after the business data is written; the second write module of the second host is used to write the business data to the The second local cache.
- this application provides a computer device.
- the cluster includes a first host and a second host, the local cache of the first host is the first local cache, the local cache of the second host is the second local cache, and the computer device is the first host, including a memory, a processor, and A computer program on the memory and running on the processor.
- the processor executes the program, the following steps provided in this application are implemented: execute the instruction to read the required service data from the first local cache; When the business data is read in the network cache system, the instruction to read the business data from the network cache system is executed; when the business data cannot be read from the network cache system, the database is accessed to read the business data; the business data is read in the database After data, the business data is written into the first local cache and network cache system. After the network cache system is written with the business data, it publishes the write operation message to the second host, and the second host is used to monitor the network cache system. When the message of the write operation is monitored, the business data is written to the second local cache.
- the present application provides a non-volatile computer-readable storage medium.
- the cluster includes a first host and a second host, the local cache of the first host is the first local cache, the local cache of the second host is the second local cache, the non-volatile computer-readable storage medium is located on the first host, and
- a computer program is stored on the computer, and when the computer program is executed by the processor, the following steps are implemented: execute the instruction to read the required business data from the first local cache; when the business data cannot be read from the first local cache, execute Instructions to read business data from the network cache system; when the business data cannot be read from the network cache system, access the database to read the business data; after the access database reads the business data, write the business data to the first
- the network cache system publishes write operation messages to the second host after the business data is written, and the second host is used to monitor the messages issued by the network cache system; when the write operation is monitored When sending a message, write business data to the second local cache.
- the data processing method, device, computer equipment and storage medium applied to the multi-level cache in the cluster provided in this application at least achieve the following technical effects: it can increase the speed of transaction operation execution, and at the same time, it can increase the speed of host processing transaction operations in the cluster .
- FIG. 1 is a flowchart of a data processing method applied to a multi-level cache in a cluster provided by an embodiment of the application;
- FIG. 2 is a block diagram of a data processing device applied to a multi-level cache in a cluster provided by an embodiment of the application;
- Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the application.
- the data processing method, device, computer equipment and storage medium applied to the multi-level cache in the cluster provided by this application.
- the cluster includes multiple hosts, each of which can perform operations in distributed transactions, and a local cache is set locally on each host , Store business data. During the execution of transaction operations, obtaining data through the local cache can increase the speed of operation execution, thereby improving the completion speed of the overall transaction.
- the local cache can be regarded as a first-level cache.
- any host in the cluster can access the network cache system to obtain data when the local cache cannot obtain the data, and when the data cannot be obtained through the network cache system, go to the database to obtain the data. Data, and, after accessing the database, update the local cache and network cache system.
- FIG. 1 is a flowchart of a data processing method applied to multi-level cache in a cluster according to an embodiment of the application.
- This embodiment provides a data processing method applied to multi-level cache in a cluster, wherein the cluster includes multiple hosts
- the first host and the second host in the cluster are taken as an example for description.
- the local cache of the first host is defined as the first local cache
- the local cache of the second host is defined as the second local cache.
- the data processing method applied to the multi-level cache in the cluster provided by this embodiment includes the following steps S1 to S7.
- Step S1 The first host executes an instruction to read required service data from the first local cache.
- the business data required by the first host is first obtained from the first local cache.
- the locally cached data has a certain Timeliness, when the locally cached data becomes invalid, the first host cannot read the service data from the first local cache.
- step S2 When the first host cannot read the business data from the first local cache, the following step S2 is executed, and when the first host can read the business data from the first local cache, execute it using the read business data Transaction operation.
- Step S2 The first host executes an instruction to read service data from the network cache system.
- the local cache is used as the first-level cache
- the network cache system is used as the second-level cache.
- the business data cannot be read in the first-level cache, it is read through the second-level cache.
- step S3 When the first host cannot read the business data from the network cache system, perform the following step S3. When the first host can read the business data from the network cache system, use the read business data to perform transaction operations At the same time, store the read business data in the first local cache.
- the network cache system can use the Redis storage system, and the local cache can use the high-speed buffer memory.
- the Redis storage system provides each host with an interface for accessing the Redis storage system.
- This step S2 specifically includes: the first host calls the interface for accessing the Redis storage system to read business data from the Redis storage system.
- Step S3 The first host accesses the database to read the business data.
- the database needs to be accessed.
- the first host uses the business data read from the database to perform transaction operations by accessing the database.
- the following step S4 is continued.
- Step S4 The first host writes the service data into the first local cache and network cache system.
- the first host In addition to performing transaction operations using the business data read from the database, the first host also writes the read business data into the first local cache and network cache system, so that the next time the data is read, it can The business data is read from the first local cache, and when the business data in the first local cache becomes invalid, the business data can be read from the network cache system.
- Step S5 After the network cache system is written into the service data, it publishes the write operation message to the second host.
- the network cache system when the network cache system is written with the business data, it publishes the write operation message to the hosts in the cluster.
- the network cache system can publish the write operation information to all the hosts in the cluster by broadcasting. Message; or, alternatively, the network cache system can publish write operation messages to other hosts in the cluster except the first host (the host that writes business data to the network cache system).
- the cluster Hosts other than the first host include the second host.
- Step S6 The second host monitors the message issued by the network caching system.
- Each host has the function of monitoring messages issued by the network caching system. Therefore, after the network caching system releases the message of the write operation to the second host, the second host can monitor the message, and when the second host monitors the write operation When the message is sent, perform the following step S7.
- Step S7 The second host writes the service data into the second local cache.
- the host obtains the business data according to the priority of the local cache, the network cache system and the database when performing the transaction operation, which can improve the execution speed of the transaction operation; After a host obtains the business data from the database, it updates the data in its local cache to increase the probability that it will obtain the business data through the local cache next time, and updates the data of the network cache system. Spread to the local caches of other hosts in the cluster, increasing the probability that other hosts can obtain business data through the local cache, thereby increasing the overall processing speed of the hosts in the cluster.
- the data processing method applied to the multi-level cache in the cluster further includes the following steps: the first host modifies the value of the business data in the first local cache and the database, and the first host modifies the modified business data in the database.
- the data is synchronized to the network cache system.
- the first host needs to modify the value of the business data in the process of executing the transaction operation. For example, when a purchase occurs, the value of the remaining inventory in the inventory database needs to be modified. At this time, while modifying the value of the business data in the database, also modify the value of the business data in the first local cache, so that the value of the business data in the first local cache can be kept up to date. In subsequent transaction operations, the value of the business data obtained through the first local cache is the latest value; In addition, the first host synchronizes the modified service data in the database to the network cache system, so that the value of the service data in the network cache system is kept up to date. In subsequent transaction operations, both the first host and the second host The value of the business data that can be obtained through the network cache system is the latest value.
- the step of the first host modifying the value of the service data in the first local cache includes: the first host obtains the version information of the service data in the first local cache to obtain the first version information; the first host obtains the network Cache the version information of the service data in the system to obtain the second version information; the first host determines whether the first version information is the same as the second version information; when the first version information is the same as the second version information, the first host modifies the first The value of the business data in the local cache; when the first version information is different from the second version information, the first host first synchronizes the business data in the network cache system to the first local cache, and then modifies the business data in the first local cache Value.
- the first The value of the business data obtained by a host from the first local cache may have lags behind the current value.
- the version information of the data is set for management, That is, when the first host modifies the value of the service data in the first local cache, it first compares the version information of the service data in the first local cache with the version information of the service data in the network cache system.
- the service data in the cache system may have been modified by other hosts, and the value of the service data in the first local cache of the first host is no longer the current value after the modification. Therefore, the service data in the network cache system is now synchronized to the first
- the local cache ensures that the value of the first local cache is the current value, and then the value of the business data in the first local cache is modified. For example, in the process of panic buying, if a purchase occurs on each host, the value of the remaining inventory in the inventory database will be modified, and the value of the remaining inventory will be synchronized to the network cache system. When each host is modifying the value of the local cache, it needs to pass The remaining inventory version information ensures that the value of the remaining inventory cached locally is the current value of the remaining inventory.
- the above application provides the data processing method applied to the multi-level cache in the cluster, and this application also provides a data processing device applied to the multi-level cache in the cluster. It should be noted that the data processing device applied to the multi-level cache in the cluster provided in this application corresponds to the above-mentioned data processing method applied to the multi-level cache in the cluster, and the relevant points can be referred to each other.
- Fig. 2 is a block diagram of a data processing device applied to multi-level cache in a cluster according to an embodiment of the application.
- this embodiment provides a data processing device applied to multi-level cache in a cluster, wherein:
- the cluster includes several hosts, and each host includes the data processing device.
- the cluster includes a first host and a second host as an example, where the local cache of the first host is the first local cache, and the second The local cache of the host is the second local cache.
- Both the first host and the second host include a data processing device.
- the data processing device includes a first reading module 10, a second reading module 20, and a third reading module.
- the reading module 30, the first writing module 40, the monitoring module 50 and the second writing module 60 wherein:
- the first reading module 10 of the first host is used to read the required service data from the first local cache; the second reading module 20 of the first host is used when the first reading module 10 cannot access the first local cache.
- the service data is read from the cache
- the service data is read from the network cache system;
- the third reading module 30 of the first host is used when the second reading module 20 cannot read the service data from the network cache system , Access to the database to read business data;
- the first write module 40 of the first host is used to write the business data into the first local cache and network cache system after the third read module 30 accesses the database to read the business data ;
- the monitoring module 50 of the second host is used to monitor the messages issued by the network cache system, where the network cache system is used to post the message of the write operation after the service data is written;
- the second write module 60 of the second host is used when When the message of the write operation is monitored, the service data is written to the second local cache.
- the first reading module 10 of the second host is used to read the required service data from the second local cache; the second reading module 20 of the second host is used when the first reading module 10 cannot read 2.
- the service data is read from the local cache
- the service data is read from the network cache system;
- the third reading module 30 of the second host is used when the second reading module 20 cannot read the service from the network cache system
- the database is accessed to read the business data;
- the first writing module 40 of the second host is used to write the business data into the second local cache and network cache after the third reading module 30 accesses the database to read the business data
- the monitoring module 50 of the first host is used to monitor the messages issued by the network cache system, where the network cache system is used to publish the message of the write operation after the service data is written;
- the second write module 60 of the first host is used When the message of the write operation is monitored, the service data is written to the first local cache.
- the data processing device further includes a modification module and a synchronization module, wherein the modification module of the first host is used to modify the value of the business data in the first local cache and the database; the synchronization module of the first host is used to modify the data in the database The subsequent business data is synchronized to the network cache system.
- the modification module of the second host is used to modify the value of the business data in the second local cache and the database; the synchronization module of the second host is used to synchronize the modified business data in the database to the network cache system.
- the modification module includes: a first acquisition unit, a second acquisition unit, a judgment unit, a first modification unit, and a second modification unit, wherein the acquisition unit of the first host is used to acquire the service data in the first local cache. Version information to obtain the first version information; the second obtaining unit of the first host is used to obtain the version information of the service data in the network cache system to obtain the second version information; the judgment unit of the first host is used to judge whether the first version information is Whether the second version information is the same; the first modification unit of the first host is used to modify the value of the service data in the first local cache when the first version information is the same as the second version information; the second modification unit of the first host is used When the first version information is different from the second version information, first synchronize the service data in the network cache system to the first local cache, and then modify the value of the service data in the first local cache.
- the acquisition unit of the second host is used to acquire the version information of the business data in the second local cache to obtain the first version information;
- the second acquisition unit of the second host is used to acquire the version information of the business data in the network cache system to obtain The second version information;
- the judgment unit of the second host is used to judge whether the first version information is the same as the second version information;
- the first modification unit of the second host is used to modify when the first version information is the same as the second version information
- the second modification unit of the second host is used to first synchronize the service data in the network cache system to the second local cache when the first version information is different from the second version information, and then Then modify the value of the service data in the second local cache.
- the network cache system is a Redis storage system
- the local cache is a high-speed buffer memory.
- the second reading module 20 when the second reading module 20 reads business data from the network cache system, it calls an interface for accessing the Redis storage system to read the business data from the Redis storage system.
- the embodiment of the application also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, Or a server cluster composed of multiple servers), etc.
- the computer device 02 in this embodiment at least includes but is not limited to: a memory 021 and a processor 022 that can be communicably connected to each other through a system bus, as shown in FIG. 3. It should be pointed out that FIG. 3 only shows the computer device 02 with components 021-222, but it should be understood that it is not required to implement all the shown components, and more or fewer components may be implemented instead.
- the memory 021 (readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
- the memory 021 may be an internal storage unit of the computer device 02, such as a hard disk or memory of the computer device 02.
- the memory 021 may also be an external storage device of the computer device 02, for example, a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD card, Flash Card, etc.
- the memory 21 may also include both the internal storage unit of the computer device 02 and its external storage device.
- the memory 021 is generally used to store the operating system and various application software installed in the computer device 02, such as the program code of the data processing device applied to the multi-level cache in the cluster in the above embodiment.
- the memory 021 can also be used to temporarily store various types of data that have been output or will be output.
- the processor 022 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
- the processor 022 is generally used to control the overall operation of the computer device 02.
- the processor 022 is configured to run program codes or process data stored in the memory 021, for example, run a data processing device applied to a multi-level cache in a cluster.
- the embodiment of the application also provides a non-volatile computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Disk, Optical Disk, Server, App Store, etc., on which A computer program is stored, and the corresponding function is realized when the program is executed by the processor.
- the non-volatile computer-readable storage medium of this embodiment is used to store the data processing device applied to the multi-level cache in the cluster, and when executed by the processor, realizes the data processing method applied to the multi-level cache in the cluster in the above embodiment.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种应用于集群内多级缓存的数据处理方法和装置。集群包括具有第一本地缓存的第一主机和具有第二本地缓存的第二主机,该方法包括:第一主机无法从第一本地缓存中读取到业务数据时,从网络缓存系统中读取业务数据,无法从网络缓存系统中读取到业务数据时,访问数据库读取业务数据,并在访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中;网络缓存系统被写入业务数据后,向第二主机发布写操作的消息;第二主机监听到写操作的消息时,将业务数据写入到第二本地缓存。本方法合理实现数据缓存中的多级缓存,能够提升事务处理速度。
Description
相关申请的交叉引用
本申请申明享有2019年03月13日递交的申请号为CN 201910190657.1、名称为“应用于集群内多级缓存的数据处理方法和装置”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
本申请涉及多级缓存技术领域,尤其涉及一种应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质。
对于金融系统或生活商场系统等分布式系统,通常包括由多个主机构成的集群,集群中的每个主机作为一个应用节点,会访问相同的数据库。各主机本地设置有本地缓存,发明人意识到主机在事务处理的过程中,首先向本地缓存获取数据,当本地缓存中的数据失效无法正常获取时,再向数据库获取,一般情况下,各主机本地缓存的数据,由于数据时效等原因,经常会出现同时失效的情形,此时,各主机都需要分别向数据库重新获取数据,出现大量数据频繁访问数据库的现象,降低事务的处理速度。
因此,提供一种应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质,以合理实现数据缓存中的多级缓存,提升事务处理的速度,是本领域急需解决的技术问题。
发明内容
本申请的目的是提供一种应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质,用于解决现有技术存在的上述问题。
为了实现上述目的,本申请提供了一种应用于集群内多级缓存的数据处理 方法。
该应用于集群内多级缓存的数据处理方法中,集群包括第一主机和第二主机,第一主机的本地缓存为第一本地缓存,第二主机的本地缓存为第二本地缓存,数据处理方法应用于第一主机,包括:执行从第一本地缓存中读取所需的业务数据的指令;当无法从第一本地缓存中读取到业务数据时,执行从网络缓存系统中读取业务数据的指令;当无法从网络缓存系统中读取到业务数据时,访问数据库来读取业务数据;在访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中,其中,网络缓存系统被写入业务数据后,向第二主机发布写操作的消息,第二主机用于监听网络缓存系统发布的消息;当监听到写操作的消息时,将业务数据写入到第二本地缓存。
为了实现上述目的,本申请提供了一种应用于集群内多级缓存的数据处理装置。
集群包括第一主机和第二主机,第一主机的本地缓存为第一本地缓存,第二主机的本地缓存为第二本地缓存,第一主机和第二主机均包括该应用于集群内多级缓存的数据处理装置,数据处理装置包括第一读取模块、第二读取模块、第三读取模块、第一写入模块、监听模块和第二写入模块,其中:第一主机的第一读取模块用于从第一本地缓存中读取所需的业务数据;第一主机的第二读取模块用于当第一读取模块无法从第一本地缓存中读取到业务数据时,从网络缓存系统中读取业务数据;第一主机的第三读取模块用于当第二读取模块无法从网络缓存系统中读取到业务数据时,访问数据库读取业务数据;第一主机的第一写入模块用于在第三读取模块访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中;第二主机的监听模块用于机监听网络缓存系统发布的消息,其中,网络缓存系统被写入业务数据后,发布写操作的消息;第二主机的第二写入模块用于当监听到写操作的消息时,将业务数据写入到第二本地缓存。
为了实现上述目的,本申请提供了一种计算机设备。
集群包括第一主机和第二主机,第一主机的本地缓存为第一本地缓存,第 二主机的本地缓存为第二本地缓存,该计算机设备为第一主机,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现本申请提供的如下步骤:执行从第一本地缓存中读取所需的业务数据的指令;当无法从第一本地缓存中读取到业务数据时,执行从网络缓存系统中读取业务数据的指令;当无法从网络缓存系统中读取到业务数据时,访问数据库来读取业务数据;在访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中,其中,网络缓存系统被写入业务数据后,向第二主机发布写操作的消息,第二主机用于监听网络缓存系统发布的消息;当监听到写操作的消息时,将业务数据写入到第二本地缓存。
为了实现上述目的,本申请提供了一种非易失性计算机可读存储介质。
集群包括第一主机和第二主机,第一主机的本地缓存为第一本地缓存,第二主机的本地缓存为第二本地缓存,该非易失性计算机可读存储介质位于第一主机,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:执行从第一本地缓存中读取所需的业务数据的指令;当无法从第一本地缓存中读取到业务数据时,执行从网络缓存系统中读取业务数据的指令;当无法从网络缓存系统中读取到业务数据时,访问数据库来读取业务数据;在访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中,其中,网络缓存系统被写入业务数据后,向第二主机发布写操作的消息,第二主机用于监听网络缓存系统发布的消息;当监听到写操作的消息时,将业务数据写入到第二本地缓存。
本申请提供的应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质,至少实现以下技术效果:能够提升事务操作执行的速度,同时,能够提升集群内主机处理事务操作的速度。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并 不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1为本申请实施例提供的应用于集群内多级缓存的数据处理方法的流程图;
图2为本申请实施例提供的应用于集群内多级缓存的数据处理装置的框图;
图3为本申请实施例提供的计算机设备的示意图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供的应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质,集群包括多个主机,各主机能够执行分布式事务中的操作,在每个主机本地均设置本地缓存,进行业务数据的存储,在事务操作的执行过程中,通过本地缓存获取数据,能够提升操作执行的速度,从而提升整体事务的完成速度,将本地缓存可以看作一级缓存。
同时,设置网络缓存系统作为二级缓存,集群内任意主机均可当本地缓存无法获取到数据时,访问网络缓存系统获取数据,而当通过网络缓存系统也无法获取数据时,再去访问数据库获取数据,并且,在访问数据库之后,更新本地缓存和网络缓存系统。
重要地是,网络缓存系统更新后,对集群内的其他主机发布消息,每个主机均能够监听网络缓存系统上发布的消息,因此,当网络缓存系统发布消息后,主机能够监听到消息,并将网络缓存系统的数据扩散至各自的本地缓存,更新其本地缓存,从而,一个主机从数据库中访问到数据后,可更新至集群内的所 有主机,从而整体上提升集群内主机处理事务操作的速度。
以下将通过具体地实施例进一步描述本申请提供的应用于集群内多级缓存的数据处理方法、装置、计算机设备及存储介质。
图1为本申请实施例提供的应用于集群内多级缓存的数据处理方法的流程图,该实施例提供了一种应用于集群内多级缓存的数据处理方法,其中,集群包括多个主机,该实施例中以集群中的第一主机和第二主机为例进行说明,定义第一主机的本地缓存为第一本地缓存,定义第二主机的本地缓存为第二本地缓存为例,如图1所示,该实施例提供的应用于集群内多级缓存的数据处理方法包括如下的步骤S1至步骤S7。
步骤S1:第一主机执行从第一本地缓存中读取所需的业务数据的指令。
为了提升操作执行的速度,在本地缓存中缓存一些业务数据,因此,在事务操作的执行过程中,第一主机需要的业务数据首先从第一本地缓存中获取,但是,本地缓存的数据具有一定的时效性,当本地缓存的数据失效时,第一主机无法从第一本地缓存中读取到业务数据。
当第一主机无法从第一本地缓存中读取到业务数据时,执行下述步骤S2,当第一主机能够从第一本地缓存中读取到业务数据时,利用读取到的业务数据执行事务操作。
步骤S2:第一主机执行从网络缓存系统中读取业务数据的指令。
本地缓存作为一级缓存,网络缓存系统作为二级缓存,当在一级缓存中读取不到业务数据时,通过二级缓存进行读取。
当第一主机无法从网络缓存系统中读取到业务数据时,执行下述步骤S3,当第一主机能够从网络缓存系统中读取到业务数据时,利用读取到的业务数据执行事务操作,同时,将读取到的业务数据存储在第一本地缓存中。
其中,网络缓存系统可采用Redis存储系统,本地缓存可采用高速缓冲存储器。
Redis存储系统向各个主机提供访问Redis存储系统的接口,该步骤S2具 体包括:第一主机调用该访问Redis存储系统的接口,从Redis存储系统中读取业务数据。
步骤S3:第一主机访问数据库来读取业务数据。
当在二级缓存中也读取不到业务数据时,需要访问数据库,此时,第一主机通过访问数据库,利用从数据库中读取到的业务数据执行事务操作。此外,在第一主机访问数据库读取到业务数据后,继续执行下述步骤S4。
步骤S4:第一主机将业务数据写入第一本地缓存和网络缓存系统中。
第一主机除了利用从数据库中读取到的业务数据执行事务操作之外,还将读取到的业务数据写入第一本地缓存和网络缓存系统中,从而在下次进行数据读取时,能够从第一本地缓存中读取到业务数据,在第一本地缓存中的业务数据失效时,能够从网络缓存系统中读取到业务数据。
步骤S5:网络缓存系统被写入业务数据后,向第二主机发布写操作的消息。
对于网络缓存系统,当网络缓存系统被写入业务数据后,向集群中的主机发布写操作的消息,可选地,网络缓存系统可通过广播的方式,向集群中的所有主机发布写操作的消息;或者,可选地,网络缓存系统可向集群中除第一主机(向网络缓存系统写入业务数据的主机)之外的其他主机发布写操作的消息,在该实施例中,集群中除第一主机之外的主机包括第二主机。
步骤S6:第二主机监听网络缓存系统发布的消息。
每个主机均具有监听网络缓存系统发布消息的功能,因而,网络缓存系统向第二主机发布写操作的消息后,第二主机能够监听到该消息,并且,当第二主机监听到写操作的消息时,执行下述步骤S7。
步骤S7:第二主机将业务数据写入到第二本地缓存。
采用本申请提供的应用于集群内多级缓存的数据处理方法,主机在进行事务操作时,按照本地缓存、网络缓存系统和数据库的先后优先级获取业务数据,能够提升事务操作执行的速度;同时,一个主机从数据库获取到业务数据后, 更新自身本地缓存的数据,以增加自身下一次通过本地缓存获取到业务数据的几率,并且,更新网络缓存系统的数据,通过网络缓存系统,将业务数据扩散到集群内其他主机的本地缓存中,增加其他主机通过本地缓存获取到业务数据的几率,从而整体上提升集群内主机处理事务操作的速度。
在一种实施例中,应用于集群内多级缓存的数据处理方法还包括如下的步骤:第一主机修改第一本地缓存和数据库中业务数据的值,第一主机将数据库中修改后的业务数据同步至网络缓存系统中。
具体地,第一主机在执行事务操作的过程中,需要修改业务数据的值,例如发生一次购买,需要修改库存数据库中剩余库存的值,此时,在修改数据库中业务数据的值的同时,也修改第一本地缓存中业务数据的值,能够使第一本地缓存中业务数据的值保持最新的状态,在后续事务操作中,通过第一本地缓存获取到的业务数据的值为最新值;并且,第一主机将数据库中修改后的业务数据同步至网络缓存系统中,使得网络缓存系统中业务数据的值保持最新的状态,在后续事务操作中,无论第一主机还是第二主机,均能够通过网络缓存系统获取到的业务数据的值为最新值。
在一种实施例中,第一主机修改第一本地缓存中业务数据的值的步骤包括:第一主机获取第一本地缓存中业务数据的版本信息,得到第一版本信息;第一主机获取网络缓存系统中业务数据的版本信息,得到第二版本信息;第一主机判断第一版本信息与第二版本信息是否相同;当第一版本信息与第二版本信息相同时,第一主机修改第一本地缓存中业务数据的值;当第一版本信息与第二版本信息不同时,第一主机先将网络缓存系统中的业务数据同步至第一本地缓存,然后再修改第一本地缓存中业务数据的值。
采用该实施例提供的应用于集群内多级缓存的数据处理方法,当第二主机对数据库中的业务数据值进行修改,并且将数据库中修改后的业务数据同步至网络缓存系统中以后,第一主机从第一本地缓存中获取到的业务数据的值可能已经滞后当前值,为了避免第一主机修改第一本地缓存中业务数据时的原值滞 后当前值,设置数据的版本信息进行管理,也即,第一主机修改第一本地缓存中业务数据的值时,首先对第一本地缓存中业务数据的版本信息和网络缓存系统中的业务数据的版本信息进行比对,如果不一致,说明网络缓存系统中的业务数据可能已经被其他主机修改,而第一主机的第一本地缓存中业务数据的值已经不是修改后的当前值,因此,现将网络缓存系统中的业务数据同步至第一本地缓存,保证第一本地缓存的值是当前值,然后再对第一本地缓存中的业务数据的值进行修改。例如在抢购过程中,每个主机上发生一次购买,均会修改库存数据库中剩余库存的值,并将剩余库存的值同步到网络缓存系统,而各主机在修改本地缓存的值,需要先通过剩余库存版本信息保证本地缓存的剩余库存的值是剩余库存的当前值。
以上为本申请提供的应用于集群内多级缓存的数据处理方法,本申请还提供了一种应用于集群内多级缓存的数据处理装置。需要说明的是,本申请提供的应用于集群内多级缓存的数据处理装置与上述应用于集群内多级缓存的数据处理方法相对应,相关之处可相互参考。
图2为本申请实施例提供的应用于集群内多级缓存的数据处理装置的框图,如图2所示,该实施例提供了一种应用于集群内多级缓存的数据处理装置,其中,集群包括若干主机,各个主机中均包括该数据处理装置,该实施例中以集群包括第一主机和第二主机为例进行说明,其中,第一主机的本地缓存为第一本地缓存,第二主机的本地缓存为第二本地缓存,第一主机和第二主机均包括数据处理装置,如图2所示,该数据处理装置包括第一读取模块10、第二读取模块20、第三读取模块30、第一写入模块40、监听模块50和第二写入模块60,其中:
第一主机的第一读取模块10用于从第一本地缓存中读取所需的业务数据;第一主机的第二读取模块20用于当第一读取模块10无法从第一本地缓存中读取到业务数据时,从网络缓存系统中读取业务数据;第一主机的第三读取模块30用于当第二读取模块20无法从网络缓存系统中读取到业务数据时,访问数 据库读取业务数据;第一主机的第一写入模块40用于在第三读取模块30访问数据库读取到业务数据后,将业务数据写入第一本地缓存和网络缓存系统中;第二主机的监听模块50用于机监听网络缓存系统发布的消息,其中,网络缓存系统被写入业务数据后,发布写操作的消息;第二主机的第二写入模块60用于当监听到写操作的消息时,将业务数据写入到第二本地缓存。
同时,第二主机的第一读取模块10用于从第二本地缓存中读取所需的业务数据;第二主机的第二读取模块20用于当第一读取模块10无法从第二本地缓存中读取到业务数据时,从网络缓存系统中读取业务数据;第二主机的第三读取模块30用于当第二读取模块20无法从网络缓存系统中读取到业务数据时,访问数据库读取业务数据;第二主机的第一写入模块40用于在第三读取模块30访问数据库读取到业务数据后,将业务数据写入第二本地缓存和网络缓存系统中;第一主机的监听模块50用于机监听网络缓存系统发布的消息,其中,网络缓存系统被写入业务数据后,发布写操作的消息;第一主机的第二写入模块60用于当监听到写操作的消息时,将业务数据写入到第一本地缓存。
可选地,数据处理装置还包括修改模块和同步模块,其中,第一主机的修改模块用于修改第一本地缓存和数据库中业务数据的值;第一主机的同步模块用于将数据库中修改后的业务数据同步至网络缓存系统中。第二主机的修改模块用于修改第二本地缓存和数据库中业务数据的值;第二主机的同步模块用于将数据库中修改后的业务数据同步至网络缓存系统中。
可选地,修改模块包括:第一获取单元、第二获取单元、判断单元、第一修改单元和第二修改单元,其中,第一主机的获取单元用于获取第一本地缓存中业务数据的版本信息,得到第一版本信息;第一主机的第二获取单元用于获取网络缓存系统中业务数据的版本信息,得到第二版本信息;第一主机的判断单元用于判断第一版本信息与第二版本信息是否相同;第一主机的第一修改单元用于当第一版本信息与第二版本信息相同时,修改第一本地缓存中业务数据的值;第一主机的第二修改单元用于当第一版本信息与第二版本信息不同时, 先将网络缓存系统中的业务数据同步至第一本地缓存,然后再修改第一本地缓存中业务数据的值。同时,第二主机的获取单元用于获取第二本地缓存中业务数据的版本信息,得到第一版本信息;第二主机的第二获取单元用于获取网络缓存系统中业务数据的版本信息,得到第二版本信息;第二主机的判断单元用于判断第一版本信息与第二版本信息是否相同;第二主机的第一修改单元用于当第一版本信息与第二版本信息相同时,修改第二本地缓存中业务数据的值;第二主机的第二修改单元用于当第一版本信息与第二版本信息不同时,先将网络缓存系统中的业务数据同步至第二本地缓存,然后再修改第二本地缓存中业务数据的值。
可选地,网络缓存系统为Redis存储系统,本地缓存为高速缓冲存储器。
可选地,第二读取模块20在从网络缓存系统中读取业务数据时,调用访问Redis存储系统的接口,从Redis存储系统中读取业务数据。
本申请实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。本实施例的计算机设备02至少包括但不限于:可通过系统总线相互通信连接的存储器021、处理器022,如图3所示。需要指出的是,图3仅示出了具有组件021-022的计算机设备02,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器021(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器021可以是计算机设备02的内部存储单元,例如该计算机设备02的硬盘或内存。在另一些实施例中,存储器021也可以是计算机设备02的外部存储设备,例如该计算机设备02上配备的插接式硬盘,智能存 储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备02的内部存储单元也包括其外部存储设备。本实施例中,存储器021通常用于存储安装于计算机设备02的操作系统和各类应用软件,例如上述实施例的应用于集群内多级缓存的数据处理装置的程序代码等。此外,存储器021还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器022在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器022通常用于控制计算机设备02的总体操作。本实施例中,处理器022用于运行存储器021中存储的程序代码或者处理数据,例如运行应用于集群内多级缓存的数据处理装置等。
本申请实施例还提供一种非易失性计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施例的非易失性计算机可读存储介质用于存储应用于集群内多级缓存的数据处理装置,被处理器执行时实现上述实施例的应用于集群内多级缓存的数据处理方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种应用于集群内多级缓存的数据处理方法,其中,所述集群包括第一主机和第二主机,所述第一主机的本地缓存为第一本地缓存,所述第二主机的本地缓存为第二本地缓存,所述数据处理方法应用于所述第一主机,包括:执行从所述第一本地缓存中读取所需的业务数据的指令;当无法从所述第一本地缓存中读取到所述业务数据时,执行从网络缓存系统中读取所述业务数据的指令;当无法从所述网络缓存系统中读取到所述业务数据时,访问数据库来读取所述业务数据;在访问所述数据库读取到所述业务数据后,将所述业务数据写入所述第一本地缓存和所述网络缓存系统中,其中,所述网络缓存系统被写入所述业务数据后,向所述第二主机发布写操作的消息,所述第二主机用于监听所述网络缓存系统发布的消息,当监听到所述写操作的消息时,将所述业务数据写入到所述第二本地缓存。
- 根据权利要求1所述的应用于集群内多级缓存的数据处理方法,其中,所述数据处理方法还包括:修改所述第一本地缓存和所述数据库中所述业务数据的值;将所述数据库中修改后的所述业务数据同步至所述网络缓存系统中。
- 根据权利要求2所述的应用于集群内多级缓存的数据处理方法,其中,修改所述第一本地缓存中所述业务数据的值的步骤包括:获取所述第一本地缓存中所述业务数据的版本信息,得到第一版本信息;获取所述网络缓存系统中所述业务数据的版本信息,得到第二版本信息;判断所述第一版本信息与所述第二版本信息是否相同;当所述第一版本信息与所述第二版本信息相同时,修改所述第一本地缓存 中所述业务数据的值;当所述第一版本信息与所述第二版本信息不同时,将所述网络缓存系统中的所述业务数据同步至所述第一本地缓存,然后再修改所述第一本地缓存中所述业务数据的值。
- 根据权利要求1所述的应用于集群内多级缓存的数据处理方法,其中,所述网络缓存系统为Redis存储系统,所述本地缓存为高速缓冲存储器。
- 根据权利要求4所述的应用于集群内多级缓存的数据处理方法,其中,执行从网络缓存系统中读取所述业务数据的指令的步骤包括:调用访问所述Redis存储系统的接口,从所述Redis存储系统中读取所述业务数据。
- 一种应用于集群内多级缓存的数据处理装置,其中,所述集群包括第一主机和第二主机,所述第一主机的本地缓存为第一本地缓存,所述第二主机的本地缓存为第二本地缓存,所述第一主机和所述第二主机均包括所述数据处理装置,所述数据处理装置包括第一读取模块、第二读取模块、第三读取模块、第一写入模块、监听模块和第二写入模块,其中:所述第一主机的第一读取模块用于从所述第一本地缓存中读取所需的业务数据;所述第一主机的第二读取模块用于当所述第一读取模块无法从所述第一本地缓存中读取到所述业务数据时,从网络缓存系统中读取所述业务数据;所述第一主机的第三读取模块用于当所述第二读取模块无法从所述网络缓存系统中读取到所述业务数据时,访问数据库读取所述业务数据;所述第一主机的第一写入模块用于在所述第三读取模块访问所述数据库读取到所述业务数据后,将所述业务数据写入所述第一本地缓存和所述网络缓存系统中;所述第二主机的监听模块用于机监听所述网络缓存系统发布的消息,其中,所述网络缓存系统被写入所述业务数据后,发布写操作的消息;所述第二主机的第二写入模块用于当监听到所述写操作的消息时,将所述业务数据写入到所述第二本地缓存。
- 根据权利要求6所述的应用于集群内多级缓存的数据处理装置,其中,所述数据处理装置还包括:修改模块和同步模块,其中:所述第一主机的修改模块用于修改所述第一本地缓存和所述数据库中所述业务数据的值;所述第一主机的同步模块用于将所述数据库中修改后的所述业务数据同步至所述网络缓存系统中。
- 根据权利要求7所述的应用于集群内多级缓存的数据处理装置,其中,所述修改模块包括:第一获取单元、第二获取单元、判断单元、第一修改单元和第二修改单元,其中:所述第一主机的获取单元用于获取所述第一本地缓存中所述业务数据的版本信息,得到第一版本信息;所述第一主机的第二获取单元用于获取所述网络缓存系统中所述业务数据的版本信息,得到第二版本信息;所述第一主机的判断单元用于判断所述第一版本信息与所述第二版本信息是否相同;所述第一主机的第一修改单元用于当所述第一版本信息与所述第二版本信息相同时,修改所述第一本地缓存中所述业务数据的值;所述第一主机的第二修改单元用于当所述第一版本信息与所述第二版本信息不同时,先将所述网络缓存系统中的所述业务数据同步至所述第一本地缓存,然后再修改所述第一本地缓存中所述业务数据的值。
- 根据权利要求6所述的应用于集群内多级缓存的数据处理装置,其中,所述网络缓存系统为Redis存储系统,所述本地缓存为高速缓冲存储器。
- 根据权利要求9所述的应用于集群内多级缓存的数据处理装置,其中,所述第二读取模块从网络缓存系统中读取所述业务数据时,具体执行的步骤包括:调用访问所述Redis存储系统的接口,从所述Redis存储系统中读取所述业务数据。
- 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其中,集群包括第一主机和第二主机,所述第一主机的本地缓存为第一本地缓存,所述第二主机的本地缓存为第二本地缓存,所述计算机设备为所述第一主机,所述处理器执行程序时实现如下步骤:执行从所述第一本地缓存中读取所需的业务数据的指令;当无法从所述第一本地缓存中读取到所述业务数据时,执行从网络缓存系统中读取所述业务数据的指令;当无法从所述网络缓存系统中读取到所述业务数据时,访问数据库来读取所述业务数据;在访问所述数据库读取到所述业务数据后,将所述业务数据写入所述第一本地缓存和所述网络缓存系统中,其中,所述网络缓存系统被写入所述业务数据后,向所述第二主机发布写操作的消息,所述第二主机用于监听所述网络缓存系统发布的消息,当监听到所述写操作的消息时,将所述业务数据写入到所述第二本地缓存。
- 根据权利要求11所述的计算机设备,其中,所述处理器执行程序时还实现如下步骤:修改所述第一本地缓存和所述数据库中所述业务数据的值;将所述数据库中修改后的所述业务数据同步至所述网络缓存系统中。
- 根据权利要求12所述的计算机设备,其中,修改所述第一本地缓存中所述业务数据的值的步骤包括:获取所述第一本地缓存中所述业务数据的版本信息,得到第一版本信息;获取所述网络缓存系统中所述业务数据的版本信息,得到第二版本信息;判断所述第一版本信息与所述第二版本信息是否相同;当所述第一版本信息与所述第二版本信息相同时,修改所述第一本地缓存中所述业务数据的值;当所述第一版本信息与所述第二版本信息不同时,将所述网络缓存系统中的所述业务数据同步至所述第一本地缓存,然后再修改所述第一本地缓存中所述业务数据的值。
- 根据权利要求11所述的计算机设备,其中,所述网络缓存系统为Redis存储系统,所述本地缓存为高速缓冲存储器。
- 根据权利要求14所述的计算机设备,其中,执行从网络缓存系统中读取所述业务数据的指令的步骤包括:调用访问所述Redis存储系统的接口,从所述Redis存储系统中读取所述业务数据。
- 一种非易失性计算机可读存储介质,其上存储有计算机程序,其中,集群包括第一主机和第二主机,所述第一主机的本地缓存为第一本地缓存,所述第二主机的本地缓存为第二本地缓存,所述非易失性计算机可读存储介质位于所述第一主机,所述程序被处理器执行时实现如下步骤:执行从所述第一本地缓存中读取所需的业务数据的指令;当无法从所述第一本地缓存中读取到所述业务数据时,执行从网络缓存系统中读取所述业务数据的指令;当无法从所述网络缓存系统中读取到所述业务数据时,访问数据库来读取 所述业务数据;在访问所述数据库读取到所述业务数据后,将所述业务数据写入所述第一本地缓存和所述网络缓存系统中,其中,所述网络缓存系统被写入所述业务数据后,向所述第二主机发布写操作的消息,所述第二主机用于监听所述网络缓存系统发布的消息,当监听到所述写操作的消息时,将所述业务数据写入到所述第二本地缓存。
- 根据权利要求16所述的非易失性计算机可读存储介质,其中,所述程序被处理器执行时还实现如下步骤:修改所述第一本地缓存和所述数据库中所述业务数据的值;将所述数据库中修改后的所述业务数据同步至所述网络缓存系统中。
- 根据权利要求17所述的非易失性计算机可读存储介质,其中,修改所述第一本地缓存中所述业务数据的值的步骤包括:获取所述第一本地缓存中所述业务数据的版本信息,得到第一版本信息;获取所述网络缓存系统中所述业务数据的版本信息,得到第二版本信息;判断所述第一版本信息与所述第二版本信息是否相同;当所述第一版本信息与所述第二版本信息相同时,修改所述第一本地缓存中所述业务数据的值;当所述第一版本信息与所述第二版本信息不同时,将所述网络缓存系统中的所述业务数据同步至所述第一本地缓存,然后再修改所述第一本地缓存中所述业务数据的值。
- 根据权利要求16所述的非易失性计算机可读存储介质,其中,所述网络缓存系统为Redis存储系统,所述本地缓存为高速缓冲存储器。
- 根据权利要求19所述的非易失性计算机可读存储介质,其中,执行 从网络缓存系统中读取所述业务数据的指令的步骤包括:调用访问所述Redis存储系统的接口,从所述Redis存储系统中读取所述业务数据。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910190657.1A CN110046029A (zh) | 2019-03-13 | 2019-03-13 | 应用于集群内多级缓存的数据处理方法和装置 |
| CN201910190657.1 | 2019-03-13 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020181810A1 true WO2020181810A1 (zh) | 2020-09-17 |
Family
ID=67273726
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/117410 Ceased WO2020181810A1 (zh) | 2019-03-13 | 2019-11-12 | 应用于集群内多级缓存的数据处理方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110046029A (zh) |
| WO (1) | WO2020181810A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116166576A (zh) * | 2023-02-27 | 2023-05-26 | 中国建设银行股份有限公司 | 数据缓存方法、装置、设备、介质及产品 |
Families Citing this family (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110046029A (zh) * | 2019-03-13 | 2019-07-23 | 平安科技(深圳)有限公司 | 应用于集群内多级缓存的数据处理方法和装置 |
| CN112445859A (zh) * | 2019-08-30 | 2021-03-05 | 北京数聚鑫云信息技术有限公司 | 数据管理方法、装置和系统 |
| CN110765165B (zh) * | 2019-10-23 | 2022-07-29 | 中国银行股份有限公司 | 一种跨系统数据同步处理的方法、装置及系统 |
| CN111782352B (zh) * | 2019-11-29 | 2024-10-18 | 北京沃东天骏信息技术有限公司 | 一种业务调度方法和装置 |
| CN111143382B (zh) * | 2019-12-13 | 2022-08-09 | 新华三大数据技术有限公司 | 数据处理方法、系统和计算机可读存储介质 |
| CN111708288B (zh) * | 2020-05-18 | 2021-11-26 | 慧灵科技(深圳)有限公司 | 数据处理的方法、装置、电子设备及存储介质 |
| CN111966283A (zh) * | 2020-07-06 | 2020-11-20 | 云知声智能科技股份有限公司 | 一种基于企业级超算场景的客户端多级缓存方法及系统 |
| CN112632092B (zh) * | 2020-12-18 | 2024-10-08 | 北京浪潮数据技术有限公司 | 一种集群管理方法、装置、设备及存储介质 |
| CN113360425A (zh) * | 2021-06-28 | 2021-09-07 | 深圳市高德信通信股份有限公司 | 一种分布式多级缓存系统 |
| CN113722281B (zh) * | 2021-08-24 | 2025-08-26 | 中国建设银行股份有限公司 | 一种利用多级数据缓存的服务进程处理系统及方法 |
| CN115190125B (zh) * | 2022-06-27 | 2024-09-20 | 京东科技控股股份有限公司 | 一种缓存集群的监控方法和装置 |
| CN117851456A (zh) * | 2024-01-05 | 2024-04-09 | 迪爱斯信息技术股份有限公司 | 一种集群中数据共享方法、系统和服务端 |
| CN118132295B (zh) * | 2024-05-10 | 2024-08-16 | 中移(苏州)软件技术有限公司 | 一种参数更新方法、装置及相关设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160006637A1 (en) * | 2011-08-30 | 2016-01-07 | International Business Machines Corporation | Fast snapshots |
| CN107463511A (zh) * | 2017-01-23 | 2017-12-12 | 北京思特奇信息技术股份有限公司 | 一种基于多级缓存的数据国际化实现方法及装置 |
| CN109388656A (zh) * | 2018-09-04 | 2019-02-26 | 中国建设银行股份有限公司 | 基于多级缓存的数据处理方法及系统、装置和存储介质 |
| CN110046029A (zh) * | 2019-03-13 | 2019-07-23 | 平安科技(深圳)有限公司 | 应用于集群内多级缓存的数据处理方法和装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107231395A (zh) * | 2016-03-25 | 2017-10-03 | 阿里巴巴集团控股有限公司 | 数据存储方法、装置和系统 |
| CN106790629A (zh) * | 2017-01-03 | 2017-05-31 | 努比亚技术有限公司 | 数据同步装置及其实现数据同步的方法、客户端访问系统 |
-
2019
- 2019-03-13 CN CN201910190657.1A patent/CN110046029A/zh active Pending
- 2019-11-12 WO PCT/CN2019/117410 patent/WO2020181810A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160006637A1 (en) * | 2011-08-30 | 2016-01-07 | International Business Machines Corporation | Fast snapshots |
| CN107463511A (zh) * | 2017-01-23 | 2017-12-12 | 北京思特奇信息技术股份有限公司 | 一种基于多级缓存的数据国际化实现方法及装置 |
| CN109388656A (zh) * | 2018-09-04 | 2019-02-26 | 中国建设银行股份有限公司 | 基于多级缓存的数据处理方法及系统、装置和存储介质 |
| CN110046029A (zh) * | 2019-03-13 | 2019-07-23 | 平安科技(深圳)有限公司 | 应用于集群内多级缓存的数据处理方法和装置 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116166576A (zh) * | 2023-02-27 | 2023-05-26 | 中国建设银行股份有限公司 | 数据缓存方法、装置、设备、介质及产品 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110046029A (zh) | 2019-07-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020181810A1 (zh) | 应用于集群内多级缓存的数据处理方法和装置 | |
| US11657034B2 (en) | Data consistency in master data integration | |
| EP2727014B1 (en) | Automatic synchronization of most recently used document lists | |
| US10599535B2 (en) | Restoring distributed shared memory data consistency within a recovery process from a cluster node failure | |
| US10031948B1 (en) | Idempotence service | |
| US20140325012A1 (en) | Rdma-optimized high-performance distributed cache | |
| CN105700937A (zh) | 多线程任务处理方法和装置 | |
| WO2019179026A1 (zh) | 电子装置、集群访问域名自动生成方法及存储介质 | |
| WO2015051690A1 (zh) | 一种基于zookeeper的信息配置方法及装置 | |
| CN108459913B (zh) | 数据并行处理方法、装置及服务器 | |
| WO2021066954A1 (en) | Subscription to dependencies in smart contracts | |
| WO2022048358A1 (zh) | 数据处理方法、装置及存储介质 | |
| US9928174B1 (en) | Consistent caching | |
| CN111651286A (zh) | 数据通信方法、装置及计算设备、存储介质 | |
| US10599629B2 (en) | Reduced locking in a distributed data store | |
| CN113421109A (zh) | 一种业务核对方法、装置、电子设备和存储介质 | |
| CN117762898A (zh) | 数据迁移方法、装置、设备及存储介质 | |
| US11138268B2 (en) | Systems and methods for improved transactional mainframes | |
| CN113687921A (zh) | 事务处理方法、装置、分布式数据库系统及电子设备 | |
| CN114168607B (zh) | 全局序列号生成方法、装置、设备、介质和产品 | |
| CN109445966B (zh) | 事件处理方法、装置、介质和计算设备 | |
| CN112650814B (zh) | 基于消息中间件的数据存储方法、装置、设备及存储介质 | |
| CN114579906A (zh) | 一种处理页面数据的方法、装置、计算机设备及存储介质 | |
| CN115190125A (zh) | 一种缓存集群的监控方法和装置 | |
| US11132351B2 (en) | Executing transactions based on success or failure of the transactions |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19919107 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19919107 Country of ref document: EP Kind code of ref document: A1 |