CN104778228B - A kind of method and apparatus for multi-party set database - Google Patents

A kind of method and apparatus for multi-party set database Download PDF

Info

Publication number
CN104778228B
CN104778228B CN201510142785.0A CN201510142785A CN104778228B CN 104778228 B CN104778228 B CN 104778228B CN 201510142785 A CN201510142785 A CN 201510142785A CN 104778228 B CN104778228 B CN 104778228B
Authority
CN
China
Prior art keywords
data
database
state
memory
party
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.)
Active
Application number
CN201510142785.0A
Other languages
Chinese (zh)
Other versions
CN104778228A (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.)
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

Abstract

The object of the present invention is to provide a kind of method and apparatus for multi-party set database;Selection needs the data of multi-party set;Obtain the relevant data flow of set with the data;According to the data flow, and the logic of multi-party set database is combined, determines the state of the data;According to the state of the data, primary database set is carried out.Compared with prior art, present invention introduces the relevant data flows of set with data, and combine the logic of multi-party set database, determine the state of data, to carry out primary database set, improve the accuracy rate and efficiency of set, improve the usage experience of user.

Description

A kind of method and apparatus for multi-party set database
Technical field
The present invention relates to computer realm more particularly to a kind of method and apparatus for multi-party set database.
Background technology
Database is as a kind of mode of general storage data, the data in some databases, as inside database table Certain fields, can have the value that different sides goes set data.Network delay is uncontrollable when due to being connect with database, Therefore, there are sequence problems, new value may be covered, lead by the older value of its other party when different sides removes set database Cause lane database data with it is expected inconsistent.
For example, in the promotion message library of extension system, each plan (plan) has a corresponding status fields, should Field includes A and B two states.Charge system and operation system will carry out set to the field;Assuming that operation system is first sent out Order of losing one's life changes the status states to A, and then charge system, which is sent, orders the modification status states to B, therefore, the data In library, the expectation state of status is B.However, due to network delay, the order that charge system is sent first reaches database, industry It is arrived after the order that business system is sent, in this way, the state final status is exactly A, it is inconsistent with desired state B.
For the problem, the prior art carries out set operation to solve by batch to database.By individual one Side calculates the state of data in real time, and timing batch carries out set operation to database, updates the state of all these fields.Though It so can also achieve the purpose that calibration in this way, however, batch set database every time, if the amount of data is bigger, for example, it is several Million arrive several ten million data volumes, too big on the influence of the performance of database write operations, take also long.
Therefore, how multi-party set database is accurately and efficiently carried out, becomes asking for those skilled in the art's urgent need to resolve One of topic.
Invention content
The object of the present invention is to provide a kind of method and apparatus for multi-party set database.
According to an aspect of the invention, there is provided a kind of method for multi-party set database, wherein this method packet Include following steps:
Selection needs the data of multi-party set;
Obtain the relevant data flow of set with the data;
According to the data flow, and the logic of multi-party set database is combined, determines the state of the data;
According to the state of the data, primary database set is carried out.
According to another aspect of the present invention, a kind of device for multi-party set database is additionally provided, wherein the dress Set including:
Device for the data for selecting to need multi-party set;
For obtaining and the device of the relevant data flow of the set of the data;
For according to the data flow, and the logic of multi-party set database is combined, determines the dress of the state of the data It sets;
For the state according to the data, the device of primary database set is carried out.
Compared with prior art, present invention introduces the relevant data flows of set with data, and combine multi-party set data The logic in library determines the state of data, to carry out primary database set, improves the accuracy rate and efficiency of set, improves use The usage experience at family.
Further, the reference data in database is compared the present invention with the real time data in memory, solves It is expected to there is a problem of that sequence problem causes these field status not meet when fields certain due to multi-party set database, in time The data for repairing error, further ensure the accuracy of data in database, improve the usage experience of user.Also, by In the data for only repairing error, pressure influence is smaller is write to database, the efficiency of operation is further improved, saves money Source.
Further, the present invention periodically or fixed condition, will be real-time in the reference data and memory in database Data are compared, and there are sequence problems to lead to these field status not when solving fields certain due to multi-party set database Meet expected problem, further ensure the accuracy of data in database, improves the usage experience of user.
Further, the data in primary database are synchronized to from database by the present invention in real time, certainly should be from database Data are read to alleviate the performance pressures of primary database to be compared with the real time data in memory, further increase The efficiency of processing.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, of the invention other Feature, objects and advantages will become more apparent upon:
Fig. 1 is the structural schematic diagram of the device for multi-party set database of one aspect of the invention.
Fig. 2 is the flow diagram of the method for multi-party set database of another aspect of the invention.
Same or analogous reference numeral represents same or analogous component in attached drawing.
Specific implementation mode
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing described as flow chart or method.Although operations are described as the processing of sequence by flow chart, therein to be permitted Multioperation can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be rearranged.When it The processing can be terminated when operation completion, it is also possible to the additional step being not included in attached drawing.The processing It can correspond to method, function, regulation, subroutine, subprogram etc..
Alleged " computer equipment " within a context, also referred to as " computer ", referring to can be by running preset program or referring to Enable and execute the intelligent electronic device of the predetermined process process such as numerical computations and/or logical calculated, may include processor with Memory, executes the survival that prestores in memory by processor and instructs and execute predetermined process process, or by ASIC, The hardware such as FPGA, DSP execute predetermined process process, or are realized by said two devices combination.Computer equipment includes but unlimited In server, PC, laptop, tablet computer, smart mobile phone etc..
The computer equipment includes user equipment and the network equipment.Wherein, the user equipment includes but not limited to electricity Brain, smart mobile phone, PDA etc.;The network equipment includes but not limited to that single network server, multiple network servers form Server group or the cloud being made of a large amount of computers or network server for being based on cloud computing (Cloud Computing), wherein Cloud computing is one kind of Distributed Calculation, a super virtual computer being made of the computer collection of a group loose couplings.Its In, the computer equipment can isolated operation realize the present invention, also can access network and by with other calculating in network The present invention is realized in the interactive operation of machine equipment.Wherein, the network residing for the computer equipment include but not limited to internet, Wide area network, Metropolitan Area Network (MAN), LAN, VPN network etc..
It should be noted that the user equipment, the network equipment and network etc. are only for example, other are existing or from now on may be used The computer equipment or network that can occur such as are applicable to the present invention, should also be included within the scope of the present invention, and to draw It is incorporated herein with mode.
Method (some of them are illustrated by flow) discussed hereafter can be by hardware, software, firmware, centre Part, microcode, hardware description language or its arbitrary combination are implemented.Implement when with software, firmware, middleware or microcode When, program code or code segment to implement necessary task can be stored in machine or computer-readable medium and (for example deposit Storage media) in.(one or more) processor can implement necessary task.
Specific structure and function details disclosed herein are only representative, and are for describing the present invention show The purpose of example property embodiment.But the present invention can be implemented by many alternative forms, and be not interpreted as It is limited only by the embodiments set forth herein.
Although it should be understood that may have been used term " first ", " second " etc. herein to describe each unit, But these units should not be limited by these terms.The use of these items is only for by a unit and another unit It distinguishes.For example, without departing substantially from the range of exemplary embodiment, it is single that first unit can be referred to as second Member, and similarly second unit can be referred to as first unit.Term "and/or" used herein above include one of them or The arbitrary and all combination of more listed associated items.
It should be understood that when a unit is referred to as " connecting " or when " coupled " to another unit, can directly connect Another unit is connect or be coupled to, or may exist temporary location.In contrast, when a unit is referred to as " directly connecting Connect " or " direct-coupling " arrive another unit when, then be not present temporary location.It should explain in a comparable manner and be used to retouch State the relationship between unit other words (such as " between being in ... " compared to " between being directly in ... ", " and with ... it is adjacent Closely " compared to " with ... be directly adjacent to " etc.).
Term used herein above is not intended to limit exemplary embodiment just for the sake of description specific embodiment.Unless Context clearly refers else, otherwise singulative used herein above "one", " one " also attempt to include plural number.Also answer When understanding, term " include " and or " include " used herein above provide stated feature, integer, step, operation, The presence of unit and/or component, and do not preclude the presence or addition of other one or more features, integer, step, operation, unit, Component and/or a combination thereof.
It should further be mentioned that in some replace implementations, the function action being previously mentioned can be according to different from attached The sequence indicated in figure occurs.For example, involved function action is depended on, the two width figures shown in succession actually may be used Substantially simultaneously to execute or can execute in a reverse order sometimes.
Present invention is further described in detail below in conjunction with the accompanying drawings.
Fig. 1 is the structural schematic diagram of the device for multi-party set database of one embodiment of the invention.This is used for more The device (hereinafter referred to as " multi-party set device 1 ") of square set database includes the data for selecting to need multi-party set It is device (hereinafter referred to as " selection device 101 "), (following with the device of the relevant data flow of the set of the data for obtaining Referred to as " data flow acquisition device 102 "), for according to the data flow, and combine the logic of multi-party set database, determine The device (hereinafter referred to as " state determination device 103 ") of the state of the data and for the state according to the data, Carry out the device (hereinafter referred to as " status set device 104 ") of primary database set.
Wherein, the selection of selection device 101 needs the data of multi-party set.
Specifically, selection device 101 is as needed, the data that multi-party set is needed in database is selected, such as according to business On needs, certain fields in database table are selected, as the data for needing multi-party set.
For example, Party A and Party B want to carry out set to the field third in database, then selection device 101 is by the field third As the data for needing multi-party set.
By taking an extension system as an example, which includes financial system and charge system, the two systems are required for Change some upper down status for promoting unit, it is assumed that the state is stored with field C in the database, which is used for table Whether show can show promotion message.For promoter when financial system is supplemented with money, financial system can change the state to A, on indicating Line;The promotion message leads to the remaining sum of the promoter when the user clicks when being zero, and charge system can change the state to B again, with Indicate offline.Selection device 101 selects the word in the database according to the financial system and the operational needs of charge system Section C, as the data for needing multi-party set.
Those skilled in the art will be understood that the mode of above-mentioned selection data is only for example, other are existing or from now on may be used The mode of selection data that can occur such as is applicable to the present invention, should also be included within the scope of the present invention, and herein with Way of reference is incorporated herein.
Data flow acquisition device 102 obtains the relevant data flow of set with the data.
Specifically, 101 selected data of the selection device have with the relevant data flow of set, such as each institute of set side The relevant data flow of the set with the data generated, data flow acquisition device 102 for example by the interaction with each set side, Such as one or many application programming interfaces (API) for calling each set side to be provided or other communication modes arranged, obtain With the relevant data flow of set of the data.
Example is connected, in extension system, the operation behavior of promoter or user, such as supplement with money, click some promotion message, Some daily record datas are will produce, such as financial data stream, charging click data flow, budget data stream, these data flows are pushed away with this The set of the upper down status of wide unit is related, and data flow acquisition device 102 such as passes through one by the interaction with the extension system The communication mode of the secondary or application programming interfaces (API) for repeatedly calling the extension system to be provided or other agreements, obtains these Data flow.
Those skilled in the art will be understood that the mode of above-mentioned acquisition data flow is only for example, other are existing or from now on The mode for the acquisition data flow being likely to occur such as is applicable to the present invention, should also be included within the scope of the present invention, and This is incorporated herein by reference.
Those skilled in the art should also be understood that above-mentioned data flow is only for example, other are existing or are likely to occur from now on The relevant data flow of the set with data be such as applicable to the present invention, should also be included within the scope of the present invention, and This is incorporated herein by reference.
State determination device 103 combines the logic of multi-party set database according to the data flow, determines the data State.
Specifically, each set side's aaset bit database has corresponding logic, for example, when changing the number According to state, set with data relevant data of the state determination device 103 acquired in data flow acquisition device 102 Stream, and the logic of multi-party set database is combined, determine the state of the data.
Precedent is connect, which includes financial system and charge system, the two systems, which are required for changing some, to be pushed away The upper down status of wide unit, it is assumed that the state is stored with field C in the database, and the state is for indicating whether energy exhibition Existing promotion message.For promoter when financial system is supplemented with money, financial system can change the state to A, to indicate to reach the standard grade;When user's point It hits the promotion message to lead to the remaining sum of the promoter when being zero, charge system can change the state to B, to indicate offline again.This Sample, it is necessary in conjunction with the processing logic of financial system and charge system.Therefore, data flow acquisition device 102 obtains and set phase Row is transferred accounts and clicked to finance stream, the charging click steam of pass, state determination device 103 according to above-mentioned data flow, by comprehensive supplement with money In conjunction with financial system and charge system logic, the current balance of promoter to be added up or being deducted operation, and judge current Whether the remaining sum of promoter is more than zero, carrys out the state of set database.
Those skilled in the art will be understood that the mode of above-mentioned determining data mode is only for example, other are existing or modern The mode for the determination data mode being likely to occur afterwards is such as applicable to the present invention, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
Status set device 104 carries out primary database set according to the state of the data.
Specifically, state determination device 103 determine data state after, status set device 104 accordingly, by main number According to the state that the data modification in library is the determination, to carry out primary database set.
Connect example, if state determination device 103 according to set it is relevant finance stream, charging click steam, in conjunction with finance be System and charge system logic judge that the remaining sum of current promoter is more than zero, then the status set device 104 will be somebody's turn to do in primary database The status set of corresponding field C is A, and to realize primary database set, state A expressions can show corresponding popularization letter Breath.
Those skilled in the art will be understood that the mode of above-mentioned primary database set is only for example, other are existing or modern The mode for the primary database set being likely to occur afterwards is such as applicable to the present invention, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
Here, the multi-party set device 1 introduces the relevant data flow of set with data, and combine multi-party set database Logic, determine the state of data, to carry out primary database set, improve the accuracy rate and efficiency of set, improve user Usage experience.
Preferably, which further includes (following for the state of the data to be updated to the device of memory Referred to as " memory refreshing device ", not shown).
Specifically, after the state that state determination device 103 determines the data, memory refreshing device is in real time by the data State be also updated to memory it is convenient subsequently in database so that the update that the data mode in the memory is implemented Data check.
Connect example, the state determination device 103 according to set it is relevant finance stream, charging click steam, in conjunction with finance be System and charge system logic judge that the remaining sum of current promoter is more than zero, and the state of the corresponding field C is A;Memory refreshing fills It sets and the state A of field C is also updated to memory in real time, state A expressions can show corresponding promotion message.
Here, the multi-party set device 1 keeps the real-time update of the data in memory, to facilitate subsequently in database Data are verified, and the accuracy of data in database is further ensured.
It is highly preferred that the multi-party set device 1 further includes corresponding with the primary database from database for determination Device (hereinafter referred to as " from library determining device ", not shown), for obtaining the state from database about the data, And be compared with state of the data in the memory device (hereinafter referred to as " state comparison device ", not shown), And if for inconsistent, according to state of the data in the memory, to the shape of data described in the primary database The device (hereinafter referred to as " state updating device ", not shown) that state is updated.
Wherein, it is determined from library determining device corresponding with the primary database from database.
For example, from library determining device from multiple databases, it is determining corresponding with the primary database from database, it should be from number According to library and primary database data having the same and its corresponding state.It for another example, should be from library determining device by the primary database In data be synchronized to another database, and using another database as corresponding with the primary database from database.
Here, primary database for writing data, is served only for reading data from database, to mitigate the performance pressure of primary database Power increases the efficiency of processing.
Then, state comparison device obtains this from database about the state of the data, and by the state and the data State in the memory is compared.
Specifically, since from database and primary database data having the same and its corresponding state, state compares Device from state about the data should be obtained from database, meanwhile, the state comparison device also obtained from memory about The state of the data, and two states are compared.
For example, there are a data multiple states, multiple state to be for example known as the full dose state of the data, and with the shape of table Formula is stored in the primary database and is somebody's turn to do from database, and state comparison device obtain the full dose shape of the data from being somebody's turn to do from database State, and the full dose state is compared with the state of the data in memory.
If inconsistent, state of the state updating device according to the data in the memory, in the primary database The state of the data is updated.
Specifically, if the data are from the state and its state consistency in memory in database, without processing; If the two state is inconsistent, state of the state updating device according to the data in the memory, to the data in primary database Set again is carried out, is updated with the state to the data in the primary database.
For example, in the promotion message library of extension system, each plan (plan) has a corresponding status fields, should Field includes A and B two states.Charge system and operation system will carry out set to the field;Assuming that operation system is first sent out Order of losing one's life changes the status states to A, and then charge system, which is sent, orders the modification status states to B, therefore, the data In library, the expectation state of status is B.However, due to network delay, the order that charge system is sent first reaches database, industry It is arrived after the order that business system is sent, in this way, the state final status is exactly A, it is inconsistent with desired state B.
And the order that memory refreshing device is sent according to operation system in real time, it is A to change the status states in the memory, Charge system send order after, the memory refreshing device again in real time by the status status modifiers in the memory be B.Cause This, in primary database the state of the status be A, from database due to be it is synchronous with the primary database, wherein status's State is also A, and the status states in memory are then B.State comparison device should obtain the status words from database certainly The state A of section, and the state is compared with the state B of the status fields in memory.The two is not consistent, then state State B of the updating device according to the status fields in the memory sets the status fields in primary database again Position, B is updated to by the state of the status fields in the primary database.Finally, in the primary database status fields shape State and desired state consistency.
Here, the reference data in database is compared the multi-party set device 1 with the real time data in memory, solution It is expected to there is a problem of that sequence problem causes these field status not meet when fields certain due to multi-party set database of having determined, The data for repairing error in time, further ensure the accuracy of data in database, improve the usage experience of user.And And the data due to only repairing error, pressure influence is smaller is write to database, further improves the efficiency of operation, is saved Resource is saved.
It is highly preferred that should further include described from number for being synchronized to the data in the primary database from library determining device According to the device (hereinafter referred to as " from library synchronizing device ", not shown) in library.
Data in the primary database are synchronized to this from database by this from library synchronizing device, for example, the master data every time When having data update in library, should from library synchronizing device in real time by the data real-time update of stateful variation in the primary database to It should be from database;Alternatively, from database the data in the primary database periodically should be synchronized to this from database so that this from The database data synchronous with primary database holding and its corresponding state.Primary database is for writing data, only from database For reading data.
Here, the time cycle of the Timing Synchronization can be preset, can also be adjusted according to actual conditions.
Those skilled in the art will be understood that above-mentioned synchronization is only for example from the mode of database, other are existing or modern The synchronization being likely to occur afterwards is such as applicable to the present invention from the mode of database, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
Here, the data in primary database are synchronized to from database by the multi-party set device 1 in real time, it certainly should be from database Middle reading data alleviate the performance pressures of primary database, further increase to be compared with the real time data in memory The efficiency of processing.
Preferably, the state comparison device further includes meeting preset trigger condition for working as, from described from database Obtain the device (hereinafter referred to as " state acquisition device ", not shown) of the state about the data.
Specifically, when meeting preset trigger condition, state acquisition device should be obtained from database about the data certainly State, for example, the state acquisition device timing is from the full dose state that should load the data from database, in turn, state compares The full dose state of the data is compared device with the state of the data in memory, further to be carried out according to comparison result Processing.
It is highly preferred that the preset trigger condition includes following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
For example, from should from database obtain about the data state have the scheduled time cycle, such as a hour, One minute;When meeting the predetermined period of time, which should obtain the shape about the data from database certainly The state of the data is compared with the state of the data in memory for state, in turn, state comparison device, to be tied according to comparison Fruit is further processed.
Here, the predetermined period of time can be system intialization, can also be adjusted according to actual conditions.
For another example, from should from database obtain about the data state have scheduled acquisition condition, such as whenever this from Database is by the data real-time update of stateful variation in the primary database to should meet and predetermined obtain item when the database Part, state acquisition device from database from that should obtain state about the data, and in turn, state comparison device is by the data State is compared with the state of the data in memory, to be further processed according to comparison result.
Here, the predetermined acquisition condition can be system intialization, can also be adjusted according to actual conditions.
Those skilled in the art will be understood that above-mentioned preset trigger condition is only for example, other are existing or from now on may The preset trigger condition of appearance is such as applicable to the present invention, should also be included within the scope of the present invention, and herein with reference Mode is incorporated herein.
Here, the multi-party set device 1 is periodically or fixed condition, it will be in the reference data and memory in database Real time data be compared, there are sequence problems to lead to these fields when solving fields certain due to multi-party set database State does not meet expected problem, further ensures the accuracy of data in database, improves the usage experience of user.
Fig. 2 is the flow diagram of the method for multi-party set database of another aspect of the invention.
In step s 201, the multi-party selection of set device 1 needs the data of multi-party set.
Specifically, in step s 201, multi-party set device 1 is as needed, selects to need multi-party set in database Data select certain fields in database table such as according to operational needs, as the data for needing multi-party set.
For example, Party A wants to carry out set, then in step s 201, multi-party set to the field third in database with Party B Device 1 is by the field third as the data for needing multi-party set.
By taking an extension system as an example, which includes financial system and charge system, the two systems are required for Change some upper down status for promoting unit, it is assumed that the state is stored with field C in the database, which is used for table Whether show can show promotion message.For promoter when financial system is supplemented with money, financial system can change the state to A, on indicating Line;The promotion message leads to the remaining sum of the promoter when the user clicks when being zero, and charge system can change the state to B again, with Indicate offline.In step s 201, multi-party set device 1 is according to the financial system and the operational needs of charge system, selection Field C in the database, as the data for needing multi-party set.
Those skilled in the art will be understood that the mode of above-mentioned selection data is only for example, other are existing or from now on may be used The mode of selection data that can occur such as is applicable to the present invention, should also be included within the scope of the present invention, and herein with Way of reference is incorporated herein.
In step S202, multi-party set device 1 obtains the relevant data flow of set with the data.
Specifically, in step s 201,1 selected data of multi-party set device have with the relevant data flow of set, With the relevant data flow of the set of the data as caused by each set side, in step S202, multi-party set device 1 is for example By the interaction with each set side, such as one or many application programming interfaces (API) for calling each set sides to be provided or The communication mode of other agreements obtains the relevant data flow of set with the data.
Example is connected, in extension system, the operation behavior of promoter or user, such as supplement with money, click some promotion message, Some daily record datas are will produce, such as financial data stream, charging click data flow, budget data stream, these data flows are pushed away with this The set of the upper down status of wide unit is related, and in step S202, multi-party set device 1 passes through the friendship with the extension system Mutually, such as the application programming interfaces (API) provided by one or many calling extension systems or other communication parties arranged Formula obtains these data flows.
Those skilled in the art will be understood that the mode of above-mentioned acquisition data flow is only for example, other are existing or from now on The mode for the acquisition data flow being likely to occur such as is applicable to the present invention, should also be included within the scope of the present invention, and This is incorporated herein by reference.
Those skilled in the art should also be understood that above-mentioned data flow is only for example, other are existing or are likely to occur from now on The relevant data flow of the set with data be such as applicable to the present invention, should also be included within the scope of the present invention, and This is incorporated herein by reference.
In step S203, multi-party set device 1 combines the logic of multi-party set database according to the data flow, Determine the state of the data.
Specifically, each set side's aaset bit database has corresponding logic, for example, when changing the number According to state, in step S203, multi-party set device 1 is relevant according to the acquired set with data in step S202 Data flow, and the logic of multi-party set database is combined, determine the state of the data.
Precedent is connect, which includes financial system and charge system, the two systems, which are required for changing some, to be pushed away The upper down status of wide unit, it is assumed that the state is stored with field C in the database, and the state is for indicating whether energy exhibition Existing promotion message.For promoter when financial system is supplemented with money, financial system can change the state to A, to indicate to reach the standard grade;When user's point It hits the promotion message to lead to the remaining sum of the promoter when being zero, charge system can change the state to B, to indicate offline again.This Sample, it is necessary in conjunction with the processing logic of financial system and charge system.Therefore, in step S202, multi-party set device 1 obtains With the relevant finance stream of set, charging click steam, in step S203, multi-party set device 1 is according to above-mentioned data flow, by comprehensive Conjunction, which is supplemented with money, transfers accounts and clicks behavior, in conjunction with financial system and charge system logic, add up to the current balance of promoter or Operation is deducted, and judges whether the remaining sum of current promoter is more than zero, carrys out the state of set database.
Those skilled in the art will be understood that the mode of above-mentioned determining data mode is only for example, other are existing or modern The mode for the determination data mode being likely to occur afterwards is such as applicable to the present invention, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
In step S204, multi-party set device 1 carries out primary database set according to the state of the data.
Specifically, multi-party set device 1 in step S203 determine data state after, in step S204, in many ways The data modification in primary database is the state of the determination, to carry out primary database set accordingly by set device 1.
Connect example, if in step S203, multi-party set device 1 according to set it is relevant finance stream, charging click steam, In conjunction with financial system and charge system logic, judge that the remaining sum of current promoter is more than zero, then in step S204, multi-party set The status set of the corresponding field C of this in primary database is A by device 1, and to realize primary database set, state A expressions can To show corresponding promotion message.
Those skilled in the art will be understood that the mode of above-mentioned primary database set is only for example, other are existing or modern The mode for the primary database set being likely to occur afterwards is such as applicable to the present invention, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
Here, the multi-party set device 1 introduces the relevant data flow of set with data, and combine multi-party set database Logic, determine the state of data, to carry out primary database set, improve the accuracy rate and efficiency of set, improve user Usage experience.
Preferably, this method further includes the steps that the state of the data is updated to memory (hereinafter referred to as " step S205 ", not shown).
Specifically, after the state for determining the data in step S203 in multi-party set device 1, in step S205, The state of the data is also updated to memory by multi-party set device 1 in real time, so that the data mode in the memory is implemented Update, it is convenient subsequently to the data check in database.
Connect example, in step S203, multi-party set device 1 according to set it is relevant finance stream, charging click steam, knot Financial system and charge system logic are closed, judges that the remaining sum of current promoter is more than zero, the state of the corresponding field C is A; In step S205, the state A of field C is also updated to memory by multi-party set device 1 in real time, and state A expressions can show Corresponding promotion message.
Here, the multi-party set device 1 keeps the real-time update of the data in memory, to facilitate subsequently in database Data are verified, and the accuracy of data in database is further ensured.
It is highly preferred that this method further include the steps that determine it is corresponding with the primary database from database (hereinafter referred to as It is " step S206 ", not shown), obtain the state from database about the data, and with the data described interior The step of state in depositing is compared (hereinafter referred to as " step S207 ", not shown) and if it is inconsistent, according to the data State in the memory, the step of state of data described in the primary database is updated (hereinafter referred to as " step S208 ", not shown).
Wherein, in step S206, multi-party set device 1 determines corresponding with the primary database from database.
For example, in step S206, for multi-party set device 1 from multiple databases, determination is corresponding with the primary database It, should be from database and primary database data having the same and its corresponding state from database.For another example, in step S206 In, the data in the primary database are synchronized to another database by multi-party set device 1, and using another database as with this Primary database is corresponding from database.
Here, primary database for writing data, is served only for reading data from database, to mitigate the performance pressure of primary database Power increases the efficiency of processing.
Then, in step S207, multi-party set device 1 obtains this from database about the state of the data, and will The state is compared with state of the data in the memory.
Specifically, due to from database and primary database data having the same and its corresponding state, in step In S207, multi-party set device 1 should obtain the state about the data from database certainly, meanwhile, the multi-party set device 1 The state about the data is obtained from memory, and two states are compared.
For example, there are a data multiple states, multiple state to be for example known as the full dose state of the data, and with the shape of table Formula is stored in the primary database and is somebody's turn to do from database, and in step S207, multi-party set device 1 is obtained from being somebody's turn to do from database The full dose state of the data, and the full dose state is compared with the state of the data in memory.
If inconsistent, in step S208, state of the multi-party set device 1 according to the data in the memory is right The state of data described in the primary database is updated.
Specifically, if the data are from the state and its state consistency in memory in database, without processing; If the two state is inconsistent, in step S208, state of the multi-party set device 1 according to the data in the memory, to master The data carry out set again in database, are updated with the state to the data in the primary database.
For example, in the promotion message library of extension system, each plan (plan) has a corresponding status fields, should Field includes A and B two states.Charge system and operation system will carry out set to the field;Assuming that operation system is first sent out Order of losing one's life changes the status states to A, and then charge system, which is sent, orders the modification status states to B, therefore, the data In library, the expectation state of status is B.However, due to network delay, the order that charge system is sent first reaches database, industry It is arrived after the order that business system is sent, in this way, the state final status is exactly A, it is inconsistent with desired state B.
And in step S205, the order that multi-party set device 1 is sent according to operation system in real time is changed in the memory Status states are A, and after charge system sends order, the multi-party set device 1 is again in real time by the status in the memory Status modifier is B.Therefore, the state of the status is A in primary database, from database due to being synchronous with the primary database , wherein the state of status is also A, and the status states in memory are then B.In step S207, multi-party set device 1 Obtain the state A of the status fields from database from this, and by the state and the state B of the status fields in memory It is compared.The two is not consistent, then in step S208, multi-party set device 1 is according to the status fields in the memory State B, in primary database the status fields carry out set again, by the state of the status fields in the primary database It is updated to B.Finally, the state of the status fields and desired state consistency in the primary database.
Here, the reference data in database is compared the multi-party set device 1 with the real time data in memory, solution It is expected to there is a problem of that sequence problem causes these field status not meet when fields certain due to multi-party set database of having determined, The data for repairing error in time, further ensure the accuracy of data in database, improve the usage experience of user.And And the data due to only repairing error, pressure influence is smaller is write to database, further improves the efficiency of operation, is saved Resource is saved.
It is highly preferred that it from the step of database further includes by the primary database that the determination is corresponding with the primary database In data be synchronized to the sub-step (hereinafter referred to as " sub-step S2061 ", not shown) from database.
In sub-step S2061, the data in the primary database are synchronized to this from database, example by multi-party set device 1 Such as, when having data update in the primary database every time, in sub-step S2061, multi-party set device 1 is in real time by the master data The data real-time update of stateful variation in library extremely should be from database;It periodically will be in the primary database from database alternatively, being somebody's turn to do Data be synchronized to this from database so that should be from the database data synchronous with primary database holding and its corresponding shape State.Primary database is served only for reading data from database for writing data.
Here, the time cycle of the Timing Synchronization can be preset, can also be adjusted according to actual conditions.
Those skilled in the art will be understood that above-mentioned synchronization is only for example from the mode of database, other are existing or modern The synchronization being likely to occur afterwards is such as applicable to the present invention from the mode of database, should also be included within the scope of the present invention, And it is incorporated herein by reference herein.
Here, the data in primary database are synchronized to from database by the multi-party set device 1 in real time, it certainly should be from database Middle reading data alleviate the performance pressures of primary database, further increase to be compared with the real time data in memory The efficiency of processing.
Preferably, the step of obtaining the state from database about the data further includes when meeting predetermined trigger Condition, from sub-step (hereinafter referred to as " sub-step S2071 ", the figure for obtaining the state about the data from database Do not show).
Specifically, when meeting preset trigger condition, in sub-step S2071, multi-party set device 1 certainly should be from database The state about the data is obtained, for example, in sub-step S2071, multi-party 1 timing of set device should be loaded from database certainly The full dose state of the data, in turn, in step S2071, multi-party set device 1 exists the full dose state of the data and the data State in memory is compared, to be further processed according to comparison result.
It is highly preferred that the preset trigger condition includes following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
For example, from should from database obtain about the data state have the scheduled time cycle, such as a hour, One minute;When meeting the predetermined period of time, in sub-step S2071, multi-party set device 1 should be obtained from database certainly About the state of the data, in turn, in step S2071, multi-party set device 1 is by the state of the data and the data in memory In state be compared, to be further processed according to comparison result.
Here, the predetermined period of time can be system intialization, can also be adjusted according to actual conditions.
For another example, from should from database obtain about the data state have scheduled acquisition condition, such as whenever this from Database is by the data real-time update of stateful variation in the primary database to should meet and predetermined obtain item when the database Part, in sub-step S2071, multi-party set device 1 is from the state that should be obtained from database about the data, in turn, in step In rapid S2071, the state of the data is compared multi-party set device 1 with the state of the data in memory, with according to than Result is further processed.
Here, the predetermined acquisition condition can be system intialization, can also be adjusted according to actual conditions.
Those skilled in the art will be understood that above-mentioned preset trigger condition is only for example, other are existing or from now on may The preset trigger condition of appearance is such as applicable to the present invention, should also be included within the scope of the present invention, and herein with reference Mode is incorporated herein.
Here, the multi-party set device 1 is periodically or fixed condition, it will be in the reference data and memory in database Real time data be compared, there are sequence problems to lead to these fields when solving fields certain due to multi-party set database State does not meet expected problem, further ensures the accuracy of data in database, improves the usage experience of user.
It should be noted that the present invention can be carried out in the assembly of software and/or software and hardware, for example, this hair Application-specific integrated circuit (ASIC) can be used in bright each device or any other is realized similar to hardware device.In one embodiment In, software program of the invention can be executed by processor to realize steps described above or function.Similarly, of the invention Software program (including relevant data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory, Magnetic or optical driver or floppy disc and similar devices.In addition, hardware can be used to realize in some steps or function of the present invention, example Such as, coordinate to execute the circuit of each step or function as with processor.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case of without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Profit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent requirements of the claims Variation includes within the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This Outside, it is clear that one word of " comprising " is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in system claims is multiple Unit or device can also be realized by a unit or device by software or hardware.The first, the second equal words are used for table Show title, and does not represent any particular order.
Although front is specifically shown and describes exemplary embodiment, it will be understood to those of skill in the art that It is that without departing substantially from the spirit and scope of claims, can be varied from terms of its form and details.Here Sought protection illustrates in the dependent claims.These of each embodiment are defined in following number clause With other aspects:
1, a kind of method for multi-party set database, wherein this approach includes the following steps:
Selection needs the data of multi-party set;
Obtain the relevant data flow of set with the data;
According to the data flow, and the logic of multi-party set database is combined, determines the state of the data;
According to the state of the data, primary database set is carried out.
2, the method for clause 1, wherein this method further includes:
The state of the data is updated to memory.
3, the method for clause 2, wherein this method further includes:
Determination is corresponding with the primary database from database;
Obtain the state from database about the data, and with state of the data in the memory into Row compares;
If inconsistent, according to state of the data in the memory, to the shape of data described in the primary database State is updated.
4, the method for clause 3, wherein determination is corresponding with the primary database to further include from the step of database:
Data in the primary database are synchronized to described from database.
5, the method for clause 3 or 4, wherein the step of obtaining the state from database about the data is also wrapped It includes:
When meeting preset trigger condition, from the state obtained from database about the data.
6, the method for clause 5, wherein the preset trigger condition includes following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
7, a kind of device for multi-party set database, wherein the device includes:
Device for the data for selecting to need multi-party set;
For obtaining and the device of the relevant data flow of the set of the data;
For according to the data flow, and the logic of multi-party set database is combined, determines the dress of the state of the data It sets;
For the state according to the data, the device of primary database set is carried out.
8, the device of clause 7, wherein the device further includes:
Device for the state of the data to be updated to memory.
9, the device of clause 8, wherein the device further includes:
For determining the device from database corresponding with the primary database;
For obtaining the state from database about the data, and the shape with the data in the memory The device that state is compared;
If for inconsistent, according to state of the data in the memory, to data described in the primary database The device that is updated of state.
10, the device of clause 9, wherein corresponding with the primary database for determination to further include from the device of database:
For the data in the primary database to be synchronized to the device from database.
11, the device of clause 9 or 10, wherein for obtaining the dress from database about the state of the data It sets and further includes:
Meet preset trigger condition for working as, from the device for obtaining the state about the data from database.
12, the device of clause 11, wherein the preset trigger condition includes following at least any one:
Predetermined period of time;
Predetermined acquisition condition.

Claims (12)

1. a kind of method for multi-party set database, wherein this approach includes the following steps:
Selection needs the data of multi-party set;
Obtain the relevant data flow of set with the data;
According to the data flow, and the logic of multi-party set database is combined, determines the state of the data;
According to the state of the data, primary database set is carried out.
2. according to the method described in claim 1, wherein, this method further includes:
After the state for determining the data, the state of the data is updated to memory.
3. according to the method described in claim 2, wherein, this method further includes:
Determination is corresponding with the primary database from database;
The state from database about the data is obtained, and is compared with state of the data in the memory It is right;
If inconsistent, according to state of the data in the memory, to the states of data described in the primary database into Row update.
4. according to the method described in claim 3, wherein it is determined that corresponding with the primary database also wrap from the step of database It includes:
Data in the primary database are synchronized to described from database.
5. method according to claim 3 or 4, wherein about the state of the data from database described in obtaining Step further includes:
When meeting preset trigger condition, from the state obtained from database about the data.
6. according to the method described in claim 5, wherein, the preset trigger condition includes following at least any one:
Predetermined period of time;
Predetermined acquisition condition.
7. a kind of device for multi-party set database, wherein the device includes:
Device for the data for selecting to need multi-party set;
For obtaining and the device of the relevant data flow of the set of the data;
For according to the data flow, and the logic of multi-party set database is combined, determines the device of the state of the data;
For the state according to the data, the device of primary database set is carried out.
8. device according to claim 7, wherein the device further includes:
For after the state for determining the data, the state of the data to be updated to the device of memory.
9. device according to claim 8, wherein the device further includes:
For determining the device from database corresponding with the primary database;
For obtaining the state from database about the data, and with state of the data in the memory into The device that row compares;
If for inconsistent, according to state of the data in the memory, to the shape of data described in the primary database The device that state is updated.
10. device according to claim 9, wherein for determining the dress from database corresponding with the primary database It sets and further includes:
For the data in the primary database to be synchronized to the device from database.
11. device according to claim 9 or 10, wherein for obtain it is described from database about the data The device of state further includes:
Meet preset trigger condition for working as, from the device for obtaining the state about the data from database.
12. according to the devices described in claim 11, wherein the preset trigger condition includes 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 CN104778228A (en) 2015-07-15
CN104778228B true 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 (5)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Patent Citations (5)

* 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
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
CN104778228A (en) 2015-07-15

Similar Documents

Publication Publication Date Title
US20170102866A1 (en) System for high volume data analytic integration and channel-independent advertisement generation
CN110418200A (en) A kind of video recommendation method, device and terminal device
US10671573B2 (en) Generating data tables
CN103440285B (en) Large-scale mobile phone games system and database update method thereof
CN109446205B (en) Device and method for judging data state and device and method for updating data
US20160063043A1 (en) Versatile Data Model
CN111177476B (en) Data query method, device, electronic equipment and readable storage medium
CN108415964A (en) Tables of data querying method, device, terminal device and storage medium
US11016650B1 (en) Building data metric objects through user interactions with data marks of displayed visual representations of data sources
TW201616377A (en) Reorganizing and presenting data fields with erroneous inputs
EP2157535A1 (en) Fast search views over business objects
US11036718B2 (en) Linking entities in dynamic graphs
CN109816410A (en) The analysis method and device of advertisement major product audience
CN113641677A (en) Data processing method and device, electronic equipment and storage medium
CN104778228B (en) A kind of method and apparatus for multi-party set database
CN106201655B (en) Virtual machine distribution method and virtual machine distribution system
CN116227951A (en) Power distribution network project screening method, system, electronic equipment and storage medium
CN109189291A (en) Menu managing method and device
CN115729687A (en) Task scheduling method and device, computer equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115408546A (en) Time sequence data management method, device, equipment and storage medium
CN110362581A (en) A kind of data processing method and device
CN115080824A (en) Target word mining method and device, electronic equipment and storage medium
CN110808899B (en) Content sharing method, device, client, server and system
CN107665451A (en) A kind of method and device that product push is carried out based on client characteristics data

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