CA3127346A1 - Data caching method, device, computer equipment and storage medium - Google Patents

Data caching method, device, computer equipment and storage medium Download PDF

Info

Publication number
CA3127346A1
CA3127346A1 CA3127346A CA3127346A CA3127346A1 CA 3127346 A1 CA3127346 A1 CA 3127346A1 CA 3127346 A CA3127346 A CA 3127346A CA 3127346 A CA3127346 A CA 3127346A CA 3127346 A1 CA3127346 A1 CA 3127346A1
Authority
CA
Canada
Prior art keywords
data
operation information
information
operated
cache
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.)
Pending
Application number
CA3127346A
Other languages
French (fr)
Inventor
Liangjun XIAO
Qingfeng Yang
Gang Qin
Xiaobo SI
Guohua YE
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.)
10353744 Canada Ltd
Original Assignee
10353744 Canada 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 10353744 Canada Ltd filed Critical 10353744 Canada Ltd
Publication of CA3127346A1 publication Critical patent/CA3127346A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention discloses a data cache method, apparatus, computer device and storage medium, the method comprising: obtaining first operation information when the operated data is making data changes and determining operation type of the first operation information; adopting a processing method to obtain a first data status of the operated data when the operation type is high-frequency access type; obtaining a second data status before the operated data is making changes, judging whether the operated data is making data status changes according to the first data status and the second data status;
determining first to-be-updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to-be-updated data. The above method efficiently detects status changes of hotspot data under multi-site high availability deployment scenarios and caches the to be updated data of the hotspot data.

Description

DATA CACHING METHOD, DEVICE, COMPUTER EQUIPMENT AND STORAGE MEDIUM
Field [0001] The present disclosure relates to data processing, particularly to a method, an apparatus, a computer device, and a storage medium for data caching.
Background
[0002] At present, multi-site high availability method is widely used to solve high availability problems, in a daily business, a server room with multi-site high availability needs traffic flow for service support. Different server room will keep each independent data, for exclusive data, adopting a strategy that one primary high server room and other secondary server rooms to synchronize the data from primary high availability server room to read-only high availability server room, ensuring that each server room can provide consistent service.
With the continuous expansion of services, more and more data needs to be transmitted among server rooms. However, network resources are limited, and transmission is time-consuming, so how to effectively ensure data consistency starts to be important.
[0003] Data transmitted in each server room includes hotspot data. The hotspot data not only has many visitors, but also has characteristics of suddenness and real-time, so it is difficult to effectively predict the hotspot data. For the transmission of the hotspot data, the primary high availability server room needs to monitor the hotspot data's changes in real time and performing a series of processing based on these changes, at the end, completing creation or updating of hotspot data caching in multiple server rooms.
[0004] The traditional monitoring method for hotspot data is as follows: when all data involved in the primary high availability server room is making changes, the primary high availability server writes the change information to the database of the primary high availability server. The primary high availability server continuously scans for the changing information in the database through a recurring processing task. Once the change information is found, the Date Recue/Date Received 2021-10-08 system calculates the status information of related hotspot data and compares the calculated status information with the status information stored in the database. If the status information changes, the system records the cache information of the to be updated hotspot data and updates the status information in the database. However, this monitoring of the hotspot data and changing processing method are inefficient.
[0005] How to efficiently discover the hotpot data changes, minimize the impact on the performance of active path service, and update hotspot information in the server with high availability are the problems to be solved.
Invention Content
[0006] Based on this, it is necessary to provide a data cache method, an apparatus, a computer device, and a storage medium to efficiently detect the hotspot data's status changes and cache the to be updated hotpot data in the case of high availability deployment to solve the above technical problems.
[0007] A data cache method, the method includes: acquiring first operation information when operated data is making data changes, and determining the first operation information's operation type; adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache; obtaining a second data status before the operated data is making changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and determining first to be updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to be updated data.

Date Recue/Date Received 2021-10-08
[0008] In one of the implementations, a data cache method also includes writing the first to be updated data in the cache to a message system so that each sever room can obtain the first to be updated data from the message system.
[0009] In one of the implementations, caching the first to be updated data includes setting first version information of the first to be updated data, and caching after associating the first version information with the first to be updated data.
[0010] In one of the implementations, a data cache method also includes when receiving second to be updated data corresponding to the operated data and second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information and the first version information; if yes, removing the first version information and the first to be updated data from the cache, caching the second to be updated data and the associated second version information.
[0011] In one of the implementations, a data cache method also includes: if executing the information processing of the first operation information fails, storing the first operation information saved in the cache;
if executing the information processing of the second operation information succeeds, deleting the first operation information saved in the cache;
[0012] In one of the implementations, a data cache method also includes storing the first operation information in a database for information backup.
[0013] In one of the implementations, a data cache method also includes adopting a second information processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access Date Recue/Date Received 2021-10-08 frequency with the normal access wherein the data access frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of operation information include the first operation information; obtaining a second data status before the operated data is making changes, judging whether the operated data is making changes according to the first data status and the second data status; obtaining a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status; determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system
[0014] In one of the implementations, a data cache method also includes: when quantity of the operation information in the database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining a fifth data status of the data corresponding to the second operation information; judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information according to the second operation information, caching the third to be updated data;
[0015] In one of the implementations, a data cache method also includes setting the operation type of the second operation information to be high-frequency access types.
[0016] In one of the implementations, a data cache method also includes: when quantity of the operation information in the database exceeds the preset threshold, after grouping the Date Recue/Date Received 2021-10-08 operation information in the database, and then sorting the operation information by repetition rate; after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group; and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
[0017] A data cache apparatus comprises a first acquisition module configured to obtain the first operation information and determine the operation type of the first operation information when the operated data is making data changes; a second acquisition module configured to adopt a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache; A third acquisition module configured to obtain the second data status before the operated data is making data changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and A cache module configured to determine the first to be updated data according to the first operation infoimation when the operated data is making data status changes, caching the first to be updated data.
[0018] A computer device, including a memory, a processor and a computer program stored in the memory and ran on the processor configured to achieve the steps of any above methods when the processor executes the computer program.
[0019] A computer readable storage medium stored with a computer program configured to achieve the steps of any above methods when processor executes the computer program.
Date Recue/Date Received 2021-10-08
[0020] The data cache method, apparatus, computer device and storage medium mentioned above obtain the first operation information and determine the first operation information's operation type when the operated data is making data changes. When the operation type is high-frequency access type, the data access frequency of the operated data is greater than the first preset value, in this case, the operated data can be regarded as hotspot data, adopting a first information processing method and associating the method with the operated data to perform information processing on the first operation information, obtaining the operated data's first data status. Among them, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache. Furthermore, judging whether the operated data is making data status changing according to the second data status and the first data status before the operated data is making changes, when the operated data is making status changes, determining the operated data's first to be updated data according to the first operation information, caching the first to be updated data. Therefore, the hotspot data can be quickly identified, the hotspot data operation information is stored to the cache, the intermediate steps are reduced, and the processing efficiency of hotspot data operation information is improved. In addition, the system can quickly identify the status changes of the hotspot data and cache the changed first to be updated data when the status is making changes, improving the storage efficiency of the hotspot data's related data.
Brief Description of the Drawings
[0021] Figure 1 is an implementation showing application environment diagram of a data cache method;
[0022] Figure 2 is an implementation showing workflow diagram of a data cache method;
[0023] Figure 3 is an implementation showing workflow diagram of updating cached data;
[0024] Figure 4 is another implementation showing workflow diagram of a data cache Date Recue/Date Received 2021-10-08 method;
[0025] Figure 5 is an implementation showing hardware information diagram under a hotspot information inquiry scenario;
[0026] Figure 6 is an implementation showing internal structures of an application server;
[0027] Figure 7 is an implementation showing workflow diagram of an inquiry service procedures;
[0028] Figure 8 is another implementation showing workflow diagram of a data cache method;
[0029] Figure 9 is another implementation showing workflow diagram of a data cache method;
[0030] Figure 10 is an implementation showing structures of a data cache apparatus;
[0031] Figure 11 is an implementation showing the internal structures of a computer device.
Detailed Description of an Embodiment
[0032] In order to make application purposes, technical solutions, and advantages clearer, the present disclosure is further explained in detail with a particular embodiment thereof, and with reference to the drawings. It shall be appreciated that these descriptions are only intended to be illustrative, but not to limit the scope of the disclosure thereto.
[0033] The present application provides a data cache method applied in the application environment as shown in Figure 1. Among them, application server 104 is configured to perform a data cache method of present application. Users access data in the application server Date Recue/Date Received 2021-10-08 104 through terminal 102. The operated data accessed by users in the application server 104 is making data changes. The application server 104 obtains the first operation infoimation when the operated data is making data changes and determines the first operation information's operation type. Among them, the first operation information's operation type is configured by configuration server 106 in advance and configuration information is transmitted to the application server 104. Furthermore, the application server 104 adopts a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information. Representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value. Setting hotspot data by configuring the high-frequency access type through the configuration server 106, filtering the hotspot data for data processing in the application server 104. The first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache. The cache can be the application server 104's cache and can be cache server 108's cache.
[0034] Furthermore, the application server 104 obtains the second data status before the operated data is making data changes and judges whether the operated data is making data status changes according to the first data status and the second data status.
When the operated data is making data status changes, determining the first to be updated data according to the first operation information and caching the first to be updated data. Among them, the caching method can cache the first to be updated data to the cache server 108.
Therefore, the hotspot data can be quickly identified, and the operation information of hotspot data can be stored in the cache, the intermediate steps are reduced, and the processing efficiency of the hotspot data's operation information is improved. In addition, the hotspot data status changes can be quickly identified, when the status is making changes, the first to be updated data can be cached to improve the storage efficiency of the hotspot data.
[0035] A data cache method is provided in the present application and applied for the application server shown in Figure 1. As shown in Figure 2, one data cache method involves Date Recue/Date Received 2021-10-08 the following steps:
[0036] S102, obtaining the first operation information when the operated data is making data changes and determining the first operation information's operation type.
[0037] In the present implementation, front-end applications of the application server provide a variety of data to users. When the users ask the front-end data of the application server through terminal, the operated data is making data changes which means the operated data is making data updating. The application server obtains the first operation information when the operated data is making data changes. The first operation information is configured to record the users' operations of the access to the operated data. For example, the operated data is the quantity of commodity A, when a user purchases commodity A, the quantity of the commodity A decreases. At this time, the first operation information is configured to record the relative information about the purchasing of the commodity A, such as, the first operation information records that the commodity A is purchased, and the quantity of the commodity A
decreases by N.
[0038] Meanwhile, the application server determines the first operation information's operation type. The first operation information's operation type can include high-frequency access type and normal access type. The high-frequency access type is used to indicate that the data access frequency is greater than a first preset value, the normal access type is used to indicate that the data access frequency is less than or equal to a first preset value. Therefore, hotspot data and normal data of the application server can be distinguished by high-frequency access type and normal access type. If the first operation information's operation type is high-frequency access type, the first operation information indicates that the operation occurs high frequently when the operated data is making data changes, and the operated data is hotspot data.
If the first operation information's operation type is normal access type, the first operation information indicates that the operation is normal operation which does not occur high frequently when the operated data is making data changes, and the operated data is non-hotspot data. The configurations of the high-frequency access type and the normal access type can be Date Recue/Date Received 2021-10-08 manually configured by the configuration server and sent to the application server by the configuration server.
[0039] S104, adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache.
[0040] In the present implementation, when the application server determines that the first operation information's operation type is high-frequency access type, the operated data can be determined to be hotspot data. At this point, the application server adopts the first information processing method on the first operation information. Wherein, the first information processing method is used to store the first operation information in the cache and read the first operation information from the cache for information processing. Therefore, storing the hotspot data's operation information in the cache, reducing the intermediate steps, and improving the processing efficiency of the hotspot data.
[0041] S106, obtaining a second data status before the operated data is making data changes, judging whether the operated data is making data status changes according to the first data status and the second data status.
[0042] In the present implementation, the application server obtains the second data status before the operated data is making data changes. The second data status can be stored in a database or in cache. Furthermore, judging whether the operated data is making data status changes according to the first data status and the second data status. If the first data status is the same as the second data status, the operated data is never making data status changes. If the first data status is not the same as the second data status, the operated data is making data status Date Recue/Date Received 2021-10-08 changes.
[0043] S108, if the operated data is making data status changes, determining the first to be updated data according to the first operation information and caching the first to be updated data.
[0044] In the present implementation, if the application server determines that the operated data is making data status changes, it determines the operated data's first to be updated data according to the first operation information. For example, the first to be updated data can contain the relative information when the operated data is making data changes. Finally, the first to be updated data is cached. The cache method can be caching to the local cache of the application server or caching to the cache server. Specifically, Redis cache method can be used to cache the first to be updated data, to meet the real-time cache updating requirement of the operated data's operation information and improve the reading efficiency of the operation information.
[0045] If the operated data is high-frequency access type which means the access frequency of the operated type is greater than the first preset value. In this case, the operated data is considered as hotspot data. By implementing the present data cache method, improving the filtering mechanism of the hotspot data, quickly and efficiently distinguishing the real hotspot data, caching the operation information of the real hotspot data, there is no need to store the operation information to a database which will cause repeated operations in the database, and reducing the resource consumption. For example, hotspot commodity is frequently operated, such as when the commodity is purchased by a large number of users, the method can reduce the number of repeated records in the database ( the frequently operated action information) and reducing the subsequent consumption of many resources. For example, reducing the insert and delete actions of a table in the database, improving the processing efficiency of the whole data processing.
[0046] The above-mentioned data cache method, obtaining the first operation information Date Recue/Date Received 2021-10-08 when the operated data is making data changes and determining the first operation information's operation type. When the operation type is high-frequency access type, the data access frequency of the operated data is greater than the first preset value, in this case, the operated data can be regarded as hotspot data, adopting a first information processing method and associating the method with the operated data to perform information processing on the first operation information, obtaining the operated data's first data status.
Among them, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache.
Furthermore, judging whether the operated data is making data status changing according to the second data status and the first data status before the operated data is making changes, when the operated data is making status changes, determining the operated data's first to be updated data according to the first operation infoimation, caching the first to be updated data. Therefore, the hotspot data can be quickly identified, the hotspot data operation information is stored to the cache, the intermediate steps are reduced, and the processing efficiency of hotspot data operation information is improved. In addition, the system can quickly identify the status changes of the hotspot data and cache the changed first to be updated data when the status is making changes, improving the storage efficiency of the hotspot data's related data.
[0047] In an implementation, S104 comprises storing the first operation information to the cache and reading the first operation information from the cache, calculating data changing information of the operated data according to the data information in the first operation information and the operated data, obtaining the first data status of the operated data according to the data changing information.
[0048] In the present implementation, extracting the data information from the first operation information when reading the first operation information from the cache. The data information is used to represent the data changes when the operated data is making changes. Furthermore, calculating the data change information of the operated data based on the data information and the operated data. For example, the data change information includes the operated data's reduction. Then, obtaining the first data status of the operated data according to the data change Date Recue/Date Received 2021-10-08 information. For example, the first operation information records that commodity A is purchased, and the quantity decreased by 5. The quantity of the commodity A is 10 before the data is changing. The determined data change information is the quantity of the commodity and there are 5 left. The application server sets the inventory threshold of commodity A to 8, in this case, the quantity of the commodity A is less than the inventory threshold, and the first data status of the commodity A is the inventory tight status. Therefore, determining the data status of the operated data through the first operation information, and then determining the processing method of the first operation information, improving the accuracy of the information processing of the first operation information.
[0049] In an implementation, after S108, also includes writing the first to be updated data to a message system and making each server room obtain the first to be updated data from the message system.
[0050] In the present implementation, writing the first to be updated data in the cache to a message queue of the message system. Meanwhile, adding a timestamp to the first to be updated data to identify the time point when the to be updated data is added to the message queue. After each server room detects a new message in the message queue, the first to be updated data is extracted for judging processing. If there is no cache in each server room, then directly creation. If there is cache in each server room, then fetching the time stamp Ti of the first to be updated data in the message queue. Fetching the time stamp T2 of the corresponding object in the cache of the server room, comparing the time between Ti and T2.
If T > T2, the first to be updated data is the latest to be updated data, using the first to be updated data to update the cache of the present server room, otherwise, no processing performed. Therefore, if the operated data is hotspot data, the hotspot can be high availability and the consistency of the hotspot data cache can be achieved.
[0051] In au implementation, S108 comprises setting the first version information of the first to be updated data, associating the first version information with the first to be updated data and caching. After S108, also includes when receiving second to be updated data corresponding Date Recue/Date Received 2021-10-08 to the operated data and second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information and the first version information; if yes, removing the first version information and the first to be updated data from the cache, caching the second to be updated data and the associated second version information.
[0052] In the present implementation, the first version information and the second version information can be version numbers. The body of the version number is the system time returned by the Redis cache server after the first operation information is cached. The first version information and the second version information are used to ensure that the updates are based on the latest information. Meanwhile, the version number is also stored in the cache data.
Among them, the cache method can be, cache key = hotspot data name, cache value = hotspot data status value + delimiter + version number. Wherein, the key represents the key value in the Redis cache server, and the value represents the data corresponding to the key value in the Redis cache server. Each time when a change updates the cache data, a judge is made as shown in Figure 3. Therefore, using the time stamp returned from the Redis cache as the version number to prevent the time difference among execution machines from affecting the generated version number order and the time's version order.
[0053] In an implementation, after S104, also includes: if the information processing on the first operation information fails, retaining the storage of the first operation information in the cache; if the information processing on the first operation information is succeed, removing the first operation information from the cache. Furthermore, storing the first operation information in a database for information backup.
[0054] In the present implementation, monitoring the information processing on the first operation information to prevent the loss of the first operation information in the cache due to the abnormal execution of the first operation information's information processing. If the first operation information fails to be processed, the first operation information is stored in the cache.
If the first operation information is successfully processed, removing the first operation Date Recue/Date Received 2021-10-08 information in the cache. Therefore, information loss of the first operation information can be avoided, and subsequent information processing failures can be avoided.
Meanwhile, storing the first operation information in the database for information backup to further avoid the loss of the first operation infoiniation.
[0055] Specifically, the application server configured with a calculation module for adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information. To prevent the loss of variable factors in the cache due to the abnormal execution in the calculation module, wherein the var refer to all the operation information that may cause data changes. The variable factors include the first operation information, during the processing, renaming the SET in the variable factors, the present renamed SET will be set with an expiration time.
If succeed, the renamed SET will be removed. If the exception execution failed, writing the contents of this renamed SET to the cache SET. Note that the SET operation does not have concurrent operation problems of multiple jobs. Meanwhile, to prevent the variable factors backlog, when the quantity of variable factors in cache exceeds the threshold, the subsequent variable factors will be written into the database. In other words, if the variable factors backlog occurs, all the variable factors in this group will be changed to the calculation mode of normal variable factors.
Furthermore, to prevent the variable factors loss caused by the exception of the cache server, the variable factors can be judged whether the cache server is added successfully during the variable factors recording stage. If the addition is successful, then stored in the database and added with an identifier to be distinguished.
[0056] In an implementation, as shown in Figure 4, after S102, also includes:
[0057] S103, adopting a second information processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the normal access wherein the data access Date Recue/Date Received 2021-10-08 frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of the operation information include the first operation information.
[0058] S105, obtaining a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status; determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system.
[0059] In the implementation, if the first operation information's operation type is the normal access type which means the access frequency of the operated data is less than or equal to the first preset value, in this case, adopting the second information processing method combined with the operated data to perform information processing on the first operation information.
Wherein the normal access type and high-frequency access type are configured in advance by the system, the configuration information can be sent to the application server after being configured by the configuration server. In specific applications, the high-frequency access type corresponds to the hotspot data's operation type, and the normal access type corresponds to the non-hotspot data's operation type. Therefore, different data can be accurately distinguished during data processing and corresponding information processing can be performed on different data operation information to improve the accuracy of information processing.
[0060] Wherein the second processing method is used to instruct that the first operation information is stored in the database and the batches of operation information is read from the database for information processing. The batches of operation information include the first operation information. Therefore, the operation information that are not frequently accessed can be stored in the database to wait for batches of the information processing which can avoid storing the operation infoimation that are not high-frequency access type to the cache which Date Recue/Date Received 2021-10-08 will occupy the storage space in the cache that the operation information of high-frequency access type cannot be stored in the cache, then the operation information that is frequently accessed cannot be quickly read. Specifically, if the operation data is hotspot data, storing the operation information corresponding to the hotspot data in the database, meanwhile, when processing the operation information in the database, the application server adopts the batches information processing method to distinguish the operation information processing method between the non-hotspot data and hotspot data, which avoiding the cache occupation by the non-hotspot data's operation information and reducing the waste of resources.
[0061] In addition, adopting a second information processing method to obtain a third data status of the operated data wherein the method combines with the operated data to perform information processing on the first operation information also comprising:
storing the first operation information in a database and reading batches of operation information from the database for information processing, reading the first operation information from the batches of operation information, calculating changed data information of the operated data according to the data information of the first operation information and the operated data, obtaining the third data status according to the changed data information.
[0062]
Furthermore, obtaining a fourth data status before the operated data is making changes. Here the fourth data status can be referred to the same as the first data status, both of which are the data status before the operated data is making data changes.
Then, judging whether the operated data is making data status changes according to the third data status and the fourth data status; determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system. Therefore, determining the operation information's processing method of the operated data corresponding to the normal access type, and according to the information processing result, writing the correspondingly second to be updated data to the message system for each server room to read. Not only achieving the data high availability of the second to be updated data corresponding to the normal access type, but Date Recue/Date Received 2021-10-08 also avoids the waste of resources caused by the cache occupation of the first operation information corresponding to the normal access type.
[0063] In an implementation, after S103, also includes when quantity of the operation information in the database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining a fifth data status of the data corresponding to the second operation information; judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information according to the second operation information, caching the third to be updated data.
[0064] In the present implementation, sorting the repeated variable factors of the normal access type, filtering the variable factors with high repetition rate, and identifying the hotspot data outside the configuration. The variable factors here include the first operation information, and the hotspot data is the operated data corresponding to the high-frequency access type. The high-frequency access type corresponding to the hotspot data is manually pre-configured, and the application server performs the repetition exclusion based on the normal access type operation information in the database and determines the second operation information which repetition rate is higher than the second pre-set value in the database according to the repetition exclusion result, the data corresponding to the second operation information is hotspot data, therefore, automatically filtering out the hotspot data can be achieved, further improving the recognition of the hotspot data, caching the operation information corresponding to the hotspot data, and improving the operation information processing efficiency corresponding to the hotspot data.
[0065] Specifically, storing the obtained second operation information in the cache after the Date Recue/Date Received 2021-10-08 repetition exclusion, adopting the first processing method and the second processing method to perform data processing, obtaining the fifth data status of the data corresponding to the second operation information. For the data processing of the second operation information with the first processing method, referring to the data processing of the first operation information with the first processing method. Furthermore, determining whether the data corresponding to the second operation information is making data status changes according to the fifth data status.
Specifically, obtaining the data status before obtaining the data corresponding to the second operation information, comparing the previous data status with the fifth data status, if the compare result shows that the data corresponding to the second operation information is making data status changes, then determining the third to be updated data of the data corresponding to the second operation information according to the second operation information, caching the third to be updated data.
[0066] Furthermore, the application server sets the operation type of the second operation information to high-frequency access type. Therefore, the application server can automatically identify the hotspot data and perform automatic configuration storage, improving the configuration mechanism of the hotspot data.
[0067] In an implementation, S103, also includes when quantity of the operation information in the database exceeds the preset threshold, after grouping the operation information in the database, and then sorting the operation information by repetition rate; after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group; and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
[0068] In the present implementation, when quantity of the operation information in the database exceeds the preset threshold, directly grouping the operation infoimation in the database, after repetition exclusion of the grouped operation information, then performing Date Recue/Date Received 2021-10-08 batches of information processing. Therefore, for the operation information with the normal access type, the updating time of the operation information corresponding to the operation information with normal access type is not high. Batches processing can ease the information processing pressure in the application server and improving the processing efficiency of the operation information with normal access type. Lastly, writing each grouped fourth to be updated data to the message system by performing batches of information processing method, to make each server room obtain each fourth to be updated data and to achieve data high availability of the fourth to be updated data corresponding to the normal access type.
[0069] For a data cache method given by the above-mentioned implementation, a implementation scenario is provided as below to specifically describe the implementation procedure of the data cache method.
[0070] Figure 5 is a hardware information diagram under a hotspot information inquiry scenario. As shown in Figure 5, the configuration server configures data of the high-frequency access type and the normal access type in the application server 1 and the application server 2.
When a user A queries data in the application server 1, the application server 1 checks whether the data queried by the user A is the data corresponding to the high-frequency access type. If yes, querying the data queried by the user A from the cache server 1 and reporting the data to the user A. When a user C queries data in the application server 2, the application server 2 checks whether the data queried by the user C is the data corresponding to the high-frequency type. If yes, querying the data queried by the user C in the cache server 2.
If the data queried by the user C is not found in the cache server 2, then querying the data queried by the user C
in the database server 1. At the same time, the data queried by the user C is cached from database server 1 to cache server 2. Wherein the data queried by the user C is also the hotspot information data. The data of the database server 1 can be obtained by data synchronization of the database server 2.
[0071] A data cache method in the present application is applied to the application server 1 or the application server 2. When external user queries hotspot data, the request is routed to the Date Recue/Date Received 2021-10-08 application server. As shown in Figure 6, the application server can be composed of variable factors management module, variable factors cache module, variable factors calculation module, pushing module, changing implementation module, message synchronization module and configuration management module. Wherein the variable factors refer to all operation which can cause hotspot data making changes, the hotspot data refers to the data corresponding to the high-frequency access type. The variable factors management module:
embedded in the associated bustiness execution process and used to monitor all the information that affects the changes of the hotspot data. When the variable factors are changing, categorizing and grouping the key information and then calling out the corresponding function to process. Key information includes commodity code, location, library location, supplier, and business type.
The variable factors information include key information and the specific content information.
For example, which commodity, which day and how many the commodity has sold.
Wherein the key information is commodity, the variable factors are which days and how many items the commodities are sold. The variable factors cache module: performing repetition exclusion and recording on the categorized variable factors information. The variable factors calculation and pushing module: After ensuring of the system changes, calculating according to corresponding rules. Comparing the calculated results with the hotspot information in the database to judge whether the hotspot information needs to be changed. If changes occur, adding the changing information and pushing the message externally. At the same time, the version number information is added to the message configured to describe the generation time of the information. The message synchronization module: synchronizing information from one high availability server room to the other high availability server rooms. The changing implementation module: obtaining the hotspot information from the message system, updating according to the version number. The configuration management module:
recording the related configuration information and overall management based on the related configuration.
[0072] In the process of executing query service, there is no distinction between the primary high availability server room and the read-only high availability server room, as shown in Figure 7, the execution steps are as follows:

Date Recue/Date Received 2021-10-08
[0073] Step 1, external user queries hotspot data and the request is routed to the application server.
[0074] Step 2, the application server performs service inquiry. The application server firstly queries the corresponding hotspot data in the cache server, if there is hotspot data in the cache server, then directly executing the step 3. If there is no hotspot data, executing the step 4.
[0075] Step 3, returning the hotspot in the cache.
[0076] Step 4, the application server fetches the related data set from the database according to query request.
[0077] Step 5, Adding a timestamp to the calculated hotspot information and storing in the cache server.
[0078] Step 6, returning the information about the new generated hotspot data.
[0079] Analysis: if the hotspot data has no cache information which indicates that the hotspot data has not changed in the recent period, and the data in the primary database and the secondary database are consistent. The process does not involve the variable factors calculation module and the changing implementation module.
[0080] The method of the high availability achieved by the primary high availability server room and the read-only high availability server room is shown in Figure 8.
Wherein, the primary high availability server execution steps are as follows:
[0081] 1. After service changes data which synchronously writes variable factors of the data changing to the cache. The variable factors data in the cache are processed by different groups.
[0082] 2. The program listens to each group data in the cache and judges whether there are Date Recue/Date Received 2021-10-08 variable factors to be processed, if any to be processed variable factors are found which will be taken out for the variable factors calculation.
[0083] 3. After the variable factor's calculation, comparing the obtained data status of the hotspot data to the data status in the cache. If there are any changes, then adding a timestamp to the new hotspot information, storing to the message queue, and updating the hotspot data in the database, otherwise, ending the steps.
[0084] The execution steps of the read-only high availability server room are as follows:
[0085] 4. When each server room listens to a new message in the message queue, fetching the hotspot information in the message for judging processing. If the server room does not have cache information, then directly creating, otherwise, executing the step 5.
[0086] 5. Fetching the timestamp Ti of the hotspot information in the message queue.
Fetching the timestamp T2 of the corresponding object in the cache of the server room, comparing T1 and T2.
[0087] 6. If Ti > T2, updating the cache of the hotspot information.
[0088] 7. Otherwise, no processing is performed.
[0089] Analysis: if the hotspot information cache exists, which indicates that the hotspot has changed in recent period. Concurrent access issues exist in multiple server rooms; therefore, the data of the hotspot information can be different in the primary database and the secondary database. So, the current updating should be based on a faster way to transfer information and overriding the old values with the new values through the message queue.
[0090] Wherein, the variable factors calculation method of the primary high availability server room is as follows:

Date Recue/Date Received 2021-10-08
[0091] Firstly configuring the related hotspot data, the configuration management module sending command to the front-end server according to the configuration information. Then the front-end server accepts the command and updates the bloom filter.
Specifically, different business has different requirements, processing the variable factors differently through the bloom filter. For example, the hotspot data with little quantities and high frequencies will be cached to improve the processing efficiency, decreasing the intermediate steps; the normal data with high quantities and low frequencies will be batches updating to reduce resource consumption. At the same time, managing the bloom filter through the configuration for convenient adjustment according to the hotspot distribution.
[0092] When the hotspot data is making changes in the system, firstly using bloom filter to check whether the data is the high-frequency access type. If yes, adopting the high-frequency variable factors to calculate. If no, adopting the normal variable factors to calculate, and also continue to use the bloom filter to check on the normal variable factors for distinguishing again.
[0093] The main differences between the two variable factors processing are:
[0094] 1. The variable factors recoding stage: the high-frequency variable factors are directly processed by the Redis cache collection, but the normal variable factors still adopt the method of recoding in the database.
[0095] 2. The variable factors calculation stage: the high-frequency variable factors do not need to do repletion exclusion and performing calculation directly. If the calculation result shows the hotspot information needs to be cached and updated, then writing to the message system at the same time. The normal variable factors are written to the waiting list for batches execution by pushing job.
[0096] 3. The cache updating stage of the hotspot information: after receiving the related updating messages, the updating listener job preferably executes the high-frequency access Date Recue/Date Received 2021-10-08 types' updating, the non-high-frequency access types will sum up to batches update.
[0097] Wherein, a data cache method executed by the primary high availability server room shown in Figure 9. When the operated data is commodity data, the execution procedure can include the hotspot commodity configuration process and service deployment process:
[0098] The hotspot commodity configuration process:
[0099] 1. Updating the hot commodity information table in the database by pages or interfaces.
[0100] 2. Modifying the SCM configuration or timer to let the application server aware of the need of updating the hotspot commodity filter.
[0101] 3. The application sever reads the hot commodity information from the database and constructs a new bloom filter.
[0102] 4. Replacing the original filter with a new bloom filter.
[0103] 5. Updating the filter version information in the database for the convenience of development and operations people to view the updating results.
[0104] Service deployment process:
[0105] 1. The business processing module needs to establish the relationship between all the business process which affects the hot commodities and the variable factors management module.
[0106] 2. The corresponding calculation interface of the variable factor's calculation module should be provided to calculate the latest hotspot data according to the different requirements.
Date Recue/Date Received 2021-10-08
[0107] 3. If the variable factors interface needs to be provided for the external synchronization, the external interface needs to be added between the variable factor's calculation module and the pushing module.
[0108] 4. Configuring the variable factors cache system.
[0109] In general, the variable factors management module and the variable factors cache module are deployed in the front-end application of the application server, and the variable factors calculation and pushing module and the changing implementation module are deployed in the back-end of the application server. The message synchronization module is an independent module and is deployed independently.
[0110] Furthermore, after caching the data of the hotspot commodity, the specific implementation process of achieving the data high availability of the hotspot commodity:
[0111] 1. Configuring the hotspot commodity information.
[0112] 2. During the execution of service, basic data is changing and synchronously calling the variable factors management module.
[0113] 3. After the variable factors management module receives the variable factors, the variable factors management module will write the key information of the related variable factors to the variable factors cache. Meanwhile, setting expiration time of the cache to prevent the invalid information from occupying system resources and affecting system performance.
[0114] 4. The variable factors calculation module maintains a process that continuously scans the changing identification caused by the variable factor cache. After the variable factors changed, performing correspondingly process of the variable factors' processing.

Date Recue/Date Received 2021-10-08
[0115] 5. The processing program of the variable factors repeatedly fetch the to be processed variable factors from the cache. After each type of the variable factors is processed, deleting the variable factors' cache information before the processing.
[0116] 6. After the calculation of the variable factors, comparing the calculation result with the cache of the hotspot information in the present system. If the result is different, writing new hotspot information to the system synchronously, and recording the hotspot changing information in the database at the same time.
[0117] 7. After the end of the variable factors' processing, reset the changing identification of variable factors, the processing program of variable factors enters the sleep status.
[0118] 8. Reading to be synchronized hotspot information from messaging synchronization system by the changing implementation system. After discovering the hotspot information, comparing the information with the cache of the hotspot information. If the version number of the current information is greater than the version number in the cache of the hotspot information, then updating the cache of the hotspot information.
[0119] A data cache method in the present application improves the mechanism of the hotspot configuration, discovering and filtering, clarifying the creation and the updating of the cache of the hotspot information. The cache sources of the hotspot information are classified, and different optimizations are adopted to improve the processing efficiency and ensure the fast updating of the hotspot information. Specifically, by configuring the hotspot information, the variable factors are grouped, then a bloom filter is used to distinguish the variable factors of the hotspot, and the bloom filter can be updated in real time. For the variable factors of the hotspot information, Redis set is used to perform repetition exclusion and recording, optimizing the processing, and improving the efficiency of the variable factor's calculation. Performing common processing to the normal access type data. For the normal access type data, filtering the variable factors with higher repetition rate in the repetition exclusion process of the variable factors, then identifying the non-configured hotspot. Adding the new identified hotspot object Date Recue/Date Received 2021-10-08 to the hotspot information table, then improving the accuracy of the hotspot information object, and improving the processing of the hotspot information cache. In other words, the hotspot data and the normal data are distinguished through the secondary filtering of the operated data, the resource consumption is reduced, the impacts on the execution time of the related main service are reduced, the processing efficiency is improved and the timely updating and response of the hotspot data are improved.
[0120] Although the steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows.
Unless explicitly instruction in this article, there is no strict order in which these steps can be performed, and they can be performed in any other orders. In addition, at least parts of the appended drawings in the steps can include more sub steps or multiple stages, these sub steps or stages are not necessarily completed at the same time but can be executed in different time, the execution order of these sub steps or stages is also not necessarily in sequence order but can be performed alternately with the other steps or sub steps of other steps or at least one part of the other stages.
[0121] The present application also provides a data cache apparatus, as shown in Figure 10, the apparatus includes the first acquisition module 10, the second acquisition module 20, the third acquisition module 30 and the cache module 40, the first acquisition module 10 is used to obtain the first operation information when the operated data is making changes and determining the first operation information's operation type; the second acquisition module 20 is used to adopt a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache; the third module 30 is used to obtain a second data status before the operated data is making changes and judge whether the operated data is Date Recue/Date Received 2021-10-08 making data status changes according to the first data status and the second data status; the cache module 40 is used to determine first to be updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to be updated data.
[0122] In one of the implementations, the data cache apparatus also includes a first writing module configured to write the first to be updated data in the cache to the message system, so that each server room can obtain the first to be updated data from the message system.
[0123] In one of the implementations, the second acquisition module 20 is also used to store the first operation information to the cache and reading the first operation information from the cache; calculating the changing information of the operated data according to the data information in the first operation information and the operated data, obtaining the operated data's first data status according to the data's changing information.
[0124] In one of the implementations, the cache module 40 is specifically used to set the first version information of the first to be updated data and after associating the first version information with the first to be updated data, then caching the first version information. The data cache apparatus also includes when receiving the second to be updated data corresponding to the operated data and the second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information; if yes, deleting the first version information and the first to be updated data from the cache, and caching the second to be updated data and the associated second version infoimation.
[0125] In one of the implementations, the data cache apparatus also includes a control module configured to retain and store the first operation information in the cache if the execution of the first operation information fails during the information processing. If the first operation information is successfully processed, deleting the first operation information from the cache.

Date Recue/Date Received 2021-10-08
[0126] In one of the implementations, the data cache apparatus also includes a backup module configured to store the first operation information in a database for information backup.
[0127] In one of the implementations, the data cache apparatus also includes the fourth acquisition module and the second writing module, the fourth acquisition module is used to adopt a second information processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the normal access wherein the data access frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of operation information include the first operation information; the second writing module is used to obtain a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status;
determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system.
[0128] In one of the implementations, the data cache apparatus also includes the storage module configured to when quantity of the operation information in the database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining a fifth data status of the data corresponding to the second operation information; judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information Date Recue/Date Received 2021-10-08 according to the second operation information, caching the third to be updated data.
[0129] In one of the implementations, the data cache apparatus also includes a setup module for setting the operation type of the second operation information to the high-frequency access type.
[0130] In one of the implementations, the data cache apparatus also includes batches processing module configured to when quantity of the operation information in the database exceeds the preset threshold, after grouping the operation information in the database, and then sorting the operation information by repetition rate; after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group; and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
[0131] For the specific limitation of the data cache apparatus can refer to the above-mentioned the data cache method, which will not be repeated here. Each module of the above data cache apparatus can be achieved fully or partly by software, hardware, and their combinations. The above modules can be embedded in the processor or independent of the processor in computer device and can store in the memory of computer device in form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0132] In one of the implementations, a computer device is provided to be a server and whose internal structure diagram is shown in Figure 11. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
The processor of the computer device is configured to provide calculation and control capabilities. The memory of computer device includes non-volatile storage medium and internal memory. The memory of non-volatile storage medium has operation system, computer programs and Date Recue/Date Received 2021-10-08 database. The internal memory provides an environment for the operation system and computer program running in a non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a data cache method.
[0133] The skilled in the art can understand that the structure shown in Figure 11 is only partial structural diagram related this application solution and not constitute limitation to the computer device applied on the current application solution, the specific computer device can include more or less components than what is shown in the figure, or combinations of some components or different components to what is shown in the figure.
[0134] In an implementation, a computer device is provided which includes a memory, a processor, and a computer program stored on the memory and running on the processor. The processor performs the following steps when executing the computer program:
obtaining first operation information from operated data when the operated data is changing and determining the first operation information's operation type; adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache;
obtaining a second data status before the operated data is making changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and determining first to be updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to be updated data.
[0135] In one of the implementations, the processor performs the following steps when executing the computer program: writing the first to be updated data from the cache to the Date Recue/Date Received 2021-10-08 message system, so that each server room obtains the first to be updated data from the message system.
[0136] In one of the implementations, the processor performs the above-mentioned steps when executing the computer program: adopting the first information processing method to obtain the first data status of the operated data when the operation type is high-frequency access type wherein the method combines with the operated data to perform information processing on the first operation information, comprising: storing the first operation information into the cache and reading the first operation information from the cache; and calculating data changing information of the operated data according to the data information in the first operation information and the operated data, obtaining the first data status of the operated data according to the data changing information.
[0137] In one of the implementations, when the processor performs the above-mentioned caching the first to be updated data steps by executing the computer program, following steps are performed: setting first version information of the first to be updated data, caching after associating the first version information and the first to be updated data;
the following steps are also performed when executing the computer program: when receiving second to be updated data corresponding to the operated data and second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information and the first version information; if yes, removing the first version information and the first to be updated data from the cache, caching the second to be updated data and the associated second version information
[0138] In one of the implementations, the processor also performs the following steps when executing the computer program: if executing the information processing of the first operation information fails, storing the first operation information saved in the cache;
if executing the information processing of the second operation information succeeds, deleting the first operation information saved in the cache.

Date Recue/Date Received 2021-10-08
[0139] In one of the implementations, the processor also performs the following steps when executing the computer program: storing the first operation information in a database for information backup.
[0140] In one of the implementations, the processor also performs the following steps when executing the computer program: adopting a second information processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the normal access wherein the data access frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of operation information include the first operation information;
obtaining a second data status before the operated data is making changes, judging whether the operated data is making changes according to the first data status and the second data status;
and obtaining a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status;
determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system.
[0141] In one of the implementations, the processor also performs the following steps when executing the computer program: when quantity of the operation information in the database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining Date Recue/Date Received 2021-10-08 a fifth data status of the data corresponding to the second operation information; judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information according to the second operation information, caching the third to be updated data.
[0142] In one of the implementations, the processor also performs the following steps when executing the computer program: setting the second operation information's operation type to be high frequency access type.
[0143] In one of the implementations, the processor also performs the following steps when executing the computer program: when quantity of the operation information in the database exceeds the preset threshold, after grouping the operation information in the database, and then sorting the operation information by repetition rate; after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group; and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
[0144] In one of the implementations, a computer readable storage medium is provided, wherein the medium stored with a computer program, the following steps are performed when executing the computer program: obtaining first operation information from operated data when the operated data is changing and determining the first operation information's operation type; adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first Date Recue/Date Received 2021-10-08 operation information read from the cache; obtaining a second data status before the operated data is making changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and determining first to be updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to be updated data.
[0145] In one of the implementations, the processor also performs the following steps when executing the computer program: writing the first to be updated data from the cache to the message system, so that each server room obtains the first to be updated data from the message system.
[0146] In one of the implementations, when executing the computer program to perform that adopting the first information processing method to obtain the first data status of the operated data when the operation type is high-frequency access type wherein the method combines with the operated data to perform information processing on the first operation information, the following specifically steps are performed: storing the first operation information into the cache and reading the first operation information from the cache; and calculating data changing information of the operated data according to the data information in the first operation information and the operated data, obtaining the first data status of the operated data according to the data changing information.
[0147] In one of the implementations, when executing the computer program to cache the first to be updated data, the following specifically steps are performed:
setting first version information of the first to be updated data, caching after associating the first version information and the first to be updated data; the following steps are also performed: when receiving second to be updated data corresponding to the operated data and second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information and the first version information.

Date Recue/Date Received 2021-10-08
[0148] In one of the implementations, the following steps are also performed when the processor executes the computer program: if executing the information processing of the first operation information fails, storing the first operation information saved in the cache; if executing the information processing of the second operation information succeeds, deleting the first operation information saved in the cache.
[0149] In one of the implementations, the following steps are also performed when the processor executes the computer program: storing the first operation information in a database for information backup.
[0150] In one of the implementations, the following steps are also performed when the processor executes the computer program: adopting a second infollnation processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the normal access wherein the data access frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of operation information include the first operation information; obtaining a second data status before the operated data is making changes, judging whether the operated data is making changes according to the first data status and the second data status; and obtaining a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status; determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system.
[0151] In one of the implementations, the following steps are also performed when the processor executes the computer program: when quantity of the operation information in the Date Recue/Date Received 2021-10-08 database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining a fifth data status of the data corresponding to the second operation information;
judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information according to the second operation information, caching the third to be updated data.
[0152] In one of the implementations, the following steps are also performed when the processor executes the computer program: setting the operation type of the second operation information to high-frequency access type.
[0153] In one of the implementations, the following steps are also performed when the processor executes the computer program: when quantity of the operation information in the database exceeds the preset threshold, after grouping the operation information in the database, and then sorting the operation information by repetition rate; after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group;
and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
[0154] The skilled in the art can understand that all or partial of procedures from the above-mentioned methods can be performed by computer program instructions through related hardware, the mentioned computer program can be stored in a non-volatile material computer readable storage medium, this computer can include various implementation procedures from the abovementioned methods when execution. Any reference to the memory, the storage, the Date Recue/Date Received 2021-10-08 database, or the other media used in each implementation provided in current application can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programable RON (PROM), electrically programmable ROM (EPRPMD), electrically erasable programmable ROM(EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an instruction but not limited to, RAM is available in many forms such as static RAM (SRAM), dynamic RAM
(DRAMD), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SRAM (ESDRAM), synchronal link (Synchlink) DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0155] The technical features of the above-mentioned implementations can be randomly combined, for concisely statement, not all possible combinations of technical features in the abovementioned implementations are described. However, if there are no conflicts in the combinations of these technical features, it shall be within the scope of this descriptions.
[0156] The above-mentioned implementations are only several implementations in this disclosure and the description is more specific and detailed but cannot be understood as the limitation of the scope of the invention patent. Evidently those ordinary skilled in the art can make various modifications and variations to the disclosure without departing from the spirit and scope of the disclosure. Therefore, the appended claims are intended to be construed as encompassing the described embodiment and all the modifications and variations coming into the scope of the disclosure.

Date Recue/Date Received 2021-10-08

Claims (10)

1. A method for data caching comprises:
obtaining first operation information from operated data when the operated data is changing and determining the first operation information's operation type;
adopting a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache;
obtaining a second data status before the operated data is making changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and determining first to be updated data of the operated data according to the first operation information when the operated data is making data status changes and caching the first to be updated data.
2. The method according to claim 1 also comprises:
writing the first to be updated data in cache to a message system, so that each server room can obtain the first to be updated data from the message system;
preferably, adopting the first information processing method to obtain the first data status of the operated data when the operation type is high-frequency access type wherein the method combines with the operated data to perform information processing on the first operation information, comprising:
Date Recue/Date Received 2021-10-08 storing the first operation information into the cache and reading the first operation information from the cache; and calculating data changing information of the operated data according to the data information in the first operation information and the operated data, obtaining the first data status of the operated data according to the data changing information.
3. The method according to claim 1, wherein caching the first to be updated data comprises:
setting first version information of the first to be updated data, caching after associating the first version information and the first to be updated data;
the method also comprises:
when receiving second to be updated data corresponding to the operated data and second version information associated with the second to be updated data, judging whether to cache the second to be updated data and the second version information according to the second version information and the first version information;
if yes, removing the first version information and the first to be updated data from the cache, caching the second to be updated data and the associated second version information.
4. The method according to claim 1 comprises:
if executing the information processing of the first operation information fails, storing the first operation information saved in the cache;
if executing the information processing of the second operation information succeeds, deleting the first operation information saved in the cache;
preferably, the method also comprises storing the first operation information in a database for information backup.

Date Recue/Date Received 2021-10-08
5. The method according to claim 1 also includes:
adopting a second information processing method to obtain a third data status of the operated data when the operation type is a normal access type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the normal access wherein the data access frequency is less than or equal to a first preset value, the second information processing method is used to store the first operation information in a database and reading batches of operation information from the database for information processing, wherein the batches of operation information include the first operation information;
obtaining a second data status before the operated data is making changes, judging whether the operated data is making changes according to the first data status and the second data status;
and obtaining a fourth data status before the operated data is making changes, judging whether the operated data is making data status changes according to the third data status and the fourth data status; determining the second to be updated data of the operated data according to the first operation information when the operated data is making data status changes, writing the second to be updated data to a message system, so that each server room can obtain the second to be update data in the message system.
6. The method according to claim 5, also comprises:
when quantity of the operation information in the database does not exceed a preset threshold, sorting the operation information in the database by repetition rate, determining the second operation information according to repetition exclusion result wherein the second operation information's repetition rate is higher than a second preset value, storing the second operation information to the cache, adopting the first operation method to perform the information processing on the second operation information, obtaining a fifth data status of the data corresponding to the second operation information;

Date Recue/Date Received 2021-10-08 judging whether the data corresponding to the second operation information is changing according to the fifth data status, if yes, determining third to be updated data corresponding to the second operation information according to the second operation information, caching the third to be updated data;
preferably, the method also comprises:
setting the second operation information's operation type to be high frequency access type.
7. The method according to claim 6 also comprises:
when quantity of the operation information in the database exceeds the preset threshold, after grouping the operation information in the database, and then sorting the operation information by repetition rate;
after repetition exclusion, performing batches of information processing on each grouped operation information, obtaining fourth to be updated data corresponding to each operation information in each group; and writing the fourth to be updated data from each group to a message system by performing batches of information processing, so that each server room can obtain the fourth to be updated data from the message system.
8. A apparatus for data caching comprises:
a first acquisition module configured to obtain the first operation information and determine the operation type of the first operation information when the operated data is making data changes;
a second acquisition module configured to adopt a first information processing method to obtain a first data status of the operated data when the operation type is high-frequency access Date Recue/Date Received 2021-10-08 type, wherein the method combines with the operated data to perform information processing on the first operation information, representing data access frequency with the high-frequency access type wherein the data access frequency is greater than a first preset value, the first information processing method is used to store the first operation information to a cache and perform information processing on the first operation information read from the cache;
a third acquisition module configured to obtain the second data status before the operated data is making data changes, judging whether the operated data is making data status changes according to the first data status and the second data status; and a cache module configured to determine the first to be updated data according to the first operation information when the operated data is making data status changes, caching the first to be updated data.
9. A computer device, including a memory, a processor and a computer program stored in the memory and ran on the processor configured to achieve the steps of any methods in claim 1 to 7 when the processor executes the computer program.
10. A computer readable storage medium stored with a computer program configured to achieve the steps of any methods in claim 1 to 7 when the processor executes the computer program.

Date Recue/Date Received 2021-10-08
CA3127346A 2020-08-11 2021-08-10 Data caching method, device, computer equipment and storage medium Pending CA3127346A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010800470.1 2020-08-11
CN202010800470.1A CN112115166B (en) 2020-08-11 2020-08-11 Data caching method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CA3127346A1 true CA3127346A1 (en) 2022-02-11

Family

ID=73804709

Family Applications (1)

Application Number Title Priority Date Filing Date
CA3127346A Pending CA3127346A1 (en) 2020-08-11 2021-08-10 Data caching method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112115166B (en)
CA (1) CA3127346A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116226203A (en) * 2023-05-05 2023-06-06 北京零壹视界科技有限公司 Single object data caching method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7116292B2 (en) * 2017-09-26 2022-08-10 富士通株式会社 Information processing device, information processing system and program
CN110471939A (en) * 2019-07-11 2019-11-19 平安普惠企业管理有限公司 Data access method, device, computer equipment and storage medium
CN110727698A (en) * 2019-09-09 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Database access method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112115166A (en) 2020-12-22
CN112115166B (en) 2022-11-15

Similar Documents

Publication Publication Date Title
CN111752957B (en) Sale locking method and system based on caching
CN107133234B (en) Method, device and system for updating cache data
CN111291079A (en) Data query method and device
CN101217571B (en) Write/read document operation method applied in multi-copy data grid system
CN110321339B (en) Data migration method, device, equipment and storage medium
CN111049928B (en) Data synchronization method, system, electronic device and computer readable storage medium
CN102722540B (en) Data processing method and device in real-time memory database system
CN113438275B (en) Data migration method and device, storage medium and data migration equipment
CN111400011A (en) Real-time task scheduling method, system, equipment and readable storage medium
CN113157411B (en) Celery-based reliable configurable task system and device
CN110765165A (en) Method, device and system for synchronously processing cross-system data
WO2020238860A1 (en) Distributed file batch processing method and apparatus, and readable storage medium
CN111522870B (en) Database access method, middleware and readable storage medium
CA3127346A1 (en) Data caching method, device, computer equipment and storage medium
CN107181773A (en) Data storage and data managing method, the equipment of distributed memory system
CN111274325A (en) Platform automation test method and system
CN114020368A (en) Information processing method and device based on state machine and storage medium
CN113377791A (en) Data processing method, system and computing equipment
CN112711606A (en) Database access method and device, computer equipment and storage medium
CN116775646A (en) Database data management method, device, computer equipment and storage medium
CN114896337A (en) Data uplink method, system, equipment and computer readable storage medium
CN112988708A (en) Version updating method and device, computer readable storage medium and processor
CN113536034A (en) Data writing method and data reading method based on bloom filter
CN113792074B (en) Data processing method and device
WO2024113991A1 (en) Version upgrade configuration parameter construction method, version upgrade method, device, and medium

Legal Events

Date Code Title Description
EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428

EEER Examination request

Effective date: 20220428