CN105160042A - Method and device for keeping user view data and data model data consistent - Google Patents

Method and device for keeping user view data and data model data consistent Download PDF

Info

Publication number
CN105160042A
CN105160042A CN201510688525.3A CN201510688525A CN105160042A CN 105160042 A CN105160042 A CN 105160042A CN 201510688525 A CN201510688525 A CN 201510688525A CN 105160042 A CN105160042 A CN 105160042A
Authority
CN
China
Prior art keywords
data
numerical value
change
user
model
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.)
Pending
Application number
CN201510688525.3A
Other languages
Chinese (zh)
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510688525.3A priority Critical patent/CN105160042A/en
Publication of CN105160042A publication Critical patent/CN105160042A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/904Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Embodiments of the invention provide a method and a device for keeping user view data and data model data consistent. The method comprises steps of monitoring the user view data and data model data every preset time interval, wherein the user view data and the data model data have a data dependence; and whether the user view data changes or the data model data changes, modifying the other of the user view data and the data model data through the dada dependence of the user view data and the data model data, keeping the user view data and the data model data consistent, and updating the data dependence of the user view data and the data model data finally. Through adoption of the method, workload is small, time and effort of developers are saved, when it is found that one of the user view data and the data model data changes, the other one of the two can be modified immediately, and furthermore, possibilities of application operation failure or even breakdown of the whole system caused by wrong trigger codes written by the developer are eliminated.

Description

A kind of method and apparatus keeping data consistent in User and data model
Technical field
The present invention relates to technical field of data processing, particularly relate to a kind of method and apparatus keeping data consistent in User and data model.
Background technology
When being engaged in web application exploitation, we can find that designing and developing of each page will realize a large amount of DOM (DocumentObjectModel, DOM Document Object Model) operation, we can carry out corresponding event trigger mechanism for corresponding DOM operation and carry out coding response design in the process of design usually.
When external user viewdata changes time, according to changing content, developer is needed manually to write corresponding trigger method, response is made in the change of control data module to User data set, upgraded by data in these trigger method triggering internal data models, in like manner, when the data that service logic triggers some data model change, also corresponding trigger method is manually write to realize the renewal of external user view, to keep the consistance of external user viewdata and internal data model data by developer.
So, a page application and development is got off, need developer whether to change to User data and data model data in real time to monitor, and write a large amount of codings when finding that User data and/or data model data change, workload is larger, expend the time and efforts that developer is more, and due to developer's reaction velocity limited, when being no matter when finding that User data or data model data change, developer is all needed to be changed by the another one of writing code to make in both after reflection, in both, another one cannot make corresponding change immediately when finding that User data or data model data change, simultaneously, because the Design Mode of each response trigger event is all very complicated, once the triggering coding that developer writes makes a mistake, fail to all event (especially some accidents, or small probability event) carry out correct coding response, system cannot make correct process, easily cause application operating failure, the collapse of whole system even may be caused time serious, there is higher potential safety hazard.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus keeping data consistent in User and data model, need developer whether to change to User data and data model data in real time to monitor to solve in prior art, and write a large amount of codings when finding that User data and/or data model data change, workload is larger, expend the time and efforts that developer is more, in both, another one cannot make corresponding change immediately when finding that User data or data model data change, once the triggering coding that developer writes makes a mistake, fail to carry out correct coding response to all events, system cannot make correct process, easily cause application operating failure, the collapse of whole system even may be caused time serious, there is the problem of higher potential safety hazard.
For achieving the above object, the embodiment of the present invention provides following technical scheme:
Keep a method for data consistent in User and data model, comprising:
User data and data model data are monitored every prefixed time interval simultaneously, wherein, between described User data and described data model data, there is data dependence relation;
If monitor described User data to change, then determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
If monitor described data model data to change, then determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
Upgrade described data dependence relation.
Wherein, describedly every prefixed time interval, monitoring is carried out to User data and data model data and comprises:
Obtain on User data Preset Time after obtain active user's viewdata, judge that whether described active user's viewdata is identical with described upper User data, if not identical, then determine that the User data of monitoring change, if identical, then determine that the User data of monitoring do not change, after described prefixed time interval, obtain next User data;
Obtain on data model data Preset Time after obtain current data model data, judge that whether described current data model data are identical with described upper data model data, if not identical, then determine that the data model data of monitoring change, if identical, then determine that the data model data of monitoring do not change, after described prefixed time interval, obtain next data model data.
Wherein, also comprise after the described numerical value by described first dependence data is revised as the numerical value of described first change data:
The User data changed described in judgement with to first rely on the numerical value of data modify after data model data whether identical;
If different, then again rely on the numerical value of data by described first and be revised as the numerical value that described first changes data, until described in the User data that change modify with the numerical value relying on data to first after data model data identical.
Wherein, also comprise after the described numerical value by described first dependence data is revised as the numerical value of described first change data:
Accumulative amendment described first of starting from scratch relies on the number of times of the numerical value of data, obtains first number;
If described first number is greater than preset first threshold value, then generate the first error message, by described first number zero.
Wherein, also comprise after the described numerical value by described second dependence data is revised as the numerical value of described second change data:
The data model data changed described in judgement with to second rely on the numerical value of data modify after User data whether identical;
If different, then again rely on the numerical value of data by described second and be revised as the numerical value that described second changes data, until described in the data model data that change modify with the numerical value relying on data to second after User data identical.
Wherein, also comprise after the described numerical value by described second dependence data is revised as the numerical value of described second change data:
Accumulative amendment described second of starting from scratch relies on the number of times of the numerical value of data, obtains second number;
If described first number is greater than default Second Threshold, then generate the second error message, by described second number zero.
Keep a device for data consistent in User and data model, comprising: monitoring modular, memory module, the first modified module, the second modified module and update module; Wherein,
Described monitoring modular, for monitoring User data and data model data every prefixed time interval simultaneously;
Described memory module, for storing the data dependence relation between described User data and described data model data;
Described first modified module, for when monitoring described User data and changing, determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
Described second modified module, for when monitoring described data model data and changing, determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
Described update module, for upgrading described data dependence relation.
Wherein, described monitoring modular comprises: the first monitoring means and the second monitoring means; Wherein,
Described first monitoring means, active user's viewdata is obtained after Preset Time for User data on obtaining, judge that whether described active user's viewdata is identical with described upper User data, if not identical, then determine that the User data of monitoring change, if identical, then determine that the User data of monitoring do not change, after prefixed time interval, obtain next User data;
Described second monitoring means, current data model data are obtained after Preset Time for data model data on obtaining, judge that whether described current data model data are identical with described upper data model data, if not identical, then determine that the data model data of monitoring do not change, if identical, then determine that the data model data of monitoring do not change, after described prefixed time interval, obtain next data model data.
Wherein, in described maintenance User and data model, the device of data consistent, also comprises: the first judge module and/or the second judge module; Wherein,
Described first judge module, for to rely on described first at described first modified module the numerical value of data be revised as described first change the numerical value of data after, the User data changed described in judgement modify with the numerical value relying on data to first after data model data whether identical; If different, then again rely on the numerical value of data by described first and be revised as the numerical value that described first changes data, until described in the User data that change modify with the numerical value relying on data to first after data model data identical;
Described second judge module, for to rely on described second at described second modified module the numerical value of data be revised as described second change the numerical value of data after, the data model data changed described in judgement modify with the numerical value relying on data to second after User data whether identical; If different, then again rely on the numerical value of data by described second and be revised as the numerical value that described second changes data, until described in the data model data that change modify with the numerical value relying on data to second after User data identical.
Wherein, in described maintenance User and data model, the device of data consistent, also comprises: the first counting module and/or the second counting module; Wherein,
Described first counting module, relies on the number of times of the numerical value of data, obtains first number for accumulative amendment described first of starting from scratch; If described first number is greater than preset first threshold value, then generate the first error message, by described first number zero;
Described second counting module, relies on the number of times of the numerical value of data, obtains second number for accumulative amendment described second of starting from scratch; If described first number is greater than default Second Threshold, then generate the second error message, by described second number zero.
Based on technique scheme, the method and apparatus of data consistent in the maintenance User that the embodiment of the present invention provides and data model, User data and data model data are monitored every prefixed time interval simultaneously, wherein, between described User data and described data model data, there is data dependence relation, if monitor User data to change, then determine the numerical value of the first change data and these the first change data changed in the User data changed, and according to data dependence relation search in data model data with this first change that data-dependent relies first rely on data, this first is relied on numerical value of data and be revised as and this first identical numerical value changing data, if monitor data model data to change, then determine the numerical value of the second change data and these the second change data changed in the data model data changed, and according to data dependence relation search in User data with this second change that data-dependent relies second rely on data, this second is relied on numerical value of data and be revised as and second change the identical numerical value of the numerical value of data with this, upgrade the data dependence relation between User data and data model data.User data and data model data are monitored every prefixed time interval simultaneously, once detect that one of them changes, immediately relative change is carried out to another according to data dependence relation between the two, in real time whether User data and data model data are changed without the need to developer and monitor, also a large amount of codings is write without the need to developer when finding that User data and/or data model data change, control data model and/or User make response, workload is less, save the time and efforts of developer, when finding that the one in User data and data model data changes, another one can be made immediately to make corresponding change, simultaneously, due to without the need to writing a large amount of codings when finding that User data and/or data model data change, also eliminate the triggering code error because developer writes and cause application operating failure, even cause the possibility that whole system is collapsed.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
The method flow diagram of data consistent in the maintenance User that Fig. 1 provides for the embodiment of the present invention and data model;
In the maintenance User that Fig. 2 provides for the embodiment of the present invention and data model data consistent method in the method flow diagram of User data being monitored every prefixed time interval;
In the maintenance User that Fig. 3 provides for the embodiment of the present invention and data model data consistent method in the method flow diagram of data model data being monitored every prefixed time interval;
Fig. 4 shows in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides and judges the method flow diagram whether data model data are updated successfully;
In the maintenance User that Fig. 5 provides for the embodiment of the present invention and data model data consistent method in generate the method flow diagram of the first error message;
In the maintenance User that Fig. 6 provides for the embodiment of the present invention and data model data consistent method in judge the method flow diagram whether User data are updated successfully;
In the maintenance User that Fig. 7 provides for the embodiment of the present invention and data model data consistent method in generate the method flow diagram of the second error message;
The system chart of the device of data consistent in the maintenance User that Fig. 8 provides for the embodiment of the present invention and data model;
In the maintenance User that Fig. 9 provides for the embodiment of the present invention and data model data consistent device in the structured flowchart of monitoring modular 100;
Another system chart of the device of data consistent in the maintenance User that Figure 10 provides for the embodiment of the present invention and data model;
The another system chart of the device of data consistent in the maintenance User that Figure 11 provides for the embodiment of the present invention and data model.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The method flow diagram of data consistent in the maintenance User that Fig. 1 provides for the embodiment of the present invention and data model, User data and data model data are monitored every prefixed time interval simultaneously, once detect that one of them changes, immediately relative change is carried out to another according to data dependence relation between the two, in real time whether User data and data model data are changed without the need to developer and monitor, also a large amount of codings is write without the need to developer when finding that User data and/or data model data change, control data model and/or User make response, workload is less, save the time and efforts of developer, when finding that the one in User data and data model data changes, another one can be made immediately to make corresponding change, simultaneously, due to without the need to writing a large amount of codings when finding that User data and/or data model data change, also eliminate the triggering code error because developer writes and cause application operating failure, even cause the possibility that whole system is collapsed, with reference to Fig. 1, in this maintenance User and data model, the method for data consistent can comprise:
Step S100: simultaneously monitor User data and data model data every prefixed time interval, wherein, has data dependence relation between described User data and described data model data;
Optionally, can by obtaining active user's viewdata after the Preset Time of User data on obtaining, judge that whether the active user's viewdata obtained is identical with upper User data, judge whether the User data monitored change.
If judge, the active user's viewdata obtained is not identical with upper User data, then can determine that the User data of monitoring change, otherwise, if judge, the active user's viewdata obtained is identical with upper User data, then can determine that the User data of monitoring do not change, after prefixed time interval, obtain next User data.
Optionally, can by obtaining current data model data after the Preset Time of data model data on obtaining, judge that whether the current data model data obtained are identical with upper data model data, judge whether the data model data monitored change.
If judge, the current data model data obtained are not identical with upper data model data, then can determine that the data model data of monitoring change, otherwise, if judge, the current data model data obtained are identical with upper data model data, then can determine that the data model data of monitoring do not change, after prefixed time interval, obtain next data model data.
Step S110: judge whether that monitoring described User data changes; If monitor, then enter step S120, if do not monitor, then enter step S150;
Step S120: determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
If monitor User data to change, then by determining the numerical value of the first change data and these the first change data changed in these User data, according to the data dependence relation had between User data and data model data search in data model data with this first change that data-dependent relies first rely on data, this first numerical value relying on data is revised as the numerical value of these the first change data, data model data are revised accordingly, user's viewdata and data model data are consistent.
Wherein, when User data occur change into data increase time, determine that first of this increase changes data by comparison active user viewdata and upper User data, and can according to the data dependence relation had between User data and data model data, to determine in data model data first not to change the bad data of data-dependent with this, namely find in data model data with this first change data-dependent rely first relies on data for sky, so, first numerical value relying on data in data model is revised as the numerical value of these the first change data, namely be the numerical value numerical value of the empty data in data model being revised as these the first change data, namely be equivalent in data model, add this first change data, thus ensure that User data and data model data are consistent.
When User data occur change into data reduce time, determine that first of this minimizing changes data by comparison active user viewdata and upper User data, and do not existed in User data due to the first data of this minimizing, therefore, in User data, the first numerical value changing data of this minimizing is zero, therefore, according to the data dependence relation had between User data and data model data, find in data model data with this first change data-dependent rely first rely on data after, first numerical value relying on data in data model is revised as the numerical value of these the first change data, namely be that the first numerical value relying on data in this data model is revised as zero, namely be equivalent to by from this data model, these the first dependence data be left out, thus ensure that User data and data model data are consistent.
When User data occur change into data change time, then determine that first of this change changes data by comparison active user viewdata and upper User data, and according to the data dependence relation had between User data and data model data, find in data model data with this first change that data-dependent relies first rely on data, directly this first numerical value relying on data is revised as the numerical value of these the first change data, ensures that User data and data model data are consistent.
Optionally, due to the numerical value successfully numerical value that first relies on data being revised as the first change data surely that differs, therefore, after the numerical value that first relies on data is revised as the numerical operation of the first change data by execution, whether the data model data after can also modifying with the numerical value relying on data to first by judging these User data changed are identical, judge whether the numerical value successfully numerical value that first relies on data being revised as the first change data.
If the data model data after judging these User data changed and modifying to the numerical value of the first dependence data are different, then illustrating fails is revised as the numerical value of the first change data by the numerical value that first relies on data, otherwise, if the data model data after judging these User data changed and modifying to the numerical value of the first dependence data are identical, then the numerical value successfully numerical value that first relies on data being revised as the first change data is described.
Optionally, if the data model data after judging these User data changed and modifying to the numerical value of the first dependence data are different, fail and the numerical value that first relies on data is revised as the numerical value of the first change data, then again can will perform and rely on first the operation that the numerical value of data is revised as the numerical value of the first change data, until judge the User data changed modify with the numerical value relying on data to first after data model data identical.
Optionally, can after the numerical value that first relies on data be revised as the numerical operation of the first change data by execution, accumulative amendment first of starting from scratch relies on the number of times of the numerical value of data, obtain first number, if rely on the amendment number of times of data to first, namely the numerical value of first number is greater than predetermined threshold value, then can think that this first dependence data modification is failed, generate the first error message, by this first number zero.
Step S130: judge whether that monitoring described data model data changes; If monitor, then enter step S140, if do not monitor, then enter step S150;
Step S140: determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
If monitor data model data to change, then by determining the numerical value of the first change data and these the first change data changed in these data model data, according to the data dependence relation had between data model data and data model data search in data model data with this first change that data-dependent relies first rely on data, this first numerical value relying on data is revised as the numerical value of these the first change data, data model data are revised accordingly, data model data and data model data are consistent.
Wherein, when data model data occur change into data increase time, when data model data occur change into data reduce time, with occur when data model data change into data change time, User data and data model data are consistent used method and principle, respectively with occur when User data change into data increase time, when User data occur change into data reduce time, with occur when User data change into data change time identical, repeat no more herein.
Optionally, due to the numerical value successfully numerical value that second relies on data being revised as the second change data surely that also differs, therefore, after the numerical value that second relies on data is revised as the numerical operation of the second change data by execution, whether the User data after also can also modifying with the numerical value relying on data to second by judging these data model data changed are identical, judge whether the numerical value successfully numerical value that second relies on data being revised as the second change data.
If the User data after judging these data model data changed and modifying to the numerical value of the second dependence data are different, then illustrating fails is revised as the numerical value of the second change data by the numerical value that second relies on data, otherwise, if the User data after judging these data model data changed and modifying to the numerical value of the second dependence data are identical, then the numerical value successfully numerical value that second relies on data being revised as the second change data is described.
Optionally, if the User data after judging these data model data changed and modifying to the numerical value of the second dependence data are different, fail and the numerical value that second relies on data is revised as the numerical value of the second change data, then again can will perform and rely on second the operation that the numerical value of data is revised as the numerical value of the second change data, until judge the data model data changed modify with the numerical value relying on data to second after User data identical.
Optionally, can after the numerical value that second relies on data be revised as the numerical operation of the second change data by execution, accumulative amendment second of starting from scratch relies on the number of times of the numerical value of data, obtain second number, if rely on the amendment number of times of data to second, namely the numerical value of second number is greater than predetermined threshold value, then can think that this second dependence data modification is failed, generate the second error message, by this second number zero.
Step S150: upgrade described data dependence relation.
No matter whether monitor User data and/or data model data change, after User data and data model data being monitored, all upgrade the data dependence relation between User data and data model data at every turn.Because monitor User data and data model data every prefixed time interval simultaneously, therefore, also can think, for each default indirect interval upgrades the data dependence relation between User data and data model data.
Based on technique scheme, the method of data consistent in the maintenance User that the embodiment of the present invention provides and data model, User data and data model data are monitored every prefixed time interval simultaneously, wherein, between described User data and described data model data, there is data dependence relation, if monitor User data to change, then determine the numerical value of the first change data and these the first change data changed in the User data changed, and according to data dependence relation search in data model data with this first change that data-dependent relies first rely on data, this first is relied on numerical value of data and be revised as and this first identical numerical value changing data, if monitor data model data to change, then determine the numerical value of the second change data and these the second change data changed in the data model data changed, and according to data dependence relation search in User data with this second change that data-dependent relies second rely on data, this second is relied on numerical value of data and be revised as and second change the identical numerical value of the numerical value of data with this, upgrade the data dependence relation between User data and data model data.User data and data model data are monitored every prefixed time interval simultaneously, once detect that one of them changes, immediately relative change is carried out to another according to data dependence relation between the two, in real time whether User data and data model data are changed without the need to developer and monitor, also a large amount of codings is write without the need to developer when finding that User data and/or data model data change, control data model and/or User make response, workload is less, save the time and efforts of developer, when finding that the one in User data and data model data changes, another one can be made immediately to make corresponding change, simultaneously, due to without the need to writing a large amount of codings when finding that User data and/or data model data change, also eliminate the triggering code error because developer writes and cause application operating failure, even cause the possibility that whole system is collapsed.
Optionally, Fig. 2 shows the method flow diagram of monitoring User data every prefixed time interval in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides, with reference to Fig. 2, can should comprise the method that User data are monitored every prefixed time interval:
Step S200: judge whether to reach prefixed time interval;
Step S210: if reach, then obtain User data;
Because monitor User data every prefixed time interval, therefore, obtain User data every prefixed time interval, in acquisition after User data, if reach prefixed time interval, then obtain active user's viewdata.
Step S220: judge that whether these User data obtained are identical with the User data that last time obtains;
Judge that whether these User data obtained are identical with the User data that last time obtains, namely judge that whether the active user's viewdata obtained is identical with upper User data.
Step S230: if not identical, then determine that the User data of monitoring change;
If the active user's viewdata obtained is not identical with upper User data, then can determine that the User data of monitoring change.
Step S240: if identical, then determine that the User data of monitoring do not change, return step S200.
If judge, the active user's viewdata obtained is identical with upper User data, then can determine that the User data of monitoring do not change, obtain next User data after prefixed time interval.
Optionally, Fig. 3 shows the method flow diagram of monitoring data model data every prefixed time interval in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides, with reference to Fig. 3, can should comprise the method that data model data is monitored every prefixed time interval:
Step S300: judge whether to reach prefixed time interval;
Step S310: if reach, then obtain data model data;
Because monitor data model data every prefixed time interval, therefore, obtain data model data every prefixed time interval, in acquisition after data model data, if reach prefixed time interval, then obtain current data model data.
Step S320: judge that whether these data model data obtained are identical with the data model data that last time obtains;
Judge that whether these data model data obtained are identical with the data model data that last time obtains, namely judge that whether the current data model data obtained are identical with upper data model data.
Step S330: if not identical, then determine that the data model data of monitoring change;
If judge, the current data model data obtained are not identical with upper data model data, then can determine that the data model data of monitoring change.
Step S340: if identical, then determine that the data model data of monitoring do not change, return step S300.
If judge, the current data model data obtained are identical with upper data model data, then can determine that the data model data of monitoring do not change, obtain next data model data after prefixed time interval.
Optionally, Fig. 4 shows in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides and judges the method flow diagram whether data model data are updated successfully, with reference to Fig. 4, this judges that the method whether data model data are updated successfully can comprise:
Step S400: the User data changed described in judgement with to first rely on the numerical value of data modify after data model data whether identical;
Optionally, due to the numerical value successfully numerical value that first relies on data being revised as the first change data surely that differs, therefore, after the numerical value that first relies on data is revised as the numerical operation of the first change data by execution, whether the data model data after can also modifying with the numerical value relying on data to first by judging these User data changed are identical, judge whether the numerical value successfully numerical value that first relies on data being revised as the first change data.
Step S410: if different, then be again revised as the numerical value that described first relies on data the numerical value that described first changes data, return step S400;
If the data model data after judging these User data changed and modifying to the numerical value of the first dependence data are different, then illustrating fails is revised as the numerical value of the first change data by the numerical value that first relies on data, return step 400, again judge the User data that change modify with the numerical value relying on data to first after data model data whether identical, until judge the User data changed modify with the numerical value relying on data to first after data model data identical.
Step S420: if identical, then end operation.
If the data model data after judging these User data changed and modifying to the numerical value of the first dependence data are identical, then the numerical value successfully numerical value that first relies on data being revised as the first change data is described, end operation.
Optionally, Fig. 5 shows the method flow diagram generating the first error message in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides, and with reference to Fig. 5, the method for this generation first error message can comprise:
Step S500: accumulative amendment described first of starting from scratch relies on the number of times of the numerical value of data, obtains first number;
Can after the numerical value that first relies on data be revised as the numerical operation of the first change data by execution, accumulative amendment first of starting from scratch relies on the number of times of the numerical value of data, obtain first number, namely the numerical value of this first number represent the number of times of modifying to these the first data relying on data.
Step S510: judge whether described first number is greater than preset first threshold value;
Judge that the numerical value of first number is greater than preset first threshold value, namely judge to exceed pre-determined number to the first amendment number of times relying on data.
Step S520: if be greater than, then generate the first error message, by described first number zero.
If the numerical value of first number is greater than predetermined threshold value, the amendment number of times namely relying on data to first exceedes pre-determined number, then can think and this first dependence data modification failure generate the first error message, then by this first time accumulative number zero, so that add up next time.
Optionally, Fig. 6 shows in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides and judges the method flow diagram whether User data are updated successfully, with reference to Fig. 6, this judges that the method whether User data are updated successfully can comprise:
Step S600: the data model data changed described in judgement with to second rely on the numerical value of data modify after User data whether identical;
Optionally, due to the numerical value successfully numerical value that second relies on data being revised as the second change data surely that differs, therefore, after the numerical value that second relies on data is revised as the numerical operation of the second change data by execution, whether the User data after also can also modifying with the numerical value relying on data to second by judging these data model data changed are identical, judge whether the numerical value successfully numerical value that second relies on data being revised as the second change data.
Step S610: if different, then be again revised as the numerical value that described second relies on data the numerical value that described second changes data, return step S600;
Optionally, if the User data after judging these data model data changed and modifying to the numerical value of the second dependence data are different, fail and the numerical value that second relies on data is revised as the numerical value of the second change data, then again can will perform and rely on second the operation that the numerical value of data is revised as the numerical value of the second change data, until judge the data model data changed modify with the numerical value relying on data to second after User data identical.
Step S620: if identical, then end operation.
If the User data after judging these data model data changed and modifying to the numerical value of the second dependence data are identical, then the numerical value successfully numerical value that second relies on data being revised as the second change data is described, end operation.
Optionally, Fig. 7 shows the method flow diagram generating the second error message in the method for data consistent in maintenance User and data model that the embodiment of the present invention provides, and with reference to Fig. 7, the method for this generation second error message can comprise:
Step S700: accumulative amendment described second of starting from scratch relies on the number of times of the numerical value of data, obtains second number;
Can after the numerical value that second relies on data be revised as the numerical operation of the second change data by execution, accumulative amendment second of starting from scratch relies on the number of times of the numerical value of data, obtain second number, namely the numerical value of this second number represent the number of times of modifying to these the second data relying on data.
Step S710: judge whether described second number is greater than default Second Threshold;
Judge that the numerical value of second number is greater than default Second Threshold, namely judge to exceed pre-determined number to the second amendment number of times relying on data.
Step S720: if be greater than, then generate the second error message, by described second number zero.
If the numerical value of second number is greater than predetermined threshold value, the amendment number of times namely relying on data to second exceedes pre-determined number, then can think and this second dependence data modification failure generate the second error message, then by this second time accumulative number zero, so that add up next time.
The method of data consistent in the maintenance User that the embodiment of the present invention provides and data model, User data and data model data are monitored every prefixed time interval simultaneously, once detect that one of them changes, immediately relative change is carried out to another according to data dependence relation between the two, in real time whether User data and data model data are changed without the need to developer and monitor, also a large amount of codings is write without the need to developer when finding that User data and/or data model data change, control data model and/or User make response, workload is less, save the time and efforts of developer, when finding that the one in User data and data model data changes, another one can be made immediately to make corresponding change, simultaneously, due to without the need to writing a large amount of codings when finding that User data and/or data model data change, also eliminate the triggering code error because developer writes and cause application operating failure, even cause the possibility that whole system is collapsed.
In the maintenance User provided the embodiment of the present invention below and data model, the device of data consistent is introduced, and in maintenance User described below and data model, the device of data consistent can mutual corresponding reference with the method for data consistent in above-described maintenance User and data model.
The system chart of the device of data consistent in the maintenance User that Fig. 8 provides for the embodiment of the present invention and data model, with reference to Fig. 8, in this maintenance User and data model, the device of data consistent can comprise: monitoring modular 100, memory module 200, first modified module 300, second modified module 400 and update module 500; Wherein,
Monitoring modular 100, for monitoring User data and data model data every prefixed time interval simultaneously;
Memory module 200, has data dependence relation for storing between described User data and described data model data;
First modified module 300, for when monitoring described User data and changing, determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
Second modified module 400, for when monitoring described data model data and changing, determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
Update module 500, for upgrading described data dependence relation.
Optionally, Fig. 9 shows the structured flowchart of monitoring modular 100 in the device of data consistent in maintenance User and data model that the embodiment of the present invention provides, with reference to Fig. 9, this monitoring modular 100 can comprise: the first monitoring means 110 and the second monitoring means 120; Wherein,
First monitoring means 110, active user's viewdata is obtained after Preset Time for User data on obtaining, judge that whether described active user's viewdata is identical with described upper User data, if not identical, then determine that the User data of monitoring change, if identical, then determine that the User data of monitoring do not change, after prefixed time interval, obtain next User data;
Second monitoring means 120, current data model data are obtained after Preset Time for data model data on obtaining, judge that whether described current data model data are identical with described upper data model data, if not identical, then determine that the data model data of monitoring do not change, if identical, then determine that the data model data of monitoring do not change, after described prefixed time interval, obtain next data model data.
Optionally, Figure 10 shows another system chart of the device of data consistent in maintenance User and data model that the embodiment of the present invention provides, with reference to Figure 10, in this maintenance User and data model, the device of data consistent can also comprise: the first judge module 600.
First judge module 600, for to rely on described first at the first modified module 300 numerical value of data be revised as described first change the numerical value of data after, the User data changed described in judgement modify with the numerical value relying on data to first after data model data whether identical; If different, then again rely on the numerical value of data by described first and be revised as the numerical value that described first changes data, until described in the User data that change modify with the numerical value relying on data to first after data model data identical.
Optionally, with reference to Figure 10, another system chart of the device of data consistent in the maintenance User that the embodiment of the present invention provides and data model, in this maintenance User and data model, the device of data consistent can also comprise: the second judge module 700.
Second judge module 700, for to rely on described second at the second modified module 400 numerical value of data be revised as described second change the numerical value of data after, the data model data changed described in judgement modify with the numerical value relying on data to second after User data whether identical; If different, then again rely on the numerical value of data by described second and be revised as the numerical value that described second changes data, until described in the data model data that change modify with the numerical value relying on data to second after User data identical.
Optionally, in the maintenance User that the embodiment of the present invention provides and data model, the device of data consistent can only include the first judge module 600, also the second judge module 700 can be only included, also not only the first judge module 600 can be comprised but also comprise the second judge module 700.
Optionally, Figure 11 shows the another system chart of the device of data consistent in maintenance User and data model that the embodiment of the present invention provides, with reference to Figure 11, in this maintenance User and data model, the device of data consistent can also comprise: the first counting module 800.
First counting module 800, relies on the number of times of the numerical value of data, obtains first number for accumulative amendment described first of starting from scratch; If described first number is greater than preset first threshold value, then generate the first error message, by described first number zero.
Because the first counting module 800 adds up the number of times that amendment first relies on the numerical value of data, therefore, only have when keeping the device of data consistent in User and data model to comprise the first judge module 600, in this maintenance User and data model data consistent device in just can comprise the first counting module 800.
Optionally, with reference to Figure 10, another system chart of the device of data consistent in the maintenance User that the embodiment of the present invention provides and data model, in this maintenance User and data model, the device of data consistent can also comprise: the second counting module 900.
Second counting module 900, relies on the number of times of the numerical value of data, obtains second number for accumulative amendment described second of starting from scratch; If described first number is greater than default Second Threshold, then generate the second error message, by described second number zero.
In like manner, because the second counting module 900 adds up the number of times that amendment second relies on the numerical value of data, therefore, only have when keeping the device of data consistent in User and data model to comprise the second judge module 700, in this maintenance User and data model data consistent device in just can comprise the second counting module 900.
The device of data consistent in the maintenance User that the embodiment of the present invention provides and data model, User data and data model data are monitored every prefixed time interval simultaneously, once detect that one of them changes, immediately relative change is carried out to another according to data dependence relation between the two, in real time whether User data and data model data are changed without the need to developer and monitor, also a large amount of codings is write without the need to developer when finding that User data and/or data model data change, control data model and/or User make response, workload is less, save the time and efforts of developer, when finding that the one in User data and data model data changes, another one can be made immediately to make corresponding change, simultaneously, due to without the need to writing a large amount of codings when finding that User data and/or data model data change, also eliminate the triggering code error because developer writes and cause application operating failure, even cause the possibility that whole system is collapsed.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For device disclosed in embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates see method part.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (10)

1. keep a method for data consistent in User and data model, it is characterized in that, comprising:
User data and data model data are monitored every prefixed time interval simultaneously, wherein, between described User data and described data model data, there is data dependence relation;
If monitor described User data to change, then determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
If monitor described data model data to change, then determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
Upgrade described data dependence relation.
2. method according to claim 1, is characterized in that, describedly carries out monitoring every prefixed time interval to User data and data model data and comprises:
Obtain on User data Preset Time after obtain active user's viewdata, judge that whether described active user's viewdata is identical with described upper User data, if not identical, then determine that the User data of monitoring change, if identical, then determine that the User data of monitoring do not change, after described prefixed time interval, obtain next User data;
Obtain on data model data Preset Time after obtain current data model data, judge that whether described current data model data are identical with described upper data model data, if not identical, then determine that the data model data of monitoring change, if identical, then determine that the data model data of monitoring do not change, after described prefixed time interval, obtain next data model data.
3. method according to claim 1, is characterized in that, also comprises after the described numerical value by described first dependence data is revised as the numerical value of described first change data:
The User data changed described in judgement with to first rely on the numerical value of data modify after data model data whether identical;
If different, then again rely on the numerical value of data by described first and be revised as the numerical value that described first changes data, until described in the User data that change modify with the numerical value relying on data to first after data model data identical.
4. method according to claim 3, is characterized in that, also comprises after the described numerical value by described first dependence data is revised as the numerical value of described first change data:
Accumulative amendment described first of starting from scratch relies on the number of times of the numerical value of data, obtains first number;
If described first number is greater than preset first threshold value, then generate the first error message, by described first number zero.
5. method according to claim 1, is characterized in that, also comprises after the described numerical value by described second dependence data is revised as the numerical value of described second change data:
The data model data changed described in judgement with to second rely on the numerical value of data modify after User data whether identical;
If different, then again rely on the numerical value of data by described second and be revised as the numerical value that described second changes data, until described in the data model data that change modify with the numerical value relying on data to second after User data identical.
6. method according to claim 5, is characterized in that, also comprises after the described numerical value by described second dependence data is revised as the numerical value of described second change data:
Accumulative amendment described second of starting from scratch relies on the number of times of the numerical value of data, obtains second number;
If described first number is greater than default Second Threshold, then generate the second error message, by described second number zero.
7. keep a device for data consistent in User and data model, it is characterized in that, comprising: monitoring modular, memory module, the first modified module, the second modified module and update module; Wherein,
Described monitoring modular, for monitoring User data and data model data every prefixed time interval simultaneously;
Described memory module, for storing the data dependence relation between described User data and described data model data;
Described first modified module, for when monitoring described User data and changing, determine that the first change data and described first changed in the User data changed change the numerical value of data, and according to described data dependence relation search in described data model data to change with described first that data-dependent relies first relies on data, the numerical value that described first relies on data is revised as the numerical value of described first change data;
Described second modified module, for when monitoring described data model data and changing, determine that the second change data and described second changed in the data model data changed change the numerical value of data, and according to described data dependence relation search in described User data to change with described second that data-dependent relies second relies on data, the numerical value that described second relies on data is revised as the numerical value of described second change data;
Described update module, for upgrading described data dependence relation.
8. device according to claim 7, is characterized in that, described monitoring modular comprises: the first monitoring means and the second monitoring means; Wherein,
Described first monitoring means, active user's viewdata is obtained after Preset Time for User data on obtaining, judge that whether described active user's viewdata is identical with described upper User data, if not identical, then determine that the User data of monitoring change, if identical, then determine that the User data of monitoring do not change, after prefixed time interval, obtain next User data;
Described second monitoring means, current data model data are obtained after Preset Time for data model data on obtaining, judge that whether described current data model data are identical with described upper data model data, if not identical, then determine that the data model data of monitoring do not change, if identical, then determine that the data model data of monitoring do not change, after described prefixed time interval, obtain next data model data.
9. device according to claim 7, is characterized in that, also comprises: the first judge module and/or the second judge module; Wherein,
Described first judge module, for to rely on described first at described first modified module the numerical value of data be revised as described first change the numerical value of data after, the User data changed described in judgement modify with the numerical value relying on data to first after data model data whether identical; If different, then again rely on the numerical value of data by described first and be revised as the numerical value that described first changes data, until described in the User data that change modify with the numerical value relying on data to first after data model data identical;
Described second judge module, for to rely on described second at described second modified module the numerical value of data be revised as described second change the numerical value of data after, the data model data changed described in judgement modify with the numerical value relying on data to second after User data whether identical; If different, then again rely on the numerical value of data by described second and be revised as the numerical value that described second changes data, until described in the data model data that change modify with the numerical value relying on data to second after User data identical.
10. device according to claim 9, is characterized in that, also comprises: the first counting module and/or the second counting module; Wherein,
Described first counting module, relies on the number of times of the numerical value of data, obtains first number for accumulative amendment described first of starting from scratch; If described first number is greater than preset first threshold value, then generate the first error message, by described first number zero;
Described second counting module, relies on the number of times of the numerical value of data, obtains second number for accumulative amendment described second of starting from scratch; If described first number is greater than default Second Threshold, then generate the second error message, by described second number zero.
CN201510688525.3A 2015-10-21 2015-10-21 Method and device for keeping user view data and data model data consistent Pending CN105160042A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510688525.3A CN105160042A (en) 2015-10-21 2015-10-21 Method and device for keeping user view data and data model data consistent

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510688525.3A CN105160042A (en) 2015-10-21 2015-10-21 Method and device for keeping user view data and data model data consistent

Publications (1)

Publication Number Publication Date
CN105160042A true CN105160042A (en) 2015-12-16

Family

ID=54800898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510688525.3A Pending CN105160042A (en) 2015-10-21 2015-10-21 Method and device for keeping user view data and data model data consistent

Country Status (1)

Country Link
CN (1) CN105160042A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301220A (en) * 2017-06-16 2017-10-27 百度在线网络技术(北京)有限公司 Method, device, equipment and the storage medium of data-driven view
CN107678774A (en) * 2017-10-09 2018-02-09 用友网络科技股份有限公司 Method, system, computer installation and the readable storage medium storing program for executing of response data modification
CN111367929A (en) * 2020-03-03 2020-07-03 腾讯科技(深圳)有限公司 Data management method and device and storage medium
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN114579915A (en) * 2022-05-05 2022-06-03 深圳市华曦达科技股份有限公司 Application page content refreshing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727322A (en) * 2009-11-19 2010-06-09 金蝶软件(中国)有限公司 Method and device for optimizing bill of material management interface
CN101872305A (en) * 2010-06-08 2010-10-27 用友软件股份有限公司 UI (User Interface) performance and service logic separation method and system
CN102325367A (en) * 2011-09-29 2012-01-18 用友软件股份有限公司 Data packet synchronizing device and method for client application
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
CN103902692A (en) * 2014-03-27 2014-07-02 乐得科技有限公司 Application interface updating method, device and system
WO2015019398A1 (en) * 2013-08-05 2015-02-12 株式会社野村総合研究所 Screen display program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727322A (en) * 2009-11-19 2010-06-09 金蝶软件(中国)有限公司 Method and device for optimizing bill of material management interface
CN101872305A (en) * 2010-06-08 2010-10-27 用友软件股份有限公司 UI (User Interface) performance and service logic separation method and system
CN102325367A (en) * 2011-09-29 2012-01-18 用友软件股份有限公司 Data packet synchronizing device and method for client application
CN103064860A (en) * 2011-10-21 2013-04-24 阿里巴巴集团控股有限公司 Database high availability implementation method and device
WO2015019398A1 (en) * 2013-08-05 2015-02-12 株式会社野村総合研究所 Screen display program
CN103902692A (en) * 2014-03-27 2014-07-02 乐得科技有限公司 Application interface updating method, device and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301220A (en) * 2017-06-16 2017-10-27 百度在线网络技术(北京)有限公司 Method, device, equipment and the storage medium of data-driven view
CN107301220B (en) * 2017-06-16 2020-12-11 百度在线网络技术(北京)有限公司 Method, device and equipment for data driving view and storage medium
CN107678774A (en) * 2017-10-09 2018-02-09 用友网络科技股份有限公司 Method, system, computer installation and the readable storage medium storing program for executing of response data modification
CN111367929A (en) * 2020-03-03 2020-07-03 腾讯科技(深圳)有限公司 Data management method and device and storage medium
CN111367929B (en) * 2020-03-03 2023-03-28 腾讯科技(深圳)有限公司 Data management method and device and storage medium
CN111880860A (en) * 2020-07-28 2020-11-03 北京浪潮数据技术有限公司 Service processing method, device and related equipment
CN114579915A (en) * 2022-05-05 2022-06-03 深圳市华曦达科技股份有限公司 Application page content refreshing method and device

Similar Documents

Publication Publication Date Title
CN105160042A (en) Method and device for keeping user view data and data model data consistent
CN106569847B (en) Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network
CN107608710B (en) Software project construction task configuration method and device based on Jenkins tool
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
CN102662697B (en) Software upgrading method and device
JP5039428B2 (en) Programmable controller and PLC system
CN102147747B (en) The system and method for the upgrading path strengthened
CN103761122A (en) Chip firmware updating method and system
CN101815988A (en) Firmware image update and management
CN112099845A (en) Software version updating method, server, vehicle, and computer storage medium
CN109639489A (en) A kind of RabbitMQ clustered deploy(ment) method, system, equipment and medium
CN104166577A (en) Method and device for upgrading system of mobile terminal
CN110633091A (en) Electronic module and software wireless upgrading method thereof
CN109814873B (en) Code publishing method and device
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
CN112181455B (en) Online upgrading method of microcontroller, microcontroller and storage medium
CN110673867A (en) CPLD online upgrading method, device and system
CN113434467B (en) Network file transmission method, device and computer readable storage medium
CN110737548A (en) Data request method and server
CN105391755A (en) Method and device for processing data in distributed system, and system
CN115033261A (en) Program updating method, device, equipment and storage medium
CN100543676C (en) The method of firmware update
CN103106089B (en) A kind of upgrade method of intelligent platform management controller and system
CN104375863A (en) Program online upgrading method in embedded system
CN109947454B (en) Data processing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20151216