CN107480309A - Database access strategies update method, device, server and computing device - Google Patents

Database access strategies update method, device, server and computing device Download PDF

Info

Publication number
CN107480309A
CN107480309A CN201710898718.0A CN201710898718A CN107480309A CN 107480309 A CN107480309 A CN 107480309A CN 201710898718 A CN201710898718 A CN 201710898718A CN 107480309 A CN107480309 A CN 107480309A
Authority
CN
China
Prior art keywords
database
access
server
targeted
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710898718.0A
Other languages
Chinese (zh)
Inventor
杨亚光
王啸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710898718.0A priority Critical patent/CN107480309A/en
Publication of CN107480309A publication Critical patent/CN107480309A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication

Abstract

This specification embodiment provides a kind of database access strategies update method, device, server and computing device, in the specification embodiment, in the scenes such as progress database access strategies renewal are needed, the targeted access policies information that service cluster manager is sent to server carries renewable time, and the renewable time of each server is identical, therefore it can ensure that each server is updated at synchronization, the problem of avoiding data synchronization errors.

Description

Database access strategies update method, device, server and computing device
Technical field
This specification is related to database technical field, more particularly to database access strategies update method, device, server And computing device.
Background technology
Operation system has generally included server and database, and business datum is stored with database, and server passes through visit Ask that database is handled business datum.For examining for data safety, data-handling efficiency, database O&M cost etc. Consider, many operation systems are likely to occur the demand in switch data storehouse, another new database of configuration are that is to say, for business number According to, from access old database switch to access new database handled.
In database handoff procedure is carried out, it is necessary in configuration service cluster each server access strategy so that service Device is directed to business data processing, according to the access strategy configured, it is known which business datum is entered by accessing which database Row processing.Can be that technical staff directly conducts interviews strategy configuration on the server for individual server, and for existing The service cluster scene of a large amount of servers is, it is necessary to by each server push configuration information of service cluster management orientation.
The content of the invention
To overcome problem present in correlation technique, present description provides database access strategies update method, device, Server and computing device.
A kind of database access strategies update method, methods described are applied to the server in service cluster, the service Device is stored with access strategy, and the access strategy indicates the database that the server process business datum is accessed;
Methods described includes:
The targeted access policies information for target service data that service cluster manager sends is received, the target is visited Ask that policy information carries the renewable time of the targeted access policies;Wherein, during renewal in the targeted access policies information Carve identical with the renewable time for the targeted access policies information that other servers in the service cluster are received;
When the renewable time reaches, the access strategy stored is updated to the targeted access policies.
Optionally, to the duration between the renewable time at the time of manager sends targeted access policies information, It is proportionate with following one or more information:
The quantity of number of servers or the business datum in the service cluster.
Optionally, the business datum has plurality of classes, and business datum described in per class corresponds to a kind of access strategy;The mesh It is one type or multi-traffic data to mark business datum;
It is described that the access strategy stored is updated to the targeted access policies, including:
Access strategy corresponding with the target service data will have been stored and be updated to the targeted access policies.
Optionally, the classification of the business datum is divided by following one or more modes:
Tables of data where service attribute, business datum or processing request initiator.
Optionally, methods described also includes:After the targeted access policies information is received, fed back to the manager Information is properly received, so that the manager determines whether that server does not receive the targeted access policies information.
Optionally, methods described is applied to that access the will be switched to from the first database is accessed for the processing of business datum The scene that two databases are handled, the access strategy include following one or more:
Access the first database;
Access the first database and the database of synchronized update second;
The first database and the database of synchronized update second are accessed, wherein, the first database enters when carrying out reading and writing data Row data check;
The second database and the database of synchronized update first are accessed, wherein, the second database enters when carrying out reading and writing data Row data check;
Access the second database and synchronous first database;
Access the second database.
A kind of database access strategies update method, methods described are applied to service cluster manager, the service cluster Including multiple servers, the server storage has access strategy, and the access strategy indicates the server process business number According to the database accessed;
Methods described includes:
Targeted access policies information is determined, when the targeted access policies information carries the renewal of the targeted access policies Carve;
Each server targeted access policies information being sent in service cluster, so that each server is in institute When stating renewable time arrival, the access strategy stored is updated to the targeted access policies.
Optionally, in addition to:
In the preset duration after sending the targeted access policies information, check whether there is server and do not feed back and successfully connect Collect mail and cease, if so, sending the targeted access policies information again to the server not fed back.
A kind of database access strategies updating device, described device are applied to the server in service cluster, the service Device is stored with access strategy, and the access strategy indicates the database that the server process business datum is accessed;
Described device includes:
Receiving module, it is used for:Receive the targeted access policies for target service data that service cluster manager sends Information, the targeted access policies information carry the renewable time of the targeted access policies;Wherein, the targeted access policies The renewable time for the targeted access policies information that renewable time in information is received with other servers in the service cluster It is identical;
Update module, it is used for:When the renewable time reaches, the access strategy stored is updated to the target and visited Ask strategy.
Optionally, to the duration between the renewable time at the time of manager sends targeted access policies information, It is proportionate with following one or more information:
The quantity of number of servers or the business datum in the service cluster.
Optionally, the business datum has plurality of classes, and business datum described in per class corresponds to a kind of access strategy;The mesh It is one type or multi-traffic data to mark business datum;
The update module, is additionally operable to:
Access strategy corresponding with the target service data will have been stored and be updated to the targeted access policies.
Optionally, the classification of the business datum is divided by following one or more modes:
Tables of data where service attribute, business datum or processing request initiator.
Optionally, described device also includes:After the targeted access policies information is received, fed back to the manager Information is properly received, so that the manager determines whether that server does not receive the targeted access policies information.
Optionally, described device is applied to that access the will be switched to from the first database is accessed for the processing of business datum The scene that two databases are handled, the access strategy include following one or more:
Access the first database;
Access the first database and the database of synchronized update second;
The first database and the database of synchronized update second are accessed, wherein, the first database enters when carrying out reading and writing data Row data check;
The second database and the database of synchronized update first are accessed, wherein, the second database enters when carrying out reading and writing data Row data check;
Access the second database and synchronous first database;
Access the second database.
A kind of database access strategies updating device, described device are applied to service cluster manager, the service cluster Including multiple servers, the server storage has access strategy, and the access strategy indicates the server process business number According to the database accessed;
Described device includes:
Determining module, it is used for:Targeted access policies information is determined, the targeted access policies information carries target visit Ask the renewable time of strategy;
Sending module, it is used for:Each server targeted access policies information being sent in service cluster, for each The access strategy stored is updated to the targeted access policies by the server when the renewable time reaches.
Optionally, the sending module, is additionally operable to:
In the preset duration after sending the targeted access policies information, check whether there is server and do not feed back and successfully connect Collect mail and cease, if so, sending the targeted access policies information again to the server not fed back.
A kind of server, including:
Processor;
For storing the memory of processor-executable instruction;The memory storage has access strategy, the access plan Slightly indicate the database that the server process business datum is accessed;
Wherein, the processor is configured as:
The targeted access policies information for target service data that service cluster manager sends is received, the target is visited Ask that policy information carries the renewable time of the targeted access policies;Wherein, during renewal in the targeted access policies information Carve identical with the renewable time for the targeted access policies information that other servers in the service cluster are received;
When the renewable time reaches, the access strategy stored is updated to the targeted access policies.
A kind of computing device, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Described device includes:
Targeted access policies information is determined, when the targeted access policies information carries the renewal of the targeted access policies Carve;
Each server targeted access policies information being sent in service cluster, so that each server is in institute When stating renewable time arrival, the access strategy stored is updated to the targeted access policies;Wherein, the server storage There is access strategy, the access strategy indicates the database that the server process business datum is accessed.
The technical scheme that the embodiment of this specification provides can include the following benefits:
In this specification, in needing to carry out the scenes such as database access strategies renewal, service cluster manager is sent to The targeted access policies information of server carries renewable time, and the renewable time of each server is identical, therefore can protect Demonstrate,prove each server to be updated in synchronization, the problem of avoiding data synchronization errors.
It should be appreciated that the general description and following detailed description of the above are only exemplary and explanatory, not This specification can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and forms the part of this specification, shows the reality for meeting this specification Apply example, and be used for together with specification the principle for explaining this specification.
Fig. 1 is a kind of business of accessing data base policy update of this specification according to an exemplary embodiment The Organization Chart of system.
Fig. 2A is a kind of stream of database access strategies update method of this specification according to an exemplary embodiment Cheng Tu.
Fig. 2 B are a kind of answering for database access strategies update method of this specification according to an exemplary embodiment Use schematic diagram of a scenario.
Fig. 3 is a kind of hardware configuration of server/computing device where this specification database access strategies updating device Figure.
Fig. 4 is a kind of frame of database access strategies updating device of this specification according to an exemplary embodiment Figure.
Fig. 5 is the frame of another database access strategies updating device of this specification according to an exemplary embodiment Figure.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute The example of the consistent apparatus and method of some aspects be described in detail in attached claims, this specification.
It is only merely for the purpose of description specific embodiment in the term that this specification uses, and is not intended to be limiting this explanation Book." one kind " of used singulative, " described " and "the" are also intended to bag in this specification and in the appended claims Most forms are included, unless context clearly shows that other implications.It is also understood that term "and/or" used herein is Refer to and any or all may be combined comprising the associated list items purpose of one or more.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but These information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, do not taking off In the case of this specification scope, the first information can also be referred to as the second information, and similarly, the second information can also be claimed For the first information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ... " or " in response to determining ".
Referring to Fig. 1, shown in Fig. 1 be accessing data base strategy shown in the exemplary embodiment of this specification one more The Organization Chart of new operation system 100.Business provider is configured with operation system 100, the operation system 100 can include via Network 112 and one or more clients 106 enter the service cluster 105 of row data communication, and independently of service cluster 105 or It is integrated in the database 115,116 of server 105.Network 112 can include such as internet, in-house network, extranets, wide area network (WAN), LAN (LAN), wired network, wireless network or other suitable networks etc., or two or more this kind of networks Any combinations.Through the discussion of exemplary, it should be understood that term " data " and " information " can exchange in this manual Ground is used for the letter for referring to the text, image, audio, video or any other form that may be present in computer based environment Breath.
Commercially available HTTP (HTTP) server application, such as HTTP can be included on server 105 Server, Internet Information Service (IIS) and/or other servers.
Client 106 can be provided with the network equipment of application.Referred to herein as application can be to provide various services The application that is related to of operation system, such as financial system that account was transferred to or produced service is provided, the communication of Communications service is provided System etc., network equipment from hardware can include desktop PC, laptop computer, tablet PC, smart phone, Handheld computer, personal digital assistant (" PDA "), or the device of any other wired or wireless processor driving.
Once user initiates registration request using client 106 and by network 112 to server 105, server 105 can To record the log-on message of the user, and the account of preset authority is opened up according to registration request in Operation Server 105.This Outside, account, the various passwords (login password and/or business processing password etc.) of each account of each user's registration can be stored with And the authentication information uploaded during user's registration.
Follow-up user every time initiates the service request for some business by client 106, such as:Service data visitation Request or business datum modification request etc. are transferred in request, business datum, so that when accessing server 105, server 105 marks for showing user identity based on the ID carried in each service request etc, can know and record so Service request.Particularly, the request time of the user can be recorded, it is selectable, IP when initiating request can also be recorded Address, the operating system version that either type of hardware of used network equipment or client release/client are based on Category information in it is one or more.Particularly, the service request updated for data occur, such as it is transferred to or produces the industry of resource Business request, request of modification service condition etc., Operation Server 105 can also record the service request, and corresponding by performing Internal or external operation after give user and specifically respond.Usually, all service requests, can be in server 105 Leave respective record.Server 105 can sort out the institute of different user respectively according to information such as ID, business description information There is service request., can also be according to above-mentioned use for the interaction between the service request of interbehavior, such as different registered users Family ID classify and form set etc..
Server 105 can store above-mentioned service request with database 115 or database 116, respond the service request Operation and the operation caused by business datum, database 115 and database 116 can be used for the business at customer in response end 106 The database of request.
For the application scenarios of redundancy backup, database 115 can be the redundancy backup of primary database and the primary database A database in database, database 116 can be one in the redundancy backup database of primary database and the primary database Database.Under DB Backup scene, it is possible to which primary database the problems such as unstable, error in data, upgrading occurs, it is necessary to will Part or all of data processing request switches to the demand for accessing and being handled from database.
For the application scenarios of Data Migration, database 115 can be the migrating data of primary database and the primary database A database in storehouse, database 116 can be the databases in the migrating data storehouse of primary database and the primary database.Its In, primary database or migrating data storehouse can be oracle database, OceanBase databases, MySQL database etc..
Except database 115 and the external system 100 of database 116 can also include other databases.Be stored in database 115 or Business datum in database 116, it is associated with the operating procedure of various embodiments described below.
In the application scenarios of Data Migration, it is possible that following situation:Operation system is configured with certain species for a long time The database (hereinafter referred to as database A) of type carries out data management, for data safety, data-handling efficiency, database O&M The consideration of cost etc., business provider wish to use other kinds of one or more databases (below with a data Illustrated exemplified by storehouse, abbreviation database B) carry out data management.In this case, business provider is configured with database B. It is appreciated that business provider will face data in database A and switch to database B demand.
Database B process is switched to from database A, may relate to following aspects:
1. starting stage, a configuration database A, all access requests for being directed to business datum in database in operation system Will be solved by accessing database A.
2. operation system is initially configured database B, afterwards by modes such as Data Migrations, in the A of replicate data storehouse, data are extremely In database B, make in database B to include and database A identical data.
3. the target of database switching is that after Data Migration to database B, data access request is all by accessing data Storehouse B processing, and abandon database A.Because the database B newly configured there may exist unstable situation, if after Data Migration At once all access requests are all switched into database B, it is possible to the problems such as causing data processing unsuccessfully to wait.
Therefore, can be that database A and database B coexists in practical application, data access request is progressively from access data Storehouse A, which is switched to, accesses database B.In such cases, initial stage can be used as primary database (Master), data using database A Storehouse B passes through synchronization mechanism as database A between database (Slave), two databases so that any database is in number During according to renewal, another database can realize data syn-chronization.Switch the later stage in database, can be database B as master data Storehouse, request of data mainly solves by accessing database B, and makes database A also keep data to update by synchronization mechanism.
From Such analysis, the processing for business datum asks to be initiated by client, and reaches certain in service cluster At one server, access database is handled business datum after receiving processing request by server.Switch in database During, technical staff needs to configure the access strategy of server in service cluster, so that server is receiving visitor After the processing request that family end is initiated, according to the access strategy configured, it is known which data processing request is by accessing database A Handled, which data processing request is by accessing database B processing.
During being configured to access strategy, due to substantial amounts of server in server cluster be present, it is necessary to protect Card Servers-all can obtain the access strategy newly configured simultaneously, but under actual conditions, each server in cluster The time configured might have successively, this for ageing and data consistency high request complicated business scene, It is likely to cause serious error in data problem.
As an example it is assumed that cluster includes 100 servers, wherein 99 servers, which obtain new configuration, (is directed to A simultaneously The access request of data switches to database B from database A), and the time delay that the 100th server is newly configured 2 Second.Between 2 seconds of this delay, just have a modification request for user U business datum reach 99 servers it Between a certain server, the server accesses database B according to the access strategy that is configured and performs modification;It is just another in addition There is one article of modification request for user U business datum to reach the 100th server, this server is new due to not obtaining Configuration, therefore database A is still accessed, the business datum of user U in database A is modified.From Such analysis, In the stage that database A and database B coexist, database A and database B needs to carry out data syn-chronization, if the above situation occurs, The problem of data synchronization errors will occur, and because the data of user U in two databases are inconsistent, if being now directed to The read requests of user U business datum, server may also can to client feedback wrong data.
Based on this, this specification embodiment provides a kind of database access strategies update scheme, service cluster in the program The targeted access policies information that manager is sent to server carries renewable time, and the renewable time phase of each server Together, therefore it can ensure that each server is updated in synchronization, the problem of avoiding data synchronization errors.Next to this theory Bright book embodiment scheme is described in detail.
As shown in Figure 2 A, it is a kind of database access strategies renewal side of this specification according to an exemplary embodiment The flow chart of method, it is related to server in service cluster manager and service cluster in this method.Wherein, visit is stored with server Strategy is asked, the access strategy indicates the database that the server process business datum is accessed.The present embodiment is from the pipe The angle that reason side interacts with server-side is described, and comprises the following steps:
In step 202, the manager determines targeted access policies information, and the targeted access policies information carries The renewable time of the targeted access policies.
In step 204, the targeted access policies information is sent to each service in service cluster by the manager Device.
In step 206, server receives the target access for target service data that service cluster manager sends Policy information, the targeted access policies information carry the renewable time of the targeted access policies.Wherein, the target access The renewal for the targeted access policies information that renewable time in policy information is received with other servers in the service cluster Moment is identical.
In a step 208, the access strategy stored is updated to the mesh by server when the renewable time reaches Mark access strategy.
In this specification embodiment, the manager is used to be managed each server in service cluster, optionally, tool Body can use the computing device independently of service cluster to realize, can also be integrated in server.In some instances, mesh Mark access strategy information can be configured as needed with system manager, such as system manager is according to industry in database Change, database switch instances or the data traffic of data of being engaged in etc. factor determine the renewal of access strategy.In other examples, Can also be automatically generated to configure targeted access policies information according to the configuration of system manager by equipment.
Wherein, renewable time is carried in the targeted access policies of the present embodiment, the renewable time can refer to future Predetermined time so that server after receiving targeted access policies information to it is final conduct interviews policy update at the time of between With certain buffering, reached in renewable time, each server can carry out the renewal of targeted access policies simultaneously.Due to from hair Send moment to renewable time that there is certain time, therefore even if each server causes to receive target access due to reasons such as networks The Time Inconsistency of strategy, also still ensure that each server while can realize renewal when the renewable time in future reaches.
Wherein, renewable time can flexible configuration as needed, for example, in some instances, renewable time can be with It is 10 minutes etc. after fixed value, such as 12 points of every night, or targeted access policies information delivery time. In other examples, it may also need to carry out to the duration between renewable time from the delivery time of targeted access policies information Certain setting, because possible manager is after targeted access policies information is sent, it is desirable to which server carries out target visit as early as possible The renewal of strategy is asked, but needs the buffer time certain to server reserves, based on this, manager sends targeted access policies To the duration between the renewable time at the time of information, it is proportionate with following one or more information:The service cluster The quantity of middle number of servers or the business datum.In the present embodiment, it is contemplated that number of servers is larger or business number According to measure it is larger in the case of, the processing pressure of server may be larger, thus the buffer time can combine number of servers or The quantity of the business datum is configured, and the quantity of number of servers or the business datum is more, then the buffer time is more It is long, ensure that each server can receive targeted access policies information, or when configuration error occurs can having time enter Row is repaired.
When number of servers is more, network problem or server are delayed machine etc., it is possible to cause certain server not receive To targeted access policies information, within this section of buffer time, server is after the targeted access policies information is received, to institute State manager's feedback and be properly received information.Manager checks in the preset duration after sending the targeted access policies information Whether there is server not feed back and be properly received information, if so, sending the target access again to the server not fed back Policy information.
This specification scheme is illustrated again followed by an embodiment.The present embodiment is related to database switching field Scape, operation system include service cluster, and service cluster includes multiple servers, and optional the present embodiment is provided with distribution Resource management platform (DRM), for being managed to server in service cluster.The operation system is related to two class databases ( One database and the second database), as an example, the first database is oracle database, and the second database is OceanBase (abbreviation OB), wherein operation system early stage configuration oracle database as primary database management business data, it The consideration of data safety, data-handling efficiency, database O&M cost etc. afterwards, determine that configuration OB databases are used as from data Storehouse, and it is desirable that switch to OB databases from oracle database, realize abandoning for oracle database.
Shown in Fig. 2 B, because operation system may need to meet the real-time online of high concurrent high traffic, do not shut down, do not damage The requirement of unemployment business, this specification embodiment can carry out the switching of database by the way of seamlessly transitting.Optionally, in order to Realize that database switches, management platform needs the configuration server access plan of server to database in database handoff procedure Slightly, to indicate which database of the server access is handled data.Optionally, said process can use the side of component Formula is realized, and is installed in each server.
Under mass data scene, the access request for certain class business datum first can be switched to database by service side B processing, by whether the state being successfully processed, then progressively switch the access request of other business datums from database A To database B, that is to say by the observation to small range data, then be progressively generalized to data in whole database.Based on this, In one optional implementation, the present embodiment can set following one or more access strategies, so that database is done step-by-step Switching:
MASTER:Access the first database.In the present embodiment, if server receives this strategy, corresponding read-write Oracle。
MASTER_TO_SLAVE (principal and subordinate):Access the first database and the database of synchronized update second.The present embodiment In, it is corresponding to read and write Oracle if server receives this strategy, while by data syn-chronization to OB.
MASTER_TO_SLAVE_CHECK (principal and subordinate's inspection):The first database and the database of synchronized update second are accessed, Wherein, the first database carries out data check when carrying out reading and writing data.In the present embodiment, if server receives this strategy, Oracle is then read and write accordingly, while by data syn-chronization to OB, and the data school set can be used when carrying out reading and writing data Whether the data for testing regular inspection institute's read-write are latest data.Wherein, data check rule can include in calibration database The renewable time of synchronous recording or the version information of synchronous recording etc..
SLAVE_TO_MASTER_CHECK (from main inspection):The second database and the database of synchronized update first are accessed, Wherein, the second database carries out data check when carrying out reading and writing data.In the present embodiment, if server receives this strategy, OB is then read and write accordingly, while by data syn-chronization to Oracle, and the data school set can be used when carrying out reading and writing data Whether the data for testing regular inspection institute's read-write are latest data.
SLAVE_TO_MASTER (from master):Access the second database and synchronous first database.In the present embodiment, clothes It is corresponding to read and write OB if business device receives this strategy, while by data syn-chronization to Oracle.
SLAVE (from):Access the second database.It is corresponding to read if server receives this strategy in the present embodiment Write OB.
Operation system during business service is provided, ask by the processing that may persistently receive for business datum Ask, database handoff procedure is the process handled originally by accessing the first database, switches to and accesses the second data Storehouse is handled.It is appreciated that the business datum amount stored in database may be less, it is also possible to it is very huge, in different application field Jing Zhong, can be configured for all business datums configuration identical access strategy or for different business datums Different access strategies.
For example, above-mentioned 6 kinds of access strategies, MASTER from the beginning until final SLAVE, that is, complete from MASTER switches to SLAVE process.In this process, the renewal of each access strategy, be likely to factor data amount it is larger, Processing asks to fail caused by the reason such as more.Therefore, the renewal of access strategy, can be directed to fraction business datum, it Progressively it is generalized to all business datums again afterwards.Therefore, in the present embodiment, business datum can have plurality of classes, industry described in per class Business data correspond to a kind of access strategy, can be using one type or multi-traffic data as target service data configuration target Access strategy information so that server will store corresponding with the target service data subsequently when renewable time reaches Access strategy be updated to the targeted access policies.
In an optional implementation, the classification of the business datum is drawn by following one or more modes Point:
The first, service attribute;As an example, operation system may provide a user polytype business, pin Different business modules is configured with to different business, therefore, business datum can be made a distinction by service attribute.Lift For example, user profile more new business, commodity issuing service or order processing business etc. may be provided with net purchase operation system, Conduct interviews tactful configuration and renewal are needed in database handoff procedure, different business configuration target access plan can be directed to Slightly, such as currently it is all MASTER strategies to be directed to all business, then needs to enter MASTER_TO_SLAVE strategies, is first directed to User profile renewal business configuration MASTER_TO_SLAVE strategies, update the new plan of business configuration by observing user profile afterwards Whether stablize after slightly, then the configuration of iterative method other business progress new strategy, realize using service attribute as dimension, to data The flow of request carries out cutting stream.
Secondth, tables of data where business datum;As an example, the business datum amount in operation system is huge, industry Business data may be stored by multiple tables of data, therefore, business datum can be entered by tables of data where business datum Row is distinguished, and is configured targeted access policies for different pieces of information table, is realized using tables of data as dimension, the flow of request of data is entered Row cuts stream.
The third, processing request initiator;As an example, operation system provides business, user towards many users As the initiator of data processing request, the authority of different user or service attribute etc. possibility possibility are identical may also be different, Therefore, business datum can be made a distinction by handling request initiator, for different disposal, request initiator configures target Access strategy.Assuming that realizing using user as dimension, the flow of request of data is carried out cutting stream.
In specifically the configuration process of targeted access policies information is carried out, the present embodiment can make targeted access policies information Carry renewable time so that server can be updated according to renewable time to access strategy.As an example, target is visited Ask that policy information can include:
Renewable time activeTime
Access strategy after renewal:SyncMode, i.e. targeted access policies
Optionally, access strategy before renewal can also be included:LastSyncMode so that server can receive mesh After marking access strategy information, determine whether targeted access policies information is wrong by access strategy before renewal.Assuming that server is worked as The preceding access strategy for tables of data K is MASTER, and the lastSyncMode in the targeted access policies information received is SLAVE, server can be to management platform feedback error information, to prevent targeted access policies information configuration mistake.
As an example, targeted access policies information is configured for tables of data K, the information delivery time is 2017-03- 25 01:20:00, config update moment activateTime=2017-03-25 01:30:00.Therefore, from information from being sent to Really come into force and have buffer time of 10 minutes.In this 10 minutes time, each server is directed to tables of data K in service cluster Current accessed strategy be:LastSyncMode, once and renewable time reach, server update is targeted access policies: SyncMode, it is achieved thereby that the policy update of service nondestructive.
Due to being provided with buffer time, if management platform discovery strategy after the transmission of targeted access policies information is matched somebody with somebody Problem is equipped with, because access strategy does not update temporarily, the configuration of mistake does not interfere with business processing yet, can also be the 10 of this buffering Repaired again within minute, push correct information and made up.
By above-mentioned processing, the present embodiment can ensure each clothes in the database handoff procedure on distributed type assemblies line Be engaged in device for database access strategies high consistency and height reliability, realize service nondestructive it is controllable cut stream target.By In ensureing that server can have buffer time in all clusters, unify renewal again afterwards, it can be avoided and obtain new setup time The inconsistent situation of priority so that no matter when, in cluster the configuration of server be consistent.It is wrong in push configuration In the case of by mistake, equally also can having time buffering, before newly configuration Pending The Entry Into Force, calm repair, and protects to greatest extent The security of database switching is hindered.
Corresponding with the embodiment of aforementioned data storehouse access strategy update method, this specification additionally provides database access The embodiment of policy update device and its server/computing device applied.
The embodiment of this specification database access strategies updating device can be applied in server/computing device.Device Embodiment can be realized by software, can also be realized by way of hardware or software and hardware combining.Exemplified by implemented in software, It is by non-volatile memories by the processor that database access strategies where it update as the device on a logical meaning Corresponding computer program instructions read what operation in internal memory was formed in device.For hardware view, as shown in figure 3, being this A kind of hardware structure diagram of server/computing device where specification database access strategy updating device, except shown in Fig. 3 Outside processor 310, internal memory 330, network interface 320 and nonvolatile memory 340, in embodiment where device 331 Server or electronic equipment, generally according to the actual functional capability of the server/computing device, other hardware can also be included, to this Repeat no more.
As shown in figure 4, Fig. 4 is a kind of database access strategies renewal of this specification according to an exemplary embodiment The block diagram of device, described device are applied to the server in service cluster, and the server storage has access strategy, the access Strategy indicates the database that the server process business datum is accessed;
Described device includes:
Receiving module 41, is used for:Receive the target access plan for target service data that service cluster manager sends Slightly information, the targeted access policies information carry the renewable time of the targeted access policies;Wherein, the target access plan During the renewal for the targeted access policies information that the renewable time slightly in information is received with other servers in the service cluster Carve identical;
Update module 42, is used for:When the renewable time reaches, the access strategy stored is updated to the target Access strategy.
Optionally, to the duration between the renewable time at the time of manager sends targeted access policies information, It is proportionate with following one or more information:
The quantity of number of servers or the business datum in the service cluster.
Optionally, the business datum has plurality of classes, and business datum described in per class corresponds to a kind of access strategy;The mesh It is one type or multi-traffic data to mark business datum;
The update module, is additionally operable to:
Access strategy corresponding with the target service data will have been stored and be updated to the targeted access policies.
Optionally, the classification of the business datum is divided by following one or more modes:
Tables of data where service attribute, business datum or processing request initiator.
Optionally, described device also includes:After the targeted access policies information is received, fed back to the manager Information is properly received, so that the manager determines whether that server does not receive the targeted access policies information.
Optionally, described device is applied to that access the will be switched to from the first database is accessed for the processing of business datum The scene that two databases are handled, the access strategy include following one or more:
Access the first database;
Access the first database and the database of synchronized update second;
The first database and the database of synchronized update second are accessed, wherein, the first database enters when carrying out reading and writing data Row data check;
The second database and the database of synchronized update first are accessed, wherein, the second database enters when carrying out reading and writing data Row data check;
Access the second database and synchronous first database;
Access the second database.
As shown in figure 5, Fig. 5 is a kind of database access strategies renewal of this specification according to an exemplary embodiment The block diagram of device, described device are applied to service cluster manager, and the service cluster includes multiple servers, the server Access strategy is stored with, the access strategy indicates the database that the server process business datum is accessed;
Described device includes:
Determining module 51, is used for:Targeted access policies information is determined, the targeted access policies information carries the target The renewable time of access strategy;
Sending module 52, is used for:Each server targeted access policies information being sent in service cluster, for The access strategy stored is updated to the targeted access policies by each server when the renewable time reaches.
Optionally, the sending module, is additionally operable to:
In the preset duration after sending the targeted access policies information, check whether there is server and do not feed back and successfully connect Collect mail and cease, if so, sending the targeted access policies information again to the server not fed back.
Accordingly, this specification embodiment also provides a kind of server, including:
Processor;
For storing the memory of processor-executable instruction;The memory storage has access strategy, the access plan Slightly indicate the database that the server process business datum is accessed;
Wherein, the processor is configured as:
The targeted access policies information for target service data that service cluster manager sends is received, the target is visited Ask that policy information carries the renewable time of the targeted access policies;Wherein, during renewal in the targeted access policies information Carve identical with the renewable time for the targeted access policies information that other servers in the service cluster are received;
When the renewable time reaches, the access strategy stored is updated to the targeted access policies.
Accordingly, this specification embodiment also provides a kind of computing device, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Described device includes:
Targeted access policies information is determined, when the targeted access policies information carries the renewal of the targeted access policies Carve;
Each server targeted access policies information being sent in service cluster, so that each server is in institute When stating renewable time arrival, the access strategy stored is updated to the targeted access policies;Wherein, the server storage There is access strategy, the access strategy indicates the database that the server process business datum is accessed.
The function of modules and the implementation process of effect specifically refer to and step are corresponded in the above method in said apparatus Implementation process, it will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component The module of explanation can be or may not be physically separate, can be as the part that module is shown or can also It is not physical module, you can with positioned at a place, or can also be distributed on multiple mixed-media network modules mixed-medias.Can be according to reality Need to select some or all of module therein to realize the purpose of this specification scheme.Those of ordinary skill in the art are not In the case of paying creative work, you can to understand and implement.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims It is interior.In some cases, the action recorded in detail in the claims or step can be come according to different from the order in embodiment Perform and still can realize desired result.In addition, the process described in the accompanying drawings not necessarily require show it is specific suitable Sequence or consecutive order could realize desired result.In some embodiments, multitasking and parallel processing be also can With or be probably favourable.
Those skilled in the art will readily occur to this specification after considering specification and putting into practice the invention applied here Other embodiments.This specification is intended to any modification, purposes or adaptations of this specification, these modifications, Purposes or adaptations follow the general principle of this specification and not applied in the art including this specification Common knowledge or conventional techniques.Description and embodiments be considered only as it is exemplary, the true scope of this specification and Spirit is pointed out by following claim.
It should be appreciated that the precision architecture that this specification is not limited to be described above and is shown in the drawings, And various modifications and changes can be being carried out without departing from the scope.The scope of this specification is only limited by appended claim System.
The preferred embodiment of this specification is the foregoing is only, it is all in this explanation not to limit this specification Within the spirit and principle of book, any modification, equivalent substitution and improvements done etc., the model of this specification protection should be included in Within enclosing.

Claims (18)

1. a kind of database access strategies update method, methods described is applied to the server in service cluster, the server Access strategy is stored with, the access strategy indicates the database that the server process business datum is accessed;
Methods described includes:
Receive the targeted access policies information for target service data that service cluster manager sends, the target access plan Slightly information carries the renewable time of the targeted access policies;Wherein, the renewable time in the targeted access policies information with The renewable time for the targeted access policies information that other servers are received is identical in the service cluster;
When the renewable time reaches, the access strategy stored is updated to the targeted access policies.
2. according to the method for claim 1, to the renewal at the time of manager's transmission targeted access policies information Duration between moment, it is proportionate with following one or more information:
The quantity of number of servers or the business datum in the service cluster.
3. according to the method for claim 1, the business datum has plurality of classes, business datum described in per class is corresponding a kind of Access strategy;The target service data are one type or multi-traffic data;
It is described that the access strategy stored is updated to the targeted access policies, including:
Access strategy corresponding with the target service data will have been stored and be updated to the targeted access policies.
4. according to the method for claim 3, the classification of the business datum is drawn by following one or more modes Point:
Tables of data where service attribute, business datum or processing request initiator.
5. according to the method for claim 1, methods described also includes:After the targeted access policies information is received, Information is properly received to manager feedback, so that the manager determines whether that server does not receive the target and visited Ask policy information.
6. according to the method for claim 1, methods described is applied to count from accessing first for the processing of business datum The scene for accessing the second database and being handled is switched to according to storehouse, the access strategy includes following one or more:
Access the first database;
Access the first database and the database of synchronized update second;
The first database and the database of synchronized update second are accessed, wherein, the first database enters line number when carrying out reading and writing data According to verification;
The second database and the database of synchronized update first are accessed, wherein, the second database enters line number when carrying out reading and writing data According to verification;
Access the second database and synchronous first database;
Access the second database.
7. a kind of database access strategies update method, methods described is applied to service cluster manager, the service cluster bag Multiple servers are included, the server storage has access strategy, and the access strategy indicates the server process business datum The database accessed;
Methods described includes:
Targeted access policies information is determined, the targeted access policies information carries the renewable time of the targeted access policies;
Each server targeted access policies information being sent in service cluster, for each server it is described more When the new moment reaches, the access strategy stored is updated to the targeted access policies.
8. the method according to claim 11, in addition to:
In the preset duration after sending the targeted access policies information, check whether there is server and do not feed back and be properly received letter Breath, if so, sending the targeted access policies information again to the server not fed back.
9. a kind of database access strategies updating device, described device is applied to the server in service cluster, the server Access strategy is stored with, the access strategy indicates the database that the server process business datum is accessed;
Described device includes:
Receiving module, it is used for:The targeted access policies information for target service data that service cluster manager sends is received, The targeted access policies information carries the renewable time of the targeted access policies;Wherein, the targeted access policies information In renewable time it is identical with the renewable time for the targeted access policies information that other servers in the service cluster are received;
Update module, it is used for:When the renewable time reaches, the access strategy stored is updated to the target access plan Slightly.
10. device according to claim 9, to the renewal at the time of manager sends targeted access policies information Duration between moment, it is proportionate with following one or more information:
The quantity of number of servers or the business datum in the service cluster.
11. device according to claim 9, the business datum has plurality of classes, business datum corresponding one described in per class Kind access strategy;The target service data are one type or multi-traffic data;
The update module, is additionally operable to:
Access strategy corresponding with the target service data will have been stored and be updated to the targeted access policies.
12. device according to claim 11, the classification of the business datum is carried out by following one or more modes Division:
Tables of data where service attribute, business datum or processing request initiator.
13. device according to claim 9, described device also include:After the targeted access policies information is received, Information is properly received to manager feedback, so that the manager determines whether that server does not receive the target and visited Ask policy information.
14. device according to claim 9, described device is applied to count from accessing first for the processing of business datum The scene for accessing the second database and being handled is switched to according to storehouse, the access strategy includes following one or more:
Access the first database;
Access the first database and the database of synchronized update second;
The first database and the database of synchronized update second are accessed, wherein, the first database enters line number when carrying out reading and writing data According to verification;
The second database and the database of synchronized update first are accessed, wherein, the second database enters line number when carrying out reading and writing data According to verification;
Access the second database and synchronous first database;
Access the second database.
15. a kind of database access strategies updating device, described device is applied to service cluster manager, the service cluster bag Multiple servers are included, the server storage has access strategy, and the access strategy indicates the server process business datum The database accessed;
Described device includes:
Determining module, it is used for:Targeted access policies information is determined, the targeted access policies information carries the target access plan Renewable time slightly;
Sending module, it is used for:Each server targeted access policies information being sent in service cluster, for each described The access strategy stored is updated to the targeted access policies by server when the renewable time reaches.
16. device according to claim 15, the sending module, are additionally operable to:
In the preset duration after sending the targeted access policies information, check whether there is server and do not feed back and be properly received letter Breath, if so, sending the targeted access policies information again to the server not fed back.
17. a kind of server, including:
Processor;
For storing the memory of processor-executable instruction;The memory storage has access strategy, and the access strategy refers to Show the database that the server process business datum is accessed;
Wherein, the processor is configured as:
Receive the targeted access policies information for target service data that service cluster manager sends, the target access plan Slightly information carries the renewable time of the targeted access policies;Wherein, the renewable time in the targeted access policies information with The renewable time for the targeted access policies information that other servers are received is identical in the service cluster;
When the renewable time reaches, the access strategy stored is updated to the targeted access policies.
18. a kind of computing device, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Described device includes:
Targeted access policies information is determined, the targeted access policies information carries the renewable time of the targeted access policies;
Each server targeted access policies information being sent in service cluster, for each server it is described more When the new moment reaches, the access strategy stored is updated to the targeted access policies;Wherein, the server storage has visit Strategy is asked, the access strategy indicates the database that the server process business datum is accessed.
CN201710898718.0A 2017-09-28 2017-09-28 Database access strategies update method, device, server and computing device Pending CN107480309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710898718.0A CN107480309A (en) 2017-09-28 2017-09-28 Database access strategies update method, device, server and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710898718.0A CN107480309A (en) 2017-09-28 2017-09-28 Database access strategies update method, device, server and computing device

Publications (1)

Publication Number Publication Date
CN107480309A true CN107480309A (en) 2017-12-15

Family

ID=60605450

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710898718.0A Pending CN107480309A (en) 2017-09-28 2017-09-28 Database access strategies update method, device, server and computing device

Country Status (1)

Country Link
CN (1) CN107480309A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491489A (en) * 2018-03-14 2018-09-04 北京思特奇信息技术股份有限公司 A kind of data processing method and system based on multi-data source
CN110737670A (en) * 2019-10-21 2020-01-31 中国民航信息网络股份有限公司 cluster data consistency guarantee method, device and system
CN113220779A (en) * 2021-04-27 2021-08-06 阿波罗智联(北京)科技有限公司 Data processing method, device, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1486891A2 (en) * 1997-02-12 2004-12-15 Kokusai Denshin Denwa Co., Ltd Document retrieval apparatus
US20090080443A1 (en) * 2007-09-21 2009-03-26 Honeywell International, Inc. System and method for remotely administering and synchronizing a clustered group of access control panels
CN102118422A (en) * 2010-01-05 2011-07-06 中兴通讯股份有限公司 Peer node of RELOAD peer network as well as method and system for updating configuration of peer node
CN102693324A (en) * 2012-01-09 2012-09-26 西安电子科技大学 Distributed database synchronization system, synchronization method and node management method
CN106878363A (en) * 2016-06-01 2017-06-20 阿里巴巴集团控股有限公司 A kind of information processing method, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1486891A2 (en) * 1997-02-12 2004-12-15 Kokusai Denshin Denwa Co., Ltd Document retrieval apparatus
US20090080443A1 (en) * 2007-09-21 2009-03-26 Honeywell International, Inc. System and method for remotely administering and synchronizing a clustered group of access control panels
CN102118422A (en) * 2010-01-05 2011-07-06 中兴通讯股份有限公司 Peer node of RELOAD peer network as well as method and system for updating configuration of peer node
CN102693324A (en) * 2012-01-09 2012-09-26 西安电子科技大学 Distributed database synchronization system, synchronization method and node management method
CN106878363A (en) * 2016-06-01 2017-06-20 阿里巴巴集团控股有限公司 A kind of information processing method, apparatus and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491489A (en) * 2018-03-14 2018-09-04 北京思特奇信息技术股份有限公司 A kind of data processing method and system based on multi-data source
CN110737670A (en) * 2019-10-21 2020-01-31 中国民航信息网络股份有限公司 cluster data consistency guarantee method, device and system
CN113220779A (en) * 2021-04-27 2021-08-06 阿波罗智联(北京)科技有限公司 Data processing method, device, storage medium and program product

Similar Documents

Publication Publication Date Title
US10389704B1 (en) Cluster claim
US10108632B2 (en) Splitting and moving ranges in a distributed system
US9019123B2 (en) Health check services for web-based collaboration environments
CN102426594B (en) Method and system for operating database
US20070136200A1 (en) Backup broker for private, integral and affordable distributed storage
CN104361119B (en) A kind of method and system of data scrubbing
CN104184812B (en) A kind of multipoint data transmission method based on private clound
CN107391758A (en) Database switching method, device and equipment
CN107958010A (en) Method and system for online data migration
US20120304262A1 (en) Automating cloud service reconnections
CN107480309A (en) Database access strategies update method, device, server and computing device
CN104104582B (en) A kind of data storage path management method, client and server
JP2020537246A (en) Security based on file system content
CN107580032A (en) Data processing method, device and equipment
US9146921B1 (en) Accessing a file system during a file system check
US9178860B2 (en) Out-of-path, content-addressed writes with untrusted clients
US20150020167A1 (en) System and method for managing files
CN107566195A (en) Mirror image warehouse processing method and system
US20200379982A1 (en) Information processing system and method of controlling information processing system
CN110471906B (en) Database switching method, device and equipment
WO2021223628A1 (en) Secure data replication in distributed data storage environments
US9626425B2 (en) Storage system, cloud storage system, and computer program product
CN116455891B (en) Safety exchange system between data networks
US8886902B1 (en) Disk backup set access
CN108595924A (en) A kind of service authority management method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171215