CN111259034A - Cache data management method and related device - Google Patents

Cache data management method and related device Download PDF

Info

Publication number
CN111259034A
CN111259034A CN202010097591.4A CN202010097591A CN111259034A CN 111259034 A CN111259034 A CN 111259034A CN 202010097591 A CN202010097591 A CN 202010097591A CN 111259034 A CN111259034 A CN 111259034A
Authority
CN
China
Prior art keywords
cache
data
request
server
database
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
CN202010097591.4A
Other languages
Chinese (zh)
Inventor
冯锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010097591.4A priority Critical patent/CN111259034A/en
Publication of CN111259034A publication Critical patent/CN111259034A/en
Pending legal-status Critical Current

Links

Images

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/23Updating
    • 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

Abstract

The embodiment of the application discloses a cache data management method, which can acquire cache expiration time of target data, judge whether the remaining time of the cache time of the target data from the cache expiration time reaches a preset threshold value before the cache expiration time reaches, if so, send a data request message to a database, request the latest data corresponding to the target data from the database through the data request message, and update the target data by using the latest data included in a first request response message returned by the database. According to the method and the device, the updating mechanism can be started in advance before the target data cache is overdue, and the target data is updated in advance by using the acquired latest data, so that the problem of cache breakdown is avoided, the protection effect on a back-end database is improved, and the normal operation of an online service is ensured.

Description

Cache data management method and related device
Technical Field
The present application relates to the field of data processing, and in particular, to a cache data management method and a related apparatus.
Background
In most internet application scenarios, for data with high concurrency requests, a caching technology is generally used, so that cached data is read from a cache server, and the purpose of protecting a back-end database is achieved.
However, in the process of designing and using the cache, the problem of cache breakdown is often encountered, which results in a decrease in the protection effect on the back-end database in some cases, and affects the normal operation of the online service.
Disclosure of Invention
In order to solve the technical problem, the present application provides a cache data management method and a related apparatus, which avoid the problem of cache breakdown, improve the protection effect on a back-end database, and ensure the normal operation of an online service.
The embodiment of the application discloses the following technical scheme:
in a first aspect, an embodiment of the present application provides a cache data management method, where the method includes:
acquiring the cache expiration time of target data;
if the remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, sending a data request message to a database, wherein the data request message is used for requesting the latest data corresponding to the target data;
acquiring a first request response message from the database, wherein the first request response message comprises the latest data;
and updating the target data by using the latest data.
In a second aspect, an embodiment of the present application provides a cache data management apparatus, where the apparatus includes a first obtaining unit, a first sending unit, a second obtaining unit, and an updating unit:
the first acquisition unit is used for acquiring the cache expiration time of the target data;
the first sending unit is configured to send a data request message to a database if a remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, where the data request message is used to request the latest data corresponding to the target data;
the second obtaining unit is configured to obtain a first request response message from the database, where the first request response message includes the latest data;
the updating unit is used for updating the target data by using the latest data.
In a third aspect, an embodiment of the present application provides a cache data management system, where the system includes a cache server and a database:
the cache server is used for acquiring the cache expiration time of the target data; if the remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, sending a data request message to a database, wherein the data request message is used for requesting the latest data corresponding to the target data;
the database is used for returning a first request response message to the cache server, wherein the first request response message comprises the latest data;
the cache server is further configured to update the target data with the latest data.
In a fourth aspect, an embodiment of the present application provides an apparatus for cache data management, where the apparatus includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the method of the first aspect according to instructions in the program code.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium for storing program code for executing the method of the first aspect.
According to the technical scheme, the cache data management method provided by the embodiment of the application can acquire the cache expiration time of the target data, judge whether the remaining time between the cache time of the target data and the cache expiration time reaches the preset threshold value before the cache expiration time reaches, if yes, send a data request message to the database, request the latest data corresponding to the target data from the database through the data request message, and update the target data by using the latest data included in the first request response message returned by the database. According to the method and the device, the updating mechanism can be started in advance before the target data cache is overdue, and the target data is updated in advance by using the acquired latest data, so that the problem of cache breakdown is avoided, the protection effect on a back-end database is improved, and the normal operation of an online service is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a signaling interaction diagram of a cache data management method in the related art;
fig. 2 is a system architecture diagram of a cache data management method according to an embodiment of the present application;
fig. 3 is a flowchart of a cache data management method according to an embodiment of the present application;
fig. 4 is a structural diagram of a cache data management system according to an embodiment of the present application;
fig. 5 is a signaling interaction diagram of a cache data management method according to an embodiment of the present application;
fig. 6a is a structural diagram of a cache data management apparatus according to an embodiment of the present application;
fig. 6b is a structural diagram of a cache data management apparatus according to an embodiment of the present application;
fig. 7 is a structural diagram of a terminal device according to an embodiment of the present application;
fig. 8 is a block diagram of a server according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings.
In the design and use process of the cache technology, cache expiration time is usually set for cache data, and for cache data of hot spots, in a high-concurrency request environment, cache misses of multiple requests can be caused once the cache expires, so that a request triggered by a user directly falls to a database, the bearing capacity of the database is limited, and once the cache is overloaded, a service is unavailable.
For example, as shown in fig. 1, a user sends a service request to a logic server through a terminal device (S101), the logic server sends a cache data request to a cache server according to the service request (S102), if the cache is hit and is not expired, the data is directly returned from the cache server (S103), and if the cache is not hit or is expired, the cache server sends a data request to a database (S104). The database returns data to the cache server according to the data request (S105), the cache server updates the local cache after receiving the data (S106), and returns the data to the logic server (S107), and the logic server returns the data to the terminal device (108).
It can be seen that when the data cache in the cache server is expired, the triggered request is directly dropped to the database, and the protection effect on the database is reduced. In a high-concurrency request environment, excessive pressure is applied to the database, and the normal operation of the online service is affected.
Therefore, the embodiment of the present application provides a cache data management method, which can update data cached in a cache server in advance before the cache expires, thereby avoiding the problem of cache breakdown, improving the protection effect on a back-end database, and ensuring the normal operation of an online service.
The method can be applied to a server, such as a cache server, which can be an independent server or a cluster server.
The cache data management method provided by the embodiment of the application can be applied to various internet scenes, such as background services of games, search services, background services of financial systems and the like.
In order to facilitate understanding of the technical solution of the present application, the following describes a cache data management method provided in the embodiment of the present application in combination with an actual application scenario.
Referring to fig. 2, fig. 2 is a system architecture diagram of a cache data management method according to an embodiment of the present application. The system architecture diagram comprises a terminal device 201, a cache server 202 and a database 203, wherein the cache server 202 is used for caching some data with frequent access so as to protect the database 203. The user can send a service request to the cache server 202 through the terminal device 201, and the cache server 202 returns data to the terminal device 201 according to the service request. Among them, the cache server 202 and the database 203 may constitute a cache management system.
The terminal 201 may be, for example, an intelligent terminal, a computer, a Personal Digital Assistant (PDA), a tablet computer, or the like.
In order to avoid the problem of cache breakdown, the cache server 202 may obtain cache expiration time of data cached thereon, for example, target data, and determine whether the remaining time of the cache time of the target data from the cache expiration time reaches a preset threshold, if so, trigger an advance update mechanism, that is, the cache server 202 sends a data request message to the database, where the data request message is used to request the latest data corresponding to the target data.
The database 203 may send a first request response message including the latest data to the cache server 202, and the cache server 202 may update the target data with the latest data after receiving the latest data. Therefore, the target data is updated in advance before the cache time of the target data reaches the cache expiration time, namely before the cache is expired, the problem of cache breakdown is avoided, and the protection effect on the database 203 is improved.
Next, a cache data management method provided in an embodiment of the present application will be described in detail with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 shows a flow chart of a cache data management method, the method comprising:
s301, obtaining the cache expiration time of the target data.
As shown in fig. 2, the cache data management system caches data corresponding to various services in the cache server, a user may send a service request to the cache server 202 through the terminal device 201, and the cache server returns data to the terminal device 201 according to the service request.
Meanwhile, the cache server stores the cache expiration time of each data. The cache expiration time may be set by the database for each data, and the cache expiration time may be an absolute time, for example, the cache expiration time is 12 months, 28 # 12: 00; the buffer expiration time may also be a relative time, for example, the buffer expiration time is 12 hours.
In order to reduce the access pressure of the cache servers, the data corresponding to the various services may be deployed in a distributed manner, that is, the data corresponding to the various services is cached in a plurality of cache servers, the data cached in each cache server is determined according to a preset caching policy, and the data cached in each cache server may be the same or different, which is not limited in this embodiment.
When data corresponding to various services may be cached in multiple cache servers, in order to determine to which cache server a service request sent by a terminal device needs to request cached data, the cache data management system further includes a logic server 204, and the logic server may include one or more logical servers, as shown in fig. 4 (fig. 4 takes the case that the logic server includes multiple logical servers as an example). At this time, the user sends a service request to the logical server 204 through the terminal device 201, and the logical server 204 may determine to which cache server 202 the cache data needs to be requested for the service request, and then the logical server 204 may send the service request to the cache server 202 in which the requested data is cached, and the cache server 202 returns the data to the terminal device 201 through the logical server 204 according to the service request.
For any data in the cache server, for example, the target data, the cache server may obtain the cache expiration time of the target data, so as to determine in advance whether the target data is about to be cached and expired.
S302, if the remaining time of the caching time of the target data and the caching expiration time reaches a preset threshold value, sending a data request message to a database.
After the cache server obtains the cache expiration time of the target data, the remaining time between the cache time of the target data and the cache expiration time can be determined, if the remaining time reaches a preset threshold value, the target data can be considered to be cached and expired, a data request message is sent to the database, the latest data corresponding to the target data is requested to the database through the data request message, and therefore the target data is updated in advance before the cache of the target data is expired.
The preset threshold value can be set at will, and in general, the set preset threshold value can be smaller, so that the caching time is closer to the caching expiration time, and the target data is updated when the target data needs to be cached and expired but is not expired. For example, the preset threshold may be set to 3 minutes, i.e. when there is 3 minutes from the cache expiration time, the early update mechanism is triggered.
In this embodiment, the cache server may determine, in real time or periodically, whether the remaining time of the cache time from the cache expiration time reaches a preset threshold.
It should be noted that, if the cache data management system includes multiple cache servers and the target data is located in the multiple cache servers, in order to reduce the request pressure on the database, ensure that the target data in the multiple cache servers can be updated in time, and ensure data consistency among the multiple cache servers, in this embodiment of the present application, the cache data management system may further include a lock server 205, so as to determine, based on a contention mode, a cache server that accesses the database to update the target data.
Referring to fig. 4, at this time, one possible implementation manner of sending the data request message to the database in S302 is that the cache server 202 sends a lock request message to the lock server 205, where the lock request message is used to request to lock the target data, so as to prevent other services from operating on the target data. And receiving a second request response message sent by the lock server 205, and sending a data request message to the database if the second request response message indicates that the locking is successful.
It should be emphasized that, in order to ensure the consistency of the data, the second request response message received by only one cache server in the plurality of cache servers indicates that the locking is successful. In addition, in the locking process, if the cache server initiates the lock request message for the target data again, the first request response message indicating that the locking is successful is not obtained. The cache server used to send the data request message to the database 203 may be referred to as a target cache server, and the target cache server shown in fig. 4 is the lowest cache server 202 in fig. 4.
S303, acquiring the first request response message from the database.
And the database sends a first request response message to the cache server according to the acquired data request message. And the first request response message comprises the latest data of the target data.
In general, in order to facilitate the cache server to know the cache expiration time of the latest data, so as to perform a subsequent update operation on the latest data in time, the first request response message further includes the cache expiration time of the latest data.
It should be noted that, if the target data is located in the plurality of cache servers, one server (the determined target cache server) of the plurality of cache servers that sends the data request message to the database may correspondingly obtain the first request response message from the database through the target cache server in S303, and the target cache server indicates the cache server that is successfully locked for the received second request response message.
And S304, updating the target data by using the latest data.
After receiving the latest data, the cache server may update the target data with the latest data.
When the target data is located in the plurality of cache servers and the first request response message is acquired by the target cache server, a cache update notification may be initiated to the plurality of cache servers (including the target cache server itself) through the target cache server, where the cache update notification includes the latest data, so as to distribute the latest data to the remaining cache servers and instruct the plurality of cache servers to update the target data, so that all the cache servers update the target data to the latest data, as shown in fig. 4.
After the target data is updated, a lock release request can be sent to the lock server through the target cache server, so that the target data is requested to be unlocked, and other services can operate the target data. And if a third request response message which is sent by the lock server and used for indicating unlocking is received through the target cache server, unlocking.
In a distributed deployment environment, a plurality of cache servers only select one cache server to update and distribute the latest data of target data to other cache servers based on lock competition, so that the consistency of cache updating is ensured, and the request pressure on a database is reduced.
According to the technical scheme, the cache data management method provided by the embodiment of the application can acquire the cache expiration time of the target data, judge whether the remaining time between the cache time of the target data and the cache expiration time reaches the preset threshold value before the cache expiration time reaches, if yes, send a data request message to the database, request the latest data corresponding to the target data from the database through the data request message, and update the target data by using the latest data included in the first request response message returned by the database. According to the method and the device, the updating mechanism can be started in advance before the target data cache is overdue, and the target data is updated in advance by using the acquired latest data, so that the problem of cache breakdown is avoided, the protection effect on a back-end database is improved, and the normal operation of an online service is ensured.
Next, a cache data management method provided by the embodiment of the present application will be described with reference to an actual application scenario. The cache data management system related in the application scenario includes, as shown in fig. 4, a terminal device 201 corresponding to a user, a plurality of cache servers 202, a database 203, a logic server 204, and a lock server 205, and by using the cache data management system, cache data management can be implemented, including access to data corresponding to a service, and updating data that is about to expire in the cache database in advance.
Referring to fig. 5, a signaling interaction diagram of a cache data management method based on the cache data management system shown in fig. 4 is shown, where the method includes:
s501, a user initiates a service request to a logic server through terminal equipment.
S502, the logic server requests the cached data from the cache server.
S503, the cache server returns data to the logic server.
And S504, the logic server returns data to the terminal equipment.
And S505, when the cache server determines that the target data cached locally is about to expire, the cache server sends a lock request to the lock server.
S506, the lock server returns a second request response message.
S507, the cache server sends a data request message to the database.
And S508, returning the latest data and the expiration time by the database.
S509, the cache server initiates a cache update notification to all cache servers, so that all cache servers update the target data with the latest data.
S510, the cache server sends a lock release request to the lock server.
And S511, the lock server returns a third request response message.
Based on the cache data management method provided in the foregoing embodiment, an embodiment of the present application provides a cache data management apparatus, referring to fig. 6a, the apparatus includes a first obtaining unit 601, a first sending unit 602, a second obtaining unit 603, and an updating unit 604:
the first obtaining unit 601 is configured to obtain a cache expiration time of the target data;
the first sending unit 602 is configured to send a data request message to a database if a remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, where the data request message is used to request the latest data corresponding to the target data;
the second obtaining unit 603 is configured to obtain a first request response message from the database, where the first request response message includes the latest data;
the updating unit 604 is configured to update the target data with the latest data.
In a possible implementation manner, if the target data is located in multiple cache servers, the first sending unit 602 is configured to:
sending a lock request message to a lock server, wherein the lock request message is used for requesting to lock the target data;
receiving a second request response message sent by the lock server;
if the second request response message indicates that the locking is successful, sending the data request message to the database; and only one cache server in the plurality of cache servers receives the second request response message indicating that the locking is successful.
In a possible implementation manner, the second obtaining unit 603 is configured to:
acquiring a first request response message from the database through a target cache server; the target cache server indicates a cache server which is successfully locked for the received second request response message;
the updating unit 604 is configured to:
and initiating a cache updating notice to the plurality of cache servers through the target cache server, wherein the cache updating notice comprises the latest data and is used for indicating the plurality of cache servers to update the target data.
In one possible implementation, referring to fig. 6b, the apparatus further includes a second sending unit 605 and a receiving unit 606:
the second sending unit 605 is configured to send a lock release request to the lock server through the target cache server;
the receiving unit 606 is configured to receive a third request response message sent by the lock server, where the third request response message is used to indicate unlocking.
In a possible implementation manner, the first request response message includes a cache expiration time of the latest data.
The embodiment of the present application further provides a device for cache data management, and the device for cache data management is described below with reference to the accompanying drawings. Referring to fig. 7, an embodiment of the present application provides an apparatus 700 for cache data management, where the apparatus 700 may also be a terminal apparatus, and the terminal apparatus may be any intelligent terminal including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a vehicle-mounted computer, and the terminal apparatus is a mobile phone for example:
fig. 7 is a block diagram illustrating a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Referring to fig. 7, the handset includes: radio Frequency (RF) circuit 710, memory 720, input unit 730, display unit 740, sensor 750, audio circuit 760, wireless fidelity (WiFi) module 770, processor 780, and power supply 790. Those skilled in the art will appreciate that the handset configuration shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 7:
the RF circuit 710 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then processes the received downlink information to the processor 780; in addition, the data for designing uplink is transmitted to the base station. In general, the RF circuit 710 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 710 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 720 may be used to store software programs and modules, and the processor 780 may execute various functional applications and data processing of the cellular phone by operating the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 730 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also referred to as a touch screen, can collect touch operations of a user (e.g. operations of the user on or near the touch panel 731 by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 731 may include two portions of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 780, and can receive and execute commands from the processor 780. In addition, the touch panel 731 may be implemented by various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 730 may include other input devices 732 in addition to the touch panel 731. In particular, other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 740 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 740 may include a display panel 741, and optionally, the display panel 741 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 731 can cover the display panel 741, and when the touch panel 731 detects a touch operation on or near the touch panel 731, the touch operation is transmitted to the processor 780 to determine the type of the touch event, and then the processor 780 provides a corresponding visual output on the display panel 741 according to the type of the touch event. Although the touch panel 731 and the display panel 741 are two independent components in fig. 7 to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 731 and the display panel 741 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 750, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 741 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 741 and/or a backlight when the mobile phone is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 760, speaker 761, and microphone 762 may provide an audio interface between a user and a cell phone. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the electrical signal is converted into a sound signal by the speaker 761 and output; on the other hand, the microphone 762 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 760, and then processes the audio data output processor 780, and then transmits the audio data to, for example, another cellular phone through the RF circuit 710, or outputs the audio data to the memory 720 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 770, and provides wireless broadband Internet access for the user. Although fig. 7 shows the WiFi module 770, it is understood that it does not belong to the essential constitution of the handset, and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 780 is a control center of the mobile phone, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 720 and calling data stored in the memory 720, thereby integrally monitoring the mobile phone. Optionally, processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 780.
The handset also includes a power supply 790 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 780 via a power management system, so that the power management system may be used to manage charging, discharging, and power consumption.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
The steps performed by the terminal device in the above-described embodiment may be based on the terminal device structure shown in fig. 7.
Referring to fig. 8, fig. 8 is a block diagram of a server 800 provided in this embodiment, where the server 800 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 822 (e.g., one or more processors) and a memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing applications 842 or data 844. Memory 832 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, a central processor 822 may be provided in communication with the storage medium 830 for executing a series of instruction operations in the storage medium 830 on the server 800.
The server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input-output interfaces 858, and/or one or more operating systems 841, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
In this embodiment, the processor 822 included in the server also has the following functions:
acquiring the cache expiration time of target data;
if the remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, sending a data request message to a database, wherein the data request message is used for requesting the latest data corresponding to the target data;
acquiring a first request response message from the database, wherein the first request response message comprises the latest data;
and updating the target data by using the latest data.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A cache data management method, the method comprising:
acquiring the cache expiration time of target data;
if the remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, sending a data request message to a database, wherein the data request message is used for requesting the latest data corresponding to the target data;
acquiring a first request response message from the database, wherein the first request response message comprises the latest data;
and updating the target data by using the latest data.
2. The method of claim 1, wherein if the target data is located in a plurality of cache servers, the sending a data request message to a database comprises:
sending a lock request message to a lock server, wherein the lock request message is used for requesting to lock the target data;
receiving a second request response message sent by the lock server;
if the second request response message indicates that the locking is successful, sending the data request message to the database; and only one cache server in the plurality of cache servers receives the second request response message indicating that the locking is successful.
3. The method of claim 2, wherein said retrieving a first request response message from said database comprises:
acquiring a first request response message from the database through a target cache server; the target cache server indicates a cache server which is successfully locked for the received second request response message;
the updating the target number by using the latest data comprises:
and initiating a cache updating notice to the plurality of cache servers through the target cache server, wherein the cache updating notice comprises the latest data and is used for indicating the plurality of cache servers to update the target data.
4. The method of claim 3, further comprising:
sending a lock release request to the lock server through the target cache server;
and receiving a third request response message sent by the lock server, wherein the third request response message is used for indicating unlocking.
5. The method according to any of claims 1-4, wherein the first request reply message includes a cache expiration time of the latest data.
6. The device for managing the cache data is characterized by comprising a first acquisition unit, a first sending unit, a second acquisition unit and an updating unit:
the first acquisition unit is used for acquiring the cache expiration time of the target data;
the first sending unit is configured to send a data request message to a database if a remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, where the data request message is used to request the latest data corresponding to the target data;
the second obtaining unit is configured to obtain a first request response message from the database, where the first request response message includes the latest data;
the updating unit is used for updating the target data by using the latest data.
7. A cache data management system, the system comprising a cache server and a database:
the cache server is used for acquiring the cache expiration time of the target data; if the remaining time between the caching time of the target data and the caching expiration time reaches a preset threshold, sending a data request message to a database, wherein the data request message is used for requesting the latest data corresponding to the target data;
the database is used for returning a first request response message to the cache server, wherein the first request response message comprises the latest data;
the cache server is further configured to update the target data with the latest data.
8. The system of claim 7, wherein if the target data is located in multiple cache servers, the system further comprises a lock server:
the cache server is configured to send a lock request message to the lock server, where the lock request message is used to request to lock the target data;
the lock server is used for sending second request response messages to the cache servers; and only one of the cache servers receives the second request response message indicating that the locking is successful.
9. An apparatus for cache data management, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the method of any of claims 1-5 according to instructions in the program code.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium is configured to store a program code for performing the method of any of claims 1-5.
CN202010097591.4A 2020-02-17 2020-02-17 Cache data management method and related device Pending CN111259034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010097591.4A CN111259034A (en) 2020-02-17 2020-02-17 Cache data management method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010097591.4A CN111259034A (en) 2020-02-17 2020-02-17 Cache data management method and related device

Publications (1)

Publication Number Publication Date
CN111259034A true CN111259034A (en) 2020-06-09

Family

ID=70943370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010097591.4A Pending CN111259034A (en) 2020-02-17 2020-02-17 Cache data management method and related device

Country Status (1)

Country Link
CN (1) CN111259034A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898054A (en) * 2020-08-07 2020-11-06 湖南快乐阳光互动娱乐传媒有限公司 Reverse cache control method and system, server, client and service end
CN112035496A (en) * 2020-08-28 2020-12-04 平安科技(深圳)有限公司 Data processing method, related equipment and computer readable storage medium
CN112559573A (en) * 2020-12-24 2021-03-26 京东数字科技控股股份有限公司 Data caching method, device, equipment and computer readable medium
CN113515530A (en) * 2021-03-30 2021-10-19 贵州白山云科技股份有限公司 Cache object updating method, device, equipment and storage medium
CN113760982A (en) * 2021-01-18 2021-12-07 西安京迅递供应链科技有限公司 Data processing method and device
CN114143376A (en) * 2021-11-18 2022-03-04 青岛聚看云科技有限公司 Server for loading cache, display equipment and resource playing method
CN113760982B (en) * 2021-01-18 2024-05-17 西安京迅递供应链科技有限公司 Data processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391862A (en) * 2014-10-23 2015-03-04 北京锐安科技有限公司 Method and device for updating cache data
CN107291756A (en) * 2016-04-01 2017-10-24 阿里巴巴集团控股有限公司 The method and device of data buffer storage
CN107943594A (en) * 2016-10-13 2018-04-20 北京京东尚科信息技术有限公司 Data capture method and device
CN107977376A (en) * 2016-10-24 2018-05-01 腾讯科技(深圳)有限公司 Distributed data base system and transaction methods
CN108334505A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of data processing method, device, server and inventory system
CN110489696A (en) * 2019-07-31 2019-11-22 上海艾融软件股份有限公司 Buffering updating method, device and electronic equipment, storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391862A (en) * 2014-10-23 2015-03-04 北京锐安科技有限公司 Method and device for updating cache data
CN107291756A (en) * 2016-04-01 2017-10-24 阿里巴巴集团控股有限公司 The method and device of data buffer storage
CN107943594A (en) * 2016-10-13 2018-04-20 北京京东尚科信息技术有限公司 Data capture method and device
CN107977376A (en) * 2016-10-24 2018-05-01 腾讯科技(深圳)有限公司 Distributed data base system and transaction methods
CN108334505A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of data processing method, device, server and inventory system
CN110489696A (en) * 2019-07-31 2019-11-22 上海艾融软件股份有限公司 Buffering updating method, device and electronic equipment, storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898054A (en) * 2020-08-07 2020-11-06 湖南快乐阳光互动娱乐传媒有限公司 Reverse cache control method and system, server, client and service end
CN112035496A (en) * 2020-08-28 2020-12-04 平安科技(深圳)有限公司 Data processing method, related equipment and computer readable storage medium
CN112559573A (en) * 2020-12-24 2021-03-26 京东数字科技控股股份有限公司 Data caching method, device, equipment and computer readable medium
CN112559573B (en) * 2020-12-24 2024-04-16 京东科技控股股份有限公司 Data caching method, device, equipment and computer readable medium
CN113760982A (en) * 2021-01-18 2021-12-07 西安京迅递供应链科技有限公司 Data processing method and device
CN113760982B (en) * 2021-01-18 2024-05-17 西安京迅递供应链科技有限公司 Data processing method and device
CN113515530A (en) * 2021-03-30 2021-10-19 贵州白山云科技股份有限公司 Cache object updating method, device, equipment and storage medium
CN114143376A (en) * 2021-11-18 2022-03-04 青岛聚看云科技有限公司 Server for loading cache, display equipment and resource playing method

Similar Documents

Publication Publication Date Title
CN111259034A (en) Cache data management method and related device
CN108601059B (en) Frequency point selection method and device and mobile terminal
CN110620822A (en) Network element determination method and device
CN105498213A (en) Aiming method and device in shooting game
CN109445917B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN107800585B (en) Network communication method and device, and message pushing method and device
CN111770529A (en) Method for processing relaxation measurement parameter update and terminal equipment
CN106326489B (en) Method and device for updating network resources
CN108112028B (en) Network searching method and equipment for international roaming
CN107534935B (en) Terminal device and positioning information processing method for terminal device
CN103312783B (en) Method, device and system for switching function modes
CN111966373B (en) APN resetting method, terminal equipment and storage medium
CN106713627B (en) Method and device for pushing message in notification bar and mobile terminal
CN106851784B (en) network scanning method and terminal equipment
CN111880928A (en) Method for selecting process to release and terminal equipment
CN108712281B (en) Method, device, storage medium and terminal for triggering detection management application update
CN108804434B (en) Message query method, server and terminal equipment
CN116468382A (en) RPA robot flow management method, device, equipment and storage medium
CN115794654A (en) Test case distribution processing method, system, equipment and storage medium
CN112214699B (en) Page processing method and related device
CN111314900B (en) Wireless connection method, wireless connection device and mobile terminal
CN109002535B (en) Data updating method and device
CN113835957A (en) Crawler task monitoring method and device
CN109905445B (en) Instruction processing method and terminal
CN107613537B (en) Frequency control method for signal quality detection and related product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40025229

Country of ref document: HK

RJ01 Rejection of invention patent application after publication

Application publication date: 20200609

RJ01 Rejection of invention patent application after publication