CN109213827A - A kind of data processing system, method, router and from database - Google Patents

A kind of data processing system, method, router and from database Download PDF

Info

Publication number
CN109213827A
CN109213827A CN201710534280.8A CN201710534280A CN109213827A CN 109213827 A CN109213827 A CN 109213827A CN 201710534280 A CN201710534280 A CN 201710534280A CN 109213827 A CN109213827 A CN 109213827A
Authority
CN
China
Prior art keywords
database
access request
database access
delay
delay threshold
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.)
Granted
Application number
CN201710534280.8A
Other languages
Chinese (zh)
Other versions
CN109213827B (en
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.)
Alibaba Cloud Computing 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 CN201710534280.8A priority Critical patent/CN109213827B/en
Publication of CN109213827A publication Critical patent/CN109213827A/en
Application granted granted Critical
Publication of CN109213827B publication Critical patent/CN109213827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Subject description discloses a kind of data processing system, method, router and from database, which includes: router and from database;Router is used to receive and judge the type of database access request;Database access request and delay threshold that type is read request are encapsulated into database message, and it is corresponding from database to be sent to primary database;It is used to judge the current delay times between database and primary database whether within the scope of the delay threshold in database message from database;According to the judging result of current delay times and delay threshold range, response database access request.In the above-mentioned technical solutions, by judging the delay between master-slave database from database, avoid the monitoring delay of middleware, the actual delay time of master-slave database can accurately be obtained, it solves the technical problem of principal and subordinate's delay judgement inaccuracy between master-slave database in the prior art, improves the accuracy of principal and subordinate's delay judgement.

Description

A kind of data processing system, method, router and from database
Technical field
This specification is related to database field, in particular to a kind of data processing system, method, router and from data Library.
Background technique
More and more to the access request of database with the continuous development of Internet technology, access frequency is also increasingly It is high.In order to improve the service ability of database, usually primary database is equipped with multiple from database, provides read-write point for client From, read load balancing service, mitigate the access pressure of primary database.
The leader follower replication function of being provided between master-slave database by database bottom keeps the consistency of data, but main There is certain delay from the synchronization between database.Many database access requests have certain want to master-slave database delay It asks.In the prior art, for the processing of database access request, a middleware is usually provided and passes through monitor component timing acquisition Delayed data and caching between master-slave database, when database access request arrives, middleware can compare the master of current cache The delay received from delay and user generates routing decision to the database access request of user using principal and subordinate's delay of caching, The access request is sent to database still from database by selection.
In the read and write abruption scheme of database, the delay situation between master-slave database is to influence read and write abruption strategy One important judgment basis.Existing database middleware is easy using the detection of timing and principal and subordinate's time-delay method of caching There is the principal and subordinate cached delay and actual principal and subordinate delay is inconsistent, leads to the technical problem of principal and subordinate's delay judgement inaccuracy, into And occur principal and subordinate's data it is inconsistent cause access fail.
Summary of the invention
This specification embodiment provides a kind of data processing system, method, router and from database, existing for solving In technology between master-slave database principal and subordinate's delay judgement inaccuracy technical problem, improve principal and subordinate's delay judgement accuracy.
In a first aspect, this specification embodiment provides a kind of data processing system, the system comprises: router and from number According to library;
The router, for receiving and judging the type of database access request;If the database access request Type is read request, and delay threshold and the database access request are encapsulated into database message;By the database report It is corresponding described from database that text is sent to primary database;
It is described to judge described between database and primary database from database for receiving the database message Whether current delay times are within the scope of the delay threshold;According to the current delay times and the delay threshold range Judging result responds the database access request.
Optionally, it is described to be used for from database: if the current delay times not within the scope of the delay threshold, respond The database access request handles the database access request.
Optionally, it is described to be also used to from database: if the current delay times not within the scope of the delay threshold, are rung It answers the database access request generation error message and is sent to the router;
The router is also used to: being received the error message, is responded the database access request and be based on the mistake The database access request is retransmitted to the primary database by message.
Optionally, it is described to be also used to from database: if the current delay times not within the scope of the delay threshold, are rung It answers the database access request that the database access request is forwarded to the primary database, passes through the primary database pair The database access request is handled.
Optionally, the router is also used to: if the type of the database access request is write request, by the data Library access request is sent to the primary database;
The primary database, for receiving the database access request and being handled.
Second aspect, this specification embodiment provide a kind of data processing method, which comprises
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated Into database message;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay from database Threshold value and the current delay times between database and the primary database, respond the database access request.
Optionally, the method also includes: if the type of the database access request be write request, by the database Access request is sent to the primary database.
Optionally, the method also includes:
It receives described from the database feedback message that library access request is fed back based on the data;
Judge whether the feedback message is error message;
If the feedback message is error message, the database access request is forwarded to the primary database, so that The primary database handles the database access request.
The third aspect, this specification embodiment provide a kind of data processing method, which comprises
The database message received from connection is parsed, and delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold range, responds the database access and ask It asks.
Optionally, the judging result according to the current delay times and the delay threshold range, described in response Database access request, comprising:
If the current delay times within the scope of the delay threshold, respond the database access request to the number It is handled according to library access request.
Optionally, the judging result according to the current delay times and the delay threshold range, described in response Database access request, comprising:
If the current delay times, not within the scope of the delay threshold, generation error message is simultaneously sent to router, So that the router, which is based on the error message, is retransmitted to the primary database for the database access request;Alternatively,
If the current delay times are forwarded to institute not within the scope of the delay threshold, by the database access request Primary database is stated, the database access request is handled by the primary database.
Fourth aspect, this specification embodiment provide a kind of router, comprising:
Judging unit, for judging the type of database access request;
Encapsulation unit, for the type in the database access request be read request when, by delay threshold and the number It is encapsulated into database message according to library access request;
Transmission unit, it is corresponding from database for the database message to be sent to primary database so that it is described from Database responds the data based on delay threshold and the current delay times between database and the primary database Library access request.
Optionally, the transmission unit is also used to:
When the type of the database access request is write request, the database access request is sent to the master Database.
Optionally, further includes: receiving unit, for receiving, described from database, library access request is fed back based on the data Feedback message;
The judging unit is also used to: judging whether the feedback message is error message;
The transmission unit is also used to: when the feedback message is error message, the database access request being turned It is sent to the primary database, so that the primary database handles the database access request.
5th aspect, this specification embodiment provide a kind of from database, comprising:
Parsing module obtains delay threshold and database access is asked for parsing to the database message received It asks;
Judgment module, for judging whether the current delay times between database and primary database prolong described When threshold range in;
Processing module responds institute for the judging result according to the current delay times and the delay threshold range State database access request.
Optionally, the processing module is used for: if the current delay times within the scope of the delay threshold, respond institute Database access request is stated to handle the database access request.
It is optionally, described from database further include:
First sending module is used for the generation error when the current delay times are not within the scope of the delay threshold Message is simultaneously sent to router, so that the router, which is based on the error message, is retransmitted to institute for the database access request State primary database.
It is optionally, described from database further include:
Second sending module is used for when the current delay times are not within the scope of the delay threshold, by the number It is forwarded to the primary database according to library access request, the database access request is handled by the primary database.
6th aspect, this specification embodiment provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence, which is characterized in that the program performs the steps of when being executed by processor
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated Into database message;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay from database Threshold value and the current delay times between database and the primary database, respond the database access request.
7th aspect, this specification embodiment provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence, which is characterized in that the program performs the steps of when being executed by processor
The database message received from connection is parsed, and delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold range, responds the database access and ask It asks.
Eighth aspect, this specification embodiment provide a kind of electronic equipment, include memory and one or one Above program, one of them perhaps more than one program be stored in memory and be configured to by one or one with It includes the instruction for performing the following operation that upper processor, which executes the one or more programs:
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated Into database message;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay from database Threshold value and the current delay times between database and the primary database, respond the database access request.
9th aspect, this specification embodiment provide a kind of electronic equipment, include memory and one or one Above program, one of them perhaps more than one program be stored in memory and be configured to by one or one with It includes the instruction for performing the following operation that upper processor, which executes the one or more programs:
The database message received is parsed, delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold range, responds the database access and ask It asks.
Said one or multiple technical solutions in this specification embodiment, at least have the following technical effect that
This specification embodiment provides a kind of data processing system, is received by router and judges database access request Type;If the type of database access request is read request, delay threshold and database access request are encapsulated into database In message and to be sent to primary database corresponding from database;By being judged between database and primary database from database Current delay times whether within the scope of the delay threshold in database message;According to current delay times and delay threshold model The judging result enclosed, response database access request.By judging the delay between master-slave database from database, avoid Between part monitoring delay, can accurately obtain the actual delay time of master-slave database, solve principal and subordinate's number in the prior art According to the technical problem of principal and subordinate's delay judgement inaccuracy between library, the accuracy of principal and subordinate's delay judgement is improved.
Detailed description of the invention
In order to illustrate more clearly of the technical solution in this specification embodiment, embodiment or the prior art will be retouched below Attached drawing needed in stating is briefly described, it should be apparent that, the accompanying drawings in the following description is the one of this specification A little embodiments for those of ordinary skill in the art without any creative labor, can also be according to this A little attached drawings obtain other attached drawings.
Fig. 1 a is a kind of schematic diagram for data processing system that this specification embodiment provides;
Fig. 1 b is a kind of flow chart for data processing method that this specification embodiment provides;
Fig. 2 is a kind of flow chart of the data processing method that provides of this specification embodiment in router side;
Fig. 3 is a kind of data processing method for providing of this specification embodiment in the flow chart from database side;
Fig. 4 is a kind of schematic diagram for router that this specification embodiment provides;
Fig. 5 is a kind of schematic diagram from database that this specification embodiment provides;
Fig. 6 is the schematic diagram for a kind of electronic equipment that this specification embodiment provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of this specification embodiment clearer, below in conjunction with this specification reality The attached drawing in example is applied, the technical solution in this specification embodiment is clearly and completely described, it is clear that described reality Applying example is this specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual, this field are general Logical technical staff every other embodiment obtained without creative efforts belongs to this specification protection Range.
A kind of data processing system, method, router and from database are provided in this specification embodiment, it is existing for solving There is the technical problem of principal and subordinate's delay judgement inaccuracy in technology between master-slave database, improves the accurate of principal and subordinate's delay judgement Property.
With reference to the accompanying drawing to the main realization principle of this specification embodiment technical solution, specific embodiment and its right The beneficial effect that should be able to reach is explained in detail.
Fig. 1 a is please referred to, this specification embodiment provides a kind of data processing system, comprising: router 10, primary database 20, from database 30.Router 10 receives the database access request of user, and database access request is forwarded to master data Library 20 or from database 30.
Fig. 1 b is please referred to, specifically, router 10 is used to receive and judge the type of database access request;If the number It is read request according to the type of library access request, delay threshold and the database access request is encapsulated into database message; And it is corresponding from database 30 that the database message is sent to primary database 20.That is, in this specification embodiment, router The routing policy of 10 pairs of database access requests is carried out based on the type of access request, not to master-slave database on router 10 Between principal and subordinate delay judge, but by user require delay threshold be encapsulated into the database message of read request and turn It is sent to from database 30.
Referring to FIG. 2, the routing procedure of router 10 is such as in a kind of data processing method that this specification embodiment provides Under:
S21, database access request is received.
S22, packet parsing and SQL (Structured Query are carried out to the database access request received Language, structured query language) parsing.
The type of database access request that S23, judgement receive, determine the database access request be read request or Write request.
If the database access request is write request, which is forwarded to primary database.In database Read and write abruption method in, write request is usually completed by primary database 20, so as to primary database 20 to each from database 30 Synchronize update.
If S24, the database access request are read request, by the database access request and the received delay threshold of user It is encapsulated into a database message and is forwarded to from database 30.
The feedback message that S25, reception are fed back from database 30 based on database access request.The feedback includes: normal place The processing result and be unsatisfactory for user demand database access request since principal and subordinate's delay is excessive that reason database access request obtains Processing failure and the error message fed back.
Whether the feedback message that S26, judgement receive is error message.
If the feedback message is error message, corresponding database access request is sent to primary database 20, so that Primary database 20 handles the database access request.Conversely, being normal if feedback message is not error message Processing result then sends it to client.
Fig. 1 b is please referred to, the database message that receiving router 10 is sent is used for from database 30, judges from database 30 Whether the current delay times between primary database 20 are within the scope of the acceptable delay threshold of user;When according to current delay Between judging result with delay threshold range, respond the database access request.Wherein, judge working as between master-slave database Whether preceding delay time is within the scope of delay threshold, it can be determined that whether current delay times are less than or equal to delay threshold, if working as Preceding delay time is less than or equal to delay threshold, then current delay times are within the scope of delay threshold, conversely, then current delay times Not within the scope of delay threshold.Certainly, judge that current delay times whether within the scope of delay threshold, also may determine that and currently prolong Whether the slow time is less than delay threshold;If being less than, current delay times are within the scope of delay threshold, conversely, then current delay Time is not within the scope of delay threshold.It is equal to this point of delay threshold about current delay times, includes or be not included in Within the scope of delay threshold, the protection scope of the application is belonged to.
Referring to FIG. 3, in a kind of data processing method that this specification embodiment provides, from the treatment process of database 30 It is as follows:
S31, database message is received and parsed through, obtains the delay threshold in database message.
S32, judge current delay times between database 30 and primary database 20 whether within the scope of delay threshold. Different database access requests has different requirements to principal and subordinate's delay between master-slave database, some access requests are to master Big from the tolerance of delay, for corresponding delay threshold with regard to big, the tolerance that some access requests are delayed to principal and subordinate is small, corresponding to prolong When threshold value with regard to small.The setting of delay threshold can be preset by designer according to different access requests, can also by with Family carries out sets itself and is sent to router 10.Current delay times between database 30 and primary database 20, can be with By calculating to obtain from database 30 according to the last master-slave database synchronization time and current time.
If S33, the current delay times between database 30 and primary database 20 are within the scope of delay threshold, from data Library handles the database access request in database message, and returns to processing result.
If S34, the current delay times between database 30 and primary database 20 not within the scope of delay threshold, generate Error message is simultaneously sent to router 10.Certainly, directly corresponding database access request can be forwarded from database page 30 To primary database 20, primary database 20 is requested to handle the database access request.
In above-described embodiment, the read request in database access request is sent directly to from database by router, By judge from database the current delay times between database and primary database whether the delay in database message In threshold range, that is, judge whether principal and subordinate's delay meets user's requirement, no longer principal and subordinate's delay is supervised by intermediate module It controls and judges, avoid the monitoring delay of middleware, when can obtain the actual delay of master-slave database accurately, in real time Between, it solves the technical problem of principal and subordinate's delay judgement inaccuracy between master-slave database in the prior art, improves principal and subordinate's delay and sentence Disconnected accuracy.
Referring to FIG. 4, a kind of data processing method provided based on the above embodiment, this specification embodiment also correspondence is mentioned For a kind of router, comprising:
Judging unit 41, for judging the type of database access request;
When encapsulation unit 42 for the type in the database access request is read request, by delay threshold and described Database access request is encapsulated into database message;
Transmission unit 43, it is corresponding from database for the database message to be sent to primary database, so that described From database based on delay threshold and the current delay times between database and the primary database, the number is responded According to library access request.
In specific implementation process, the transmission unit 43 is also used to: being to write to ask in the type of the database access request When asking, the database access request is sent to the primary database.
Further, the router that this specification embodiment provides further include: receiving unit 44, it is described from number for receiving According to the library feedback message that library access request is fed back based on the data;The judging unit 41 is also used to: judging the feedback report Whether text is error message;The transmission unit 43 is also used to: when the feedback message is error message, by the database Access request is forwarded to the primary database, so that the primary database handles the database access request.
Referring to FIG. 5, a kind of data processing method provided based on the above embodiment, this specification embodiment also correspondence is mentioned For one kind from database, comprising:
Parsing module 51 obtains delay threshold and database access for parsing to the database message received Request;
Judgment module 52, for judging the current delay times between database and primary database whether described Within the scope of delay threshold;
Processing module 53, for the judging result according to the current delay times and the delay threshold range, response The database access request.
It is described from database in specific implementation process further include: the first sending module, in the current delay times When not within the scope of the delay threshold, generation error message is simultaneously sent to router, so that the router is based on the mistake The database access request is retransmitted to the primary database by wrong report text.Alternatively, it is described from database can also include: second Sending module is used for when the current delay times are not within the scope of the delay threshold, by the database access request It is forwarded to the primary database, the database access request is handled by the primary database.
About in above-described embodiment router, from database, wherein each unit, module execute the concrete mode of operation It is described in detail in the embodiment of method, no longer elaborates herein.
Referring to FIG. 6, being shown according to an exemplary embodiment a kind of set for realizing the electronics of data processing method Standby 700 block diagram.For example, electronic equipment 700 can be computer, database console, tablet device, personal digital assistant Deng.
Referring to Fig. 6, electronic equipment 700 may include following one or more components: processing component 702, memory 704, Power supply module 706, multimedia component 708, the interface 710 and communication component 712 of input/output (I/O).
The integrated operation of the usual controlling electronic devices 700 of processing component 702 is such as grasped with display, data communication, and record Make associated operation.Processing element 702 may include one or more processors 720 to execute instruction, above-mentioned to complete The all or part of the steps of method.In addition, processing component 702 may include one or more modules, it is convenient for 702 He of processing component Interaction between other assemblies.
Memory 704 is configured as storing various types of data to support the operation in equipment 700.These data are shown Example includes the instruction of any application or method for operating on electronic equipment 700, contact data, telephone directory number According to, message, picture, video etc..Memory 704 can by any kind of volatibility or non-volatile memory device or they Combination realize, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable Programmable read only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, quick flashing Memory, disk or CD.
Power supply module 706 provides electric power for the various assemblies of electronic equipment 700.Power supply module 706 may include power supply pipe Reason system, one or more power supplys and other with for electronic equipment 700 generate, manage, and distribute the associated component of electric power.
I/O interface 710 provides interface between processing component 702 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Communication component 712 is configured to facilitate the communication of wired or wireless way between electronic equipment 700 and other equipment. Electronic equipment 700 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.Show at one In example property embodiment, communication component 712 receives broadcast singal or broadcast from external broadcasting management system via broadcast channel Relevant information.In one exemplary embodiment, the communication component 712 further includes near-field communication (NFC) module, short to promote Cheng Tongxin.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, electronic equipment 700 can be by one or more application specific integrated circuit (ASIC), number Word signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 704 of instruction, above-metioned instruction can be executed by the processor 720 of electronic equipment 700 to complete the above method.Example Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft Disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of mobile terminal When device executes, so that electronic equipment is able to carry out a kind of data processing method, which comprises
Judge the type of database access request;If the type of the database access request is read request, by the threshold that is delayed Value and the database access request are encapsulated into database message;It is corresponding that the database message is sent to primary database From database so that it is described from database based on delay threshold and currently the prolonging between database and the primary database The slow time responds the database access request.
Certainly, one of this specification embodiment non-transitorycomputer readable storage medium, when the storage medium In instruction when being executed by the processor of mobile terminal, it is also possible that electronic equipment is able to carry out a kind of data processing method, The described method includes:
The database message received from connection is parsed, and delay threshold and database access request are obtained;Sentence Whether the disconnected current delay times between database and primary database are within the scope of the delay threshold;Worked as according to described Judging result between preceding delay time and the delay threshold range, responds the database access request.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (17)

1. a kind of data processing system, which is characterized in that the system comprises: router and from database;
The router, for receiving and judging the type of database access request;If the type of the database access request For read request, delay threshold and the database access request are encapsulated into database message;The database message is sent out It send corresponding described from database to primary database;
It is described to judge described current between database and primary database from database for receiving the database message Whether delay time is within the scope of delay threshold;According to the judgement knot of the current delay times and the delay threshold range Fruit responds the database access request.
2. the system as claimed in claim 1, which is characterized in that described to be used for from database: if the current delay times exist Within the scope of the delay threshold, responds the database access request and the database access request is handled.
3. the system as claimed in claim 1, which is characterized in that described to be used for from database: if the current delay times are not Within the scope of the delay threshold, responds the database access request generation error message and be sent to the router;
The router is also used to: being received the error message, is based on the error message for the database access request weight It is sent to the primary database.
4. the system as claimed in claim 1, which is characterized in that described to be also used to from database: if the current delay times Not within the scope of the delay threshold, the database access request is responded by the database access request and is forwarded to the master Database is handled the database access request by the primary database.
5. the system as described in Claims 1 to 4 is any, which is characterized in that the router is also used to: if the database is visited The type for asking request is write request, and the database access request is sent to the primary database;
The system also includes the primary database, the primary database is for receiving the database access request and being located Reason.
6. a kind of data processing method, which is characterized in that the described method includes:
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated into number According in the message of library;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay threshold from database And the current delay times between database and the primary database, respond the database access request.
7. method as claimed in claim 6, which is characterized in that the method also includes:
If the type of the database access request is write request, the database access request is sent to the master data Library.
8. method as claimed in claim 6, which is characterized in that the method also includes:
It receives described from the database feedback message that library access request is fed back based on the data;
Judge whether the feedback message is error message;
If the feedback message is error message, the database access request is forwarded to the primary database, so that described Primary database handles the database access request.
9. a kind of data processing method, which is characterized in that the described method includes:
The database message received from connection is parsed, and delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold, the database access request is responded.
10. method as claimed in claim 9, which is characterized in that described according to the current delay times and the delay threshold The judging result of value responds the database access request, comprising:
If the current delay times within the scope of the delay threshold, respond the database access request to the database Access request is handled.
11. method as claimed in claim 9, which is characterized in that described according to the current delay times and the delay threshold The judging result of value responds the database access request, comprising:
If the current delay times not within the scope of the delay threshold, respond the database access request generation error report Text is simultaneously sent to router so that the router be based on the error message database access request is retransmitted to it is described Primary database;Or
If the current delay times not within the scope of the delay threshold, respond the database access request for the data Library access request is forwarded to the primary database, is handled by the primary database the database access request.
12. a kind of router characterized by comprising
Judging unit, for judging the type of database access request;
Encapsulation unit, for the type in the database access request be read request when, by delay threshold and the database Access request is encapsulated into database message;
Transmission unit, it is corresponding from database for the database message to be sent to primary database, so that described from data Library is responded the database and is visited based on delay threshold and the current delay times between database and the primary database Ask request.
13. a kind of from database characterized by comprising
Parsing module obtains delay threshold and database access request for parsing to the database message received;
Judgment module, for judging the current delay times between database and primary database whether in the delay threshold It is worth in range;
Processing module responds the number for the judging result according to the current delay times and the delay threshold range According to library access request.
14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor It is performed the steps of when execution
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated into number According in the message of library;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay threshold from database And the current delay times between database and the primary database, respond the database access request.
15. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor It is performed the steps of when execution
The database message received is parsed, delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold range, the database access request is responded.
16. a kind of electronic equipment, which is characterized in that include memory and one or more than one program, wherein one A perhaps more than one program is stored in memory and is configured to execute described one by one or more than one processor A or more than one program includes the instruction for performing the following operation:
Judge the type of database access request;
If the type of the database access request is read request, delay threshold and the database access request are encapsulated into number According in the message of library;
It is corresponding from database that the database message is sent to primary database, so that described be based on delay threshold from database And the current delay times between database and the primary database, respond the database access request.
17. a kind of electronic equipment, which is characterized in that include memory and one or more than one program, wherein one A perhaps more than one program is stored in memory and is configured to execute described one by one or more than one processor A or more than one program includes the instruction for performing the following operation:
The database message received is parsed, delay threshold and database access request are obtained;
Whether the judgement current delay times between database and primary database are within the scope of the delay threshold;
According to the judging result of the current delay times and the delay threshold range, the database access request is responded.
CN201710534280.8A 2017-07-03 2017-07-03 Data processing system, method, router and slave database Active CN109213827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710534280.8A CN109213827B (en) 2017-07-03 2017-07-03 Data processing system, method, router and slave database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710534280.8A CN109213827B (en) 2017-07-03 2017-07-03 Data processing system, method, router and slave database

Publications (2)

Publication Number Publication Date
CN109213827A true CN109213827A (en) 2019-01-15
CN109213827B CN109213827B (en) 2022-07-08

Family

ID=64992471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710534280.8A Active CN109213827B (en) 2017-07-03 2017-07-03 Data processing system, method, router and slave database

Country Status (1)

Country Link
CN (1) CN109213827B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727698A (en) * 2019-09-09 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Database access method and device, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110266870A1 (en) * 2009-10-29 2011-11-03 Huan Yu Hu Master/slave power strip with delay mechanism
CN102591964A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Implementation method and device for data reading-writing splitting system
CN104503965A (en) * 2014-10-16 2015-04-08 杭州斯凯网络科技有限公司 High-elasticity high availability and load balancing realization method of PostgreSQL (Structured Query Language)
CN106066890A (en) * 2016-06-16 2016-11-02 上海天玑科技股份有限公司 A kind of distributed high-performance data storehouse integrated machine system
CN106375462A (en) * 2016-09-13 2017-02-01 北京百度网讯科技有限公司 Method and device for realizing message persistence in distributed message system
CN106528803A (en) * 2016-11-14 2017-03-22 武汉斗鱼网络科技有限公司 Method and apparatus for monitoring MongoDB database object replication delay
CN106528388A (en) * 2016-10-21 2017-03-22 网易(杭州)网络有限公司 Database detection method and apparatus
US20170103092A1 (en) * 2015-10-07 2017-04-13 Oracle International Corporation Ddl processing in sharded databases
CN106874281A (en) * 2015-12-11 2017-06-20 北京新媒传信科技有限公司 Realize the method and apparatus that data base read-write is separate

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110266870A1 (en) * 2009-10-29 2011-11-03 Huan Yu Hu Master/slave power strip with delay mechanism
CN102591964A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Implementation method and device for data reading-writing splitting system
CN104503965A (en) * 2014-10-16 2015-04-08 杭州斯凯网络科技有限公司 High-elasticity high availability and load balancing realization method of PostgreSQL (Structured Query Language)
US20170103092A1 (en) * 2015-10-07 2017-04-13 Oracle International Corporation Ddl processing in sharded databases
CN106874281A (en) * 2015-12-11 2017-06-20 北京新媒传信科技有限公司 Realize the method and apparatus that data base read-write is separate
CN106066890A (en) * 2016-06-16 2016-11-02 上海天玑科技股份有限公司 A kind of distributed high-performance data storehouse integrated machine system
CN106375462A (en) * 2016-09-13 2017-02-01 北京百度网讯科技有限公司 Method and device for realizing message persistence in distributed message system
CN106528388A (en) * 2016-10-21 2017-03-22 网易(杭州)网络有限公司 Database detection method and apparatus
CN106528803A (en) * 2016-11-14 2017-03-22 武汉斗鱼网络科技有限公司 Method and apparatus for monitoring MongoDB database object replication delay

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
L. ZHAO 等: "Application-Managed Database Replication on Virtualized Cloud Environments", 《2012 IEEE 28TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING WORKSHOPS》 *
李方超: "基于NOSQL的数据最终一致性策略研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727698A (en) * 2019-09-09 2020-01-24 上海陆家嘴国际金融资产交易市场股份有限公司 Database access method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109213827B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
US10284705B2 (en) Method and apparatus for controlling smart device, and computer storage medium
US20220294706A1 (en) Methods, apparatus and machine-readable media relating to machine-learning in a communication network
WO2017028678A1 (en) Communication method, server and device
US20160012150A1 (en) System and method for main distribution network graph/model/data integration based on remote access and information interaction
CN103517405B (en) A kind of method and system of network positions, mobile terminal and network side equipment
TWI757317B (en) A method and system for pushing information, and a client and a server
US20150363340A1 (en) Providing multiple synchronous serial console sessions using data buffering
CN111628897B (en) Intelligent equipment initialization method, device and system
US11843516B2 (en) Federated learning in telecom communication system
US20220171011A1 (en) Positioning method and device, server, storage medium and terminal
EP3723343A1 (en) Resource processing method and system, storage medium and electronic device
CN109213827A (en) A kind of data processing system, method, router and from database
CN111901395B (en) Multi-cluster switching method and device
KR101275995B1 (en) Data storing system and data processing method of informational household appliance
KR101645251B1 (en) Protocol dynamic configuration system for reflecting network characteristics in service oriented architecture and Method thereof
CN109446428A (en) A kind of specification management system and method
WO2021259168A1 (en) Network mode control method and apparatus for mobile terminal, and computer device
JP2013162712A (en) House appliance control server device and program
CN102904742B (en) To method of operation and the system of executable node
CN106254575B (en) A kind of method and apparatus of determining user identifier
CN111190897B (en) Information processing method, information processing apparatus, storage medium, and server
CN213581775U (en) Intelligent home system
CN115168139A (en) Early warning method and system based on monitoring prediction
KR102112627B1 (en) Apparatus and Method for Displaying Indicator According to Interwork Network
CN109450686B (en) Network resource management system and method based on pervasive network

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: 20210909

Address after: Room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

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

Applicant before: ALIBABA GROUP HOLDING Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211117

Address after: 310000 No. 12, Zhuantang science and technology economic block, Xihu District, Hangzhou City, Zhejiang Province

Applicant after: Aliyun Computing Co.,Ltd.

Address before: 310000 room 508, 5th floor, building 4, No.699 Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Alibaba (China) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant