CN104778228A - Method and device for multi-party setting database - Google Patents

Method and device for multi-party setting database Download PDF

Info

Publication number
CN104778228A
CN104778228A CN201510142785.0A CN201510142785A CN104778228A CN 104778228 A CN104778228 A CN 104778228A CN 201510142785 A CN201510142785 A CN 201510142785A CN 104778228 A CN104778228 A CN 104778228A
Authority
CN
China
Prior art keywords
data
state
database
many ways
internal memory
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
CN201510142785.0A
Other languages
Chinese (zh)
Other versions
CN104778228B (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.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201510142785.0A priority Critical patent/CN104778228B/en
Publication of CN104778228A publication Critical patent/CN104778228A/en
Application granted granted Critical
Publication of CN104778228B publication Critical patent/CN104778228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention aims to provide a method and a device for a multi-party setting database. The method comprises the steps of selecting data needing multi-party setting; obtaining data flow related to the setting of the data; according to the data flow, and by combining a logic of the multi-party setting database, determining the state of the data; performing main database setting according to the state of the data. Compared with the prior art, the method and device have the advantages that the data flow related to the setting of the data is introduced, the state of the data is determined by combining the logic of the multi-party setting database to as to perform main database setting, the setting accuracy and efficiency are improved and the use experience of a user is improved.

Description

A kind of method and apparatus for set database in many ways
Technical field
The present invention relates to computer realm, particularly relate to a kind of method and apparatus for set database in many ways.
Background technology
Database is as a kind of mode of general storage data, and the data in some database, as some field inside database table, can exist the value that different sides goes set data.Owing to being uncontrollable with network delay during DataBase combining, therefore, different sides goes to there is sequence problem during set database, and new value may be covered by the older value of its other party, causes the data of lane database and the inconsistent of expection.
Such as, in the promotion message storehouse of extension system, each plan (plan) has a corresponding status field, and this field comprises A and B two states.Charge system and operation system all will carry out set to this field; Suppose that operation system first sends order and revises this status state to A, then charge system sends this status state of order amendment to B, and therefore, in this database, the expectation state of status is B.But due to network delay, the order that charge system sends first arrives database, arrive after the order that operation system sends, like this, the final state of this status has been exactly A, inconsistent with the state B expected.
For this problem, prior art carries out set operation to solve to database by batch.Calculated the state of data in real time by an independent side, timing batch carries out set operation to database, upgrades the state of these all fields.Also the object of calibration can be reached although it is so, but, each batch set database, if the amount of data is larger, such as millions of to several data volume of ten million, too large, consuming time also long to the performance impact of database write operations.
Therefore, how to carry out set database in many ways accurately and efficiently, become one of those skilled in the art's problem needing solution badly.
Summary of the invention
The object of this invention is to provide a kind of method and apparatus for set database in many ways.
According to an aspect of the present invention, provide a kind of method for set database in many ways, wherein, the method comprises the following steps:
Select the data needing set in many ways;
Obtain the data stream relevant to the set of described data;
According to described data stream, and combine the logic of set database in many ways, determine the state of described data;
According to the state of described data, carry out master data base set.
According to another aspect of the present invention, additionally provide a kind of device for set database in many ways, wherein, this device comprises:
For selecting the device of the data needing set in many ways;
For obtaining the device of the data stream relevant to the set of described data;
For according to described data stream, and combine the logic of set database in many ways, determine the device of the state of described data;
For the state according to described data, carry out the device of master data base set.
Compared with prior art, the data stream that introducing of the present invention is relevant to the set of data, and the logic combining set database in many ways, determine the state of data, to carry out master data base set, improves accuracy rate and the efficiency of set, improve the experience of user.
Further, reference data in database and the real time data in internal memory are compared by the present invention, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, the data that timely reparation makes mistakes, further ensure the accuracy of data in database, improve the experience of user.Further, owing to only repairing the data of makeing mistakes, to database to write pressure influence less, further improve the efficiency of operation, save resource.
Further, the present invention periodically or fixed condition ground, reference data in database and the real time data in internal memory are compared, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, further ensure the accuracy of data in database, improve the experience of user.
Further, the present invention in real time by the data syn-chronization in master data base to from database, from data should be read from database, in order to compare with the real time data in internal memory, alleviated the performance pressures of master data base, further increased the efficiency of process.
Accompanying drawing explanation
By reading the detailed description done non-limiting example done with reference to the following drawings, other features, objects and advantages of the present invention will become more obvious:
Fig. 1 is the structural representation for the device of set database in many ways of one aspect of the invention.
Fig. 2 is the schematic flow sheet for the method for set database in many ways of another aspect of the present invention.
In accompanying drawing, same or analogous Reference numeral represents same or analogous parts.
Embodiment
Before in further detail exemplary embodiment being discussed, it should be mentioned that some exemplary embodiments are described as the process or method described as process flow diagram.Although operations is described as the process of order by process flow diagram, many operations wherein can be implemented concurrently, concomitantly or simultaneously.In addition, the order of operations can be rearranged.Described process can be terminated when its operations are completed, but can also have the additional step do not comprised in the accompanying drawings.Described process can correspond to method, function, code, subroutine, subroutine etc.
Within a context alleged " computer equipment ", also referred to as " computer ", refer to the intelligent electronic device that can be performed the predetermined process such as numerical evaluation and/or logical calculated process by operation preset program or instruction, it can comprise processor and storer, the survival instruction that prestores in memory is performed to perform predetermined process process by processor, or perform predetermined process process by the hardware such as ASIC, FPGA, DSP, or combined by said two devices and realize.Computer equipment includes but not limited to server, PC, notebook computer, panel computer, smart mobile phone etc.
Described computer equipment comprises subscriber equipment and the network equipment.Wherein, described subscriber equipment includes but not limited to computer, smart mobile phone, PDA etc.; The described network equipment includes but not limited to the server group that single network server, multiple webserver form or the cloud be made up of a large amount of computing machine or the webserver based on cloud computing (Cloud Computing), wherein, cloud computing is the one of Distributed Calculation, the super virtual machine be made up of a group loosely-coupled computing machine collection.Wherein, described computer equipment isolated operation can realize the present invention, also accessible network by realizing the present invention with the interactive operation of other computer equipments in network.Wherein, the network residing for described computer equipment includes but not limited to internet, wide area network, Metropolitan Area Network (MAN), LAN (Local Area Network), VPN etc.
It should be noted that; described subscriber equipment, the network equipment and network etc. are only citing; other computer equipments that are existing or that may occur from now on or network, as being applicable to the present invention, within also should being included in scope, and are contained in this with way of reference.
Method (some of them are illustrated by process flow diagram) discussed below can be implemented by hardware, software, firmware, middleware, microcode, hardware description language or its combination in any.When implementing by software, firmware, middleware or microcode, program code or code segment in order to implement necessary task can be stored in machine or computer-readable medium (such as storage medium).(one or more) processor can implement necessary task.
Concrete structure disclosed herein and function detail are only representational, and are the objects for describing exemplary embodiment of the present invention.But the present invention can carry out specific implementation by many replacement forms, and should not be construed as only being limited to the embodiments set forth herein.
Should be understood that, although may have been used term " first ", " second " etc. here to describe unit, these unit should not limit by these terms.These terms are used to be only used to a unit and another unit to distinguish.For example, when not deviating from the scope of exemplary embodiment, first module can be called as second unit, and second unit can be called as first module similarly.Here used term "and/or" comprise one of them or more any and all combinations of listed associated item.
Should be understood that, when a unit is called as " connection " or " coupling " to another unit, it can directly connect or be coupled to another unit described, or can there is temporary location.On the other hand, " when being directly connected " or " directly coupled " to another unit, then there is not temporary location when a unit is called as.Should explain in a comparable manner the relation be used between description unit other words (such as " and be in ... between " compared to " and be directly in ... between ", " with ... contiguous " compared to " and with ... be directly close to " etc.).
Here used term is only used to describe specific embodiment and be not intended to limit exemplary embodiment.Unless context refers else clearly, otherwise singulative used here " ", " one " are also intended to comprise plural number.It is to be further understood that, the existence of the feature that term used here " comprises " and/or " comprising " specifies to state, integer, step, operation, unit and/or assembly, and do not get rid of and there is or add other features one or more, integer, step, operation, unit, assembly and/or its combination.
Also it should be mentioned that and to replace in implementation at some, the function/action mentioned can according to being different from occurring in sequence of indicating in accompanying drawing.For example, depend on involved function/action, in fact the two width figure in succession illustrated can perform simultaneously or sometimes can perform according to contrary order substantially.
Below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 1 is the structural representation for the device of set database in many ways of one embodiment of the invention.This device (hereinafter referred to as " in many ways set device 1 ") being used for set database in many ways comprises the device (hereinafter referred to as " selecting arrangement 101 ") for selecting the data needing set in many ways, for obtaining the device (hereinafter referred to as " data stream acquisition device 102 ") of the data stream relevant to the set of described data, for according to described data stream, and combine the logic of set database in many ways, determine the device (hereinafter referred to as " state determination device 103 ") of the state of described data, and for the state according to described data, carry out the device (hereinafter referred to as " status set device 104 ") of master data base set.
Wherein, the data needing set in many ways selected by selecting arrangement 101.
Particularly, selecting arrangement 101 as required, selects the data needing set in many ways in database, as according to operational needs, selects some field in database table, as the data needing set in many ways.
Such as, Party A and Party B all want to carry out set to the field in database third, then selecting arrangement 101 using this field third as the data needing set in many ways.
For an extension system, this extension system comprises financial system and charge system, these two systems all need to revise the upper down status that certain promotes unit, suppose that this state stores with field C in a database, and this state is used for representing whether can represent promotion message.Promoter is when financial system is supplemented with money, and financial system can revise this state to A, reaches the standard grade to represent; When user click this promotion message cause the remaining sum of this promoter to be zero time, charge system can revise again this state to B, rolls off the production line to represent.Selecting arrangement 101, according to this financial system and the operational needs of charge system, selects this field C in this database, as the data needing set in many ways.
Those skilled in the art will be understood that; the mode of above-mentioned selection data is only citing; the mode of other selection data that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
Data stream acquisition device 102 obtains the data stream relevant to the set of described data.
Particularly, these data selected by selecting arrangement 101 have the data stream relevant to set, as each set side the data stream relevant to the set of these data that produce, mutual such as by with each set side of data stream acquisition device 102, as one or many call each set side the communication mode of the application programming interfaces (API) that provide or other agreements, obtain the data stream relevant to the set of these data.
Connect example, in extension system, the operation behavior of promoter or user, as supplemented, clicking certain promotion message etc. with money, some daily record datas can be produced, as data stream, budget data stream etc. are clicked in financial data stream, charging, these data stream are relevant to the set of the upper down status of this popularization unit, mutual by with this extension system of data stream acquisition device 102, as called by one or many this extension system the communication mode of the application programming interfaces (API) that provide or other agreements, obtain these data stream.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition data stream is only citing; the mode of other acquisition data stream that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
Those skilled in the art also will be understood that; above-mentioned data stream is only citing; other existing or data stream relevant to the set of data that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
State determination device 103 according to described data stream, and combines the logic of set database in many ways, determines the state of described data.
Particularly, each set side's aaset bit database has corresponding logic, such as, when revise the state of these data, the data stream relevant to the set of data that state determination device 103 obtains according to data stream acquisition device 102, and combine the logic of set database in many ways, determine the state of these data.
Connect precedent, this extension system comprises financial system and charge system, and these two systems all need to revise the upper down status that certain promotes unit, suppose that this state stores with field C in a database, and this state is used for representing whether can represent promotion message.Promoter is when financial system is supplemented with money, and financial system can revise this state to A, reaches the standard grade to represent; When user click this promotion message cause the remaining sum of this promoter to be zero time, charge system can revise again this state to B, rolls off the production line to represent.Like this, the processing logic in conjunction with financial system and charge system is just needed.Therefore, data stream acquisition device 102 obtains finance stream, the charging click steam relevant to set, state determination device 103 is according to above-mentioned data stream, transfer accounts and click behavior by comprehensively supplementing with money, in conjunction with financial system and charge system logic, carry out adding up or deduct operation to the current balance of promoter, and judge whether the remaining sum of current promoter is greater than zero, carrys out the state of set database.
Those skilled in the art will be understood that; above-mentionedly determine that the mode of data mode is only citing; other are existing or may occur that the mode of given data state is really as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference from now on.
Status set device 104, according to the state of described data, carries out master data base set.
Particularly, after state determination device 103 determines the state of data, this data modification in master data base accordingly, is the state that this is determined by status set device 104, to carry out master data base set.
Connect example, if state determination device 103 is according to the finance stream relevant to set, charging click steam, in conjunction with financial system and charge system logic, judge that the remaining sum of current promoter is greater than zero, then the status set of the field C of this correspondence in master data base is A by this status set device 104, to realize master data base set, this state A represents can represent corresponding promotion message.
Those skilled in the art will be understood that; the mode of above-mentioned master data base set is only citing; the mode of other master data base set that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
At this, this data stream that set device 1 introducing is relevant to the set of data in many ways, and combine the logic of set database in many ways, determine the state of data, to carry out master data base set, improve accuracy rate and the efficiency of set, improve the experience of user.
Preferably, this in many ways set device 1 also comprise for by the state updating of described data to the device (hereinafter referred to as " memory refreshing device ", figure do not show) of internal memory.
Particularly, after state determination device 103 determines the state of these data, the state of these data is also updated to internal memory by memory refreshing device in real time, obtains the renewal implemented, facilitate follow-up to the data check in database to make the data mode in this internal memory.
Connect example, this state determination device 103, according to the finance stream relevant to set, charging click steam, in conjunction with financial system and charge system logic, judges that the remaining sum of current promoter is greater than zero, and the state of the field C of this correspondence is A; The state A of this field C is also updated to internal memory by memory refreshing device in real time, and this state A represents can represent corresponding promotion message.
At this, this in many ways set device 1 keep the real-time update of the data in internal memory, follow-up data in database to be verified to facilitate, further ensure the accuracy of data in database.
More preferably, this in many ways set device 1 also comprise for determining that the device from database corresponding with described master data base is (hereinafter referred to as " from storehouse determining device ", figure does not show), for obtain described from database about the state of described data, and the device of comparing with the state of described data in described internal memory is (hereinafter referred to as " state comparison device ", figure does not show), if and for inconsistent, according to the state of described data in described internal memory, the device upgraded the state of data described in described master data base is (hereinafter referred to as " state updating device ", figure does not show).
Wherein, determine from storehouse determining device corresponding to this master data base database.
Such as, from storehouse determining device from multiple database, determine corresponding to this master data base database, identical data and corresponding state thereof should be had from database and this master data base.And for example, should from storehouse determining device by the data syn-chronization this master data base to another database, and using this another database as corresponding with this master data base from database.
At this, master data base is used for writing data, from database only for reading data, to alleviate the performance pressures of master data base, increases the efficiency of process.
Subsequently, state comparison device obtains this state about these data from database, and the state in this internal memory is compared by this state and this data.
Particularly, owing to there is identical data and corresponding state thereof from database and this master data base, state comparison device is from the state that should obtain from database about these data, simultaneously, this state comparison device also obtains the state about these data from internal memory, and these two states is compared.
Such as, one data have multiple state, the plurality of state is such as called the full dose state of these data, and be stored in this master data base in the form of a table and be somebody's turn to do from database, state comparison device is from being somebody's turn to do from database, obtain the full dose state of these data, and the state in internal memory is compared by this full dose state and this data.
If inconsistent, state updating device, according to the state of described data in described internal memory, upgrades the state of data described in described master data base.
Particularly, if these data are from the state in database and its state consistency in internal memory, then do not process; If both states are inconsistent, then state updating device is according to the state of these data in this internal memory, carries out set again to these data in master data base, to upgrade the state of these data in this master data base.
Such as, in the promotion message storehouse of extension system, each plan (plan) has a corresponding status field, and this field comprises A and B two states.Charge system and operation system all will carry out set to this field; Suppose that operation system first sends order and revises this status state to A, then charge system sends this status state of order amendment to B, and therefore, in this database, the expectation state of status is B.But due to network delay, the order that charge system sends first arrives database, arrive after the order that operation system sends, like this, the final state of this status has been exactly A, inconsistent with the state B expected.
And memory refreshing device is in real time according to the order that operation system sends, the status state revised in this internal memory is A, and after charge system sends order, the status status modifier in this internal memory is B again by this memory refreshing device in real time.Therefore, in master data base, the state of this status is A, and from database due to synchronous with this master data base, wherein the state of status is also A, and the status state in internal memory is then B.State comparison device is from the state A that should obtain this status field from database, and the state B in internal memory compares by this state and this status field.Both are also inconsistent, then state updating device is according to the state B of this status field in this internal memory, carries out set again to this status field in master data base, is B by the state updating of this status field in this master data base.Finally, the state of this status field and the state consistency of expectation in this master data base.
At this, this in many ways set device 1 reference data in database and the real time data in internal memory are compared, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, the data that timely reparation makes mistakes, further ensure the accuracy of data in database, improve the experience of user.Further, owing to only repairing the data of makeing mistakes, to database to write pressure influence less, further improve the efficiency of operation, save resource.
More preferably, should from storehouse determining device also comprise for by the data syn-chronization described master data base to the described device from database (hereinafter referred to as " from storehouse synchronous device ", figure do not show).
Should from storehouse synchronous device by the data syn-chronization this master data base to this from database, such as, when having Data Update in this master data base at every turn, should from storehouse synchronous device in real time by have state to change this master data base data real-time update to this from database; Or, should from database periodically by the data syn-chronization this master data base to this from database, keep synchronous data and corresponding state thereof to make this from database and this master data base.Master data base is used for writing data, from database only for reading data.
At this, the time cycle of this Timing Synchronization can be preset, also can adjust according to actual conditions.
Those skilled in the art will be understood that; above-mentionedly synchronously be only citing from the mode of database; other synchronous modes from database that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
At this, this in many ways set device 1 in real time by the data syn-chronization in master data base to from database, from reading data from database, in order to compare with the real time data in internal memory, alleviate the performance pressures of master data base, further increase the efficiency of process.
Preferably, described state comparison device also comprises for when meeting preset trigger condition, from the described device (hereinafter referred to as " state acquisition device ", figure does not show) obtaining state about described data from database.
Particularly, when meeting preset trigger condition, state acquisition device is from the state that should obtain from database about these data, such as, this state acquisition device timing is from the full dose state that should load these data from database, and then, state comparison device by the full dose state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
More preferably, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
Such as, from the state obtained from database about these data having cycle predetermined time, as one hour, one minute; When meeting this predetermined period of time, this state acquisition device is from the state that should obtain from database about these data, and then, state comparison device by the state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
At this, this predetermined period of time can be system intialization, also can adjust according to actual conditions.
And for example, the state obtained from database about these data from this has predetermined acquisition condition, as whenever this from database by have state to change this master data base data real-time update to this from database when, meet predetermined acquisition condition, state acquisition device is from the state that should obtain from database about these data, and then, state comparison device by the state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
At this, this predetermined acquisition condition can be system intialization, also can adjust according to actual conditions.
Those skilled in the art will be understood that above-mentioned preset trigger condition is only citing, and other preset trigger condition that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
At this, this in many ways set device 1 periodically or fixed condition ground, reference data in database and the real time data in internal memory are compared, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, further ensure the accuracy of data in database, improve the experience of user.
Fig. 2 is the schematic flow sheet for the method for set database in many ways of another aspect of the present invention.
In step s 201, set device 1 selects the data needing set in many ways in many ways.
Particularly, in step s 201, set device 1 as required in many ways, selects the data needing set in many ways in database, as according to operational needs, selects some field in database table, as the data needing set in many ways.
Such as, Party A and Party B all want to carry out set to the field in database third, then in step s 201, in many ways set device 1 using this field third as the data needing set in many ways.
For an extension system, this extension system comprises financial system and charge system, these two systems all need to revise the upper down status that certain promotes unit, suppose that this state stores with field C in a database, and this state is used for representing whether can represent promotion message.Promoter is when financial system is supplemented with money, and financial system can revise this state to A, reaches the standard grade to represent; When user click this promotion message cause the remaining sum of this promoter to be zero time, charge system can revise again this state to B, rolls off the production line to represent.In step s 201, set device 1 is according to this financial system and the operational needs of charge system in many ways, selects this field C in this database, as the data needing set in many ways.
Those skilled in the art will be understood that; the mode of above-mentioned selection data is only citing; the mode of other selection data that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
In step S202, set device 1 obtains the data stream relevant to the set of described data in many ways.
Particularly, in step s 201, in many ways the data selected by set device 1 have the data stream relevant to set, as each set side the data stream relevant to the set of these data that produce, in step S202, in many ways mutual such as by with each set side of set device 1, as one or many call each set side the communication mode of the application programming interfaces (API) that provide or other agreements, obtain the data stream relevant to the set of these data.
Connect example, in extension system, the operation behavior of promoter or user, as supplemented, clicking certain promotion message etc. with money, some daily record datas can be produced, as data stream, budget data stream etc. are clicked in financial data stream, charging, these data stream are relevant to the set of the upper down status of this popularization unit, in step S202, in many ways mutual by with this extension system of set device 1, as called by one or many this extension system the communication mode of the application programming interfaces (API) that provide or other agreements, obtain these data stream.
Those skilled in the art will be understood that; the mode of above-mentioned acquisition data stream is only citing; the mode of other acquisition data stream that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
Those skilled in the art also will be understood that; above-mentioned data stream is only citing; other existing or data stream relevant to the set of data that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
In step S203, set device 1 is according to described data stream in many ways, and combines the logic of set database in many ways, determines the state of described data.
Particularly, each set side's aaset bit database has corresponding logic, such as, when revise the state of these data, in step S203, in many ways set device 1 is according to the data stream relevant to the set of data obtained in step S202, and combines the logic of set database in many ways, determines the state of these data.
Connect precedent, this extension system comprises financial system and charge system, and these two systems all need to revise the upper down status that certain promotes unit, suppose that this state stores with field C in a database, and this state is used for representing whether can represent promotion message.Promoter is when financial system is supplemented with money, and financial system can revise this state to A, reaches the standard grade to represent; When user click this promotion message cause the remaining sum of this promoter to be zero time, charge system can revise again this state to B, rolls off the production line to represent.Like this, the processing logic in conjunction with financial system and charge system is just needed.Therefore, in step S202, in many ways set device 1 obtains finance stream, the charging click steam relevant to set, in step S203, set device 1 is according to above-mentioned data stream in many ways, transfers accounts and click behavior by comprehensively supplementing with money, in conjunction with financial system and charge system logic, carry out adding up or deduct operation to the current balance of promoter, and judge whether the remaining sum of current promoter is greater than zero, carrys out the state of set database.
Those skilled in the art will be understood that; above-mentionedly determine that the mode of data mode is only citing; other are existing or may occur that the mode of given data state is really as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference from now on.
In step S204, set device 1 is according to the state of described data in many ways, carries out master data base set.
Particularly, after set device 1 determines the state of data in step S203 in many ways, in step S204, set device 1 accordingly in many ways, is the state that this is determined by this data modification in master data base, to carry out master data base set.
Connect example, if in step S203, in many ways set device 1 is according to the finance stream relevant to set, charging click steam, in conjunction with financial system and charge system logic, judge that the remaining sum of current promoter is greater than zero, then, in step S204, the status set of the field C of this correspondence in master data base is A by set device 1 in many ways, to realize master data base set, this state A represents can represent corresponding promotion message.
Those skilled in the art will be understood that; the mode of above-mentioned master data base set is only citing; the mode of other master data base set that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and is contained in this at this with way of reference.
At this, this data stream that set device 1 introducing is relevant to the set of data in many ways, and combine the logic of set database in many ways, determine the state of data, to carry out master data base set, improve accuracy rate and the efficiency of set, improve the experience of user.
Preferably, the method also comprises the state updating of described data to the step (hereinafter referred to as " step S205 ", figure do not show) of internal memory.
Particularly, after set device 1 determines the state of these data in step S203 in many ways, in step S205, in many ways the state of these data is also updated to internal memory by set device 1 in real time, obtain the renewal implemented to make the data mode in this internal memory, facilitate follow-up to the data check in database.
Connect example, in step S203, set device 1 is according to the finance stream relevant to set, charging click steam in many ways, in conjunction with financial system and charge system logic, judges that the remaining sum of current promoter is greater than zero, and the state of the field C of this correspondence is A; In step S205, the state A of this field C is also updated to internal memory by set device 1 in real time in many ways, and this state A represents can represent corresponding promotion message.
At this, this in many ways set device 1 keep the real-time update of the data in internal memory, follow-up data in database to be verified to facilitate, further ensure the accuracy of data in database.
More preferably, the method also comprises determines that the step from database corresponding with described master data base is (hereinafter referred to as " step S206 ", figure does not show), obtain described from database about the state of described data, and the step of comparing with the state of described data in described internal memory is (hereinafter referred to as " step S207 ", figure do not show) and if inconsistent, according to the state of described data in described internal memory, to the step (hereinafter referred to as " step S208 ", figure does not show) that the state of data described in described master data base upgrades.
Wherein, in step S206, set device 1 is determined corresponding to this master data base database in many ways.
Such as, in step S206, set device 1 is in multiple database in many ways, determines corresponding to this master data base database, should have identical data and corresponding state thereof from database and this master data base.And for example, in step S206, in many ways set device 1 by the data syn-chronization in this master data base to another database, and using this another database as corresponding with this master data base from database.
At this, master data base is used for writing data, from database only for reading data, to alleviate the performance pressures of master data base, increases the efficiency of process.
Subsequently, in step S207, set device 1 obtains this state about these data from database in many ways, and the state in this internal memory is compared by this state and this data.
Particularly, owing to there is identical data and corresponding state thereof from database and this master data base, in step S207, in many ways set device 1 is from the state that should obtain from database about these data, simultaneously, this in many ways set device 1 from internal memory, also obtain the state about these data, and these two states to be compared.
Such as, one data have multiple state, the plurality of state is such as called the full dose state of these data, and be stored in this master data base in the form of a table and be somebody's turn to do from database, in step S207, in many ways set device 1 is from from database, obtain the full dose state of these data, and the state in internal memory being compared by this full dose state and this data.
If inconsistent, in step S208, set device 1 is according to the state of described data in described internal memory in many ways, upgrades the state of data described in described master data base.
Particularly, if these data are from the state in database and its state consistency in internal memory, then do not process; If both states are inconsistent, then in step S208, set device 1 is according to the state of these data in this internal memory in many ways, carries out set again to these data in master data base, to upgrade the state of these data in this master data base.
Such as, in the promotion message storehouse of extension system, each plan (plan) has a corresponding status field, and this field comprises A and B two states.Charge system and operation system all will carry out set to this field; Suppose that operation system first sends order and revises this status state to A, then charge system sends this status state of order amendment to B, and therefore, in this database, the expectation state of status is B.But due to network delay, the order that charge system sends first arrives database, arrive after the order that operation system sends, like this, the final state of this status has been exactly A, inconsistent with the state B expected.
And in step S205, set device 1 is in real time according to the order that operation system sends in many ways, the status state revised in this internal memory is A, after charge system sends order, this in many ways set device 1 be B by the status status modifier in this internal memory in real time again.Therefore, in master data base, the state of this status is A, and from database due to synchronous with this master data base, wherein the state of status is also A, and the status state in internal memory is then B.In step S207, set device 1 is from the state A that should obtain this status field from database in many ways, and the state B in internal memory compares by this state and this status field.Both are also inconsistent, then in step S208, set device 1 is according to the state B of this status field in this internal memory in many ways, carries out set again to this status field in master data base, is B by the state updating of this status field in this master data base.Finally, the state of this status field and the state consistency of expectation in this master data base.
At this, this in many ways set device 1 reference data in database and the real time data in internal memory are compared, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, the data that timely reparation makes mistakes, further ensure the accuracy of data in database, improve the experience of user.Further, owing to only repairing the data of makeing mistakes, to database to write pressure influence less, further improve the efficiency of operation, save resource.
More preferably, this determines that the step from database corresponding with described master data base also comprises the data syn-chronization described master data base to the described sub-step from database (hereinafter referred to as " sub-step S2061 ", figure does not show).
In sub-step S2061, in many ways set device 1 extremely should from database by the data syn-chronization in this master data base, such as, when having Data Update in this master data base each, in sub-step S2061, set device 1 in real time extremely should from database by the data real-time update having state to change in this master data base in many ways; Or, should from database periodically by the data syn-chronization this master data base to this from database, keep synchronous data and corresponding state thereof to make this from database and this master data base.Master data base is used for writing data, from database only for reading data.
At this, the time cycle of this Timing Synchronization can be preset, also can adjust according to actual conditions.
Those skilled in the art will be understood that; above-mentionedly synchronously be only citing from the mode of database; other synchronous modes from database that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
At this, this in many ways set device 1 in real time by the data syn-chronization in master data base to from database, from reading data from database, in order to compare with the real time data in internal memory, alleviate the performance pressures of master data base, further increase the efficiency of process.
Preferably, also comprise when meeting preset trigger condition about the step of the state of described data from database described in obtaining, from the described sub-step (hereinafter referred to as " sub-step S2071 ", figure does not show) obtaining state about described data from database.
Particularly, when meeting preset trigger condition, in sub-step S2071, set device 1 is from the state that should obtain from database about these data in many ways, such as, in sub-step S2071, in many ways set device 1 timing is from the full dose state that should load these data from database, and then, in step S2071, in many ways set device 1 by the full dose state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
More preferably, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
Such as, from the state obtained from database about these data having cycle predetermined time, as one hour, one minute; When meeting this predetermined period of time, in sub-step S2071, in many ways set device 1 is from the state that should obtain from database about these data, and then, in step S2071, in many ways set device 1 by the state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
At this, this predetermined period of time can be system intialization, also can adjust according to actual conditions.
And for example, the state obtained from database about these data from this has predetermined acquisition condition, as whenever this from database by have state to change this master data base data real-time update to this from database when, meet predetermined acquisition condition, in sub-step S2071, in many ways set device 1 is from the state that should obtain from database about these data, and then, in step S2071, in many ways set device 1 by the state of these data and this data the state in internal memory compare, to be further processed according to comparison result.
At this, this predetermined acquisition condition can be system intialization, also can adjust according to actual conditions.
Those skilled in the art will be understood that above-mentioned preset trigger condition is only citing, and other preset trigger condition that are existing or that may occur from now on, as being applicable to the present invention, within also should being included in scope, and are contained in this at this with way of reference.
At this, this in many ways set device 1 periodically or fixed condition ground, reference data in database and the real time data in internal memory are compared, solve and cause these field status not meet the problem of expection owing to there is sequence problem during some field of set database in many ways, further ensure the accuracy of data in database, improve the experience of user.
It should be noted that the present invention can be implemented in the assembly of software and/or software restraint, such as, each device of the present invention can adopt special IC (ASIC) or any other similar hardware device to realize.In one embodiment, software program of the present invention can perform to realize step mentioned above or function by processor.Similarly, software program of the present invention (comprising relevant data structure) can be stored in computer readable recording medium storing program for performing, such as, and RAM storer, magnetic or CD-ROM driver or flexible plastic disc and similar devices.In addition, steps more of the present invention or function can adopt hardware to realize, such as, as coordinating with processor thus performing the circuit of each step or function.
To those skilled in the art, obviously the invention is not restricted to the details of above-mentioned one exemplary embodiment, and when not deviating from spirit of the present invention or essential characteristic, the present invention can be realized in other specific forms.Therefore, no matter from which point, all should embodiment be regarded as exemplary, and be nonrestrictive, scope of the present invention is limited by claims instead of above-mentioned explanation, and all changes be therefore intended in the implication of the equivalency by dropping on claim and scope are included in the present invention.Any Reference numeral in claim should be considered as the claim involved by limiting.In addition, obviously " comprising " one word do not get rid of other unit or step, odd number does not get rid of plural number.Multiple unit of stating in system claims or device also can be realized by software or hardware by a unit or device.First, second word such as grade is used for representing title, and does not represent any specific order.
Although show and describe exemplary embodiment especially above, it will be appreciated by those skilled in the art that when not deviating from the spirit and scope of claims, can change to some extent in its form and details.Here sought protection is set forth in the dependent claims.Define in following numbering clause each embodiment these and other in:
1, for a method for set database in many ways, wherein, the method comprises the following steps:
Select the data needing set in many ways;
Obtain the data stream relevant to the set of described data;
According to described data stream, and combine the logic of set database in many ways, determine the state of described data;
According to the state of described data, carry out master data base set.
2, the method for clause 1, wherein, the method also comprises:
By the state updating of described data to internal memory.
3, the method for clause 2, wherein, the method also comprises:
Determine corresponding to described master data base database;
Obtain described from database about the state of described data, and to compare with the state of described data in described internal memory;
If inconsistent, according to the state of described data in described internal memory, the state of data described in described master data base is upgraded.
4, the method for clause 3, wherein, determine from the step of database also comprise corresponding with described master data base:
By the data syn-chronization in described master data base to described from database.
5, the method for clause 3 or 4, wherein, also comprises about the step of the state of described data described in obtaining from database:
When meeting preset trigger condition, from the described state obtained from database about described data.
6, the method for clause 5, wherein, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
7, for a device for set database in many ways, wherein, this device comprises:
For selecting the device of the data needing set in many ways;
For obtaining the device of the data stream relevant to the set of described data;
For according to described data stream, and combine the logic of set database in many ways, determine the device of the state of described data;
For the state according to described data, carry out the device of master data base set.
8, the device of clause 7, wherein, this device also comprises:
For by the state updating of described data to the device of internal memory.
9, the device of clause 8, wherein, this device also comprises:
For determining the device from database corresponding with described master data base;
For obtain described from database about the state of described data, and the device of comparing with the state of described data in described internal memory;
If for inconsistent, according to the state of described data in described internal memory, to the device that the state of data described in described master data base upgrades.
10, the device of clause 9, wherein, for determining from the device of database also comprise corresponding with described master data base:
For by the data syn-chronization in described master data base to the described device from database.
11, the device of clause 9 or 10, wherein, also comprises about the device of the state of described data described in obtaining from database:
For when meeting preset trigger condition, from the described device obtaining state about described data from database.
12, the device of clause 11, wherein, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.

Claims (12)

1., for a method for set database in many ways, wherein, the method comprises the following steps:
Select the data needing set in many ways;
Obtain the data stream relevant to the set of described data;
According to described data stream, and combine the logic of set database in many ways, determine the state of described data;
According to the state of described data, carry out master data base set.
2. method according to claim 1, wherein, the method also comprises:
By the state updating of described data to internal memory.
3. method according to claim 2, wherein, the method also comprises:
Determine corresponding to described master data base database;
Obtain described from database about the state of described data, and to compare with the state of described data in described internal memory;
If inconsistent, according to the state of described data in described internal memory, the state of data described in described master data base is upgraded.
4. method according to claim 3, wherein, determine from the step of database also comprise corresponding with described master data base:
By the data syn-chronization in described master data base to described from database.
5. the method according to claim 3 or 4, wherein, also comprises about the step of the state of described data described in obtaining from database:
When meeting preset trigger condition, from the described state obtained from database about described data.
6. method according to claim 5, wherein, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
7., for a device for set database in many ways, wherein, this device comprises:
For selecting the device of the data needing set in many ways;
For obtaining the device of the data stream relevant to the set of described data;
For according to described data stream, and combine the logic of set database in many ways, determine the device of the state of described data;
For the state according to described data, carry out the device of master data base set.
8. device according to claim 7, wherein, this device also comprises:
For by the state updating of described data to the device of internal memory.
9. device according to claim 8, wherein, this device also comprises:
For determining the device from database corresponding with described master data base;
For obtain described from database about the state of described data, and the device of comparing with the state of described data in described internal memory;
If for inconsistent, according to the state of described data in described internal memory, to the device that the state of data described in described master data base upgrades.
10. device according to claim 9, wherein, for determining from the device of database also comprise corresponding with described master data base:
For by the data syn-chronization in described master data base to the described device from database.
11. devices according to claim 9 or 10, wherein, describedly also to comprise about the device of the state of described data for obtaining from database:
For when meeting preset trigger condition, from the described device obtaining state about described data from database.
12. devices according to claim 11, wherein, described preset trigger condition comprises following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
CN201510142785.0A 2015-03-27 2015-03-27 A kind of method and apparatus for multi-party set database Active CN104778228B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510142785.0A CN104778228B (en) 2015-03-27 2015-03-27 A kind of method and apparatus for multi-party set database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510142785.0A CN104778228B (en) 2015-03-27 2015-03-27 A kind of method and apparatus for multi-party set database

Publications (2)

Publication Number Publication Date
CN104778228A true CN104778228A (en) 2015-07-15
CN104778228B CN104778228B (en) 2018-08-07

Family

ID=53619692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510142785.0A Active CN104778228B (en) 2015-03-27 2015-03-27 A kind of method and apparatus for multi-party set database

Country Status (1)

Country Link
CN (1) CN104778228B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1784677A (en) * 2004-03-31 2006-06-07 微软公司 System and method for a consistency check of a database backup
CN101221573A (en) * 2003-04-30 2008-07-16 甲骨文国际公司 Method for restoring storage database to the original state
US20120066118A1 (en) * 2010-09-13 2012-03-15 Dantas Kelly C F Interface Integration Application Connection between Websites and Social Network in Addition with the Social Network Tree Chart System
CN103020242A (en) * 2012-12-19 2013-04-03 中国人民解放军第二炮兵装备研究院第四研究所 Data synchronization method based on oracle database
CN103778136A (en) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 Cross-room database synchronization method and system
CN104463611A (en) * 2015-01-07 2015-03-25 上海瀚银信息技术有限公司 Agent management system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221573A (en) * 2003-04-30 2008-07-16 甲骨文国际公司 Method for restoring storage database to the original state
CN1784677A (en) * 2004-03-31 2006-06-07 微软公司 System and method for a consistency check of a database backup
US20120066118A1 (en) * 2010-09-13 2012-03-15 Dantas Kelly C F Interface Integration Application Connection between Websites and Social Network in Addition with the Social Network Tree Chart System
CN103778136A (en) * 2012-10-19 2014-05-07 阿里巴巴集团控股有限公司 Cross-room database synchronization method and system
CN103020242A (en) * 2012-12-19 2013-04-03 中国人民解放军第二炮兵装备研究院第四研究所 Data synchronization method based on oracle database
CN104463611A (en) * 2015-01-07 2015-03-25 上海瀚银信息技术有限公司 Agent management system

Also Published As

Publication number Publication date
CN104778228B (en) 2018-08-07

Similar Documents

Publication Publication Date Title
CN110806923B (en) Parallel processing method and device for block chain tasks, electronic equipment and medium
CN109446570B (en) Business process display method, device, computer equipment and storage medium
CN110998558B (en) Delayed updating of database hash codes in a blockchain
US20210108931A1 (en) Method and apparatus for determining hybrid travel route, device and storage medium
CN104809025A (en) Method and device for enabling programs to be online
CN105550225A (en) Index construction method and query method and apparatus
CN104461625A (en) Hot patch realization method and system
CN103218364A (en) Searching method and system
CN103093038A (en) Updating method and updating device for bills of material (BOMs)
JP7412489B2 (en) Federated learning methods and devices, electronic devices, storage media and computer programs
CN104462477A (en) Data synchronizing method, device and system based on timestamp
CN106557436A (en) The memory compression function enabled method of terminal and device
CN104702703A (en) Method and device for updating data
CN110598059B (en) Database operation method and device
CN104881350A (en) Method and device for confirming user experience and method and device for assisting in user experience confirmation
CN104506636A (en) Method and device for synchronizing data
CN102541544A (en) Method, device and system for processing tree control
CN112560928B (en) Negative sample mining method and device, electronic equipment and storage medium
CN104778228A (en) Method and device for multi-party setting database
CN116361205A (en) Data processing apparatus, method, device and medium for determining tensor memory address
CN104035881A (en) Vehicle parameter modifying method and vehicle controller
US11941055B2 (en) Method and apparatus for graph computing, electronic device and storage medium
CN104199984A (en) Method and device for realizing dynamic reference of function library
CN114328739A (en) Data synchronization method, data reading method, data synchronization device, data reading device, electronic equipment, storage medium and product
CN110879871B (en) Page menu configuration method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant