The content of the invention
Based on this, it is necessary to provide a kind of data cached processing method, it is possible to increase the reading efficiency of data in caching,
And effectively reduce server stress.
A kind of data cached processing unit is provided in addition, there is a need to, it is possible to increase the reading efficiency of data in caching,
And effectively reduce server stress.
A kind of data cached processing method, including:
The initial configuration sent by registration center's node receiving terminal is asked, and extracts the initial configuration request
In access instances;
The configuration information matched with the access instances is obtained, and the configuration information is sent to the terminal, so that
The memory node that the terminal accesses according to needed for obtaining the configuration information;
The access request of the terminal is received by the memory node;
The access request is parsed, obtains major key, the NameSpace of the major key and action type;
Data corresponding to being obtained according to the NameSpace of the major key and major key from the memory node, and according to described
Action type is handled the data of acquisition.
In one of the embodiments, the memory node includes primary storage node and standby memory node;
The access request that the terminal is received by the memory node, including:
The access request of the terminal is received by the primary storage node;
After the step of access request that the terminal is received by the primary storage node described, in addition to:
Detect whether the primary storage node breaks down, if breaking down, obtain corresponding with the primary storage node
Standby memory node;
It is described obtained according to the NameSpace of the major key and major key from the memory node corresponding to data, and according to
The action type is handled the data of acquisition, including:
If the primary storage nodes break down, saved according to the NameSpace of the major key and major key from the standby storage
Data corresponding to point acquisition, and the data of acquisition are handled according to the action type;
If the primary storage node does not break down, according to the NameSpace of the major key and major key from the main memory
Data corresponding to being obtained in node are stored up, and the data of acquisition are handled according to the action type.
In one of the embodiments, methods described also includes:
Data Migration is received by registration center's node to ask;
According to the Data Migration acquisition request migration example, migration groove position and target storage node;
Migration memory node is determined according to the migration example and the migration groove position;
It will be stored in and the Data Migration for migrating the groove that groove position matches to the target in the migration memory node
Memory node.
In one of the embodiments, it is described to be stored in what is matched with the migration groove position in the migration memory node
The Data Migration of groove to the target storage node, including:
Migration groove position is labeled as premigrates state in the migration memory node;
The terminal associated with the migration example is obtained, and Data Migration is sent to the terminal associated with the migration example
Instruction;
When receiving the confirmation message that all terminals associated with the migration example return, by migration groove position mark
It is designated as transition state;
The data that will be stored in the groove matched with the migration groove position by the migration memory node are sent to and institute
The terminal of migration example association is stated, so that the data of reception are sent to the target storage node by the terminal of the association;
The migration groove position is labeled as completion status.
In one of the embodiments, methods described, in addition to:
Monitor and gather the application operating index of each memory node;
When detecting that the application operating index is abnormal, then positioning occurs using the abnormal memory node of operating index;
Close the memory node occurred using operating index exception and generate abnormal information.
A kind of data cached processing unit, including:
First receiving module, for the initial configuration request sent by registration center's node receiving terminal, and extract
Access instances in the initial configuration request;
Configuration information acquisition module, for obtaining the configuration information matched with the access instances, and match somebody with somebody confidence by described in
Breath is sent to the terminal, so that the memory node that the terminal accesses according to needed for obtaining the configuration information;
Second receiving module, for receiving the access request of the terminal by the memory node;
Parsing module, for parsing the access request, obtain major key, the NameSpace of the major key and operation class
Type;
Data processing module, obtain and correspond to from the memory node for the NameSpace according to the major key and major key
Data, and the data of acquisition are handled according to the action type.
In one of the embodiments, the memory node includes primary storage node and standby memory node;
Second receiving module, it is additionally operable to receive the access request of the terminal by the primary storage node;
Described device also includes:
Detection module, for detecting whether the primary storage node breaks down, if breaking down, obtain and the master
Standby memory node corresponding to memory node;
The data processing module, if the primary storage nodes break down is additionally operable to, according to the major key and major key
NameSpace from the standby memory node obtain corresponding to data, and according to the action type to the data of acquisition at
Reason;
The data processing module, do not broken down if being additionally operable to the primary storage node, according to the major key and
The NameSpace of major key obtained from the primary storage node corresponding to data, and data according to the action type to acquisition
Handled.
In one of the embodiments, first receiving module, it is additionally operable to receive number by registration center's node
According to migration request;
Described device, in addition to:
Migration information acquisition module, for according to the Data Migration acquisition request migration example, migration groove position and target
Memory node;
Determining module, for determining migration memory node according to the migration example and the migration groove position;
Transferring module, for the data that the groove matched with the migration groove position is stored in the migration memory node to be moved
Move to the target storage node.
In one of the embodiments, the transferring module, including:
Indexing unit, for migration groove position to be labeled as into premigrates state in the migration memory node;
Transmitting element, for obtaining the terminal that is associated with the migration example, and to the end associated with the migration example
End sends Data Migration instruction;
The indexing unit, it is additionally operable to when the confirmation message for receiving all terminals returns associated with the migration example
When, the migration groove position is labeled as transition state;
The transmitting element, it is additionally operable to that the groove matched with the migration groove position will be stored in by the migration memory node
In data be sent to the terminal associated with the migration example so that the data of reception are sent to institute by the terminal of the association
State target storage node;
The indexing unit, it is additionally operable to the migration groove position being labeled as completion status.
In one of the embodiments, described device, in addition to:
Monitoring module, for monitoring and gathering the application operating index of each memory node;
Locating module, for when detecting that the application operating index is abnormal, then positioning to occur abnormal using operating index
Memory node;
Closedown module, for closing the memory node occurred using operating index exception and generating abnormal information.
Above-mentioned data cached processing method and processing device, server are sent initial by registration center's node receiving terminal
Change configuring request, obtain the configuration information that the access instances in being asked with initial configuration match and be sent to terminal, terminal root
According to configuration information obtain needed for the memory node that accesses, server is by the access request of the memory node receiving terminal, and root
The major key that is obtained according to parsing access request, the NameSpace of major key from the memory node obtain corresponding to data, and according to parsing
The action type that access request obtains is handled data, using the NameSpace of example and major key respectively to the number in caching
According to being physically separated and logic isolation, terminal directly determines the memory node that accesses according to configuration information and conducted interviews, nothing
Need server to carry out complicated logical calculated, improve the efficiency of reading cache data and effectively reduce server stress.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
Fig. 1 is the system architecture diagram of processing method data cached in one embodiment.As shown in figure 1, the system architecture
Including terminal 100 and server 200, server 200 includes registration center's node 202 and one or more memory nodes 204.Eventually
End 100 sends initial configuration request to server 200.The receiving terminal 100 of registration center's node 202 in server 200 is sent out
The initial configuration request sent, and the access instances in initial configuration request are extracted, registration center's node 202 obtains and the visit
The configuration information of example match is asked, and sends configuration information to terminal 100.The configuration that the reception server 200 of terminal 100 returns
Information, the memory node accessed according to needed for obtaining configuration information, and the memory node of the required access into server 200
204 send access request.The access request that the receiving terminal 100 of memory node 204 in server 200 is sent, parses the access
Request, obtains major key, the NameSpace of major key and action type.NameSpace and master of the memory node 204 according to major key
Data corresponding to key acquisition, and the data of acquisition are handled according to action type.
Fig. 2 is the internal structure schematic diagram of above-mentioned server 200 in one embodiment.As shown in Fig. 2 the server 200
Including processor, non-volatile memory medium, built-in storage and the network interface connected by system bus.Wherein, the service
The non-volatile memory medium of device 200 is stored with operating system, database and data cached processing unit, is stored in database
There are the data related to business, the data cached processing unit is used to realize suitable for a kind of data cached of server 200
Processing method.The processor of the server 200 is used to provide calculating and control ability, supports the operation of whole server 200.
The built-in storage of the server 200 provides environment for the operation of the data cached processing unit in non-volatile memory medium,
Computer-readable instruction can be stored in the built-in storage, when the computer-readable instruction is by the computing device, may be such that
The data cached processing method of the computing device.The terminal that the network interface of the server 200 is used for according to this with outside is led to
Cross network connection communication, such as receiving terminal 100 send initial configuration request etc..Server 200 can use independent clothes
Business device either multiple server groups into server cluster realize.It will be understood by those skilled in the art that shown in Fig. 2
The block diagram of structure, the only part-structure related to application scheme, do not form and application scheme is applied thereon
Server 200 restriction, specifically server 200 can include than more or less parts shown in figure, or combination
Some parts, or arranged with different parts.
As shown in Figure 3, there is provided a kind of data cached processing method, comprise the following steps:
Step S310, the initial configuration sent by registration center's node receiving terminal is asked, and is extracted initialization and matched somebody with somebody
Put the access instances in request.
Specifically, server can be multiple server groups into server cluster, can be by being disposed on multiple servers
Redis memory nodes, so as to build distributed cache system, the distributed cache system in server may include there is registration center
Node and one or more memory nodes.Registration center node is mainly used in coordinating control and managed each to be made up of Redis
Memory node, registration center's node can be built by ZooKeeper, wherein, ZooKeeper be one it is distributed, open
The distributed application program coordination service of source code is put, it includes a simple primitive collection, and distributed application program can be based on
It realizes synchronous service, configuring maintenance and naming service etc..Memory node is then built by Redis, and a Redis node is
For a memory node, wherein, Redis is a kind of distributed memory system of key-value (key-value) type, can be supported a variety of
Value types, including string (character string), list (chained list), set (set), zset (sorted set, ordered set)
With hash (Hash type) etc., storage and read data speed it is all very high.
Terminal can be by accessing ZooKeeper address, and sending initial configuration to registration center's node of server please
Ask, access instances (instance) mark is may include in initial configuration request, wherein, the mark of access instances can be by counting
The characters such as word, letter or symbol form, and can be title or numbering of access instances etc..In the distributed cache system of server
In, an example can correspond to the groove of fixed number, and the groove of fixed number is allocated to different Redis memory nodes, wherein,
Groove refers to the logical partition of division, and a logical partition is a groove.For example, the example in server is corresponding 600
Groove, then it can configure the groove that groove position corresponding to example A is 0~300 and be located on Redis memory nodes A, groove position is 301-600 groove
Positioned at Redis memory node B, the groove that groove position corresponding to example B is 0~300 is located on Redis memory nodes C, and groove position is 301-
600 groove is located on Redis memory nodes D.Different examples can be set to correspond to different classs of business according to the actual requirements,
And the related data of class of business corresponding with example is stored in the groove of Redis memory nodes of the exemplary configuration, terminal
Can according to belonging to the data of required access class of business determine corresponding to access instances.
Step S320, the configuration information matched with access instances is obtained, and send configuration information to terminal, so that terminal
The memory node accessed according to needed for obtaining configuration information.
Specifically, the initial configuration request that registration center's node receiving terminal of server is sent, can extract initialization
The mark of the access instances included in configuring request, and match somebody with somebody confidence according to what the mark acquisition of access instances matched with access instances
Breath, configuration information may include Redis memory nodes corresponding with access instances, all groove positions and groove corresponding each
The distribution condition of Redis memory nodes.
Registration center's node of server sends the configuration information matched with access instances to terminal.Terminal is according to reception
Configuration information determines one or more Redis memory nodes corresponding with access instances.Terminal obtains corresponding with access instances
After Redis memory nodes, it can directly be stored and saved with each Redis respectively according to the address of each corresponding Redis memory nodes
Point establishes connection.
After terminal each Redis memory nodes corresponding with access instances establish connection, can obtain needs to carry out data behaviour
The major key (key) of work, and groove position is calculated according to major key.The formula for calculating groove position is:Slotid=CRC16 (key) %N, wherein,
Slotid represents groove position, and N represents the number of groove corresponding to each example, and terminal first can carry out CRC16 (Cyclic to major key
Redundancy Check-16, CRC -16) verification calculate after, to N modulus, so as to obtain the groove matched with major key
Position, it may be determined which groove is data corresponding with major key are placed in.
Terminal can judge that this is calculated according to the groove of access instances in the distribution condition of each corresponding Redis memory nodes
To groove position which Redis memory node belonged to, so as to the Redis memory nodes of access needed for obtaining.For example, in server
Example correspond to 600 grooves, groove position corresponding to access instances A be 0~300 groove be located on Redis memory nodes A, groove position
It is located at Redis memory node B for 301-600 groove, it is 320 to calculate major key and obtain groove position, then can obtain required access is
Redis memory nodes B.Terminal can be sent to the Redis memory nodes by the address of the Redis memory nodes of required access and be visited
Ask request.
Step S330, pass through the access request of memory node receiving terminal.
Specifically, the Redis memory nodes of terminal access can receive the access request of terminal transmission in server.
Step S340, access request is parsed, obtains major key, the NameSpace of major key and action type.
Specifically, after the Redis memory nodes in server receive the access request of terminal, access request can be carried out
Parsing, obtains major key, the NameSpace of major key and action type.
Same Redis memory nodes likely correspond to two different examples, that is, two different classs of business can
It can need to access certain a part of identical data, and in order to which the data of different instances are made a distinction in Redis memory nodes,
It can add NameSpace before major key, and with ";”、“.", the symbol such as "/" separate, prevent occurring in the case of major key identical
The problem of data access malfunctions.For example, the data of instance X and instance Y are stored with Redis memory nodes X, then in instance X
The NameSpace of " insX " is added before the major key of data, the NameSpace of " insY " is added before the major key of the data of instance Y.
Action type may include to obtain (get), set (set), delete (delete), set NameSpace
(SetNameSpace) etc., wherein, set NameSpace may include for major key addition, modification or delete the operation such as NameSpace.
Step S350, obtained according to the NameSpace of major key and major key from memory node corresponding to data, and according to behaviour
Make type to handle the data of acquisition.
Specifically, the major key and the NameSpace of major key that the Redis memory nodes of server can obtain according to parsing are read
Corresponding data, and the data of reading are handled according to action type, if action type is acquisition, by the data of reading
It is sent to terminal.
Above-mentioned data cached processing method, the initial configuration that server is sent by registration center's node receiving terminal
Request, obtain the configuration information that the access instances in being asked with initial configuration match and be sent to terminal, terminal is according to configuration
The memory node accessed needed for acquisition of information, server is by the access request of the memory node receiving terminal, and according to parsing
Major key that access request obtains, the NameSpace of major key from the memory node obtain corresponding to data, and accessed according to parsing please
The action type for asking to obtain is handled data, and the data in caching are carried out respectively using the NameSpace of example and major key
Physical isolation and logic isolation, terminal directly determines the memory node of access according to configuration information and conducted interviews, without service
Device carries out complicated logical calculated, improves the efficiency of reading cache data and effectively reduces server stress.
In one embodiment, above-mentioned data cached processing method, it is further comprising the steps of:
Step S402, pass through the access request of primary storage node receiving terminal.
Specifically, may include in each Redis memory nodes of server a Redis primary storages node (master) and
One or more Redis form a group (group) for memory node (slave), the Redis primary storages in same group
Node and Redis carry out data redundancy backup for memory node, so as to keep data syn-chronization.What terminal accessed needed for obtaining
After Redis memory nodes, the Redis primary storages address of node in group corresponding to the Redis memory nodes is generally obtained, and
Redis primary storage nodes in direct access group.
Step S404, whether detection primary storage node breaks down, if so, step S406 is then performed, if it is not, then performing step
Rapid S412.
Specifically, after the Redis primary storage nodes in server receive the access request of terminal transmission, registration can be passed through
Whether Centroid detection Redis primary storages node breaks down.Registration center's node can be sent to the Redis primary storages node
Heartbeat packet, if in preset time, such as in 1s, 2s etc., the response message that the Redis primary storages node returns is not received,
Then judge the Redis primary storage nodes break downs, and obtain any Redis corresponding with the Redis primary storage nodes for depositing
Store up node and carry out data processing.
Step S406, obtain standby memory node corresponding with primary storage node.
Step S408, access request is parsed by standby memory node, obtain major key, the NameSpace of major key and operation class
Type.
Specifically, if Redis primary storage nodes break downs, can obtain corresponding any with the Redis primary storage nodes
Redis switches to the Redis for memory node for memory node, parses access request for memory node by the Redis, obtains
To major key, the NameSpace of major key and action type.
Step S410, according to data corresponding to the NameSpace of major key and major key from standby memory node acquisition, and according to behaviour
Make type to handle the data of acquisition.
Specifically, the Redis for memory node can according to corresponding to being read the NameSpace of major key and major key data, and press
Operation processing is carried out to the data of acquisition according to action type.
Step S412, access request is parsed by primary storage node, obtain major key, the NameSpace of major key and operation class
Type.
Specifically, registration center's node sends heartbeat packet to Redis primary storages node, if receiving this in preset time
The response message that Redis primary storages node returns, then judge that the Redis primary storage nodes do not break down.Redis primary storages
Node parses access request, major key, the NameSpace of major key and action type is obtained, according to major key and the NameSpace of major key
Data corresponding to reading, and operation processing is carried out to the data of reading according to action type.
Step S414, obtained according to the NameSpace of major key and major key from primary storage node corresponding to data, and according to
Action type is handled the data of acquisition.
In the present embodiment, when Redis primary storage nodes break downs, then automatically switch into the corresponding standby storages of Redis and save
Point carries out data processing, ensures the validity of data processing, and extract data-handling efficiency.
As shown in figure 5, in one embodiment, above-mentioned data cached processing method is further comprising the steps of:
Step S502, Data Migration is received by registration center's node and asked.
Specifically, when Redis memory nodes need carry out dilatation, capacity reducing, or occur delaying machine failure when, data can be carried out
Migration, system manager can send Data Migration by registration center's node of terminal to server and ask.Data Migration is asked
In may include migration example, migration groove position and target Redis memory nodes, wherein, migration example refers to carrying out Data Migration
Example, migration groove position refers to carrying out the groove position of Data Migration in migration example, and target Redis memory nodes are referred to number
The Redis memory nodes finally stored according to being migrated.
Step S504, according to Data Migration acquisition request migration example, migrate groove position and target storage node.
Step S506, migration memory node is determined according to migration example and migration groove position.
Specifically, registration center's node of server can obtain the configuration information matched with migration example, and according to configuration
The distribution condition of groove in acquisition of information migration example in corresponding each Redis memory nodes.Groove in migration example
In the distribution condition of corresponding each Redis memory nodes, can determine whether to be located at which Redis is deposited with the groove that migration groove position matches
Node is stored up, so as to obtain migrating Redis memory nodes.For example, the groove that groove position corresponding to migration example A is 0~300 is located at
On Redis memory nodes A, the groove that groove position is 301-600 is located at Redis memory node B, and migration groove position is 200~300, then may be used
It is Redis memory nodes A to obtain migrating Redis memory nodes.
Step S508, the Data Migration that the groove matched with migration groove position is stored in migration memory node to target is stored
Node.
Specifically, server, by migration memory node, can match successively according to the order of migration groove position with migration groove position
Groove in the Data Migration that stores to target storage node.
As shown in fig. 6, in one embodiment, step S508 will be migrated in memory node to be stored in and matched with migration groove position
Groove Data Migration to target storage node, including:
Step S602, migration groove position is labeled as premigrates state in memory node is migrated.
Specifically, registration center's node of server can be according to the order of migration groove position, successively to migration Redis storage sections
The data stored in the groove matched in point with migration groove position are migrated, and often during the Data Migration of one groove of progress, can be moved this
Shifting groove position first marks to be migrated corresponding with migration groove position in Redis memory nodes for state (pre_migrate), record
The Data Migration state of groove.
Step S604, the terminal associated with migration example is obtained, and send data to the terminal associated with migration example and move
Move instruction.
Specifically, registration center's node of server can record all terminals for being sent to initial configuration request, and
Access instances in being asked according to initial configuration establish the incidence relation of terminal and example.When carrying out Data Migration, registration
Centroid can obtain the terminal for having incidence relation with migration example, and send number to each terminal associated with migration example
Instructed according to migration.
Step S606, when receiving the confirmation message that all terminals associated with migration example return, by migration groove position
Labeled as transition state.
Specifically, when registration center's node receives the confirmation message that all terminals associated with migration example return,
The groove position that can will carry out the groove of Data Migration is changed to transition state (migrate) from premigrates state, and carries out Data Migration.
Step S608, the data being stored in the groove matched with migration groove position are sent to and moved by migrating memory node
The terminal of example association is moved, so that the data of reception are sent to target storage node by the terminal of association.
Specifically, registration center's node can send migration order, migration Redis storage sections to migration Redis memory nodes
The data that point will carry out storing in the groove of Data Migration according to migration order, it is sent to successively according to major key each real with migration
The terminal of example association, terminal again send the data received to target Redis memory nodes, until the carry out Data Migration
The data stored in groove all complete by migration.After the completion of Data Migration, the data stored in the groove for completing Data Migration can be deleted.
Step S610, migration groove position is labeled as completion status.
Specifically, when the data in the groove of the carry out Data Migration, all migration is completed, and registration center's node can be by the groove
Migration groove position be revised as completion status (online) from transition state, and the data for carrying out the groove of next groove position matching are moved
Move.When all migration groove positions are marked as completion status, then data migration task is completed, and registration center's node can be to system pipes
Terminal where reason person sends migration and completes information.
In this embodiment, Data Migration can be carried out by the terminal associated with migration example, even if in Redis memory nodes
Also Data Migration can be completed during machine failure of delaying, it is convenient and swift, and the feelings that data are lost in transition process can be reduced
Condition.
As shown in fig. 7, in one embodiment, above-mentioned data cached processing method is further comprising the steps of:
Step S702, monitor and gather the application operating index of each memory node.
Specifically, real-time monitoring system can be built in the server based on influxdb time series databases, monitoring in real time is simultaneously
The application operating index of each Redis memory nodes in acquisition server, may include machine state information using operating index, asks
Access situation etc. is sought, wherein, machine state information may include that CPU (Central Processing Unit, central processing unit) is negative
Load, memory information, disk utilization rate etc., request access situation may include to ask number, response time and processing state etc..
Step S704, abnormal using operating index when detecting, then positioning occurs using the abnormal storage section of operating index
Point.
Specifically, each Redis memory nodes are monitored in real time by monitoring system and gathers corresponding application fortune
Row index, it can judge by each data using operating index of collection compared with corresponding pre-set level normal range (NR)
Whether exception occurs using each data of operating index, when the data in application operating index are not on corresponding default finger
Mark in normal range (NR), then it is abnormal to illustrate that the data occur.For example, the request number for collecting Redis memory nodes A is 10,000,
And it is 0~8000 to ask pre-set level normal range (NR) corresponding to number, the request number of collection exceeds corresponding pre-set level
Normal range (NR), illustrate exception occurs.It can pre-set corresponding to request number, access frequency of each Redis memory nodes etc.
Index normal range (NR), Current limited Control is carried out to data access, ensure the performance and response speed of each Redis memory nodes of server
Degree.
Step S706, close and occur using the abnormal memory node of operating index and generate abnormal information.
Specifically, it is abnormal using operating index when detecting, can be to occurring to store section using the abnormal Redis of operating index
Point is positioned, and closes the abnormal Redis memory nodes of the generation application operating index, ensures server Redis storage sections
The performance of point.Corresponding abnormal information can be generated according to the Redis memory nodes for occurring to apply operating index abnormal, wherein, it is different
Normal information may include to occur using group mark corresponding to the abnormal Redis memory nodes of operating index, abnormal refer to using operation
Mark etc..After generating abnormal information, server can send abnormal information the terminal to where system manager, carry out at failure
Reason.
In the present embodiment, it can monitor and gather the application operating index of each memory node, when generation refers to using operation
Mark is abnormal, and fast positioning can be carried out to memory node and is closed, the performance of each memory node in server is ensured, mitigates service
Device pressure.
As shown in Figure 8, there is provided a kind of data cached processing unit, including the first receiving module 810, configuration information obtain
Modulus block 820, the second receiving module 830, parsing module 840 and data processing module 850.
First receiving module 810, for the initial configuration request sent by registration center's node receiving terminal, and carry
Take the access instances in initial configuration request.
Configuration information acquisition module 820, for obtaining the configuration information matched with access instances, and configuration information is sent
To terminal, so that the memory node that terminal accesses according to needed for obtaining configuration information.
Second receiving module 830, for receiving the access request of the terminal by memory node.
Parsing module 840, for parsing access request, obtain major key, the NameSpace of major key and action type.
Data processing module 850, for number corresponding to being obtained according to the NameSpace of major key and major key from memory node
According to, and the data of acquisition are handled according to action type.
Above-mentioned data cached processing unit, the initial configuration that server is sent by registration center's node receiving terminal
Request, obtain the configuration information that the access instances in being asked with initial configuration match and be sent to terminal, terminal is according to configuration
The memory node accessed needed for acquisition of information, server is by the access request of the memory node receiving terminal, and according to parsing
Major key that access request obtains, the NameSpace of major key from the memory node obtain corresponding to data, and accessed according to parsing please
The action type for asking to obtain is handled data, and the data in caching are carried out respectively using the NameSpace of example and major key
Physical isolation and logic isolation, terminal directly determines the memory node of access according to configuration information and conducted interviews, without service
Device carries out complicated logical calculated, improves the efficiency of reading cache data and effectively reduces server stress.
In one embodiment, memory node includes primary storage node and standby memory node.As shown in figure 9, above-mentioned caching
The processing unit of data, except including the first receiving module 810, configuration information acquisition module 820, the second receiving module 830, solution
Analyse module 840 and data processing module 850, in addition to detection module 860.
Second receiving module 830, is additionally operable to the access request by primary storage node receiving terminal.
Detection module 860, for detecting whether primary storage node breaks down, if breaking down, acquisition and primary storage
Standby memory node corresponding to node.
Data processing module 850, if being additionally operable to primary storage nodes break down, according to major key and the NameSpace of major key
From data corresponding to standby memory node acquisition, and the data of acquisition are handled according to action type.
Data processing module 850, do not broken down if being additionally operable to primary storage node, according to the name of major key and major key
Space obtained from primary storage node corresponding to data, and the data of acquisition are handled according to action type.
In the present embodiment, when Redis primary storage nodes break downs, then automatically switch into the corresponding standby storages of Redis and save
Point carries out data processing, ensures the validity of data processing, and extract data-handling efficiency.
As shown in Figure 10, in one embodiment, above-mentioned data cached processing unit, except including the first receiving module
810th, configuration information acquisition module 820, the second receiving module 830, parsing module 840, data processing module 850 and detection module
860, in addition to migration information acquisition module 870, determining module 880 and transferring module 890.
First receiving module 810, it is additionally operable to receive Data Migration request by registration center's node.
Migration information acquisition module 870, for being deposited according to Data Migration acquisition request migration example, migration groove position and target
Store up node.
Determining module 880, for determining migration memory node according to migration example and migration groove position.
Transferring module 890, the Data Migration of the groove matched with migrating groove position is stored in mesh for memory node will to be migrated
Mark memory node.
As shown in figure 11, in one embodiment, transferring module 890 includes indexing unit 892 and transmitting element 894.
Indexing unit 892, for migration groove position to be labeled as into premigrates state in memory node is migrated.
Transmitting element 894, sent for obtaining the terminal associated with migration example, and to the terminal associated with migration example
Data Migration instructs.
Indexing unit 892, it is additionally operable to when receiving the confirmation message that all terminals associated with migration example return, will
Migration groove position is labeled as transition state.
Transmitting element 894, it is additionally operable to the data that will be stored in by migrating memory node in the groove matched with migration groove position
The terminal associated with migration example is sent to, so that the data of reception are sent to target storage node by the terminal of association.
Indexing unit 892, it is additionally operable to migration groove position being labeled as completion status.
In this embodiment, Data Migration can be carried out by the terminal associated with migration example, even if in Redis memory nodes
Also Data Migration can be completed during machine failure of delaying, it is convenient and swift, and the feelings that data are lost in transition process can be reduced
Condition.
As shown in figure 12, in one embodiment, above-mentioned data cached processing unit, except including the first receiving module
810th, configuration information acquisition module 820, the second receiving module 830, parsing module 840, data processing module 850, detection module
860th, migration information acquisition module 870, determining module 880 and transferring module 890, in addition to monitoring module 900, locating module
910 and closedown module 920.
Monitoring module 900, for monitoring and gathering the application operating index of each memory node.
Locating module 910, for abnormal using operating index when detecting, then positioning occurs apply operating index abnormal
Memory node.
Closedown module 920, for closing the memory node occurred using operating index exception and generating abnormal information.
In the present embodiment, it can monitor and gather the application operating index of each memory node, when generation refers to using operation
Mark is abnormal, and fast positioning can be carried out to memory node and is closed, the performance of each memory node in server is ensured, mitigates service
Device pressure.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, described program can be stored in a non-volatile computer and can be read
In storage medium, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, described storage is situated between
Matter can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneously
Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the art
Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention
Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.