CN107480185A - A kind of data access method and equipment - Google Patents

A kind of data access method and equipment Download PDF

Info

Publication number
CN107480185A
CN107480185A CN201710548151.4A CN201710548151A CN107480185A CN 107480185 A CN107480185 A CN 107480185A CN 201710548151 A CN201710548151 A CN 201710548151A CN 107480185 A CN107480185 A CN 107480185A
Authority
CN
China
Prior art keywords
database
data
access
effective
burst
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
CN201710548151.4A
Other languages
Chinese (zh)
Inventor
陈正
殷舒
刘胜
祝晓潭
汤成山
杨士弘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Union Mobile Pay Co Ltd
Original Assignee
Union Mobile Pay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Union Mobile Pay Co Ltd filed Critical Union Mobile Pay Co Ltd
Priority to CN201710548151.4A priority Critical patent/CN107480185A/en
Publication of CN107480185A publication Critical patent/CN107480185A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24535Query rewriting; Transformation of sub-queries or views
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • 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/278Data partitioning, e.g. horizontal or vertical partitioning

Landscapes

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

Abstract

The invention discloses a kind of data access method and equipment, for improving the efficiency of data access.Data access method therein includes:Whether each database is effective in the multiple databases for multiple bursts that detection the first data of storage are divided into;Part or all of database in effective database is conducted interviews.

Description

A kind of data access method and equipment
Technical field
The present invention relates to database technical field, more particularly to a kind of data access method and equipment.
Background technology
Increasingly extensive and different field the class of business applied with cyber-net becomes increasingly abundant, and network should Increasing with the data volume of system, the species of data is also more and more, and access of the network application system to data is also increasingly Frequently.
Because the data of database may break down, then it is all to carry at any time that can not just ensure database For service, for example, database breaks down, network failure, the tables of data of database purchase is actually what is be not present, Caused database can not be accessed, i.e. the success rate of data access is relatively low.In this case, terminal just can not successful access First data, this just needs terminal to access database again, and to obtain the first data, inevitably, terminal is route with burst Interactive number is more, causes the less efficient of data access.
The content of the invention
The embodiment of the present invention provides a kind of data access method and equipment, for improving the efficiency of data access.
In a first aspect, one embodiment of the invention provides a kind of data access method, the data access method includes:
Whether each database is effective in the multiple databases for multiple bursts that detection the first data of storage are divided into;
Part or all of database in effective database is conducted interviews.
Optionally, whether there is each database in the multiple databases for multiple bursts that the first data of detection storage are divided into Effect, including:
In the data access request that receiving terminal is sent, detect whether each database in the multiple database has Effect;
Or,
Whether each database periodically detected in the multiple database is effective.
Optionally, whether each database detected in the multiple database is effective, including:
Whether the network port of each database described in test access may have access to, detects whether each database can visit Ask, or the tables of data stored in detection each database whether there is and may have access to.
Optionally, in addition to:
If detection determines invalid database be present in the multiple database, the invalid database is reported Other equipment, to safeguard the invalid database.
Optionally, the multiple database corresponds to multiple backup databases, the corresponding backup database of a database;
Methods described also includes:
If accessing the part or all of failed database in effective database, access in the multiple backup database Backup database corresponding with the effective database of access failure;
Or,
Access backup database corresponding with invalid database in the multiple backup database.
Optionally, after the data access request that receiving terminal is sent, in addition to:
The request that the data access request is carried accesses third party's program of parameter input setting, and receives described the The route results of three equations output;Wherein, the route results are used for the multiple bursts for indicating that the first data of storage are divided into Multiple databases.
Optionally, third party's program is to enter the program of edlin according to burst rule, wherein, the burst rule is First data are divided into multiple burst rules according to which.
Second aspect, one embodiment of the invention provide a kind of data access equipment, and the data access equipment includes:
Detection module, it is whether effective for detecting each database in multiple databases for being divided into of the first data of storage;
Access modules, for being conducted interviews to the part or all of database in effective database.
Optionally, it is each in the multiple databases for multiple bursts that detection module detection first data of storage are divided into Whether database is effective, including::
In the data access request that receiving terminal is sent, detect whether each database in the multiple database has Effect;
Or,
Whether each database periodically detected in the multiple database is effective.
Optionally, whether each database that the detection module is detected in the multiple database is effective, including:
Whether the network port of each database described in test access may have access to, detects whether each database can visit Ask, or the tables of data stored in detection each database whether there is and may have access to.
Optionally, in addition to sending module, the sending module are used for:If detection determines exist in the multiple database Invalid database, then the invalid database is reported into other equipment, to safeguard the invalid database.
Optionally, the multiple database corresponds to multiple backup databases, the corresponding backup database of a database;
The access modules are additionally operable to:If accessing the part or all of failed database in effective database, access Backup database corresponding with the effective database of access failure in the multiple backup database;
Or,
Access backup database corresponding with invalid database in the multiple backup database.
Optionally, the access modules are additionally operable to:
After the data access request that receiving terminal is sent, the request that the data access request is carried accesses parameter Third party's program of setting is inputted, and receives the route results of third party's program output;Wherein, third party's program is led to The mode for crossing Run Script file realizes that the route results are used to indicate the more of multiple bursts that the first data of storage are divided into Individual database.
Optionally, third party's program is to enter the program of edlin according to burst rule, wherein, the burst rule is First data are divided into multiple burst rules according to which.
The embodiment of the present invention provides a kind of data access method, in multiple bursts that access the first data of storage are divided into In multiple databases before each database, whether each database that can be detected in this multiple database is effective, with only right Effective database conducts interviews, and can directly abandon accessing for invalid database, and which reduces access interaction Number, so as to reach the purpose for improving access efficiency.
Brief description of the drawings
Fig. 1 is data access method flow chart provided in an embodiment of the present invention;
Fig. 2 is a kind of structural representation of data access equipment provided in an embodiment of the present invention;
Fig. 3 is a kind of structural representation of data access equipment provided in an embodiment of the present invention.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described.
Technical scheme provided in an embodiment of the present invention is introduced with reference to Figure of description.
Fig. 1 is referred to, the embodiment of the present invention provides a kind of data access method, and the flow of this method is described as follows:
S101:Whether there is each database in the multiple databases for multiple bursts that detection the first data of storage are divided into Effect;
S102:Part or all of database in effective database is conducted interviews.
In the embodiment of the present invention, the first data can be understood as data to be visited, it is contemplated that the first data are stored in One tables of data, just need to operate whole tables of data when conducting interviews to the first data, add the burden of database. In order to mitigate the burden of database, the database summary table of the first data is carried out according to certain rule, also referred to as burst rule Burst, multiple bursts are divided into, multiple bursts are disperseed to be stored in multiple databases.
, can be according to time rule, such as by the order data in units of the moon for example, for the order data table of 1 year Table is split, and can be divided into 12 sub- order data tables, and one of those sub- order data table can be understood as one point Piece.Multiple bursts can be stored on a server, can also be stored on multiple servers.To the access process of data, The process that exactly data in multiple bursts on one or more server are conducted interviews.
User can be conducted interviews by the data of terminal-pair first, when being conducted interviews to the first data, just be needed first Which database where knowing multiple bursts that the first data to be accessed include has, to be grasped in these databases Make, realize and access the first data.Which database where determining multiple bursts that the first data include has can pass through burst Route implementing.Burst route is correspondingly arranged on routing rule, and routing rule is corresponding with burst rule, and burst route can pass through road As multiple bursts included by rule calculates the first data, and the database where multiple bursts.In the embodiment of the present invention, point Piece route can be set in the terminal, can also be set in the server, or can also be set independently of terminal and server Between terminal and server.
Burst route receives data access request, can calculate outlet according to data access request and the routing rule of setting By result, that is, store at least one Database Lists of multiple bursts included by the first data.Wherein, at least one number The list of the address of database where including the list of the burst included by the first data, and/or burst according to storehouse list.Burst road After calculating route results, the route results of calculating can be fed back to terminal, so that route of the terminal according to reception As a result the address of database where obtaining the list of the burst included by the first data, and burst, so as to be wrapped to the first data Database where the multiple bursts included is operated, to obtain the first data to be accessed.
Because the data of database may break down, then it is all effective at any time that can not just ensure database , for example, the tables of data of database purchase is actually what is be not present, caused database can not be accessed, even if having accessed The database also cannot get the first data, i.e. the success rate of data access is relatively low.In this case, terminal just can not be visited successfully The first data are asked, this just needs terminal to access database again, and request obtains the first data, inevitably, terminal and burst It is just more to route the number of interaction, causes the less efficient of data access.
Therefore, the number interacted in order to avoid terminal and burst route is more, the efficiency of data access is improved, in the present invention In embodiment, when multiple databases where the multiple bursts being divided into the first data of storage conduct interviews, it can detect Whether each database is effective in this multiple database, and database effectively refers to that database may have access to here.With only to effective Database conduct interviews, directly abandon accessing for invalid database, interaction times during so as to reduce access, reach Improve the purpose of access efficiency.
Each data in the multiple databases for multiple bursts that detection the first data of storage of the embodiment of the present invention are divided into Whether storehouse is effective, can detect whether the network port corresponding to each database may have access to, and can check each database sheet Whether body may have access to, or can also check whether the tables of data to be accessed in each database exists in database, and The tables of data can also access in itself.If the network port corresponding to a data place can access, it is considered that the number Effective according to storehouse, similarly, if a database can access in itself, the database is also effective.Three of the above detects Situation is merely illustrative, and in the embodiment of the present invention, whether effective, can also all consider three kinds of situations if detecting each database Enter, once all detected three cases above, so may further determine that effective database, visited with reducing as far as possible Ask the possibility of invalid database.Certainly, database is effectively not limited to several situations of the above, in addition to other possible feelings Condition.
Each data in the multiple databases for multiple bursts that detection the first data of storage of the embodiment of the present invention are divided into Whether storehouse can also can effectively be route by terminal by burst, can also be realized by server.Wherein, detect multiple Whether each database in database can effectively be carried out in the following two cases.
The first situation:Burst route can be detected after route results are calculated, to be visited only to detect Database validity, the negligible amounts of the database detected, detection efficiency is higher, can also mitigate detection burden.This It in inventive embodiments, except burst is route, can also be detected by terminal after route results are calculated, now just need to divide Piece route informs terminal when calculating route results, is examined as the validity of the database included by terminal-pair route results Survey.Certainly, in the embodiment of the present invention, the detection to the validity of the database included by route results is not limited by burst road By being realized with terminal, can also be realized by other possible equipment, such as server.
Second of situation:Burst route can also be directed to all databases stored on server and periodically be examined Survey, to be periodically monitored to all databases, when finding to have invalid database, be easy in time to invalid data Safeguarded in storehouse.The setting in cycle can rule of thumb be set, such as the frequency that database breaks down is every 30 minute/time, It is exactly 30 minutes that the cycle, which can so be set,.The setting in cycle can also measure gained according to actual experiment, on the other hand, the present invention is not It is restricted.
Under this detection mode, after burst router-level topology goes out route results, the route results that will can calculate Included database is compared with the efficient database for being periodically detected to obtain, if the database included by route results In some or some databases not in the range of the efficient database for being periodically detected to obtain, then it is considered that some or it is some Database is invalid database.Burst route all database that the route results fed back to terminal can include calculating, Efficient database can also be only included.When burst route the route results fed back to terminal and only includes efficient database, i.e. burst Route after can invalid data storehouse be removed, then feeds back to terminal after route results are calculated.
In addition, when burst route detects the presence of invalid database, invalid database can be reported other and set It is standby, such as terminal, know invalid database be present so as to terminal, invalid database is safeguarded.Certainly, the present invention is real Apply in example, server can also be directed to all databases stored on server and periodically be detected, with periodically All databases are monitored, when finding to have invalid database, are easy in time safeguard invalid database.
If it is determined that invalid database be present, then also can thinks first be stored in invalid database The partial data of data be access less than, that is, the first data that terminal finally gives are incomplete.And invalid data Storehouse is likely to be database in use, and because some situations break down and it is invalid to cause.For example, for certain data For table, when initial, this tables of data is stored in database, in using process, is deleted due to maloperation, So now the database is exactly invalid.Under the circumstances, the embodiment of the present invention can also be to storage the first data point The multiple databases for the multiple bursts being cut into are backed up, and wherein the data in backup database can pass through data duplication instrument Realize consistent with the data in multiple databases.
In the presence of backup database, the route results of burst router-level topology can comprise more than multiple data Storehouse, in addition to multiple backup databases corresponding with multiple primary databases.So when terminal is it is determined that there is invalid data stock In case, database corresponding with invalid database in multiple backup databases can be accessed, is so obtained with The whole content of first data, can more meet the needs of user.
In addition, the data of database may break down, then can not just ensure that database is all at any time can be with Service is provided, for example, database breaks down, network failure, system jam, such as disk is full etc., it is caused Database can not provide service, and in this case, terminal just can not the data of successful access first, the i.e. success rate of data access It is relatively low.Even also there is a situation where to access failure unavoidably so accessing effective database.
Therefore, in the presence of backup database, the route results of burst router-level topology comprise more than the first data Including multiple bursts where Database Lists, include the backup of the database where multiple bursts for including of the first data Database Lists, terminal is in some or all of failed database in accessing at least one efficient database, then can be with Thinking the database that has, there occurs failure.Now, terminal can is accessed in multiple backup databases with accessing miss data storehouse Corresponding backup database, so as to obtain the first data, to improve the success rate for accessing data.
In addition, burst route is to calculate route results according to the routing rule in data access request and burst route Afterwards, then by the route results of calculating terminal is fed back to, so that terminal goes to access the first data according to the route results of reception. In the prior art, the routing rule of burst route is pre-set, once routing rule is changed, it is necessary to weight During newly the routing rule programming after change to burst is route, it otherwise can not continue through burst route and data are conducted interviews. In the embodiment of the present invention, burst route the routing rule of itself and can obtained by third party's program, and third party's program passes through The mode of Run Script file is realized.In possible embodiment, JavaScript script languages are performed in java running environment Speech, obtains script file.Wherein, third party's program is to enter the program of edlin according to burst rule, and burst rule is the first number According to being divided into multiple burst rules according to which.
If burst rule is changed, such as newly increases burst rule, either abandon existing burst rule or Improved in existing burst rule, accordingly routing rule is also just changed, and also just needs to update burst route Routing rule.In the prior art, when needing to update routing rule, it is necessary to be burnt new routing rule again by fever writes Record to all bursts and route, it is cumbersome.And in the embodiment of the present invention, third party's program can pass through Run Script file Mode is realized, when routing rule is changed, it is only necessary to accordingly changes the code in script file, then Run Script text Renewal routing rule can be achieved in part, more flexibly.In addition, in the embodiment of the present invention, script file can be disposed independently, can be with Hot load and execution script file, without just-ahead-of-time compilation.So there is no need to by fever writes by new routing rule again Burst route is burned onto, avoids operational cumbersome, is relatively easy to realize the extension of routing rule.
The implementation that burst route calculates route results according to data access request and third party's program is described below.
The data access request that burst route receiving terminal is sent, the request that can carry data access request access ginseng Third party's program of number input setting, route results are calculated by third party's program, that is, more included by the first data At least one Database Lists of individual burst, and at least one backup database list.Wherein, at least one Database Lists bag Include the list of the burst included by the first data, and/or the list of the address of the database where burst.
Different types of data, corresponding burst rule are also different, then and corresponding routing rule is also different, Corresponding script file is also different.In the embodiment of the present invention, different types of data can be embodied by logic table name, Script file corresponding to so different logic table names is different, i.e., according to corresponding to logic table name can determine the data to be accessed Routing rule.Wherein, logic table name can be used for the title of tables of data where identifying the first data, such as order table, Ke Yitong Order form is crossed to represent.Order table t_order data volumes are very big, to do burst, can be split into t_ by date Order201705, t_order201706, t_order201707 ... wait several sub- order tables, wherein, t_order is exactly to patrol Collect table name, the table name with date suffix, such as t_order201705 and be properly termed as entity table name, entity table name can be understood as The title of database where multiple bursts that first data include.When being conducted interviews to the first data, can determine first The logic table name of first data, to determine routing rule corresponding to the first data by the logic table name, to further determine that Multiple databases where multiple bursts included by one data.
In the embodiment of the present invention, data access request carries request and accesses parameter, and request, which accesses parameter, can include knot Structure query language (Structured Query Language, SQL) sentence, burst field and logic table name, wherein, burst Field is used for the access consideration of the data of identification access first, for example, the date.Continue by taking the example of the preceding paragraph as an example, burst field Can be 201705,201706,201707 etc..
After burst route obtains request access parameter from data access request, it can be accessed first according to request in parameter Logic table name determine corresponding script file, namely be to determine the routing rule to be used.After script file is determined, burst Run Script file is route, and using the value for asking to access the burst field in parameter as the input parameter of script file, script The output of file is exactly route results.For example, calculating order table t_order route results, determine to need by t_order first The routing rule for the script file t_order.js to be used, then burst field date value is transferred to t_ as input parameter Order.js, the result for performing t_order.js outputs is exactly route results.The route results include storehouse table information, i.e., both include Data table information where first data, such as entity table name t_order201705, also including where t_order201705 Database information.
Further, the embodiment of the present invention considers that the data of magnanimity include various types of data, on the other hand, all kinds Data carry out burst rules according to which, i.e., burst rule also include it is a variety of.It is so polytype when being stored on server Multiple bursts of data.Terminal first has to obtain the burst rule of the first data, so as to edit with dividing before the first data are accessed Script file corresponding to piece rule, then when terminal needs to access other data, it is necessary to update and other data Script file corresponding to burst rule, is updated every time, cumbersome.
In consideration of it, in embodiments of the present invention, the record burst that terminal can be commonly used according to the data stored on server Multiple script files corresponding to regular pre-edit, one of script file correspond to a kind of routing rule.Terminal can store Multiple script files of pre-edit, when the data stored on to server conduct interviews, as long as script text corresponding to calling Part.Accordingly even when server has newly increased the data of storage, as long as the burst rule of the data newly increased is constant, just it is not required to Script file is updated, realizes the multiplexing of script file, avoids the operation of frequent edit script file.
Further, the burst route in the embodiment of the present invention can be realized more multiple by way of Run Script file Miscellaneous routing rule.In the prior art, burst, which route stored routing rule, is realized by way of routing table, and is tied The routing table storage organization of structure is difficult to meet that complicated routing rule is set.For example, in the situation of a variety of routing rules combination Under, for example, the first data, using the period as the first result, are entered first according to date field burst on a time period according to certain field Row Hash operation, most the first data carry out burst at last, and such routing rule is complex, and routing table is difficult to realize so Rule.In the embodiment of the present invention, a script file can include routing rule more than two-stage or two-stage, or with above-mentioned Exemplified by example, script file provided in an embodiment of the present invention can both include first according to the rule of period burst, again can be with On the basis of according to period burst, the rule of Hash operation is carried out further according to certain field, i.e., in the embodiment of the present invention Burst is route can realize complex routing rule by way of Run Script file, and application is more extensive.Certainly, one It is only citing that individual script file, which includes two-stage routing rule, in possible embodiment, a script file can include three-level, Routing rule even more than three-level.
Furthermore in the prior art, when terminal needs to access the first data, send data access request, burst route The parameter carried in data access request, such as SQL statement are first parsed, burst field is determined whether further according to routing table and divides Piece rule, if burst field and burst rule, then determine multiple bursts included by the first data.I.e. in prior art In, burst route is firstly the need of access routing table, then calculates route results, and accessing routing table just needs to expend the time, so The computational efficiency for having led to burst route is relatively low.And sometimes, burst is routed through the mode of routing table, and once calculated can Route results can not be drawn, it is necessary to which the calculating carried out twice or more than twice can just draw route results.For example, refer to Table 1, table 1 is the regular signal table of the burst of the first data, so that the rule according to the period carries out burst to the first data as an example. Burst field, such as from date, the Close Date, burst is monthly done according to the burst field, configured in database generally such as Shown in table 1, continuity over time, the configuration item of the table also needs to increase, if to access first data in May to July Burst, it is obviously desirable to calculate the burst of first data in May, June and July respectively according to the routing rule in May, June and July, Only it can not configure the routing rule by one.
The signal table of the burst rule of the data of table 1- first
From date Close Date Table name
20170501 20170531 T201705
20170601 20170630 T201706
20170701 20170731 T201707
If the first data to be accessed exist in the T201705 and T201707 shown in table 1, then by existing The mode of routing table in technology is realized, it is necessary to is calculated twice, and is required for accessing routing table, such burst route meter every time Need to expend the time for accessing routing table when calculating route results, the computational efficiency for causing burst to route is relatively low.And of the invention real Apply in example, burst route direct Run Script file and calculates route results, it is not necessary to access routing table, also save on and access road By the time of table, so as to improve the computational efficiency of burst route.
After terminal receives the route results of burst route feedback, at least one database can be accessed according to route results In part or all of database, obtain the first data.Sometimes user is only needed included by some bursts that the first data include Data, then now terminal can access the partial database at least one database, without accessing whole numbers According to storehouse, to save access time, data access efficiency is improved.Part or all of data at least one database of terminal access During storehouse, directly it can be operated in part or all of database, for example, inquiry operation, modification operation, deletion action etc., certainly These operations can be realized by SQL statement.
In the embodiment of the present invention, the routing rule mode that passes through third party's program, that is, script file of burst route Realize,, can without routeing new routing rule programming to burst again through fever writes when routing rule changes Various new routing rules are realized, are easy to extend routing rule, application is relatively broad, and script file need not be compiled in advance Translate, can directly hot load and execution, implementation process is more convenient.
The equipment that the embodiment of the present invention is provided is introduced below in conjunction with the accompanying drawings.
Fig. 2 is referred to, based on same inventive concept, the embodiment of the present invention provides a kind of data access equipment, and the data are visited Ask that equipment can include memory 201 and processor 202, memory 201 can be connected by bus 200 with processor 202 (Fig. 2 is as example), or can also be connected by special connecting line with processor 202.Wherein, memory 201 can be used In store instruction.Processor 202 can perform the instruction of the storage of memory 201, be used for:Detection the first data of storage are divided into Whether each database is effective in multiple databases of multiple bursts, and the part or all of database in effective database is entered Row is visited.
Optionally, per number in the multiple databases for multiple bursts that the first data of the detection of processor 202 storage are divided into It is whether effective according to storehouse, including:
In the data access request that receiving terminal is sent, whether effective each database in multiple databases is detected;
Or,
Whether each database periodically detected in multiple databases is effective.
Optionally, whether each database that processor 202 is detected in multiple databases is effective, including:
Whether the network port of each database of test access may have access to, detects whether each database may have access to, or inspection The tables of data stored is surveyed in each database to whether there is and may have access to.
Optionally, processor 202 can be also used for:If detection determines invalid database be present in multiple databases, Invalid database is reported into other equipment, to safeguard invalid database.
Optionally, multiple databases correspond to multiple backup databases, the corresponding backup database of a database;
Processor 202 is additionally operable to:
If accessing the part or all of failed database in effective database, access in multiple backup databases with visit Ask backup database corresponding to the effective database of failure;
Or,
Access backup database corresponding with invalid database in multiple backup databases.
Optionally, processor 202 is additionally operable to:
After the data access request that receiving terminal is sent, the request that data access request is carried accesses parameter input Third party's program of setting, and receive the route results of third party's program output;Wherein, route results are used to indicate storage first The multiple databases for multiple bursts that data are divided into.
Optionally, third party's program is to enter the program of edlin according to burst rule, wherein, burst rule is the first data It is divided into multiple burst rules according to which.
Function that each functional unit of data access equipment shown in Fig. 2 is realized etc. refers to the reality shown in Fig. 1 The introduction in example is applied, is seldom repeated.
Fig. 3 is referred to, based on same inventive concept, the embodiment of the present invention also provides a kind of data access equipment, the data Access equipment can include detection module 301 and access modules 302.
Wherein, detection module 301 can be used for each data in multiple databases that detection the first data of storage are divided into Whether storehouse is effective.Access modules 302 can be used for conducting interviews to the part or all of database in effective database.
Optionally, it is each in the multiple databases for multiple bursts that the first data of the detection of detection module 301 storage are divided into Whether database is effective, including::
In the data access request that receiving terminal is sent, whether effective each database in multiple databases is detected;
Or,
Whether each database periodically detected in multiple databases is effective.
Optionally, whether each database that detection module 301 is detected in multiple databases is effective, including:
Whether the network port of each database of test access may have access to, detects whether each database may have access to, or inspection The tables of data stored is surveyed in each database to whether there is and may have access to.
Optionally, in addition to sending module, if sending module, which is used to detect, determines invalid number be present in multiple databases According to storehouse, then invalid database is reported into other equipment, to safeguard the invalid database.
Optionally, multiple databases correspond to multiple backup databases, the corresponding backup database of a database;
Access modules 302 are additionally operable to:If accessing the part or all of failed database in effective database, access more Backup database corresponding with the effective database of access failure in individual backup database;
Or,
Access backup database corresponding with invalid database in multiple backup databases.
Optionally, access modules 302 are additionally operable to:
After the data access request that receiving terminal is sent, the request that data access request is carried accesses parameter input Third party's program of setting, and receive the route results of third party's program output;Wherein, route results are used to indicate storage first The multiple databases for multiple bursts that data are divided into.
Optionally, third party's program is to enter the program of edlin according to burst rule, wherein, burst rule is described first Data are divided into multiple burst rules according to which.
Optionally, detection module 301 and the entity device corresponding to access modules 302 may each be the processor in Fig. 2 202。
The embodiment of the present invention provides a kind of data access method, disperses to deposit in multiple bursts that the first data of access are divided into Before multiple databases, whether each database that can be detected in this multiple database is effective for storage, with only to effective number Conducted interviews according to storehouse, for abandoning accessing between invalid database, reduce the number for accessing interaction, reached raising and access effect The purpose of rate.
It is apparent to those skilled in the art that for convenience and simplicity of description, only with above-mentioned each function The division progress of module, can be as needed and by above-mentioned function distribution by different function moulds for example, in practical application Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of work(described above Energy.The specific work process of the system, apparatus, and unit of foregoing description, it may be referred to corresponding in preceding method embodiment Journey, it will not be repeated here.
In several embodiments provided by the present invention, it should be understood that disclosed apparatus and method, it can be passed through Its mode is realized.For example, device embodiment described above is only schematical, for example, the module or unit Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, the technical scheme of the application is substantially The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer It is each that equipment (can be personal computer, server, or network equipment etc.) or processor (processor) perform the application The all or part of step of embodiment methods described.And foregoing storage medium includes:General serial bus USB (Universal Serial Bus flash disk), mobile hard disk, read-only storage (Read-Only Memory, ROM), Random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various can be with store program codes Medium.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (14)

  1. A kind of 1. data access method, it is characterised in that including:
    Whether each database is effective in the multiple databases for multiple bursts that detection the first data of storage are divided into;
    Part or all of database in effective database is conducted interviews.
  2. 2. the method as described in claim 1, it is characterised in that detection stores the multiple of multiple bursts that the first data are divided into Whether each database is effective in database, including:
    In the data access request that receiving terminal is sent, whether effective each database in the multiple database is detected;
    Or,
    Whether each database periodically detected in the multiple database is effective.
  3. 3. method as claimed in claim 2, it is characterised in that whether each database detected in the multiple database has Effect, including:
    Whether the network port of each database described in test access may have access to, detects whether each database may have access to, Or the tables of data stored in detection each database whether there is and may have access to.
  4. 4. the method as described in claim 1, it is characterised in that also include:
    If detection determines invalid database be present in the multiple database, the invalid database is reported other Equipment, to safeguard the invalid database.
  5. 5. the method as described in claim 1, it is characterised in that the multiple database corresponds to multiple backup databases, one The corresponding backup database of database;
    Methods described also includes:
    If accessing the part or all of failed database in effective database, access in the multiple backup database with visit Ask backup database corresponding to the effective database of failure;
    Or,
    Access backup database corresponding with invalid database in the multiple backup database.
  6. 6. method as claimed in claim 2, it is characterised in that after the data access request that receiving terminal is sent, also wrap Include:
    The request that the data access request is carried accesses third party's program of parameter input setting, and receives the third party The route results of program output;Wherein, the route results are used to indicate the more of multiple bursts that the first data of storage are divided into Individual database.
  7. 7. method as claimed in claim 6, it is characterised in that third party's program is to enter edlin according to burst rule Program, wherein, the burst rule is divided into multiple burst rules according to which for first data.
  8. A kind of 8. data access equipment, it is characterised in that including:
    Detection module, it is whether effective for detecting each database in multiple databases for being divided into of the first data of storage;
    Access modules, for being conducted interviews to the part or all of database in effective database.
  9. 9. equipment as claimed in claim 8, it is characterised in that detection module detection first data of storage are divided into more Whether each database is effective in multiple databases of individual burst, including::
    In the data access request that receiving terminal is sent, whether effective each database in the multiple database is detected;
    Or,
    Whether each database periodically detected in the multiple database is effective.
  10. 10. equipment as claimed in claim 9, it is characterised in that the detection module detects every in the multiple database Whether individual database is effective, including:
    Whether the network port of each database described in test access may have access to, detects whether each database may have access to, Or the tables of data stored in detection each database whether there is and may have access to.
  11. 11. equipment as claimed in claim 8, it is characterised in that be also used for including sending module, the sending module:If inspection Survey and determine invalid database be present in the multiple database, then the invalid database is reported into other equipment, with Safeguard the invalid database.
  12. 12. equipment as claimed in claim 8, it is characterised in that the multiple database corresponds to multiple backup databases, one The corresponding backup database of database;
    The access modules are additionally operable to:If accessing the part or all of failed database in effective database, described in access Backup database corresponding with the effective database of access failure in multiple backup databases;
    Or,
    Access backup database corresponding with invalid database in the multiple backup database.
  13. 13. equipment as claimed in claim 9, it is characterised in that the access modules are additionally operable to:
    After the data access request that receiving terminal is sent, the request that the data access request is carried accesses parameter input Third party's program of setting, and receive the route results of third party's program output;Wherein, the route results are used to indicate Store the multiple databases for multiple bursts that the first data are divided into.
  14. 14. equipment as claimed in claim 13, it is characterised in that third party's program is to enter edlin according to burst rule Program, wherein, burst rule is divided into multiple burst rules according to which for first data.
CN201710548151.4A 2017-07-06 2017-07-06 A kind of data access method and equipment Pending CN107480185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710548151.4A CN107480185A (en) 2017-07-06 2017-07-06 A kind of data access method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710548151.4A CN107480185A (en) 2017-07-06 2017-07-06 A kind of data access method and equipment

Publications (1)

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

Family

ID=60595652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710548151.4A Pending CN107480185A (en) 2017-07-06 2017-07-06 A kind of data access method and equipment

Country Status (1)

Country Link
CN (1) CN107480185A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239417A (en) * 2014-08-19 2014-12-24 天津南大通用数据技术股份有限公司 Dynamic adjustment method and dynamic adjustment device after data fragmentation in distributed database
CN105528373A (en) * 2014-10-21 2016-04-27 阿里巴巴集团控股有限公司 Database fault processing method, device, system and server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239417A (en) * 2014-08-19 2014-12-24 天津南大通用数据技术股份有限公司 Dynamic adjustment method and dynamic adjustment device after data fragmentation in distributed database
CN105528373A (en) * 2014-10-21 2016-04-27 阿里巴巴集团控股有限公司 Database fault processing method, device, system and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李晓: "基于 MongoDB 和 Asio 的传感器数据存储系统设计", 《电子技术与软件工程》 *

Similar Documents

Publication Publication Date Title
JP5598017B2 (en) Judgment program, method and apparatus
CN102640151B (en) Transformed data recording method and system
CN110601922B (en) Method and device for realizing comparison experiment, electronic equipment and storage medium
JP5535322B2 (en) Storage system whose backend communication standard is SAS
CN106484606A (en) Method and apparatus submitted to by a kind of code
CN103067297B (en) A kind of dynamic load balancing method based on resource consumption prediction and device
CN109783543B (en) Data query method, device, equipment and storage medium
CN109614262A (en) Business method of calibration, device and computer readable storage medium
CN103970807B (en) Method and system for managing database connection
CN109213604A (en) A kind of management method and device of data source
CN104301233A (en) Route access method, route access system and user terminal
CN107451202A (en) A kind of data access method and equipment
CN107766396A (en) resource data management method and device
CN107480184A (en) A kind of data access method and equipment
CN101802791B (en) Dynamic address tracking
CN113010208B (en) Version information generation method, device, equipment and storage medium
CN113656307A (en) System capacity evaluation method, device, equipment and medium
CN109947667B (en) Data access prediction method and device
CN104318960B (en) The restorative procedure and device of a kind of bad track of hard disk
CN107480185A (en) A kind of data access method and equipment
US20090100000A1 (en) Acquisition and expansion of storage area network interoperation relationships
CN106649584A (en) Index processing method and device in master-slave database system
US9910926B2 (en) Managing searches for information associated with a message
CN109783718A (en) Repetitive requests judgment method and device
CN104156358B (en) A kind of batch read method of table for database, device and system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171215

RJ01 Rejection of invention patent application after publication