CN102902812A - Method for realizing remote synchronization of database - Google Patents

Method for realizing remote synchronization of database Download PDF

Info

Publication number
CN102902812A
CN102902812A CN2012104019031A CN201210401903A CN102902812A CN 102902812 A CN102902812 A CN 102902812A CN 2012104019031 A CN2012104019031 A CN 2012104019031A CN 201210401903 A CN201210401903 A CN 201210401903A CN 102902812 A CN102902812 A CN 102902812A
Authority
CN
China
Prior art keywords
database
sequence information
product
digest
key
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
CN2012104019031A
Other languages
Chinese (zh)
Other versions
CN102902812B (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201210401903.1A priority Critical patent/CN102902812B/en
Publication of CN102902812A publication Critical patent/CN102902812A/en
Application granted granted Critical
Publication of CN102902812B publication Critical patent/CN102902812B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method for realizing remote synchronization of databases, which belongs to the field of information processing. The method comprises the following steps that an abstract is generated by a first database in accordance with received order information, and then the abstract is transmitted to a second database through a network, so that real-time synchronization between the abstract and order information of the second database is realizedand the content included in the order information is updated by the second database in accordance with a order number and a logistics number which are received by the second database, an abstract is generated in accordance with the updated order information, and then the abstract is transmitted to the first database through the network, so that the real-time synchronization between database and the updated order information of the first database is realized.By using the method disclosed by the invention, the risk caused by remote data synchronization can be effectively avoided, and additionally, data synchronization is not omitted.

Description

The implementation method that a kind of data-base remote is synchronous
Technical field
The present invention relates to field of information processing, relate in particular to the synchronous implementation method of a kind of data-base remote.
Background technology
In daily life, people need to create identical information at different terminal devices, and above-mentioned terminal device is generally computer, and the method that generally adopts now is to realize the remote synchronization of information on the different terminals by network.But, the risk that exists data to be maliciously tampered in the process of network remote synchrodata, the security of data is affected and brings heavy losses to the user possibly, for example, the phenomenon that data are maliciously tampered appears in the data-base remote synchrodata process of two-server, it is not corresponding then to cause easily workflow corresponding to two-server to occur, directly economic loss.In order to solve the synchronous safety issue of remote data, the inventor has proposed the security that a kind of implementation method ensures that remote data is synchronous.
Summary of the invention
For existing risk problem in the data synchronization process in the solution prior art, the present invention proposes the synchronous implementation method of a kind of data-base remote.
The technical solution used in the present invention is: the implementation method that a kind of data-base remote is synchronous comprises
Execution in step S1 is to step S4 when the first database receives sequence information;
Step S1: the first database is saved to the sequence information table with the sequence information that receives, and generates the first digest according to the user basic information that comprises in the sequence information in the first key and the described sequence information table, and sends the first request msg to the second database;
Step S2: described the second database obtains sequence information and the first digest from described the first request msg that receives, and generates the second digest according to the user basic information that comprises in the second key and the described sequence information that gets access to;
Step S3: whether described the second database is compared described the first digest consistent with described the second digest, is then to carry out next step, otherwise return the request response that comprises error code to described the first database;
Step S4: the described sequence information that described the second database will get access to is saved in the formal tabulation, and sends the request response that comprises synchronous success coding to described the first database;
Also comprise step S5 after the described step S4: described the second database is preserved product ID for the product ID field that comprises in the sequence information in the formal tabulation;
When the second database received thing stream number and order number, execution in step S6 was to step S11;
Step S6: described the second database is saved to thing stream number and the order number that receives in the interim tabulation, and finds corresponding with it sequence information according to described order number from formal tabulation;
Step S7: described the second database root generates the 3rd digest according to the described thing stream number in the user basic information that comprises in the second key, the described sequence information that finds and product ID, the interim tabulation, and sends the second request msg to described the first database;
Step S8: described the first database obtains sequence information, thing stream number and the 3rd digest from described the second request msg that receives, and generates the 4th digest according to the user basic information and the product ID that comprise in the first key, described thing stream number, the described sequence information;
Step S9: whether described the first database is compared described the 3rd digest consistent with described the 4th digest, is then to carry out next step, otherwise send the request response that comprises error code to described the second database;
Step S10: described the first database is that the thing stream number field of the sequence information in the described sequence information table is preserved described thing stream number, and sends the request response that comprises synchronous success coding to described the second database;
Step S11: described the second database is saved to the thing stream number field that the described sequence information in the formal tabulation comprises with described thing stream number, and the described sequence information deletion in will temporarily tabulating.
Include user basic information, order number, product type field, product ID field and thing stream number field in the above order information, described product ID field and thing stream number field are initially sky.
Above-mentioned the first key and described the second key are the session keys that the first database and the second database are consulted in advance.Or: prestore the arranging key file according to the time name in described the first database and described the second database, described step S1 also comprises, described the first database reads the current system time, read corresponding arranging key file according to the current system time, from described arranging key file, obtain the first key, described step S2 also comprises, described the second database reads the current system time, read corresponding arranging key file according to the current system time, from described arranging key file, obtain the second key.
Described the first database root of step S1 generates the first digest according to the user basic information that comprises in the sequence information in the first key and the sequence information table and is specially: described the first database is spliced into a serial data with the user basic information in the described sequence information and described the first key by the order of making an appointment, and adopts the algorithm of making an appointment that described serial data is encrypted and produces the first digest;
The described user basic information according to comprising in the second key and the described sequence information that gets access to of step S2 generates the second digest and is specially: the user basic information in the described sequence information and the second key are spliced into a serial data by the order of making an appointment, adopt the algorithm of making an appointment that described serial data is encrypted and produce the second digest.
Described step S2 also comprises, the process of the validity of the described sequence information that described the second database authentication obtains from described the first request msg, described step S8 also comprises, the process of the validity of the described sequence information that described the first database authentication obtains from described the second request msg; Whether the process of verifying the validity of described sequence information is specially the format and content of the described sequence information of checking effective.
Described step S5 is specially, described the second database root requires qualified Optimum Matching product in the retrieval product library according to the product type field that comprises in the described sequence information, and the product ID field value in the product record that retrieves is saved in the product ID field of described sequence information.
Described step S5 comprises, the first operation of described the second database initialize, create trigger and the trigger parameter is set, scheduling start time and dispatch interval time are set, reach scheduling during the start time when monitoring system time, the operation that the initiating task scheduler schedules creates, and will dispatch the start time and increase described dispatch interval time; The first operation of described establishment is: all sequence informations during traversal is formally tabulated automatically, product type field according to sequence information requires qualified Optimum Matching product record in the retrieval product library, and product ID field value in the product record is saved in the product ID field of described sequence information.
Described step S6 comprises described the second database searches whether there is the described order number that receives in formal tabulation, be that described thing stream number and the order number that then will receive is saved in the interim tabulation as a record, otherwise do not preserve.
Or described step S6 comprises, the second operation of described the second database initialize and the 3rd operation, create trigger and the trigger parameter is set, the second scheduling start time was set, the 3rd scheduling start time and dispatch interval time, reach the second scheduling during the start time when monitoring system time, the second operation that the initiating task scheduler schedules creates, and the second scheduling increased described dispatch interval time the start time, reach the 3rd scheduling during the start time when monitoring system time, the 3rd operation that the initiating task scheduler schedules creates, and the second scheduling start time increased described dispatch interval time; Described the second operation is, the formal tabulation of depositing sequence information is downloaded to designated memory space, and described the 3rd operation is to obtain the interim tabulation of preserving order number and thing stream number from described designated memory space.
Step S4 is described to comprise that after described the first database transmission comprises the request response of successfully encoding after described the first database received the described request response, the described sequence information of mark came into force.
Described step S11 can replace with: described the second database is saved to the thing stream number field that the described sequence information in the formal tabulation comprises with described thing stream number, and the described sequence information in will temporarily tabulating is labeled as and processes.The method of the invention also comprises, when system time reaches Preset Time, and the 4th operation of initiating task scheduler schedules, described the 4th operation is: be labeled as the sequence information processed in the retrieval temporary table and with its deletion.
When receiving the sequence information that will upgrade, described the second database comprises among the described step S4, the described sequence information that will upgrade is saved in the formal tabulation, and the product ID field in the described sequence information that will upgrade comprises old product sequence-number field and new product sequence-number field; Described step S5 is specially, preserve the new product sequence number for the product ID field of the described sequence information that will upgrade in the formal tabulation, the product ID that comprises in the sequence information that is updated is saved in the old product sequence-number field of the described sequence information that will upgrade.
Described the second database root of step S7 generates the 3rd digest according to the described thing stream number in the user basic information that comprises in the second key, the described sequence information that finds and product ID, the interim tabulation and is specially, described the second database is spliced into a serial data with described thing stream number and the second key in the user basic information in the described sequence information and product ID, the interim tabulation according to the order of making an appointment, and adopts the algorithm of making an appointment to produce the 3rd digest to described serial data;
Described user basic information and the product ID according to comprising in the first key, described thing stream number, the described sequence information of step S8 generates the 4th digest and is specially, described the first database is spliced into a serial data with the user basic information in the described sequence information and product ID, described thing stream number and described the first key by the order of making an appointment, and adopts the algorithm of making an appointment that described serial data is encrypted and produces the 4th digest.
The invention has the beneficial effects as follows: the risk that the method that adopts the present invention to propose can effectively avoid the teledata synchronizing process to bring, can ensure that simultaneously data do not omit synchronously: 1) guarantee that by real-time trigger interface data are immediately synchronous, come trigger interface by the timing scan data, ensure that data are synchronously without omitting; 2) can detect in the data transmission procedure and whether be tampered; 3) Data Source of the generation of the digest in the Internet Transmission is indefinite also is the characteristic of this method safety guarantee.
Description of drawings
Fig. 1 is the synchronous implementation method process flow diagram of a kind of data-base remote that embodiment 1 provides;
Fig. 2 is a wherein side the synchronous process flow diagram of data of a kind of database of providing of embodiment 2;
Fig. 3 is a kind of process flow diagram that upgrades sequence information that embodiment 3 provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
The sequence information of the synchronous implementation method of data-base remote in the remote synchronization database describes in detail as example in the embodiment of the invention.
Embodiment 1
The synchronous implementation method of a kind of data-base remote that present embodiment provides, can realize as shown in Figure 1, may further comprise the steps the real-time synchronization of the sequence information of the first database and the second database:
Step 1: the first database receives the sequence information of user's application;
Particularly, include user basic information, order number, product type field, product ID field and thing stream number field in the described sequence information, described product ID field and thing stream number field are initially sky, and the first database is saved to the sequence information table with the sequence information that receives.
The first database comprises before receiving the sequence information of user application in the present embodiment, the first database and the second database consult to produce a pair of session key, i.e. the first key and the second key, the first database is stored described the first key, and the second database is stored described the second key.
Step 2: the first database root produces the first digest according to the user basic information in the first key and the sequence information;
Be specially: the user basic information in the sequence information and the first key are spliced into a serial data by the order of making an appointment, adopt the algorithm of making an appointment that this serial data is encrypted and produce the first digest.
In the present embodiment, the user basic information in the described sequence information specifically comprises the information such as consignee's name, address, phone.
Preferably, the user basic information in the sequence information and the first key are spliced into a serial data sequentially, with the MD5 algorithm this serial data are calculated the first digest.In addition, can also adopt the SHA1 algorithm that this serial data is encrypted and produce the first digest, thereby reach the purpose that the synchrodata of transmission is protected.
Step 3: the first database is encapsulated as sequence information and the first digest the first request msg and is sent to the second database.
Particularly, mutually calling between the first database and the second database adopted the mode of URL request path, and be preferred in the present embodiment, sequence information and the first digest is encapsulated as URL the first request msg is sent to the second database.
Step 4: the second database receives the first request msg and therefrom obtains sequence information and the first digest, produces the second digest according to the user basic information in the second key and the sequence information;
Particularly, the second database receives URL the first request msg, therefrom read sequence information and the first digest, user basic information in the sequence information and the second key are spliced into a serial data by the order of making an appointment, adopt the algorithm of making an appointment that this serial data is encrypted and produce the second digest.Preferably, sequence information and the second key are spliced into a serial data sequentially, with the MD5 algorithm this serial data are calculated the second digest.In addition, can also adopt the SHA1 algorithm that this serial data is encrypted and produce the second digest, thereby reach the purpose that the synchrodata of transmission is protected.
Preferably, the first database can also be set and the second database interval certain hour is consulted a secondary key again, for example be 1 month interval time, specific implementation is: some arranging key files prestore in the first database and the second database, the filename of arranging key file represented with month, step 2 also comprises, the first database reads the current system time, read the arranging key file in corresponding month according to the current system time, obtain the first key from this document, corresponding step 4 comprises that also the second database reads the current system time, read the arranging key file in corresponding month according to the current system time, from this document, obtain the second key.
Further, step 4 can also be specially following steps in the present embodiment:
Step 4-1: the validity of sequence information in the second database authentication URL the first request msg, as effectively then continuing step 4-2, otherwise execution in step 4-3;
In the present embodiment particularly, whether the validity of sequence information is specially the format and content of verifying described sequence information in authentication URL the first request msg effective, for example, whether the user name that comprises in the checking sequence information meets default form, and whether the cell-phone number length that comprises in the checking sequence information is effective.
Step 4-2: the second database receives the sequence information in URL the first request msg, according to the order of making an appointment the user basic information in the sequence information and the second key are spliced into a serial data, and adopt the algorithm of making an appointment to produce the second digest with this serial data.
Step 4-3: the second database returns a request response Response to the first database.Response has encapsulated the error code of Validation of Data failure, redirect execution in step 1.
For example, error code 2000017 expressions lack the product type parameter.
Step 5: whether the second database is compared the second digest consistent with the first digest, is execution in step 7 then, otherwise execution in step 6;
Step 6: the second database returns a request response Response who comprises error code to the first database.Response has encapsulated the error code of the synchronous authentication faileds of data, then returns execution in step 1;
For example, error code 2000000 expression sign test digest failures.
Step 7: the sequence information in the second database preservation URL request msg is in formal tabulation;
Step 8: the second database sends to the first database and comprises the request response that synchronous success is encoded;
Particularly, the second database preservation sequence information is finished backward the first database and is returned a request response Response in the present embodiment, and Response has encapsulated synchronously successful coding of data.So far, it is synchronous that the first database and the second database are finished in the sequence information data of user basic information.
Step 9: after the first database received the successful Response message of the second database, the mark sequence information came into force.
Step 10: the second database is that the product ID field of the sequence information in the formal tabulation is preserved product ID;
Particularly, all sequence informations in the formal tabulation of the second database traversal, require qualified Optimum Matching product in the retrieval product library according to the product type field in the sequence information, if retrieve in the sequence-number field of then the product ID field value in the product record that retrieves being preserved sequence information so far; If not retrieving then, the second database outwards sends the prompting of preserving the product ID failure.
Preferably, can also use the quartz scheduler to realize task scheduling, the start time of configuration scheduling and the interval time of scheduling, such as interval 24 hours, specific implementation is: create the quartz operation, create trigger and the parameter of trigger is set, scheduling start time and dispatch interval time are set, for example, it is am8:00 that the scheduling start time is set, and it is 12 hours that dispatch interval time is set, and reaches scheduling during the start time when monitoring system time, start the quartz operation that the quartz scheduler schedules creates, and will dispatch the start time and increase described conduct interval time and dispatch the start time next time.The quartz operation that creates in the present embodiment is specially: all sequence informations during traversal is formally tabulated automatically, require qualified Optimum Matching product record in the retrieval product library according to the product type field of sequence information, product ID field value in the product record is preserved in the product ID field in the sequence information so far.
Supporting priority scheme also has the storage early warning use quartz task scheduling of not selling (coupling) for product library, namely create a plurality of quartz operations, described quartz operation also comprises: remaining tank farm stock in the second data base querying cash statement, when retrieving tank farm stock and be less than default numerical value, send mailbox and SMS is reminded to the product center personnel.
Step 11: the second database receives thing stream number and the order number of product delivery personnel input and is saved in the interim tabulation;
Particularly, the second database receives thing stream number and the order number of product delivery personnel input, by having or not this order number in the formal tabulation of order number retrieval sequence information, if having then thing stream number and the order number of product delivery personnel input is saved in the interim tabulation; If without this order number, then continue to receive next bar order number and the thing stream number of product delivery personnel input in the formal tabulation of sequence information.
Particularly, described product delivery personnel sign in to the i.e. order operating personnel of the second database of current system, so system acquisition thing stream number is to finish under the state of order operating personnel login in the present embodiment.The order number of every record depositing in the interim tabulation has also guaranteed in formal tabulation corresponding order number is arranged.
Further, can also set the second database and use the quartz task scheduling, realize that the second database regularly downloads to sequence information product delivery personnel's mailbox or other storage space every day, specific implementation is described with step 10, and different is that the quartz operation that creates in this step and call is that order downloaded information is to product delivery personnel's mailbox or other storage spaces.
Further, personnel are without login system in the product delivery, only the thing stream number of each order and order number are saved in mailbox or other storage space, the second database uses the quartz task scheduling, the start time of configuration scheduling and the interval time of scheduling, such as interval 24 hours, then the second database regularly reads belongings stream number and corresponding order number from product delivery personnel's mailbox or other storage space every day, the second database is by having or not this order number in the formal tabulation of order number retrieval sequence information, if have then thing stream number and the order number that reads be saved in the interim tabulation, if in the formal tabulation of sequence information, do not retrieve then not preserving of order number.The constructive process of quartz task scheduling is described with step 10, realize regularly calling the operation that creates by the quartz task dispatcher, for example, can realize second database 8 mailbox or storage spaces that automatically sequence information downloaded to product delivery personnel appointment every morning, every night, 8 automatic mailbox or storage spaces from described appointment obtained order number and homologue stream number.Adopt this mode, product delivery personnel do not need login system can get access to order list yet, after for sequence information binding thing stream number, do not need login system to import the thing stream number yet, system can automatic acquisition to the thing stream number, saved the step that manual entry operates.
Step 12: the second database root inquires corresponding with it sequence information according to the order number in the interim tabulation from formal tabulation.
Particularly, the second database root is according to the identical order number of retrieval in formal tabulation of the order number in the interim tabulation, and with the corresponding sequence information of this order number as the sequence information that finds.
This step can also be the interim list records of the second database timing acquisition, therefrom extract stream number and order number, and from formal tabulation, inquire sequence information according to order number.
Particularly, this step regularly realizes by the quartz task scheduling, detailed process is described with step 10, different is in this step, be 24 hours interval time that arranges, the quartz operation that creates and call is: obtain interim list records, and therefrom extract stream number and order number, and from formal tabulation, inquire sequence information according to order number.
This step comprises instant and two kinds of modes regularly, can ensure that immediately the very first time in time desynchronizes to the first database after obtaining the thing stream number, can ensure that regularly obtain can be exhaustively synchronously to the first database behind the thing stream number.
Step 13: the second database root produces the 3rd digest according to thing stream number and the second key in the user basic information in the sequence information and product ID, the interim tabulation;
Particularly, the user basic information in the sequence information, product ID, thing stream number and the second key are spliced into a serial data according to the order of making an appointment, and adopt the algorithm of making an appointment to produce the 3rd digest to this serial data.
Preferred in the present embodiment, user basic information in the sequence information, product ID, thing stream number and the second cipher key sequence are spliced into a serial data, adopt MD5 to calculate to this serial data and generate the 3rd digest, also can make an appointment with the first database and adopt other algorithms, such as the SHA1 scheduling algorithm.
Step 14: the second database is packaged into the second request msg with sequence information, thing stream number and the 3rd digest and is sent to the first database;
Particularly, the second database is encapsulated as URL the second request msg with sequence information, thing stream number and the 3rd digest and is sent to the first database.
Step 15: the first database receives the second request msg, therefrom obtains sequence information, thing stream number and the 3rd digest, produces the 4th digest according to the user basic information in the sequence information and product ID, the thing stream number that receives and the first key;
Particularly, the first database receives URL the second request msg, therefrom read sequence information, thing stream number and the 3rd digest, user basic information in the sequence information and product ID, thing stream number and the first key are spliced into a serial data by the order of making an appointment, adopt the algorithm of making an appointment that this serial data is encrypted and produce the 4th digest.Preferably, the user basic information in the sequence information and product ID, thing stream number and the first key are spliced into a serial data sequentially, with the MD5 algorithm this serial data are calculated the 4th digest.
Particularly, also comprise the validity of the sequence information that checking is obtained in the step 15 from URL the second request msg in the present embodiment, concrete proof procedure is identical with step 4, does not repeat them here.
Step 16: whether the first database is compared the 4th digest consistent with the 3rd digest, is execution in step 18 then, otherwise execution in step 17;
Step 17: the first database sends the request response that comprises error code to the second database; Redirect execution in step 12;
Particularly: the first database returns a request response Response to the second database, and Response has encapsulated the error code of failure of data synchronization; Then return execution in step 12;
Preferably, the number of times of counter records synchronization failure can also be set, when certain order continuous 3 subsynchronous data failures, to specifying the maintainer to send mail or SMS prompting.
Concrete counter is that synchronization failure once preserves 1 so far in the identification field of order afterwards, again upgrades in the identification field of order so far 2 behind the synchronization failure, is updated to successively 3 rear transmission mails or SMS and reminds.
Step 18: the first database is saved in the thing stream number field of sequence information with the thing stream number, and sequence information is updated to the sequence information table;
Step 19: the first database sends to the second database and comprises the request response that synchronous success is encoded;
Particularly, the first database sends a request response Response to the second database, and Response has encapsulated synchronously successful coding of data; So far, the first database and the second database are finished the synchronous of thing stream number.The user can activate the use product.
Step 20: the second database is saved in the thing stream number thing stream number field of sequence information in the formal tabulation;
Preferably, can also set the second database and use the quartz task scheduling, the start time of configuration scheduling and the interval time of scheduling, such as interval 24 hours, realize that the second database retrieves the formal tabulation of sequence information whether the sequence information of not binding yet the thing stream number above predetermined number of days is arranged every day, when monitoring the sequence information that satisfies condition and exist, to product delivery personnel's mailbox or the mobile phone reminding delivery of appointment.
Step 21: this sequence information during the second database will be tabulated temporarily is labeled as to be processed;
Step 22: the second database is regularly removed and is labeled as the sequence information of having processed in the interim tabulation.
Particularly, this step realizes that by the quartz task scheduling detailed process is described with step 10, different is in this step, be 24 hours interval time that arranges, and the quartz operation that creates and call is: be designated the sequence information record of having processed in the retrieval order temporary table, with its deletion.
Embodiment 2
As shown in Figure 2, on the basis of embodiment 1 with data synchronization process in the example that is operating as carried out of the second database be described in detail, specific as follows:
Step 201: receive the first request msg and therefrom obtain sequence information and the first digest;
For example, the first request msg that receives is the URL request msg, is specially: http://IP:port/application/notify address=101103﹠amp; Amount=1024﹠amp; Area=lufu﹠amp; Buyer_alias=eb25cf0249971db8cf57c683efe1e5c2﹠amp; City=sheng﹠amp; Country=china﹠amp; Input_charset=GBK﹠amp; Invoice_title=galenzhang﹠amp; Invoice_type=nornal﹠amp; Need_invoice=1﹠amp; Out_trade_no=20000005012011102498749808﹠amp; Partner=2000000501﹠amp; Phone=0755-12345667﹠amp; Product_model=10001﹠amp; Prov=guang﹠amp; Recv_name=zhang﹠amp; Sign=E10ADC3949BA59ABBE56E057F20F883E﹠amp; Transaction_id=1212419701201112210078541998﹠amp; Zip_code=Ty@%23%2Bs%2B
The first digest that wherein comprises is: E10ADC3949BA59ABBE56E057F20F883E, the user basic information in the sequence information that comprises has addressee the country one belongs to, address of the addressee, addressee's phone etc.
Step 202: judge whether sequence information is effective, is then to carry out next step, otherwise return execution in step 201;
In the present embodiment, judge whether whether sequence information effectively is specially form and/or the content of verifying described sequence information effective, for example, whether the user name that comprises in the checking sequence information meets default form, and whether the cell-phone number length that comprises in the checking sequence information is effective.
Step 203: produce the second digest according to the user basic information in the second key that prestores and the sequence information;
Be specially: the user basic information in the sequence information and the second cipher key sequence are spliced into a serial data, and with the MD5 algorithm this serial data are encrypted generation the second digest; Described the second key is the session key of consulting with sync database in advance.
Particularly, the second digest of generation is: E10ADC3949BA59ABBE56E057F20F883E in the present embodiment.
Whether step 204: it is consistent with the first digest to compare the second digest, is then to carry out next step, otherwise returns execution in step 201;
Step 205: preserve sequence information and preserve successful prompting to formal tabulation and to the sync database transmission;
The data packet format of the prompting that for example, preservation is successful is:
Figure BDA0000228454551
Step 206: be the sequence information matching product according to the rule of making an appointment;
Particularly, be the sequence information matching product according to allocation identification and the label size of product in the present embodiment, described rule of making an appointment is that sequence information is distributed for preferentially choosing the product that allocation identification is unallocated and label is less.
Preferably, can also whether enough products be arranged for coupling by periodic monitor, implementation is: create the quartz operation, create trigger and the parameter of trigger is set, scheduling start time and dispatch interval time are set, for example, it is am7:00 that the scheduling start time is set, it is 24 hours that dispatch interval time is set, reach scheduling during the start time when monitoring system time, start the quartz operation that the quartz scheduler schedules creates, and will dispatch the start time and increase described conduct interval time and dispatch the start time next time.The quartz operation that creates in the present embodiment is specially: when monitoring can be less than default number for the product number of coupling the time, send to remind mail or send SMS to employee's mailbox of appointment and remind.Can guarantee like this continuation of data.
Step 207: for the product ID field in the sequence information in the formal tabulation is preserved product ID;
Particularly, all sequence informations in the formal tabulation of the second data Kuku traversal, require qualified Optimum Matching product in the retrieval product library according to the product type field that comprises in the sequence information, if retrieve in the sequence-number field of then product ID corresponding to product that retrieves being preserved sequence information so far, then outwards send the prompting of preserving the product ID failure if retrieve.
Step 208: receive thing stream number and the order number for the sequence information binding of product delivery personnel input, and it is kept in the interim tabulation;
Step 209: obtain interim tabulation, and therefrom extract stream number and order number, from formal tabulation, inquire corresponding sequence information according to order number;
Step 210: according to the user basic information in the sequence information and product ID, produce the 3rd digest with thing stream number, the second key;
Particularly, the user basic information in the sequence information and product ID, thing stream number and the second cipher key sequence are spliced into a serial data in the present embodiment, adopt the MD5 algorithm of making an appointment that this serial data is encrypted and generate the 3rd digest.
Step 211: sequence information, thing stream number and the 3rd digest are encapsulated as the second request msg and send to sync database;
For example, the second request msg that sends to sync database is: http://IP:port/application/notify address=101103﹠amp; Amount=1024﹠amp; Area=lufu﹠amp; Buyer_alias=eb25cf0249971db8cf57c683efe1e5c2﹠amp; City=sheng﹠amp; Country=china﹠amp; Input_charset=GBK﹠amp; Invoice_title=galenzhang﹠amp; Invoice_type=nornal﹠amp; Need_invoice=1﹠amp; Out_trade_no=20000005012011102498749808﹠amp; Partner=2000000501﹠amp; Phone=0755-12345667﹠amp; Product_model=10001﹠amp; Prov=guang﹠amp; Recv_name=zhang﹠amp; Old_product_isn=1090123123﹠amp; Product_isn=1090123187﹠amp; Product_sn=FT010983﹠amp; Express_co=6168785922﹠amp; Sign=BC9ADBN7809W39A456ERE057F20MN89E﹠amp; Transaction_id=1212419701201112210078541998﹠amp; Zip_code=Ty@%23%2Bs%2B
The 3rd digest that wherein comprises is: BC9ADBN7809W39A456ERE057F20MN89E.
The thing stream number that comprises is: 6168785922.
Step 212: wait for the response that the receiving isochronous data storehouse is returned;
Step 213: judge that whether the response that receives comprises synchronously successfully coding, is then to carry out next step, otherwise returns execution in step 209;
The response that comprises synchronous success coding that receives is:
Figure BDA0000228454552
Step 214: the thing stream number is kept at the thing stream number field in the sequence information in the formal tabulation;
Step 215: sequence information is labeled as in interim tabulation processes;
Step 216: regularly remove in the interim tabulation and be labeled as the sequence information of having processed.
Embodiment 3
On the basis of embodiment 1 or 2, further, the product ID field in the sequence information specifically comprises old product sequence-number field and new product sequence-number field.When having order to upgrade, guaranteeing in the synchronous situation of data that as shown in Figure 3, the more new order operation that the second database is carried out is specific as follows:
Step 301: receive that the sequence information that will upgrade is saved in the formal tabulation;
Particularly, the sequence information of described renewal is when the order that needs renewal is arranged, to be imported in the formal tabulation by the user in the present embodiment.
Step 302: for the product ID field of the sequence information that will upgrade in the formal tabulation is preserved the new product sequence number;
Particularly, require qualified Optimum Matching product in the retrieval product library according to upgrading the product type field that comprises in the sequence information in formal tabulation, the sequence number that product is corresponding is preserved in the new product sequence-number field of sequence information so far.
Step 303: the product ID that comprises in former order information in formal tabulation is saved in the old product sequence-number field of the sequence information that will upgrade;
Step 304: receive the user for thing stream number and the order number of the sequence information input that will upgrade and be kept in the interim tabulation.
In the present embodiment, particularly, when having order to upgrade, that the second database is received first the sequence information that will upgrade, and send to the first database realize in the sequence information user basic information synchronously, product ID in the sequence information afterwards and thing stream number synchronously identical with embodiment 1 or 2 do not repeat them here.
The above; be the specific embodiment of the present invention only, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (15)

1. the implementation method that data-base remote is synchronous is characterized in that: comprise
Execution in step S1 is to step S4 when the first database receives sequence information;
Step S1: the first database is saved to the sequence information table with the sequence information that receives, and generates the first digest according to the user basic information that comprises in the sequence information in the first key and the described sequence information table, and sends the first request msg to the second database;
Step S2: described the second database obtains sequence information and the first digest from described the first request msg that receives, and generates the second digest according to the user basic information that comprises in the second key and the described sequence information that gets access to;
Step S3: whether described the second database is compared described the first digest consistent with described the second digest, is then to carry out next step, otherwise return the request response that comprises error code to described the first database;
Step S4: the described sequence information that described the second database will get access to is saved in the formal tabulation, and sends the request response that comprises synchronous success coding to described the first database;
Also comprise step S5 after the described step S4: described the second database is preserved product ID for the product ID field that comprises in the sequence information in the formal tabulation;
When the second database received thing stream number and order number, execution in step S6 was to step S11;
Step S6: described the second database is saved to thing stream number and the order number that receives in the interim tabulation, and finds corresponding with it sequence information according to described order number from formal tabulation;
Step S7: described the second database root generates the 3rd digest according to the described thing stream number in the user basic information that comprises in the second key, the described sequence information that finds and product ID, the interim tabulation, and sends the second request msg to described the first database;
Step S8: described the first database obtains sequence information, thing stream number and the 3rd digest from described the second request msg that receives, and generates the 4th digest according to the user basic information and the product ID that comprise in the first key, described thing stream number, the described sequence information;
Step S9: whether described the first database is compared described the 3rd digest consistent with described the 4th digest, is then to carry out next step, otherwise send the request response that comprises error code to described the second database;
Step S10: described the first database is that the thing stream number field of the sequence information in the described sequence information table is preserved described thing stream number, and sends the request response that comprises synchronous success coding to described the second database;
Step S11: described the second database is saved to the thing stream number field that the described sequence information in the formal tabulation comprises with described thing stream number, and the described sequence information deletion in will temporarily tabulating.
2. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: include user basic information, order number, product type field, product ID field and thing stream number field in the described sequence information, described product ID field and thing stream number field are initially sky.
3. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described the first key and described the second key are the session keys that the first database and the second database are consulted in advance.
4. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: prestore the arranging key file according to the time name in described the first database and described the second database, described step S1 also comprises, described the first database reads the current system time, read corresponding arranging key file according to the current system time, from described arranging key file, obtain the first key, described step S2 also comprises, described the second database reads the current system time, read corresponding arranging key file according to the current system time, from described arranging key file, obtain the second key.
5. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described the first database root of step S1 generates the first digest according to the user basic information that comprises in the sequence information in the first key and the sequence information table and is specially: described the first database is spliced into a serial data with the user basic information in the described sequence information and described the first key by the order of making an appointment, and adopts the algorithm of making an appointment that described serial data is encrypted and produces the first digest;
The described user basic information according to comprising in the second key and the described sequence information that gets access to of step S2 generates the second digest and is specially: the user basic information in the described sequence information and the second key are spliced into a serial data by the order of making an appointment, adopt the algorithm of making an appointment that described serial data is encrypted and produce the second digest.
6. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S2 also comprises, the process of the validity of the described sequence information that described the second database authentication obtains from described the first request msg, described step S8 also comprises, the process of the validity of the described sequence information that described the first database authentication obtains from described the second request msg; Whether the process of verifying the validity of described sequence information is specially the format and content of the described sequence information of checking effective.
7. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S5 is specially, described the second database root requires qualified Optimum Matching product in the retrieval product library according to the product type field that comprises in the described sequence information, and the product ID field value in the product record that retrieves is saved in the product ID field of described sequence information.
8. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S5 comprises, the first operation of described the second database initialize, create trigger and the trigger parameter is set, scheduling start time and dispatch interval time are set, reach scheduling during the start time when monitoring system time, the operation that the initiating task scheduler schedules creates, and will dispatch the start time and increase described dispatch interval time; The first operation of described establishment is: all sequence informations during traversal is formally tabulated automatically, product type field according to sequence information requires qualified Optimum Matching product record in the retrieval product library, and product ID field value in the product record is saved in the product ID field of described sequence information.
9. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S6 comprises, described the second database searches whether there is the described order number that receives in formal tabulation, be that described thing stream number and the order number that then will receive is saved in the interim tabulation as a record, otherwise do not preserve.
10. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S6 comprises, the second operation of described the second database initialize and the 3rd operation, create trigger and the trigger parameter is set, the second scheduling start time was set, the 3rd scheduling start time and dispatch interval time, reach the second scheduling during the start time when monitoring system time, the second operation that the initiating task scheduler schedules creates, and the second scheduling increased described dispatch interval time the start time, reach the 3rd scheduling during the start time when monitoring system time, the 3rd operation that the initiating task scheduler schedules creates, and the second scheduling start time increased described dispatch interval time; Described the second operation is, the formal tabulation of depositing sequence information is downloaded to designated memory space, and described the 3rd operation is to obtain the interim tabulation of preserving order number and thing stream number from described designated memory space.
11. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: step S4 is described to be comprised after described the first database transmission comprises the request response of successfully encoding, after described the first database received the described request response, the described sequence information of mark came into force.
12. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described step S11 replaces with: described the second database is saved to the thing stream number field that the described sequence information in the formal tabulation comprises with described thing stream number, and the described sequence information in will temporarily tabulating is labeled as and processes.
13. the synchronous implementation method of a kind of data-base remote according to claim 12, it is characterized in that: described method also comprises, when system time reaches Preset Time, the 4th operation of initiating task scheduler schedules, described the 4th operation is: retrieval is labeled as the sequence information processed in the temporary table and with its deletion.
14. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: when described the second database receives the sequence information that will upgrade, comprise among the described step S4, the described sequence information that will upgrade is saved in the formal tabulation, and the product ID field in the described sequence information that will upgrade comprises old product sequence-number field and new product sequence-number field; Described step S5 is specially, preserve the new product sequence number for the product ID field of the described sequence information that will upgrade in the formal tabulation, the product ID that comprises in the sequence information that is updated is saved in the old product sequence-number field of the described sequence information that will upgrade.
15. the synchronous implementation method of a kind of data-base remote according to claim 1, it is characterized in that: described the second database root of step S7 is according to the second key, the user basic information and the product ID that comprise in the described sequence information that finds, described thing stream number in the interim tabulation generates the 3rd digest and is specially, described the second database is with the user basic information in the described sequence information and product ID, described thing stream number and the second key in the interim tabulation are spliced into a serial data according to the order of making an appointment, and adopt the algorithm of making an appointment to produce the 3rd digest to described serial data;
Described user basic information and the product ID according to comprising in the first key, described thing stream number, the described sequence information of step S8 generates the 4th digest and is specially, described the first database is spliced into a serial data with the user basic information in the described sequence information and product ID, described thing stream number and described the first key by the order of making an appointment, and adopts the algorithm of making an appointment that described serial data is encrypted and produces the 4th digest.
CN201210401903.1A 2012-10-22 2012-10-22 Method for realizing remote synchronization of database Active CN102902812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210401903.1A CN102902812B (en) 2012-10-22 2012-10-22 Method for realizing remote synchronization of database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210401903.1A CN102902812B (en) 2012-10-22 2012-10-22 Method for realizing remote synchronization of database

Publications (2)

Publication Number Publication Date
CN102902812A true CN102902812A (en) 2013-01-30
CN102902812B CN102902812B (en) 2015-05-27

Family

ID=47575044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210401903.1A Active CN102902812B (en) 2012-10-22 2012-10-22 Method for realizing remote synchronization of database

Country Status (1)

Country Link
CN (1) CN102902812B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166739A (en) * 2014-09-05 2014-11-26 北京国双科技有限公司 Index file processing method and device for analysis database
CN104252407A (en) * 2013-11-05 2014-12-31 深圳市华傲数据技术有限公司 Method and device for recording tasks under quartz frame
CN104484481A (en) * 2014-12-26 2015-04-01 携程计算机技术(上海)有限公司 Data matching method, device and system of ticket order
CN104965880A (en) * 2015-06-12 2015-10-07 小米科技有限责任公司 Database splitting method and device
CN106846030A (en) * 2016-07-27 2017-06-13 宁波圆形网络科技有限公司 A kind of commodity prize drawing runtime and method
CN106997557A (en) * 2017-03-23 2017-08-01 深圳市创梦天地科技有限公司 Sequence information acquisition method and device
CN107038617A (en) * 2017-01-19 2017-08-11 阿里巴巴集团控股有限公司 Pay invoice pre-creates method and device
CN107103426A (en) * 2017-04-26 2017-08-29 郑州云海信息技术有限公司 Batch deletes the method and device of sequence number and multiple order number binding relationships
CN107197018A (en) * 2017-05-23 2017-09-22 北京奇艺世纪科技有限公司 A kind of method and apparatus of inter-system data synchronization
CN107491658A (en) * 2017-09-13 2017-12-19 上海联影医疗科技有限公司 Transmission method, radiotherapy system and the electric terminal of medical information
CN107563942A (en) * 2016-06-30 2018-01-09 阿里巴巴集团控股有限公司 A kind of logistics data batch processing method, logistics processing system and processing unit
CN108665352A (en) * 2018-05-10 2018-10-16 延锋彼欧(沈阳)汽车外饰系统有限公司 Customer order information emergency processing method and device
CN109684369A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 Information updating method and device
CN109829016A (en) * 2019-01-25 2019-05-31 网宿科技股份有限公司 A kind of method of data synchronization and device
CN111858775A (en) * 2020-08-06 2020-10-30 四川长虹电器股份有限公司 Data synchronization method for remote database of Internet of things platform
CN113590716A (en) * 2021-08-09 2021-11-02 深圳市携客互联科技有限公司 ERP system-based integrated interface service data automatic synchronization method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741447A (en) * 2004-08-23 2006-03-01 威达电股份有限公司 Network safety management method and system
CN101110831A (en) * 2007-08-24 2008-01-23 中兴通讯股份有限公司 Digital cryptographic key protection method
CN101640682A (en) * 2009-06-04 2010-02-03 深圳市汇海科技开发有限公司 Method for improving safety of Web service

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741447A (en) * 2004-08-23 2006-03-01 威达电股份有限公司 Network safety management method and system
CN101110831A (en) * 2007-08-24 2008-01-23 中兴通讯股份有限公司 Digital cryptographic key protection method
CN101640682A (en) * 2009-06-04 2010-02-03 深圳市汇海科技开发有限公司 Method for improving safety of Web service

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252407A (en) * 2013-11-05 2014-12-31 深圳市华傲数据技术有限公司 Method and device for recording tasks under quartz frame
CN104166739B (en) * 2014-09-05 2017-12-19 北京国双科技有限公司 The index document handling method and device of analytical database
CN104166739A (en) * 2014-09-05 2014-11-26 北京国双科技有限公司 Index file processing method and device for analysis database
CN104484481A (en) * 2014-12-26 2015-04-01 携程计算机技术(上海)有限公司 Data matching method, device and system of ticket order
CN104484481B (en) * 2014-12-26 2018-01-02 上海携程商务有限公司 Data matching method, the apparatus and system of ticketing service order
CN104965880A (en) * 2015-06-12 2015-10-07 小米科技有限责任公司 Database splitting method and device
CN107563942A (en) * 2016-06-30 2018-01-09 阿里巴巴集团控股有限公司 A kind of logistics data batch processing method, logistics processing system and processing unit
CN107563942B (en) * 2016-06-30 2021-06-18 菜鸟智能物流控股有限公司 Logistics data batch processing method, logistics processing system and processing device
CN106846030A (en) * 2016-07-27 2017-06-13 宁波圆形网络科技有限公司 A kind of commodity prize drawing runtime and method
CN107038617A (en) * 2017-01-19 2017-08-11 阿里巴巴集团控股有限公司 Pay invoice pre-creates method and device
CN106997557A (en) * 2017-03-23 2017-08-01 深圳市创梦天地科技有限公司 Sequence information acquisition method and device
CN106997557B (en) * 2017-03-23 2021-06-29 深圳市创梦天地科技有限公司 Order information acquisition method and device
CN107103426A (en) * 2017-04-26 2017-08-29 郑州云海信息技术有限公司 Batch deletes the method and device of sequence number and multiple order number binding relationships
CN107197018A (en) * 2017-05-23 2017-09-22 北京奇艺世纪科技有限公司 A kind of method and apparatus of inter-system data synchronization
CN107197018B (en) * 2017-05-23 2020-01-21 北京奇艺世纪科技有限公司 Method and device for data synchronization between systems
CN107491658A (en) * 2017-09-13 2017-12-19 上海联影医疗科技有限公司 Transmission method, radiotherapy system and the electric terminal of medical information
CN109684369A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 Information updating method and device
CN108665352A (en) * 2018-05-10 2018-10-16 延锋彼欧(沈阳)汽车外饰系统有限公司 Customer order information emergency processing method and device
CN108665352B (en) * 2018-05-10 2022-04-05 延锋彼欧(沈阳)汽车外饰系统有限公司 Customer order information emergency processing method and device
CN109829016A (en) * 2019-01-25 2019-05-31 网宿科技股份有限公司 A kind of method of data synchronization and device
CN111858775A (en) * 2020-08-06 2020-10-30 四川长虹电器股份有限公司 Data synchronization method for remote database of Internet of things platform
CN113590716A (en) * 2021-08-09 2021-11-02 深圳市携客互联科技有限公司 ERP system-based integrated interface service data automatic synchronization method

Also Published As

Publication number Publication date
CN102902812B (en) 2015-05-27

Similar Documents

Publication Publication Date Title
CN102902812B (en) Method for realizing remote synchronization of database
US11569982B2 (en) Blockchain compression using summary and padding blocks
CN101984692B (en) A kind of method and device for preventing Malware from sending data
CN100450108C (en) System, device and method for synchronously processing e-mail using data
CN101472140B (en) System for distributing and requiring multimedia program and implementing method thereof
CN102664871A (en) Method for processing intelligent terminal address list
EP2863613A1 (en) Method using mobile terminal to implement cloud searching
US9442925B2 (en) Regulated texting solution for mobile devices
CN108989040B (en) Information processing method and device based on block chain
CN111045806A (en) Method and system for realizing delay message queue
CN101674318A (en) Method for pushing data to mobile equipment at regular time
CN104637185A (en) Offline box opening method of intelligent storage cabinet
CN109493224A (en) A kind of block chain picture social intercourse system
CN103455599A (en) Method, equipment and system for data synchronism
CN102204193B (en) A communication device
CN105049631B (en) Enter the method and mobile terminal of row information transmission in address list program
EP2820832B1 (en) Initiating a communication using a wireless security key device
CN108984197A (en) A kind of code update method and device
CN107423446A (en) New media based on cloud storage automates credible deployment system and method
CN114390452B (en) Message sending method and related equipment
CN110618989A (en) Information processing method, information processing device and related product
CN102300181A (en) Mobile phone instant information transceiver system based on data communication mode and method thereof
CN109597698A (en) Message prompt method, device, electronic equipment and computer readable storage medium
CN108683582A (en) A kind of method and system for ensureing real-time stabilization and being pushed to user terminal
CA2498025C (en) Method and system for synchronizing a drafts folder

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant