The application is a divisional application of CN105630823A, the application date of the original application is 2014, 11 months and 4 days, the application number is 201410613792.X, and the invention is named as a method, a device and a system for monitoring cache data based on a distributed system.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented 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.
Example 1
In its most basic configuration, fig. 1 is a schematic structural diagram of a monitoring system based on cache data of a distributed system according to a first embodiment of the present application. For purposes of description, the architecture portrayed is only one example of a suitable environment and is not intended to suggest any limitation as to the scope of use or functionality of the application. Neither should the computing system be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in FIG. 1.
As shown in fig. 1, the monitoring system based on the cache data of the distributed system provided by the application may include: an application terminal cluster 10, a database terminal 12, and a cache monitor server 14.
Wherein a cluster of terminals 10 is applied; a database terminal 12, which establishes a communication relationship with the application terminal cluster and is used for storing a hot spot database and a cache state database; the cache monitoring server 14 is configured to establish a communication relationship with the database terminal, and is configured to detect whether hot spot data in a hot spot data table of the hot spot database is updated, and if it is detected that the hot spot data in the hot spot data table of the hot spot database is updated, modify a hot spot data cache state associated with the hot spot data updated in the hot spot data table to a to-be-updated state, and if the hot spot data cache state in the cache state database is the to-be-updated state, drive the application terminal cluster to refresh the locally cached hot spot data; the application terminal cluster registers the locally cached hot spot data to a hot spot database to obtain hot spot data in a hot spot data table, and a hot spot data cache state associated with the hot spot data updated in the hot spot data table is pre-stored in a cache state database.
As can be seen from analysis, in the first embodiment of the present application, the cache monitoring server monitors the hot spot data in the hot spot data table of the hot spot database in real time, and once the cache monitoring server finds that the hot spot data in the hot spot data table in the hot spot database changes, immediately modifies the cache state of the hot spot data in the hot spot data table corresponding to the hot spot database in the cache state database to be the state to be updated, so as to ensure the accuracy of the data in the cache state database.
Meanwhile, the cache monitoring server scans the cache state database in unit time, and if the cache monitoring server detects that the hot spot data cache state in the cache state database is the state to be updated, the cache monitoring server drives the application terminals in the application terminal cluster to refresh the hot spot data corresponding to the hot spot data locally.
The steps provided in the first embodiment of the present application may be applied to the cache monitor server 14, and in the implementation process, one implementation manner of the cache monitor server in the first embodiment of the present application may be a cache monitor server used by a network bank client to implement a rule that "user login behavior belongs to high risk behavior in a different place (across provinces)" in order to achieve refresh, and the first embodiment of the present application is described in detail below by taking the cache monitor server as an example.
In the first embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior in 30 minutes" may be considered as a piece of hotspot data, and may be stored in the hotspot server of the bank. And the cache monitoring server of the bank monitors the piece of hot spot data in the hot spot data table in the hot spot database of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server immediately modifies the regular cache state of the hot spot data table corresponding to the hot spot database in the cache state database to be the state to be updated. Meanwhile, the cache monitoring server of the bank scans the cache state database in unit time (the unit time can be 1 second, 1 minute or 1 hour, and other time forms can be also adopted, for example, a user logs in each time by using the network bank client, operates each time by using the network bank client, and the like), and if the cache monitoring server detects that the cache state of the hot spot data in the cache state database is to be updated, the cache monitoring server of the bank drives all application terminals installed with the network bank client to update the hot spot data corresponding to the hot spot data in the local cache.
Preferably, in the solution provided in the first embodiment of the present application, the application terminal cluster 10 may include: at least one application terminal 101, each application terminal receives the refresh notification sent by the cache monitoring server, and after accessing the hot spot data table of the hot spot database according to the refresh notification and reading the updated hot spot data, the updated hot spot data is cached in the memory of the local application, so as to update the hot spot data.
When the application terminals receive the refreshing notification sent by the cache monitoring server, each application terminal in the application cluster accesses a hot spot data table of the hot spot database according to the refreshing notification, reads the updated hot spot data and caches the updated hot spot data in a memory of a local application of each application terminal in the application terminal cluster.
In a specific implementation process, an implementation manner of the application terminal cluster in the first embodiment may be an application terminal used by the internet banking client to implement a rule that "in 30 minutes, user login behavior belongs to high risk behavior" occurs in a different place (across provinces) for refreshing, and a specific example of an application terminal installed in a certain application terminal cluster is described in detail below.
In the first embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior in 30 minutes" may be considered as a piece of hotspot data, and may be stored in the hotspot server of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server detects the update of the hot spot data and notifies the application terminal. After receiving the update notification, the application terminal installed with the online banking client accesses a hotspot data table of a banking hotspot database, reads and updates the hotspot data table into a memory of a local online banking client of the application terminal, wherein the hotspot data table is updated to be "in 20 minutes, and a user login behavior belongs to a high risk behavior when the user is in a different place (across provinces)".
Preferably, in the first embodiment of the present application, the database terminal 12 may include a database processor 120 and a memory 122.
The database processor 120 is configured to register, when any one or more application terminals in the application terminal cluster are started for the first time, initialization information of hot spot data cached in each application terminal to a cache state database, where the initialization information includes: the machine name, the IP address, the cache name, the hot spot data cache state, the timestamp and the cache version of the application terminal;
When one or more application terminals in the application terminal cluster are started for the first time, the database processor of the database terminal registers initialization information of hot spot data cached in each application terminal in the cache state database, and the initialization information of each application terminal can include: machine name, IP address, cache name, hot spot data cache status, timestamp, cache version, etc. of the application terminal. The main purpose of the initialization information is to realize the basic functions of identifying the application terminal, reading the geographic position, confirming the cache version and the like.
And a memory 122, connected to the database processor, for storing the cache state database. After the hot spot data is loaded to the application terminals, the initialization information is successfully initialized, and the cache registration information of each application terminal is stored.
And after the initialization of the terminal is completed, the memory obtains the cache registration information of the application terminal.
Preferably, the hot spot data cache state in the cache state database comprises: the application terminals in the application terminal cluster 10 are further configured to generate a refresh completion notification after the application terminals in the application terminal cluster cache the updated hot spot data in the memory of the local application, and convert the hot spot data cache state in the cache state database from the state to be updated to the update completion state by using the refresh completion notification.
After the application terminals in the application terminal cluster cache the updated hot spot data in the application memory of the local application terminal, the application terminal generates a refreshing completion notification. And after receiving the refreshing completion notification, the cache state database converts the hot spot data cache state in the cache state database from the state to be updated to the updating completion state. The cache monitoring server is prevented from repeatedly driving the application terminal cluster to refresh the locally cached hot spot data, and waste of hot spot database resources is avoided.
Preferably, in the solution provided in the first embodiment of the present application, the cache monitor server 14 may include a monitor processor 141, configured to detect whether the number of cache registration information of each application terminal in the application terminal cluster is the same, and if not, read cache registration information of an application terminal with an abnormal number, and send out prompt information with an abnormal number; or detecting whether the hot spot data caching states of each application terminal in the application terminal cluster are consistent, if not, reading caching registration information of the application terminal with abnormal hot spot data caching states, and sending out prompt information of the abnormal hot spot data caching states.
The monitoring processor 141 is configured to determine that each application terminal in the application terminal cluster is abnormal. The method of determining abnormality can be divided into two types. The cache monitoring server detects cache registration information in each application in the application terminal cluster and detects whether the number of entries of the cache registration information of each application terminal is the same. If the number of the cache information of one application terminal is different from the number of the cache information of other application terminals, judging that the cache information of the application terminal is abnormal, reading the cache registration information of the application terminal with the abnormal registration information number, and sending out prompt information of the abnormal cache registration information number. Or through the other type, the cache monitoring server detects the hot spot data cache state of each application terminal in the application terminal cluster and detects whether the cache state of each application terminal is consistent. If the cache state of one application terminal is different from the cache states of other application terminals, judging that the cache information of the application terminal corresponding to the hot spot data cache state with the abnormality exists, reading the cache registration information of the application terminal with the abnormality in the cache information, and sending prompt information of the abnormality in the hot spot data cache state. The buffer monitoring server is used for performing abnormal monitoring on the buffer data of each application terminal in the application terminal cluster.
Preferably, in the first embodiment of the present application, the monitor processor 141 is further configured to drive the application terminals with abnormal numbers to read the hotspot data table of the access hotspot database, read all the hotspot data, and synchronously cache all the read hotspot data into the memory of the application terminal.
The monitoring processor 141 may be used for processing after an abnormality occurs in each application terminal in the application terminal cluster. After detecting the abnormal prompt information, the monitoring processor in the cache monitoring server drives the application terminal corresponding to the quantity abnormal information to access a hot spot data table of a hot spot database of the database terminal, re-reads all hot spot data, and caches all read hot spot data into a memory of a local application of the application terminal. The method and the device realize refreshing of the abnormal cache data, thereby solving the problem of local cache data abnormality.
Example 2
In accordance with embodiments of the present application, there is also provided a method embodiment of a method for monitoring cache data based on a distributed system, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Fig. 2 is a flowchart of a method for monitoring cache data based on a distributed system according to a second embodiment of the present application.
As shown in fig. 2, the method may be applied to a cache monitoring server, and the implementation process of the method for monitoring cache data based on a distributed system of the present application is described in detail from the perspective of the cache monitoring server, and may include the following steps:
step S20, detecting whether the hot spot data in the hot spot data table establishing the communication relation with the application terminal cluster is updated, wherein the application terminal cluster registers the locally cached hot spot data to the hot spot data table.
In the step S20, the hot spot data table may be stored in the hot spot database, and the hot spot data in the hot spot data table in the database may be read by accessing the hot spot database through the cache monitoring server, so as to detect whether the hot spot data is updated. The hot spot data database can be independently stored in a third party server side or can be directly stored in a cache monitoring server.
In step S22, when it is detected that the hot spot data in the hot spot data table is updated, the hot spot data cache state associated with the hot spot data updated in the hot spot data table is modified to be a to-be-updated state, where the hot spot data cache state associated with the hot spot data updated in the hot spot data table is pre-stored in the cache state database.
In the step S22, if the cache monitoring server detects that the hot spot data in the hot spot data table of the hot spot database changes, the cache monitoring server will modify the cache state of the hot spot data in the hot spot data table corresponding to the hot spot database in the cache state database to be the state to be updated.
It should be noted that, the cache state database in the above step is used for storing the hot spot data cache state and the association information for characterizing the hot spot data cache state and the corresponding hot spot data. The hot spot database can be combined with the cache state database to form a database. In addition, the combined database can be independently stored in a third-party server side or can be directly stored in a cache monitoring server.
And step S24, if the hot spot data caching state is the state to be updated, driving the application terminal cluster to refresh the locally cached hot spot data.
In the above step S24, the cache monitor server periodically scans the cache state database at a set time. When the hot spot data cache state in the cache state database is scanned to be the state to be updated, the cache monitoring server drives the application terminals in the application terminal cluster to refresh the hot spot data corresponding to the hot spot data.
In the second embodiment, the cache monitoring server monitors the hot spot data in the hot spot data table of the hot spot database in real time, and once the cache monitoring server finds that the hot spot data in the hot spot data table in the hot spot database changes, the cache state of the hot spot data in the hot spot data table corresponding to the hot spot database in the cache state database is immediately modified to be the state to be updated, so as to ensure the accuracy of the data in the cache state database.
Meanwhile, the cache monitoring server scans the cache state database in unit time, and if the cache monitoring server detects that the hot spot data cache state in the cache state database is the state to be updated, the cache monitoring server drives the application terminals in the application terminal cluster to refresh the hot spot data corresponding to the hot spot data locally.
In the implementation process, one implementation manner of the cache monitor server in the second embodiment may be a cache monitor server used by a network bank client to implement a rule that "user login behavior belongs to high risk behavior in a different place (across provinces)" in 30 minutes, and the cache monitor server is taken as an example, and the second embodiment is described in detail below.
In the first embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior in 30 minutes" may be considered as a piece of hotspot data, and may be stored in the hotspot server of the bank. And the cache monitoring server of the bank monitors the piece of hot spot data in the hot spot data table in the hot spot database of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server immediately modifies the regular cache state of the hot spot data table corresponding to the hot spot database in the cache state database to be the state to be updated. Meanwhile, the cache monitoring server of the bank scans the cache state database in unit time (the unit time can be 1 second, 1 minute or 1 hour, and other time forms can be also adopted, for example, a user logs in each time by using the network bank client, operates each time by using the network bank client, and the like), and if the cache monitoring server detects that the cache state of the hot spot data in the cache state database is to be updated, the cache monitoring server of the bank drives all application terminals installed with the network bank client to update the hot spot data corresponding to the hot spot data in the local cache.
Preferably, as shown in fig. 3, in the solution provided in the second embodiment of the present application, the solution for driving the application terminal cluster to refresh the locally cached hotspot data implemented in step S24 may include the following implementation steps:
step S241, a refreshing notification is sent to the application terminal cluster, so that the application terminals in the application terminal cluster update the hot spot data according to the refreshing notification. Specifically, the application terminal in the step can access the hot spot data table through the refresh notification to read the updated hot spot data, and modify the local hot spot data by using the updated hot spot data, so that the application terminal updates the hot spot data according to the refresh notification.
After the refreshing notification is sent to the application terminal cluster, the refreshing notification triggers the application terminals in the application terminal cluster to access the hot spot data table of the hot spot database, the hot spot data table is scanned, and after updated hot spot data in the hot spot data table is detected, the updated hot spot data is cached. It should be noted that, in the process of caching the updated hot spot data, the old hot spot data may be first deleted, then the current updated hot spot data is cached in the memory of the local application, or the updated hot spot data may be directly used to replace the old hot spot data, in addition, if the requirement of hot spot data recovery is considered, after the current updated hot spot data is cached in the memory of the local application, the old hot spot data may be cached for a certain time, and then automatically deleted after a certain time.
The scheme can also be applied to each application terminal in the application terminal cluster. After receiving the refreshing notification sent by the cache monitoring server, each application terminal in the application cluster accesses the hot spot data table of the hot spot database according to the refreshing notification, reads the updated hot spot data and caches the updated hot spot data in the memory of the local application of each application terminal in the application terminal cluster.
In a specific implementation process, an implementation manner of the application terminal cluster in the second embodiment may be an application terminal used by the internet banking client to implement a rule that "in 30 minutes, user login behavior belongs to high risk behavior" occurs in a different place (across provinces) for refreshing, and the second embodiment is described in detail below by taking an example in which an internet banking client application terminal is installed in one of the application terminal clusters.
In the second embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior" is considered as a piece of hotspot data in 30 minutes, and may be stored in the hotspot server of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server detects the update of the hot spot data and notifies the application terminal. After receiving the update notification, the application terminal installed with the online banking client accesses a hotspot data table of a banking hotspot database, reads and updates the hotspot data table into a memory of a local online banking client of the application terminal, wherein the hotspot data table is updated to be "in 20 minutes, and a user login behavior belongs to a high risk behavior when the user is in a different place (across provinces)".
Preferably, as shown in fig. 4, in the above-mentioned embodiment of the present application, before modifying the hot spot data cache state associated with the hot spot data updated in the hot spot data table to the to-be-updated state in step S22, the following implementation steps may be further performed:
step S211, when any one or more application terminals in the application terminal cluster are started for the first time, registering initialization information of hot spot data cached in each application terminal to a cache state database, where the initialization information includes: the machine name, the IP address, the cache name, the hot spot data cache state, the timestamp and the cache version of the application terminal;
the step S211 may be performed on a database processor of the database terminal. When one or more application terminals in the application terminal cluster are started for the first time, the initialization information of the hot spot data cached in each application terminal is registered in a cache state database, and the initialization information of each application terminal can include: machine name, IP address, cache name, hot spot data cache status, timestamp, cache version, etc. of the application terminal. The main purpose of the initialization information is to realize the basic functions of identifying the application terminal, reading the geographic position, confirming the cache version and the like.
Step S213, after loading the hot spot data to the application terminal and initializing the initialization information successfully, obtaining the cache registration information of each application terminal.
In step S213, after the initialized application terminal in the application terminal cluster normally loads the hot spot data and completes initializing the terminal, the memory of the database terminal will obtain the cache registration information of the application terminal.
Preferably, as shown in fig. 5, in the solution provided in the second embodiment of the present application, the hot spot data caching status includes: a to-be-updated state and an update completion state, wherein after the step S241 is implemented to enable the application terminals in the application terminal cluster to update the hotspot data, the following implementation steps may be further performed:
step S2451 receives a refresh completion notification generated by an application terminal in the application terminal cluster.
Step S2453 uses the refresh complete notification to transform the hot spot data cache state in the cache state database from the state to be updated to the update complete state.
In the steps S2451 to S2453, after the application terminal in the application terminal cluster caches the updated hot spot data in the application memory of the local application terminal, the application terminal generates a refresh completion notification. And after receiving the refreshing completion notification, the cache state database converts the hot spot data cache state in the cache state database from the state to be updated to the updating completion state. The cache monitoring server is prevented from repeatedly driving the application terminal cluster to refresh the locally cached hot spot data, and waste of hot spot database resources is avoided.
Preferably, in the solution provided in the second embodiment of the present application, after driving the application terminal cluster to refresh the locally cached hot spot data in step S24, the following implementation steps may be further executed:
step S251, detecting whether the number of the cache registration information of each application terminal in the application terminal cluster is the same, if not, reading the cache registration information of the application terminals with abnormal number, and sending out prompt information with abnormal number; or alternatively
Step S253, detecting whether the hot spot data caching states of each application terminal in the application terminal cluster are consistent, if not, reading caching registration information of the application terminals with abnormal hot spot data caching states, and sending out prompt information of the abnormal hot spot data caching states.
The steps S251 to S253 are specific implementation steps for performing abnormality determination for each application terminal in the application terminal cluster. The method of determining abnormality can be divided into two types. In step S251, the cache monitoring server detects cache registration information in each application in the application terminal cluster, and detects whether the number of entries of the cache registration information of each application terminal is the same. If the number of the cache information of one application terminal is different from the number of the cache information of other application terminals, judging that the cache information of the application terminal is abnormal, reading the cache registration information of the application terminal with the abnormal registration information number, and sending out prompt information of the abnormal cache registration information number. Or, through step S253, the cache monitoring server detects the hot spot data cache state of each application terminal in the application terminal cluster, and detects whether the cache state of each application terminal is consistent. If the cache state of one application terminal is different from the cache states of other application terminals, judging that the cache information of the application terminal corresponding to the hot spot data cache state with the abnormality exists, reading the cache registration information of the application terminal with the abnormality in the cache information, and sending prompt information of the abnormality in the hot spot data cache state. The buffer monitoring server is used for performing abnormal monitoring on the buffer data of each application terminal in the application terminal cluster.
Preferably, in the solution provided in the second embodiment of the present application, after the cache registration information of the application terminal with the abnormal number is read in step S251 or after the cache registration information of the application terminal with the abnormal hot spot data cache state is read in step S253, the following implementation steps may be further executed:
step S261, driving an application terminal with abnormal quantity to access a hot spot data table of a hot spot database, and reading all hot spot data;
step S263, all the read hot spot data are synchronously cached in the memory of the application terminal.
The steps S261 to S263 are specific implementation steps after abnormality occurs in each application terminal in the application terminal cluster. After detecting the abnormal prompt information, the monitoring processor in the cache monitoring server drives the application terminal corresponding to the quantity abnormal information to access a hot spot data table of a hot spot database of the database terminal, re-reads all hot spot data, and caches all read hot spot data into a memory of a local application of the application terminal. The method and the device realize refreshing of the abnormal cache data, thereby solving the problem of local cache data abnormality.
It should be noted that, for simplicity of description, the foregoing method embodiments two are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the described action sequences, as some steps may be performed in other sequences or simultaneously, according to the present application. Further, it should be understood by those skilled in the art that the second embodiment described in the specification is a preferred second embodiment, and the actions and modules involved are not necessarily required in the present application.
From the above description of the embodiments, it will be clear to those skilled in the art that the method according to the second embodiment may be implemented by means of software plus necessary general hardware platform, or may be implemented by hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the second embodiment of the present application.
Example 3
Fig. 6 is a schematic diagram of a monitoring device for cached data based on a distributed system according to a third embodiment of the present application. As shown in fig. 6, the apparatus may include: a detection module 301, a modification status module 303 and a driving module 305.
The detection module 301 is configured to detect whether hot spot data in a hot spot data table that establishes a communication relationship with the application terminal cluster is updated, where the application terminal cluster registers locally cached hot spot data in the hot spot data table; the modification state module 303 is configured to modify, when it is detected that the hotspot data in the hotspot data table is updated, a hotspot data cache state associated with the hotspot data in the hotspot data table that is updated to a to-be-updated state, where the hotspot data cache state associated with the hotspot data in the hotspot data table that is updated is pre-stored in a cache state database; the driving module 305 is configured to drive the application terminal cluster to refresh the locally cached hotspot data if the hotspot data cache state is a state to be updated.
It should be noted that, in the foregoing embodiment of the present invention, the hotspot data table may be stored in a hotspot database, and the cache monitoring server may access the hotspot database to read the hotspot data in the hotspot data table in the database, so as to detect whether the hotspot data is updated. The hot spot data database can be independently stored in a third party server side or can be directly stored in a cache monitoring server.
The cache state database in the above embodiment may be used to store the hot spot data cache state, and the association information used to characterize the hot spot data cache state and the corresponding hot spot data. The hot spot database can be combined with the cache state database to form a database. In addition, the combined database can be independently stored in a third-party server side or can be directly stored in a cache monitoring server.
In the third embodiment of the present invention, the cache monitoring server monitors the hot spot data in the hot spot data table of the hot spot database in real time, and once the cache monitoring server finds that the hot spot data in the hot spot data table in the hot spot database changes, the cache state of the hot spot data in the hot spot data table corresponding to the hot spot database in the cache state database is immediately modified to be the state to be updated, so as to ensure the accuracy of the data in the cache state database.
Meanwhile, the cache monitoring server scans the cache state database in unit time, and if the cache monitoring server detects that the hot spot data cache state in the cache state database is the state to be updated, the cache monitoring server drives the application terminals in the application terminal cluster to refresh the hot spot data corresponding to the hot spot data locally.
In the implementation process, an implementation manner of the cache monitor server in the third embodiment may be a cache monitor server used by a network bank client to implement a rule that "user login behavior belongs to high risk behavior in a different place (across provinces)" in order to refresh, and the third embodiment is described in detail below by taking the cache monitor server as an example.
In the third embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior" is considered as a piece of hotspot data in 30 minutes, and may be stored in the hotspot server of the bank. And the cache monitoring server of the bank monitors the piece of hot spot data in the hot spot data table in the hot spot database of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server immediately modifies the regular cache state of the hot spot data table corresponding to the hot spot database in the cache state database to be the state to be updated. Meanwhile, the cache monitoring server of the bank scans the cache state database in unit time (the unit time can be 1 second, 1 minute or 1 hour, and other time forms can be also adopted, for example, a user logs in each time by using the network bank client, operates each time by using the network bank client, and the like), and if the cache monitoring server detects that the cache state of the hot spot data in the cache state database is to be updated, the cache monitoring server of the bank drives all application terminals installed with the network bank client to update the hot spot data corresponding to the hot spot data in the local cache.
It should be noted that, the detection module 301, the modification status module 303, and the driving module 305 correspond to steps S20 to S24 in the second embodiment, and the three modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the second embodiment. It should be noted that the above modules may be implemented in software or hardware as a part of the apparatus and be executed in the cache monitor server 14 provided in the first embodiment.
After the driving module 10 drives the application terminal cluster to refresh the locally cached hot spot data, the receiving module of the application terminal cluster receives the refresh notification.
And the reading module of the application terminal in the application terminal cluster accesses the hot spot data table of the hot spot database according to the refreshing notification, and reads the updated hot spot data. And the updating module of the application terminal caches the updated hot spot data into the memory of the local application to realize the updating of the hot spot data.
The modules provided in the third embodiment of the present application may be applied to each application terminal in the user terminal cluster. After receiving the refreshing notification sent by the cache monitoring server, each application terminal in the application cluster accesses the hot spot data table of the hot spot database according to the refreshing notification, reads the updated hot spot data and caches the updated hot spot data in the memory of the local application of each application terminal in the application terminal cluster.
In a specific implementation process, an implementation manner of the application terminal cluster in the third embodiment may be an application terminal used by the internet banking client to implement a rule that "in 30 minutes, user login behavior belongs to high risk behavior" occurs in a different place (across provinces) for refreshing, and the third embodiment is described in detail below by taking an example in which an internet banking client application terminal is installed in one of the application terminal clusters.
In the third embodiment, the rule that "the user logs in to the user login behavior in the different place (across provinces) and belongs to the high risk behavior" is considered as a piece of hotspot data in 30 minutes, and may be stored in the hotspot server of the bank. When the bank hot spot server modifies the hot spot data to the state that the user login behavior belongs to high risk behavior in different places (across provinces) within 20 minutes, the bank cache monitoring server detects the update of the hot spot data and notifies the application terminal. After receiving the update notification, the application terminal installed with the online banking client accesses a hotspot data table of a banking hotspot database, reads and updates the hotspot data table into a memory of a local online banking client of the application terminal, wherein the hotspot data table is updated to be "in 20 minutes, and a user login behavior belongs to a high risk behavior when the user is in a different place (across provinces)".
Before the modification state module 303 modifies the hot spot data cache state corresponding to the hot spot data table in the cache state database to a state to be updated, if any one or more application terminals in the application terminal cluster are started for the first time, the initialization module is configured to register initialization information of the hot spot data cached in each application terminal to the cache state database, where the initialization information includes: the method comprises the steps of machine name, IP address, cache name, hot spot data cache state, timestamp and cache version of an application terminal.
The initialization module can be used on a database processor of a database terminal. When one or more application terminals in the application terminal cluster are started for the first time, the initialization information of the hot spot data cached in each application terminal is registered in a cache state database, and the initialization information of each application terminal can include: machine name, IP address, cache name, hot spot data cache status, timestamp, cache version, etc. of the application terminal. The main purpose of the initialization information is to realize the basic functions of identifying the application terminal, reading the geographic position, confirming the cache version and the like.
If the initialization module of the application terminal is successful in initializing the initialization information after loading the hot spot data into the application terminal, the sub-acquisition module of the database terminal will obtain the cache registration information of each application terminal.
And the sub-acquisition module is used for acquiring cache registration information of the application terminal after the initialized application terminal in the application terminal cluster normally loads hot spot data and completes initialization of the terminal.
In the third embodiment, the hot spot data cache state includes: the driver module 305 generates a refresh completion notification after the application terminals in the application terminal cluster cache the updated hot spot data in the memory of the local application. And converting the hot spot data cache state in the cache state database from the state to be updated to the update completion state by using the refresh completion notification.
After the application terminals in the application terminal cluster cache the updated hot spot data in the application memory of the local application terminal, the application terminals generate a refreshing completion notification. And after receiving the refreshing completion notification, the cache state database converts the hot spot data cache state in the cache state database from the state to be updated to the updating completion state. The cache monitoring server is prevented from repeatedly driving the application terminal cluster to refresh the locally cached hot spot data, and waste of hot spot database resources is avoided.
After the driving module 305 drives the application terminal cluster to refresh the locally cached hot spot data, a first sub-detection module in the cache monitoring server is used for detecting whether the number of cache registration information of each application terminal in the application terminal cluster is the same, if not, reading cache registration information of application terminals with abnormal number, and sending out prompt information with abnormal number; or the second sub-detection module in the cache monitoring server detects whether the hot spot data cache state of each application terminal in the application terminal cluster is consistent, if not, the cache registration information of the application terminal with the abnormal hot spot data cache state is read, and prompt information of the abnormal hot spot data cache state is sent out.
The two self-detection modules are specific implementation steps for carrying out abnormality judgment on each application terminal in the application terminal cluster. The method of determining abnormality can be divided into two types. The first sub-detection module is used for detecting cache registration information in each application in the application terminal cluster by the cache monitoring server and detecting whether the number of entries of the cache registration information of each application terminal is the same. If the number of the cache information of one application terminal is different from the number of the cache information of other application terminals, judging that the cache information of the application terminal is abnormal, reading the cache registration information of the application terminal with the abnormal registration information number, and sending out prompt information of the abnormal cache registration information number. Or the second sub-detection module is used for detecting the hot spot data cache state of each application terminal in the application terminal cluster by the cache monitoring server and detecting whether the cache state of each application terminal is consistent. If the cache state of one application terminal is different from the cache states of other application terminals, judging that the cache information of the application terminal corresponding to the hot spot data cache state with the abnormality exists, reading the cache registration information of the application terminal with the abnormality in the cache information, and sending prompt information of the abnormality in the hot spot data cache state. The buffer monitoring server is used for performing abnormal monitoring on the buffer data of each application terminal in the application terminal cluster.
Further, after the cache registration information of the application terminals with abnormal quantity is read, or after the cache registration information of the application terminals with abnormal hot spot data cache states is read, the sub-driving module drives the application terminals with abnormal quantity to read and access the hot spot data table of the hot spot database, and reads all the hot spot data; and synchronously caching all the read hot spot data into the memory of the application terminal.
The step performed by the sub-driving module is a specific implementation step after each application terminal in the application terminal cluster is abnormal. After detecting the abnormal prompt information, the monitoring processor in the cache monitoring server drives the application terminal corresponding to the quantity abnormal information to access a hot spot data table of a hot spot database of the database terminal, re-reads all hot spot data, and caches all read hot spot data into a memory of a local application of the application terminal. The method and the device realize refreshing of the abnormal cache data, thereby solving the problem of local cache data abnormality.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.