CN107016016A - A kind of method and device of data processing - Google Patents

A kind of method and device of data processing Download PDF

Info

Publication number
CN107016016A
CN107016016A CN201610882919.7A CN201610882919A CN107016016A CN 107016016 A CN107016016 A CN 107016016A CN 201610882919 A CN201610882919 A CN 201610882919A CN 107016016 A CN107016016 A CN 107016016A
Authority
CN
China
Prior art keywords
sql statement
database
service request
relevant database
data
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
CN201610882919.7A
Other languages
Chinese (zh)
Other versions
CN107016016B (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610882919.7A priority Critical patent/CN107016016B/en
Publication of CN107016016A publication Critical patent/CN107016016A/en
Application granted granted Critical
Publication of CN107016016B publication Critical patent/CN107016016B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/217Database tuning
    • 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/258Data format conversion from or to a database
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

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

Abstract

This application discloses a kind of data processing method and device, due to being provided with the first and second transformation rule in advance, so after service request is received, the first SQL statement operated to the first database and the second SQL statement operated to the second database successively can be generated by the service request, first transformation rule and second transformation rule, and operation of first and second SQL statement realization to second database can be performed respectively.It can be seen that, the method provided by the application, first and second database can be operated according to service request, so that the data in second database are actually to perform what is obtained according to the service request of the application, and then cause without again by the data backup in first database into second database, the process for subsequently needing to verify data in second database is avoided, the cost of database replacement is reduced.

Description

A kind of method and device of data processing
Technical field
The application is related to areas of information technology, more particularly to a kind of method and device of data processing.
Background technology
With the development of information technology, application program by network perform business demand constantly increase, perform business and The business datum of generation is also continuously increased.These business datums are generally stored using database.In storage service data, To ensure the uniformity of data storage, " dirty data " is prevented, each business datum of relational data library storage is generally used.
The structure of the relevant database used generally, due to different application is not quite identical, is answered using corresponding The relational data matched for an application configuration and its demand or performance is needed (to be referred to herein as legacy data with server Storehouse).But, over time, the legacy data storehouse may no longer adapt to the demand or performance of the application program, and this is just needed Other more superior databases (referred to herein as replacement data storehouse) of performance are wanted to replace the legacy data storehouse.
In the prior art, the way in replacement legacy data storehouse is typically:By the legacy data storehouse after predetermined point of time The business datum produced in a period of time, the replacement data storehouse is backed up to (i.e. first by the data processing method of " asynchronous pair is write " Former relevant database is write, then writes replacement data storehouse), so as to realize data in legacy data storehouse to replacement data storehouse Data " migration ".
But, because the process of this " asynchronous double write " is only carried out in database aspect, and with application program and should There is no special relation with server, the replacement data storehouse after Data Migration may be caused to support the normal fortune of application program OK.To prevent the appearance of this situation, before the application or application server are using the data in the replacement data storehouse, it is necessary to Accuracy to data in the replacement data storehouse is verified, but current various verification methods do not have versatility, it is necessary to enter The special design of row verification method, verification tool, verification environment etc., causes verification process quite complicated, time-consuming longer, so that greatly The big alternative costs for adding relational database.
The content of the invention
The embodiment of the present application provides a kind of data processing method, for solving in the prior art, to carry out changing database After data processing, in addition it is also necessary to which the accuracy to data in database verifies that the proving time is long, consuming resource is more, causes to replace Change the problem of this is high into.
The embodiment of the present application provides a kind of data processing equipment, for solving in the prior art, to carry out changing database After data processing, in addition it is also necessary to which the accuracy to data in database verifies that the proving time is long, consuming resource is more, causes to replace Change the problem of this is high into.
The embodiment of the present application uses following technical proposals:
A kind of data processing method, including:
Receive the service request to relevant database;
According to the service request and the first transformation rule being pre-configured with, the service request corresponding first is generated SQL statement, and according to the service request and the second transformation rule being pre-configured with, generate the second SQL statement;
Corresponding operation is performed to the first relevant database by first SQL statement, and passes through the 2nd SQL languages Sentence performs corresponding operation to the second relevant database.
A kind of data processing equipment, including:
Receiving module, receives the service request to relevant database;
Generation module, according to the service request and the first transformation rule being pre-configured with, generates the service request Corresponding first SQL statement, and according to the service request and the second transformation rule being pre-configured with, generate the 2nd SQL Sentence;
Performing module, performs corresponding operation, and pass through by first SQL statement to the first relevant database Second SQL statement performs corresponding operation to the second relevant database.
At least one above-mentioned technical scheme that the embodiment of the present application is used can reach following beneficial effect:
Due to being provided with the first transformation rule and the second transformation rule in advance, so after service request is received, can The first SQL statement that the service request and first transformation rule generation are operated to the first database is first passed through, afterwards The second SQL statement operated further according to second transformation rule and service request generation to the second database, and lead to Cross first and second SQL statement and perform corresponding operation respectively, wherein, first database is legacy data storehouse, and this Two databases are replacement data storehouse.It can be seen that, the method provided by the application, can according to service request to this first and second Database is operated so that the data in second database are actually to be generated according to the service request for performing the application , so cause without database aspect by the data backup in first database into second database, it is to avoid The process verified to data in second database is subsequently needed, the cost of database replacement is reduced.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, this Shen Schematic description and description please is used to explain the application, does not constitute the improper restriction to the application.In the accompanying drawings:
Fig. 1 is that the embodiment of the present application provides a kind of data handling procedure;
The structure of application server, first database and second database that Fig. 2 provides for the embodiment of the present application Relation schematic diagram;
Application server, first database and second database that Fig. 3 provides for the embodiment of the present application it is detailed Structural relation schematic diagram.
Fig. 4 for the embodiment of the present application provide performed respectively in first database and second database this first The schematic diagram of SQL statement and the second SQL statement process;
Fig. 5 is that the embodiment of the present application provides a kind of structural representation of data processing equipment.
Embodiment
To make the purpose, technical scheme and advantage of the application clearer, below in conjunction with the application specific embodiment and Technical scheme is clearly and completely described corresponding accompanying drawing.Obviously, described embodiment is only the application one Section Example, rather than whole embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing Go out the every other embodiment obtained under the premise of creative work, belong to the scope of the application protection.
The data handling procedure provided in the embodiment of the present application is, it is necessary to which the first database used application program is replaced When being changed to the second database, the business produced when first database is performed into service request within the latter time of pre- timing point Process of the data " migration " into second database.Wherein, first database is the legacy data that the application program is used Storehouse, second database is the replacement data storehouse for replacing the legacy data storehouse.
Generally, a period of time is right after the time point that the predetermined point of time can determine for staff, the predetermined point of time The duration answered can also be determined by staff, i.e. being somebody's turn to do the end time of " migration " process can also be determined by staff.Also, Because the data handling procedure of the duration and the application of the predetermined point of time and a period of time is not related, so the application To this and it is not specifically limited.That is, data handling procedure described herein be after the predetermined point of time until At the end of the duration of a period of time, the application performs data processing method during service request, is not related to the data processing When method starts and when terminates.
Below in conjunction with accompanying drawing, the technical scheme that each embodiment of the application is provided is described in detail.
The data handling procedure that Fig. 1 provides for the embodiment of the present application, specifically includes following steps:
S101:Receive the service request to relevant database.
In the prior art, a business can be received business correspondence during execution, generally by application server Service request, and the operation of subsequent step is determined according to the service request by the application server.
Similarly, in the embodiment of the present application, also service request can be received by application server, wherein, due to the application couple What is answered is the process how data in database are carried out with data processing, so the service request can also be for relationship type number According to the service request in storehouse.Again because the data handling procedure is to the data " migration " in first database to second data Process in storehouse, so the application server can be to should the first database and second database, also, first data Storehouse is the legacy data storehouse that the application server is used, and second database is that the application server is estimated in " migration " process After end, what is used replaces the replacement data storehouse of first database, and first database and second database can be Relevant database, can be as shown in Figure 2.
The structure of application server, first database and second database that Fig. 2 provides for the embodiment of the present application Relation schematic diagram.It can be seen that, the application server is corresponding with first database and second database.
Wherein, the application server can be a single equipment or the system being made up of multiple devices (that is, distributed application server), first database may each be a single equipment with second database, can also The system (that is, distributed data base) being made up of multiple devices, the application is not limited this.
Further, since what application program generally performed is language (e.g., java language) in face of object, so the application clothes The service request that receives of business device be generally also by this in face of object language generation, if but the service request be related to The increase of data in database corresponding to the application server, inquiry, change, delete (Create, Retrieve, Update, Delete, CRUD) operation, then because the language operated to relevant database is SQL (Structured Query Language, SQL), it is not consistent in face of the language of object with this, so in the embodiment of the present application In, the application server can also be closed when receiving the service request of this pair of relevant database by the object being pre-configured with System's mapping (Object Relation Mapping, ORM) framework, the service request is converted to can be to relevant database The SQL statement operated, subsequently to be operated to the relevant database, wherein, but the application server ORM frames Frame, is operated using data Layer middleware to the relevant database, and the ORM frameworks can be specifically ibatis.
Then Fig. 2 can continue to be refined as Fig. 3.Application server that Fig. 3 provides for the embodiment of the present application, first database And the detailed construction relation schematic diagram of second database.It can be seen that, the application server generates SQL statement by ORM frameworks, Using data Layer middleware-operation this first and second database.
Also, because the application server is to that should have first database and second database, also, first He Second wide area information server species and Database size are likely to difference, so can be advance in the application server The first transformation rule for the service request to be converted to the SQL statement that can be operated to first database is configured with, And the service request is converted to the second transformation rule of the SQL statement that can be operated to second database, wherein, by SQLMAP is also generally referred to as in the transformation rule, so first transformation rule is referred to as into first in subsequent descriptions SQLMAP, is referred to as the 2nd SQLMAP by second transformation rule.
For example, it is assumed that application server A is to that should have the first database B and the second database C, wherein, first data Storehouse B and second database C is relevant database, and the corresponding application programs of application server A use Java languages Speech, it is further assumed that first database B is mysql, second database C is oracle, then also pre- in application server A The first SQLMAP that Java language is converted to corresponding first SQL statement of mysql databases is first configured with, by Java language Be converted to the 2nd SQLMAP of corresponding second SQL statement of oracle database, the first SQLMAP and the 2nd SQLMAP Configure in the ORM frameworks of the application server, and application server A is received and the business of relevant database is asked Seek D.
S102:According to the service request and the first transformation rule being pre-configured with, the service request correspondence is generated The first SQL statement, and according to the service request and the second transformation rule being pre-configured with, generate the second SQL statement.
In the embodiment of the present application, after the application server receives the service request to relevant database, just may be used An idle thread is determined, and the service request is performed by the thread, wherein, the thread first can change the service request To perform the first SQL statement of respective operations to first database, it is reconverted into and respective operations is performed to second database The second SQL statement.
Specifically, the application server can first determine an idle thread, and the thread is set to pass through the application server The first SQLMAP being pre-configured with ORM frameworks, first SQL statement is generated according to the service request, and due to the ORM The 2nd SQLMAP is also provided with framework in advance, so the thread can also be generated as the 2nd SQL languages according to the service request Sentence, so that the application server can be performed respectively to first database by first SQL statement and second SQL statement And second data perform corresponding operation.
Further, since in the embodiment of the present application, second database is as replacement data storehouse, and the data volume of storage is relative It is less in the data volume of first database purchase, it can support that the probability that the application server is normally run is relatively low, if so Any service request to the relevant database respectively generates first SQL statement and second SQL statement, then may Second SQL statement is caused to perform the probability increase of failure.Also, in data handling procedure described herein, it is only necessary to make The change of data is equally present in the second server in first database caused by the service request, i.e. ensured After the default time point, the value of the data in second database occurs after change with data in first database The value of data is consistent, so in the embodiment of the present application, to the data handling procedure can only for the increasing to data, The operation delete, changed, without inquiry operation is carried out data handling procedure described herein (inquiry operation will not change this The value of data storage in one database).
Because staff can determine which kind of service request of the application program is needed in first database The operation that data are increased, deleted, changed, so in this application, can also be previously stored with the application server by working The service identification list that personnel determine, wherein, the business represents each service identification in list, is to need to first data The service identification of the service request for the operation that storehouse is increased, deleted, changed, then the application server can also pass through the service request pair The service identification answered, it is determined whether generate second SQL statement.
Specifically, the service request pair can be carried in the service request that the application server is received in step S101 The service identification answered, then, first, can be by the industry when the application server will call idle thread according to the service request Business mark is write in the thread variable of the thread.Secondly, the thread according to the first SQLMAP generate first SQL statement it Afterwards, the data Layer middleware can be used to perform first SQL statement to operate first database, then in the data Layer Between part the service identification can be determined by the thread variable of the thread.Afterwards, the data Layer middleware can be according to prestoring The service identification list, judge whether the service identification identical with any service identification in the service identification list, if phase Together, it is determined that need to generate second SQL statement, then the thread can also generate second SQL statement by the 2nd SQLMAP, Subsequent execution this first and second SQL statement, if it is different, then determine to generate second SQL statement, the thread can be after It is continuous to perform subsequent operation (corresponding operation e.g., is performed to first database according to first SQL statement).
Continue to use the example above, it is assumed that application server A determines that idle thread x performs the service request, then the application Server can write the service identification y of the service request in thread x thread variable, then thread x passes through the ORM frameworks In the first SQLMAP that is pre-configured with generate after the first SQL statement, perform first SQL statement using the data Layer middleware When, service identification y can be determined by thread x thread variable, it is further assumed that prestored in application server A Service identification y is included in service identification list, then the data Layer middleware, can be further true when performing first SQL statement Surely need to generate the second SQL statement, then thread x can also generate the second SQL statement by the 2nd SQLMAP, then thread x The data Layer middleware can be used to perform first SQL statement and second SQL statement.
S103:Corresponding operation is performed to the first relevant database by first SQL statement, and passes through second SQL statement performs corresponding operation to the second relevant database.
In the embodiment of the present application, when generate this first and after second SQL statement, the application server just can lead to The thread is crossed using the data Layer middleware, corresponding operation is performed to first database and second database.
Also, because first database and second database are two independent databases, thus can for this One SQL statement and second SQL statement set up corresponding affairs respectively, further, in order to ensure in second database Data can be consistent with the data after the change in first database, so in this application can only when this first First SQL statement and second SQL statement is just submitted to distinguish corresponding affairs when being performed both by successfully with the second SQL statement.
Specifically, the thread use the data Layer middleware, first, foundation performed in first database this first First affairs of SQL statement, secondly, set up the second affairs that second SQL statement is performed in second database, afterwards, The corresponding operation of first SQL statement is performed in first database according to first SQL statement, then, according to this second SQL statement performs the corresponding operation of second SQL statement in second database, also, when first SQL statement and is somebody's turn to do Second SQL statement, when respectively running succeeded, submits first affairs and second affairs, and if, first affairs are set up Failure or second affairs set up failure or first SQL statement performs failure or second SQL statement performs failure, Then the thread returns to error message (mistake of also referred to as dishing out), and performs rolling back action, makes first database and second number According to the data recovery in storehouse to perform step S103 before state, as shown in Figure 4.
Fig. 4 for the embodiment of the present application provide performed respectively in first database and second database this first The schematic diagram of SQL statement and the second SQL statement process.
It can be seen that, corresponding operation is performed to the first database by first SQL statement and passes through the second SQL statement pair During second database performs corresponding operation, as long as mistake or failure occurs in either step, the thread can be thrown Make mistake and perform rolling back action, to should service request when first affairs and second affairs are submitted successfully after Operation execution terminates.
It can ensure that first database is with being somebody's turn to do for the corresponding operation of the service request by step as shown in Figure 4 The change of data is identical in second database, is not in that one of database runs succeeded and another performs mistake Lose, cause the inconsistent situation of data to occur.
It should be noted that as it was previously stated, it can also be by Duo Tai that the application server, which can be a single equipment, The system of equipment composition, thus the embodiment of the present application as shown in Figure 1 the executive agent of each step of method is provided can be with It is same equipment, or, this method also can be used as executive agent by distinct device.Such as, step S101 and step S102 is held Row main body can be equipment 1, and step S103 executive agent can be equipment 2;Again such as, step S101 executive agent can be with For equipment 1, step S102 and step S103 executive agent can be equipment 2;Etc..
By data processing method as shown in Figure 1, can be received according to the application service to relevant database Service request, generation respectively to the operation of the execution of first database and second database this first and second SQL statement so that the service request can perform corresponding operation by second SQL statement in second database, make The data in second database are obtained, are no longer obtained merely by the data handling procedure of " asynchronous pair is write " of database aspect Arrive, but obtained by the service request of application, also, in this application, only when first SQL statement and this When two SQL statements are performed both by successfully, corresponding first affairs and second affairs can just be submitted respectively, make first data Storehouse and second database produce actual data variation, so the data handling procedure provided by the application, not only may be used Contacting for reality is produced with application with the operation to second database for being, and first and second database can be ensured The uniformity of middle data (specially the change of data is consistent after the preset time point) so that second database is at this section Between duration at the end of, can directly support the operation of the application, it is to avoid follow-up needs enter to data in second database The process of row checking, reduces the cost of database replacement.
In addition, in this application, due to before second SQL statement generation, having been generated in the application server First SQL statement, so the 2nd SQLMAP is alternatively, is carried out according to first SQL statement generation to second database Operation the second SQL statement rule, then the thread it is determined that need generate second SQL statement when, can according to this first SQL statement and the 2nd SQLMAP generate second SQL statement.
Further, due to that for the application program, can need not be concerned about whether the application server will be according to the industry Business request, carries out corresponding operation, so the content of the service request respectively to first database and second database Can be only for first database, and the application server can be realized according to the application request subsequent step S102 with And S103 operation.
In addition, being to be said using the application server as executive agent during the described above of the embodiment of the present application Bright, i.e. data Layer middleware is contained in the application program run in the application server, still, the data Layer middleware Also can exist as a single program or system, so in the embodiment of the present application, also can be by the data Layer middleware Perform the part and step S103 in above-mentioned steps S102.
Specifically, when the data Layer middleware is as a single program, face can be also run in the application server To the application program (being, to show difference, to be subsequently referred to as top layer application) of user, the top layer is applied to receive the operation of user, really Determine service request, and first SQL statement is generated according to the first SQLMAP being pre-configured with, and first SQL statement is sent Into the data Layer middleware so that the data Layer middleware perform subsequent operation.
In the embodiment of the present application, the application server is according to the service identification list and the service request prestored Service identification of middle carrying, it is determined that needing to generate second SQL statement for operating second relevant database, tool Body can be:
The top layer is applied after the service request is received, and first SQL statement can be generated according to the first SQLMAP, and The corresponding service identification write-in of the service request is performed in the thread of first SQL statement, and sent to the data Layer Part.Then the data Layer middleware can determine the service identification write in the thread variable, and pass through by running the thread The service identification list prestored, it is determined whether to generate the second SQL statement, if desired, then with according to being somebody's turn to do that this is pre-configured with 2nd SQLMAP, generates second SQL statement.Also, step S103 whole mistakes can be subsequently performed by the data Layer middleware Journey, process that specifically can be as shown in Figure 4 is consistent.
Further, applied and the data Layer middleware due to the top layer can be divided into the application server, and on State two programs can make it is separate, so this be pre-configured with first and the 2nd SQLMAP can be the top layer application And the data Layer middleware is addressable.
Further, due to the top layer is applied to the data Layer middleware can be independent mutually, then top layer application can be with The data Layer middleware is carried out by application programming interface (Application Programming Interface, API) Data interaction, then, can be by staff in advance in the table when the top layer with the data Layer middleware using connecting for the first time The statement file that configures in layer application, states that the top layer is applied to should first and second data to the data Layer middleware In storehouse, wherein the statement file comprising this first and second database distinguish corresponding database address, database configuration Deng database information.
Certainly, the top layer is applied can also be located in same application program with the data Layer middleware, and the application is to this And be not specially limited, when the data Layer middleware is an independent program, then the data Layer middleware may be alternatively located at independence One or more equipment in, and the data Layer middleware can also be connected with the application of multiple top layers, and to multiple databases Operated respectively.Also, because the application is related to " migration " process of data in database, thus only to exist this first with And second the situation of database be illustrated, but method described herein do not limit it is only corresponding with the application server In two databases, the application server can also correspond to multiple databases, as long as being provided with correspondence in the application server in advance SQLMAP.
Further, since the data Layer middleware can directly invoke first and the 2nd SQLMAP, institute being pre-configured with With in this application, also can by service request of the data Layer middleware to relevant database, and generate this first and Two SQL statements, finally perform first and second SQL statement, it is necessary to explanation, the industry that the data Layer middleware is received Business request can be different from foregoing service request, and (for show difference, subsequently referred to as request of data) can be specifically by the table Layer application is sent to the service request of the data Layer middleware after processing, specifically, top layer application can be according to connecing The service request received, according to service logic, it is determined that needing the operation performed to data, and the operation is sent out as request of data The data Layer middleware is delivered to, to cause the data Layer middleware to perform subsequent operation.
, can be with it should be noted that the language that the application program is used is in addition to Java language described in Fig. 1 C language, other language of C Plus Plus etc., the ORM frameworks in addition to the ibatis, can also be Entity EJB, The type of Hibernate, TopLink, OJB etc., first database and second database can be Oracle, DB2, Microsoft SQL Server etc., the ORM that language that the application is used for the application program, the application server are used The type of framework and first and second database is simultaneously not specifically limited.
Based on the data handling procedure shown in Fig. 1, the embodiment of the present application, which is also corresponded to, provides a kind of data processing equipment, such as schemes Shown in 5.
Fig. 5 is that the embodiment of the present application provides a kind of structural representation of data processing equipment, including:
Receiving module 201, receives the service request to relevant database;
Generation module 202, according to the service request and the first transformation rule being pre-configured with, generating the business please Corresponding first SQL statement is sought, and according to the service request and the second transformation rule being pre-configured with, generation second SQL statement;
Performing module 203, corresponding operation is performed to the first relevant database by first SQL statement, and Corresponding operation is performed to the second relevant database by the second SQL statement.
Service identification is carried in the service request;
The generation module 202, according to the institute carried in the service identification list and the service request prestored Service identification is stated, it is determined that needing to generate second SQL statement for operating second relevant database.
The receiving module 201, the service identification is write the thread variable for the thread for performing first SQL statement In;
The generation module 202, when performing first SQL statement by the thread, according to the thread variable The service identification is determined, according to the service identification list and the service identification prestored, it is determined that needing to generate to institute State second SQL statement that the second relevant database is operated.
The performing module 203, foundation performs the first of first SQL statement in first relevant database Affairs, set up the second affairs that second SQL statement is performed in second relevant database, according to described first SQL statement performs corresponding operation in first relevant database, is closed according to second SQL statement described second It is to perform corresponding operation in type database, when first SQL statement and second SQL statement are performed both by successfully, First affairs and second affairs are submitted, when first SQL statement and/or second SQL statement perform mistake When losing, error message is returned to, and perform rolling back action.
First relevant database is legacy data storehouse, and second relevant database is replacement data storehouse, institute Stating corresponding operation includes at least one of increase, deletion, change.
Specifically, above-mentioned data processing equipment as shown in Figure 4 can be located in application server, the application server can With the system for being an equipment or being made up of multiple devices.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net Network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus Or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, calculate according to herein Machine computer-readable recording medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability Comprising so that process, method, commodity or equipment including a series of key elements are not only including those key elements, but also wrap Include other key elements being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described Also there is other identical element in process, method, commodity or the equipment of element.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product. Therefore, the application can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.Deposited moreover, the application can use to can use in one or more computers for wherein including computer usable program code The shape for the computer program product that storage media is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
Embodiments herein is the foregoing is only, the application is not limited to.For those skilled in the art For, the application can have various modifications and variations.It is all any modifications made within spirit herein and principle, equivalent Replace, improve etc., it should be included within the scope of claims hereof.

Claims (11)

1. a kind of method of data processing, it is characterised in that including:
Receive the service request to relevant database;
According to the service request and the first transformation rule being pre-configured with, corresponding first SQL of the service request is generated Sentence, and according to the service request and the second transformation rule being pre-configured with, generate the second SQL statement;
Corresponding operation is performed to the first relevant database by first SQL statement, and passes through the second SQL statement pair Second relevant database performs corresponding operation.
2. the method as described in claim 1, it is characterised in that carry service identification in the service request;
According to the service request and the second transformation rule being pre-configured with, generate before the second SQL statement, methods described is also Including:
According to the service identification carried in the service identification list and the service request prestored, it is determined that needing life Second SQL statement that paired second relevant database is operated.
3. method as claimed in claim 2 is characterized in that, according to the service identification list and the business prestored The service identification carried in request, it is determined that needing to generate operate second relevant database described second SQL statement, is specifically included:
In the thread variable that the service identification is write to the thread for performing first SQL statement;
So that when running the thread, the service identification is determined according to the thread variable;
According to the service identification list and the service identification prestored, it is determined that needing to generate to the second relationship type number Second SQL statement operated according to storehouse.
4. the method as described in claim 1, it is characterised in that by first SQL statement to the execution pair of the first database The operation answered and corresponding operation is performed to second database by the second SQL statement, specifically included:
Set up the first affairs that first SQL statement is performed in first relevant database;
Set up the second affairs that second SQL statement is performed in second relevant database;
By first affairs, corresponding operation is performed to first relevant database according to first SQL statement;
By second affairs, corresponding operation is performed to second relevant database according to second SQL statement;
When first SQL statement and second SQL statement are performed both by successfully, first affairs are submitted and described Second affairs;
When first SQL statement and/or second SQL statement perform failure, error message is returned to, and perform rollback behaviour Make.
5. the method as described in any one of Claims 1-4, it is characterised in that first relevant database is original number According to storehouse, second relevant database is replacement data storehouse, and the corresponding operation is included in increase, deletion, change extremely Few one kind.
6. the method as described in claim 1, it is characterised in that methods described also includes:
Data Layer middleware, according to the service request and the second transformation rule being pre-configured with, generates the second SQL statement;
The data Layer middleware, corresponding operation is performed to the first relevant database by first SQL statement, and Corresponding operation is performed to the second relevant database by the second SQL statement.
7. a kind of device of data processing, it is characterised in that including:
Receiving module, receives the service request to relevant database;
Generation module, according to the service request and the first transformation rule being pre-configured with, generates the service request correspondence The first SQL statement, and according to the service request and the second transformation rule being pre-configured with, generate the second SQL statement;
Performing module, performs corresponding operation, and pass through second by first SQL statement to the first relevant database SQL statement performs corresponding operation to the second relevant database.
8. device as claimed in claim 7, it is characterised in that carry service identification in the service request;
The generation module, according to the business mark carried in the service identification list and the service request prestored Know, it is determined that needing to generate second SQL statement for operating second relevant database.
9. device as claimed in claim 8, it is characterised in that the receiving module, institute is performed by service identification write-in In the thread variable for the thread for stating the first SQL statement;
The generation module, when running the thread, determines the service identification, according to depositing in advance according to the thread variable The service identification list of storage and the service identification, it is determined that needing to generate operate second relevant database Second SQL statement.
10. device as claimed in claim 7, it is characterised in that the performing module, sets up in first relational data The first affairs of first SQL statement are performed in storehouse, foundation performs the 2nd SQL in second relevant database Second affairs of sentence, by first affairs, are performed according to first SQL statement to first relevant database Corresponding operation, by second affairs, correspondence is performed according to second SQL statement to second relevant database Operation, when first SQL statement and second SQL statement are performed both by successfully, submit first affairs and Second affairs, when first SQL statement and/or second SQL statement execution failure, return to error message, and Perform rolling back action.
11. the device as described in any one of claim 7 to 10, it is characterised in that first relevant database is original Database, second relevant database is replacement data storehouse, and the corresponding operation is included in increase, deletion, change It is at least one.
CN201610882919.7A 2016-10-10 2016-10-10 Data processing method and device Active CN107016016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610882919.7A CN107016016B (en) 2016-10-10 2016-10-10 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610882919.7A CN107016016B (en) 2016-10-10 2016-10-10 Data processing method and device

Publications (2)

Publication Number Publication Date
CN107016016A true CN107016016A (en) 2017-08-04
CN107016016B CN107016016B (en) 2021-04-06

Family

ID=59439498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610882919.7A Active CN107016016B (en) 2016-10-10 2016-10-10 Data processing method and device

Country Status (1)

Country Link
CN (1) CN107016016B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033381A (en) * 2018-07-27 2018-12-18 郑州云海信息技术有限公司 A kind of execution method, device and equipment of service request
CN109558303A (en) * 2017-09-25 2019-04-02 阿里巴巴集团控股有限公司 A kind of applied behavior analysis method, apparatus and electronic equipment
CN110580556A (en) * 2018-06-08 2019-12-17 阿里巴巴集团控股有限公司 Data processing method and system and processor
CN112732734A (en) * 2020-12-31 2021-04-30 上海瑞家信息技术有限公司 Information processing method and device
CN113076331A (en) * 2021-03-23 2021-07-06 中国联合网络通信集团有限公司 Middle station data processing method, device, equipment, storage medium and program product
CN113094379A (en) * 2021-03-23 2021-07-09 杭州电魂网络科技股份有限公司 Anchor type user data maintenance method, device, equipment and medium
CN113448942A (en) * 2020-03-27 2021-09-28 阿里巴巴集团控股有限公司 Database access method, device, equipment and storage medium
WO2024098858A1 (en) * 2022-11-08 2024-05-16 杭州趣链科技有限公司 Database access system and method, computer device, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030105732A1 (en) * 2000-11-17 2003-06-05 Kagalwala Raxit A. Database schema for structure query language (SQL) server
CN101000615A (en) * 2006-12-31 2007-07-18 华为技术有限公司 Service processing method and device based on data base
CN101369283A (en) * 2008-09-25 2009-02-18 中兴通讯股份有限公司 Data synchronization method and system for internal memory database physical data base
CN102629268A (en) * 2012-03-09 2012-08-08 华为技术有限公司 Data synchronization method, system and date access device
CN102708203A (en) * 2012-05-18 2012-10-03 成都科泰地理信息技术有限公司 Database dynamic management method based on XML metadata
CN102841927A (en) * 2012-07-18 2012-12-26 福建省新泽尔资讯科技有限公司 Method and device for data interaction among a plurality of databases and distributed data interaction system
US20140304217A1 (en) * 2013-04-08 2014-10-09 Oracle International Corporation Method and system for implementing an on-demand data warehouse
CN104462119A (en) * 2013-09-18 2015-03-25 腾讯科技(深圳)有限公司 Data migration method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030105732A1 (en) * 2000-11-17 2003-06-05 Kagalwala Raxit A. Database schema for structure query language (SQL) server
CN101000615A (en) * 2006-12-31 2007-07-18 华为技术有限公司 Service processing method and device based on data base
CN101369283A (en) * 2008-09-25 2009-02-18 中兴通讯股份有限公司 Data synchronization method and system for internal memory database physical data base
CN102629268A (en) * 2012-03-09 2012-08-08 华为技术有限公司 Data synchronization method, system and date access device
CN102708203A (en) * 2012-05-18 2012-10-03 成都科泰地理信息技术有限公司 Database dynamic management method based on XML metadata
CN102841927A (en) * 2012-07-18 2012-12-26 福建省新泽尔资讯科技有限公司 Method and device for data interaction among a plurality of databases and distributed data interaction system
US20140304217A1 (en) * 2013-04-08 2014-10-09 Oracle International Corporation Method and system for implementing an on-demand data warehouse
CN104462119A (en) * 2013-09-18 2015-03-25 腾讯科技(深圳)有限公司 Data migration method and device

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558303A (en) * 2017-09-25 2019-04-02 阿里巴巴集团控股有限公司 A kind of applied behavior analysis method, apparatus and electronic equipment
CN109558303B (en) * 2017-09-25 2023-02-28 阿里巴巴集团控股有限公司 Application behavior analysis method and device and electronic equipment
CN110580556A (en) * 2018-06-08 2019-12-17 阿里巴巴集团控股有限公司 Data processing method and system and processor
CN109033381A (en) * 2018-07-27 2018-12-18 郑州云海信息技术有限公司 A kind of execution method, device and equipment of service request
CN113448942A (en) * 2020-03-27 2021-09-28 阿里巴巴集团控股有限公司 Database access method, device, equipment and storage medium
CN113448942B (en) * 2020-03-27 2022-07-22 阿里巴巴集团控股有限公司 Database access method, device, equipment and storage medium
CN112732734A (en) * 2020-12-31 2021-04-30 上海瑞家信息技术有限公司 Information processing method and device
CN113076331A (en) * 2021-03-23 2021-07-06 中国联合网络通信集团有限公司 Middle station data processing method, device, equipment, storage medium and program product
CN113094379A (en) * 2021-03-23 2021-07-09 杭州电魂网络科技股份有限公司 Anchor type user data maintenance method, device, equipment and medium
CN113076331B (en) * 2021-03-23 2023-06-02 中国联合网络通信集团有限公司 Method, device, equipment, storage medium and program product for processing middle-stage data
CN113094379B (en) * 2021-03-23 2023-08-01 杭州电魂网络科技股份有限公司 Anchored user data maintenance method, device, equipment and medium
WO2024098858A1 (en) * 2022-11-08 2024-05-16 杭州趣链科技有限公司 Database access system and method, computer device, and storage medium

Also Published As

Publication number Publication date
CN107016016B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN107016016A (en) A kind of method and device of data processing
US10437795B2 (en) Upgrading systems with changing constraints
US11113272B2 (en) Method and apparatus for storing blockchain state data and electronic device
US9021440B1 (en) System and method for automated test script generation
US9576019B2 (en) Increasing distributed database capacity
CN105468473A (en) Data migration method and data migration apparatus
CN106557486A (en) A kind of storage method and device of data
CN109634587B (en) Method and equipment for generating warehousing script and warehousing data
CN112487083B (en) Data verification method and device
US9449063B2 (en) Synchronization of form fields in a client-server environment
US11386054B2 (en) Blockchain-based hierarchical data storage
CN107832446B (en) Configuration item information searching method and computing device
CA3015566A1 (en) Systems and methods for expediting rule-based data processing
CN105677346A (en) Dynamic expansion method of web interface and server
CN105335143A (en) Business processing method and apparatus
US20210263905A1 (en) Blockchain based hierarchical data storage
TW201802739A (en) Invoice title information change method, device and invoice management system
CN110532243A (en) Data processing method, device and electronic equipment
CN106897338A (en) A kind of data modification request processing method and processing device for database
CN112948473A (en) Data processing method, device and system of data warehouse and storage medium
CN106990974B (en) APP updating method and device and electronic equipment
CN107609011A (en) The maintaining method and device of a kind of data-base recording
US10409787B1 (en) Database migration
CN106855821A (en) A kind of distributed transaction processing method and device
CN113886505B (en) Management system for realizing dynamic modeling based on search engine and relational database

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1241084

Country of ref document: HK

TA01 Transfer of patent application right

Effective date of registration: 20200924

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

Applicant after: Innovative advanced technology Co.,Ltd.

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

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

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

Applicant after: Advanced innovation technology Co.,Ltd.

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

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant