CN106294769A - Method, system and device for synchronizing engineering data - Google Patents

Method, system and device for synchronizing engineering data Download PDF

Info

Publication number
CN106294769A
CN106294769A CN201610658456.6A CN201610658456A CN106294769A CN 106294769 A CN106294769 A CN 106294769A CN 201610658456 A CN201610658456 A CN 201610658456A CN 106294769 A CN106294769 A CN 106294769A
Authority
CN
China
Prior art keywords
engineering
engineering equipment
equipment information
information
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610658456.6A
Other languages
Chinese (zh)
Other versions
CN106294769B (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201610658456.6A priority Critical patent/CN106294769B/en
Publication of CN106294769A publication Critical patent/CN106294769A/en
Application granted granted Critical
Publication of CN106294769B publication Critical patent/CN106294769B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The invention discloses a method, a system and a device for synchronizing engineering data. Wherein, the method comprises the following steps: under the condition of starting synchronous engineering equipment information, reading at least one piece of engineering equipment information from a memory database, wherein any piece of engineering equipment information is stored in the memory database in a key-value pair mode; synchronizing all the engineering equipment information in the memory database to a storage database, and/or synchronizing the updated engineering equipment information in the memory database to the storage database in real time, wherein any piece of engineering equipment information stored in the memory database is stored to the storage database as an engineering record. The invention solves the technical problem that the memory database and the storage database can not be synchronized in real time due to the rapid increase of unit operation data when a client or a server directly operates the database in the prior art.

Description

The mthods, systems and devices of Simultaneous Engineering data
Technical field
The present invention relates to database technical field, in particular to method, system and the dress of a kind of Simultaneous Engineering data Put.
Background technology
The Central air-conditioning unit being distributed throughout the country is monitored by Gree long-distance intelligent service centre, it is achieved that data Gather, store, analyze the functions such as application.Along with continuing to increase of central air-conditioning demand, monitoring unit quantity the most quickly increases Long.Therefore, data storage is faced with huge challenge with analyzing.
Each central air-conditioning is set as one by Intelligent Service center as an engineering, the unit that air-conditioning is comprised Standby.Currently, comprise crew base data (engineering, facility information) in data base, data unit operation, client user operate letter The data such as breath, machine group analysis information.The sharp increase of unit operation array can reduce the performance of data base, especially when client or During the operations such as data base is directly increased, deletes, revises by person's server, inquiry, further increase the operating pressure of data base. The most often there are the problems such as time delay in engineering, the operation of facility information frequently so that server cannot obtain quickly and accurately Information;Engineering equipment information can not be modified timely, and the data of storage are incorrect, have time delay etc., further affect Client is to the correctness of user display data and real-time.
When directly operating data base for client in prior art or server, data unit operation is drastically Increase make memory database and storage data base can not the problem of real-time synchronization, effective solution is the most not yet proposed.
Summary of the invention
Embodiments provide the mthods, systems and devices of a kind of Simultaneous Engineering data, at least to solve existing skill When in art, data base is directly operated by client or server, the sharp increase of data unit operation makes memory database Data base can not the technical problem of real-time synchronization with storage.
An aspect according to embodiments of the present invention, it is provided that a kind of method of Simultaneous Engineering data, including:
In the case of starting Simultaneous Engineering facility information, from memory database, read at least one engineering equipment letter Breath, wherein, stores any one engineering equipment information in the way of key-value pair in memory database;By in memory database All engineering equipment synchronizing information to storing data base, and/or, memory database will occur the engineering equipment information updated real Time be synchronized to store data base, wherein, any one the engineering equipment information being stored in memory database is as an engineering Record stores to storage data base.
Another aspect according to embodiments of the present invention, additionally provides the system of a kind of Simultaneous Engineering data, including:
Memorizer, for storing the real-time update data of engineering equipment information;Real-time update equipment, is used for obtaining memorizer Real-time update data, and resolve real-time update data, obtain the operational order after resolving, and update storage according to operational order Engineering equipment information in data base;Start more new equipment, all engineering equipments letter in the queue obtaining memory database Breath, and by engineering equipment information updating to storage data base.
Another aspect according to embodiments of the present invention, additionally provides the device of a kind of Simultaneous Engineering data, including:
Read module, for, in the case of starting Simultaneous Engineering facility information, reading at least one from memory database Bar engineering equipment information, wherein, stores any one engineering equipment information in the way of key-value pair in memory database;Update Module, is used for all engineering equipment synchronizing information in memory database to storing data base, and/or, by memory database The middle engineering equipment information real-time synchronization occurring to update is to storing data base, and wherein, be stored in memory database is any one Bar engineering equipment information stores to storage data base as an engineering record.
In embodiments of the present invention, by after Simultaneous Engineering facility information starts, with key in the memory database of reading The engineering equipment information that mode is stored by value, and by all engineering equipment synchronizing information in this memory database to storage data In storehouse or by memory database occur update engineering equipment information updating to storage data base in, reached memory database with The purpose of the synchronization of storage data base, it is achieved thereby that accelerate the access speed of server, promotes the technology of the performance of server Effect, and then when solving that in prior art, data base is directly operated by client or server, data unit operation Sharp increase makes the memory database can not the technical problem of real-time synchronization with storage data base.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, this Bright schematic description and description is used for explaining the present invention, is not intended that inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the method flow diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 2 is that the startup of a kind of optional Simultaneous Engineering data according to embodiments of the present invention updates flow chart;
Fig. 3 is the real-time update flow chart of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 4 is the real-time update flow chart of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 5 is the system structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 6 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 7 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 8 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Fig. 9 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Figure 10 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Figure 11 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention;
Figure 12 is the apparatus structure schematic diagram of a kind of optional Simultaneous Engineering data according to embodiments of the present invention.
Detailed description of the invention
In order to make those skilled in the art be more fully understood that the present invention program, below in conjunction with in the embodiment of the present invention Accompanying drawing, is clearly and completely described the technical scheme in the embodiment of the present invention, it is clear that described embodiment is only The embodiment of a present invention part rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under not making creative work premise, all should belong to the model of present invention protection Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " Two " it is etc. for distinguishing similar object, without being used for describing specific order or precedence.Should be appreciated that so use Data can exchange in the appropriate case, in order to embodiments of the invention described herein can with except here diagram or Order beyond those described is implemented.Additionally, term " includes " and " having " and their any deformation, it is intended that cover Cover non-exclusive comprising, such as, contain series of steps or the process of unit, method, system, product or equipment are not necessarily limited to Those steps clearly listed or unit, but can include the most clearly listing or for these processes, method, product Or intrinsic other step of equipment or unit.
Embodiment 1
According to embodiments of the present invention, it is provided that the embodiment of the method for a kind of Simultaneous Engineering data, it should be noted that attached Step shown in the flow chart of figure can perform in the computer system of such as one group of computer executable instructions, and, though So show logical order in flow charts, but in some cases, can perform with the order being different from herein shown Or the step described.
Fig. 1 is Simultaneous Engineering data method according to embodiments of the present invention, as it is shown in figure 1, the method comprises the steps:
Step S102, in the case of starting Simultaneous Engineering facility information, reads at least one work from memory database Journey facility information, wherein, stores any one engineering equipment information in the way of key-value pair in memory database.
Concrete, in above-mentioned steps, all of engineering equipment information is stored in memory database with the form of key-value pair, Value corresponding to key word of the inquiry can read engineering equipment information from memory database.
It should be noted that above-mentioned memory database can be redis stores data base, from redis storage data base The mode of access data is: the value that keyword+keyword is corresponding.
As a kind of optional embodiment, by above-mentioned memory database for illustrating as a example by redis storage data base, Before starting Simultaneous Engineering facility information, the mode using key-value pair is needed to store engineering equipment information, it is possible to use hmset orders Order storage engineering equipment information, as performed statement " hmset project_id 1 engineering name Central Garden ", can be by engineering Being designated " 1 ", engineering name is that the engineering information of " Central Garden " is stored in redis storage data base, in above-mentioned statement, " project " represents engineering information, and unique mark " _ id " is first territory, and " 1 " is first value, and " engineering name " is second Individual territory, " Central Garden " is second value.In the case of starting Simultaneous Engineering facility information, can read in memory database Engineering equipment information, it is possible to use hmget order read engineering equipment information, as perform statement " hmget project_1_ Id engineering name ", engineering can be obtained and be designated unique mark and the engineering name information of " 1 ".
Step S104, by all engineering equipment synchronizing information in memory database to storing data base, and/or, by interior Deposit data storehouse occurs the engineering equipment information real-time synchronization updated to storing data base, wherein, be stored in memory database Any one engineering equipment information as an engineering record store to storage data base.
Concrete, in above-mentioned steps, in the case of starting Simultaneous Engineering facility information, in order to prevent server Start a period of time, now need to use to start and update, will all engineering equipment synchronizing information in memory database extremely Storage data base;Memory database will occur the engineering equipment information real-time synchronization updated to the process of storage data base for real The process of Shi Gengxin.
It should be noted that startup updates and real-time update is that dual-thread is carried out simultaneously, both differences are to start more Newly need to read all of engineering equipment information from memory database, and these engineering equipment information is stored data In storehouse, after having traveled through all of engineering equipment information, start renewal and just stop not reruning;And real-time update is from interior poke According to obtaining engineering equipment information in the list in storehouse, obtain is the operation information more revised, and these information by top service device are Application server provides, and the thread of real-time update can run always.Particularly, synchronization program and real-time update program meeting Start simultaneously.
As a kind of optional embodiment, above-mentioned storage data base can be mongodb data base, with above-mentioned internal storage data Storehouse is to illustrate as a example by redis stores data base, and when updating and start for two kinds simultaneously, real-time property may exist Special circumstances, the data in hash table are such as now:
(project_1 engineering name test1 location province Guangdong Province mac 123456781 module's address 1 time 2016+07+01 + 13+32+16,
Project_2 engineering name test2 location province Guangdong Province mac 123456782 module's address 2 time 2016+07+01+ 13+32+16,
Project_300 engineering name test3 location province Guangdong Province mac 123456783 module's address 2 time 2016+07+ 01+13+32+18,
…)
And the data of redis list sync_proj are:
(….
Gree Electric Appliances location, insert project 300 engineering name Zhuhai City province Guangdong Province time 2016+07+01+13: 32:18,
Upsert project 300 module's address 2)
When starting renewal speed and being faster than real-time update speed, it is assumed that got increase engineering equipment and be designated The data of 300, and it is written with each field, now real-time update data start the (insert processing in queue Project300 ...) data, if writing unsuccessful, twice write operation can be performed, being nInsert=0 when obtaining return value And code=11000, explanation has been written into, and does not reprocesses.When again processing, can update module's address is 2, and now In the project set of mongodb data base, the module's address of engineering 300 has been 2, and mongodb is for being updated to itself Data value will not operate again.
If having deleted engineering equipment to be designated the data of 300, hash table does not exist this field, But redis queue exists the operation of the amendment to engineering 300, when synchronization program first detects upsert in redis queue, Can write upsert order to mongodb, mongodb judges whether to have there is this engineering, if there is no rebuilding This engineering equipment information;When getting remove operation from redis queue, this project data will be deleted, now Redis with mongodb presents consistent.
If hash table have changed the engineering equipment information of field, and redis queue there is also this engineering Facility information, when starting to read hash table, can change field corresponding in mongodb set;The queue of redis is read when the later stage Time, the data field of mongodb is still last look.
If certain several field deleted by the document in hash table, redis queue first operates these fields, after Continue and delete these fields again, then mongodb first builds these fields, performs deletion action the most again.
When real-time update speed is more than when starting renewal speed, and real-time update data have updated the number in mongodb According to, from hash table, read the latest data of project.Synchronization program updates the data in mongodb data base, owing to updating After data with update before data consistent, mongodb data base no longer operates.It should be noted that mongodb data One operation in storehouse is called upsert, if document or field exist, is then updated, if it does not exist, then increase document or Field.
As known from the above, after Simultaneous Engineering facility information starts, the memory database of reading is deposited in key-value pair mode The engineering equipment information of storage, and by all engineering equipment synchronizing information in this memory database to storage data base or by interior Deposit data storehouse occurs the engineering equipment information updating updated to storing in data base, can realize internal storage data by above-mentioned steps Storehouse is synchronization with storage data base's, therefore, it can accelerate the access speed of server, promotes the performance of server, and then solves When in prior art, data base is directly operated by client or server, in the sharp increase of data unit operation makes Deposit data storehouse can not the technical problem of real-time synchronization with storage data base.
Alternatively, before starting Simultaneous Engineering facility information, method also includes:
Step S1020, generates multiple engineering mark in real time or regularly, and multiple engineerings mark successively write is pre-created Memory queue in.
Concrete, before starting Simultaneous Engineering facility information, generate a number of in the queue of memory database Integer, these, as unique mark of engineering, are written to memory database as engineering uniquely identified integer by these integers Queue in.It should be noted that when Simultaneous Engineering facility information restarts, these integers can't be regenerated again, only Being to insert new integer at the tail of the queue of this queue, newly inserted integer is incremented by the basis of the maximum of tail of the queue last time, This queue will not disappear because of the closedown of Simultaneous Engineering facility information.
As a kind of optional embodiment, illustrate as a example by memory database using redis storage data base.Assume Generating 10 integers in redis queue, be inserted in the queue of redis by these 10 integers, these integers are in redis team Structure in row is as shown in table 1.
Table 1
1 2 3 4 5 6 7 8 9 10
Wherein, 1 is team's head, and 10 is tail of the queue.It should be noted that redis queue at most can store 4294967295 columns According to.
Step S1022, after receiving the device data that at least one engineering equipment is uploaded, from memory queue successively Reading engineering identifies.
Concrete, in above-mentioned steps, after server receives the data that an engineering equipment is uploaded, from internal storage data The queue in storehouse is taken out team's head data unique mark as this engineering;If server receives what multiple engineering equipment was uploaded After data, take out the unique mark as each engineering of the team's head data in memory database queue successively.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If server has received only the data of an engineering equipment, then from redis queue, take out team's head data 1 connect as server Unique mark of the engineering equipment received, the structure of now redis queue is as shown in table 2.
Table 2
2 3 4 5 6 7 8 9 10
Step S1024, is associated with the engineering mark being successively read successively by each device data, and by number of devices According to inserting the position corresponding with the engineering of association mark, obtaining at least one engineering equipment information, wherein, engineering equipment information is extremely Include less: engineering equipment data and the unique engineering mark associated with engineering mark.
Concrete, the engineering obtaining engineering equipment information and get from memory database queue mark is carried out by server One_to_one corresponding, and the engineering equipment data of acquisition are sequentially inserted into corresponding to this engineering equipment information engineering identify institute right The position answered, the most just can get the engineering equipment information corresponding to above-mentioned engineering mark.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, logical Cross step S1022 and step S1024 has obtained the hash table of this engineering equipment, the named project_1 of this hash table, its engineering It is designated 1, the engineering equipment information that information is this engineering equipment of storage in this hash table.This hash table is as storage data base A record in table, and all hash tables with project beginning constitute project set in storage data base.
Step S1026, at least one engineering equipment information that preserves obtains memory database.
It should be noted that the engineering equipment information after carrying out data association is sequentially stored in memory database, convenient Subsequent step uses.
As known from the above, said method takes full advantage of the characteristic of queue first in first out, and the tail of the queue in queue adds data, Team's head takes out data, and this mode both ensure that the uniqueness of mark, in turn ensure that the increasing property certainly of mark, and from the mark increased The information also making current engineering equipment can preferably show.
Alternatively, all engineering equipment synchronizing information in memory database are included to the method for storage data base:
Step S202, travels through memory database based on engineering key word, obtains all keys with engineering Keywords matching Word.
Concrete, in above-mentioned steps S202, using the query statement of memory database, the engineering according to input is crucial Word, can inquire all key word same or analogous with this keyword.It should be noted that the side of above-mentioned search key word Method can be to search for generally, it is also possible to for accurately search;In the case of searching for generally, input is incomplete key word; In the case of accurately search, search is complete key word.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, The scan order of redis storage data base can be used to ergodic data storehouse, mates all of engineering equipment information.Such as use " scan 0match project_* " order can travel through in whole redis storage data base all with " project_ " beginning The key assignments of hash table.In mentioned order, " * " is asterisk wildcard, and " 0 " represents and proceeds by operation from first occurrence.On Stating the result after order is finished is an array, and the element in this array is and this engineering key word " project_ " phase All key words of coupling, the elementary composition of this array may be " project_1 ", " project_2 ", " project_ 3 " ... this array element number and element value with in redis data base under concrete condition storage concrete data relevant.
Step S204, the keyword obtained according to coupling determines the key assignments of correspondence, obtains all engineering equipments letter of storage Breath, wherein, keyword is used for characterizing engineering mark, and key assignments identifies, with engineering, the device data associated for characterizing.
Concrete, in above-mentioned steps S204, by using the querying command of memory database to travel through whole internal storage data Storehouse, the keyword obtained according to traversal uses the key assignments of memory database to obtain instruction, can obtain corresponding to this keyword Engineering equipment information.It should be noted that keyword is unique mark of engineering equipment, and key assignments represents this engineering equipment letter Breath.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, make After having traveled through memory database with the scan order of redis storage data base, obtain a key word array, it is assumed that this key word The component of array is " project_1 ", " project_2 ", " project_3 ".Then re-use redis and store data base " hgetall " order can obtain in this array the engineering equipment information corresponding to certain key word, as performed order " hgetall project_1 ", can obtain all engineering equipment information under engineering equipment " project_1 ", " project_ 1 " the engineering equipment information under may be " _ id 1 engineering name Central Garden ".
Step S206, by all engineering equipment synchronizing information to storing data base.
Concrete, in above-mentioned steps S206, after having obtained all of engineering equipment information, these engineering equipments are believed Breath updates in storage data base, just completes the renewal of engineering equipment information.
It should be noted that what step S202 to step S206 completed is the startup renewal process of Simultaneous Engineering data, tool The flow chart of body is as shown in Figure 2.
Alternatively, engineering equipment information includes at least one following: engineering equipment title, location province, MAC Address, module Type and time.
Concrete, engineering equipment title represents the mark distinguishing this engineering equipment;Location province represents this engineering equipment place Province;MAC Address represents the physical address of engineering equipment;Concrete numerical value is used to represent module type, as used 1 representative Temperature detecting module, 2 representing fault display modules etc..
Alternatively, by memory database occurs update engineering equipment information real-time synchronization to storing data base, including:
Step S302, if be detected that the engineering equipment information in memory database updates, reads and there occurs renewal The instruction of the renewal corresponding to engineering equipment information, update instruction and include at least one following: increase instruction, delete instruction and repair Change instruction.
Concrete, in above-mentioned steps S302, the engineering equipment information in memory database being detected there occurs renewal After, occur update engineering equipment information comprise this engineering equipment occur specifically update instruction, including increase engineering equipment letter Breath, deletion engineering equipment information and amendment engineering equipment information.
Step S304, there occurs the engineering equipment information of renewal according to the different instruction parsings that updates.
Concrete, in above-mentioned steps S304, instruct having occurred that more according to the renewal in memory database queue New engineering equipment information carries out dissection process.
Step S306, stores data base according to analysis result synchronized update.
In above-mentioned steps step S306, according to the analysis result in step S304, the result after resolving updates deposits Storage data base preserves the engineering equipment information after updating.
It should be noted that what step S302 to step S306 completed is the real-time update process of Simultaneous Engineering data, tool The flow chart of body is as shown in Figure 3.
As a kind of optional embodiment, as it is shown on figure 3, in above-mentioned steps S302 to step S306, store with redis Data base illustrates as a example by memory database, real-time update order by the queue being placed on entitled sync_projdev, First synchronization program uses " lindex " order to check data from queue, according to the data checked, enters for different operations Row mongodb database update, after being updated successfully, takes out this engineering equipment information from redis queue, i.e. deletes letter Breath.
Alternatively, as shown in Figure 4, before reading the renewal operation corresponding to the engineering equipment information that there occurs renewal, Said method also includes:
Step S3002, receives the renewal instruction that memory database is updated by server.
Concrete, before being updated engineering equipment information, server sends to memory database and updates instruction, interior After deposit data storehouse receives this renewal instruction, memory database is increased according to updating instruction, revises and deletion action.
Step S3004, uses renewal instruction engineering equipment information corresponding in the memory queue of memory database to be carried out Update, and renewal instruction write is updated queue, wherein, if synchronization program detects to exist in renewal queue updates instruction, Then determine that the engineering equipment information in memory database there occurs renewal.
As a kind of optional embodiment, in above-mentioned steps S3004, using redis storage data base as internal storage data Illustrating as a example by storehouse, real-time update order is by the queue being placed on entitled sync_projdev, when sync_ being detected Existence in projdev queue updates instruction, during such as amendment instruction, the engineering equipment information in redis storage data base is described There occurs renewal, now, use the engineering equipment information in amendment instruction modification redis data base, and by amendment instruction write In sync_projdev queue.Complete step S302 the most again to the operation of step S306, realize the real-time of synchronization program Update.
Alternatively, there occurs that the engineering equipment information of renewal includes according to the different instruction parsings that updates:
Step S104102, resolves the first character section updating instruction, if the content of first character section is update, Then determine that renewal instruction is for increasing instruction.
Step S104104, resolves other fields updating instruction, obtains the first synchronized update information, and wherein, first synchronizes More fresh information at least includes: the engineering mark of newly-increased engineering equipment information and device data.
Concrete, in above-mentioned steps S104102 and step S104104, the engineering equipment having occurred that renewal is believed Breath resolves, and when the content resolving first character section is update, adds character string one by one with key assignments, as added inlet identity It is the engineering equipment information of 3, as shown in table 3.
Table 3
insert project 3 Engineering name name1 Module type 2
Wherein, engineering name, module type are the field information that this engineering equipment comprises.
As a kind of optional embodiment, in above-mentioned steps S104102 and step S104104, still store number with redis Illustrate as a example by memory database according to storehouse, it is assumed that newly-increased engineering equipment information is (insert project 3 engineering Gree Electric Appliances location, name Zhuhai City province Guangdong Province time 2016+07+01+13:32:18).Synchronization program stores data from redis Storehouse obtains this engineering equipment information, first resolves first character section insert, be known as increasing instruction, then resolve Project, explanation is operation engineering information, and 3 representatives are engineering equipment marks, and this engineering equipment is designated engineering equipment information Unique mark, then resolve engineering and be set to province, obtaining field Zhuhai City Gree Electric Appliances and Zhuhai City.
Alternatively, there occurs that the engineering equipment information of renewal includes according to the different instruction parsings that updates:
Step S104106, resolves the first character section updating instruction, if the content of first character section is amendment operation, Then determine that renewal instruction is for amendment instruction.
Step S104108, resolves other fields updating instruction, obtains the second synchronized update information, and wherein, second synchronizes More fresh information at least includes: the engineering mark of amended engineering equipment information and device data.
Concrete, in above-mentioned steps S104106 and step S104108, the engineering equipment having occurred that renewal is believed Breath resolves, and when the content resolving first character section operates for amendment, revises data with the form of key-value pair, such as amendment work Journey is designated the information of 3, as shown in table 4.
Table 4
upsert project 3 Engineering name name2 Module type 3
Synchronization program will be changed into name2 to the engineering name of engineering 3 by original name1, and module type is changed into 3 by 2.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If the engineering equipment information of amendment is (upsert project 3 engineering name perfume (or spice) continent general merchandise), resolve first character section upsert, Be known as amendment instruction, (project 3) then represent be modified logo be the engineering equipment information of 3, (engineering name perfume (or spice) continent general merchandise) Represent and the engineering file-name field in this engineering equipment information is changed into fragrant continent general merchandise.
Alternatively, there occurs that the engineering equipment information of renewal includes according to the different instruction parsings that updates:
Step S104110, resolves the first character section updating instruction, if the content of first character section is deletion action, Then determine that renewal instruction is for deleting instruction.
Step S104112, resolves other fields updating instruction, obtains the 3rd synchronized update information, and wherein, the 3rd synchronizes More fresh information at least includes: the engineering mark of the engineering equipment information that needs are deleted and device data.
Concrete, in above-mentioned steps S104110 and step S104112, the engineering equipment having occurred that renewal is believed Breath resolves, when the content resolving first character section is deletion action, according to the behaviour of memory database with storage data base Make, be classified as the deletion to document and the deletion to field.
When the content resolving first character section is to delete document function, delete certain document according to unique mark, such as: table Shown in 5.
Table 5
remove project 3
This operation is designated all information of 3 by deleting engineering.
When the content resolving first character section is to delete field operations, detailed operational character string is listed and needs deletion Field name, as shown in table 6.
Table 6
unset project 3 Engineering name MAC Address Module type Location saves
This operation will delete the information such as the engineering name of engineering 3, MAC Address, module type, location province.
As a kind of optional embodiment, in above-mentioned steps S104106 and step S104108, still store number with redis Illustrate as a example by memory database according to storehouse, it is assumed that the engineering equipment information deleting document is (remove project3), First resolve remove field and determine that this engineering equipment information, for deleting document function, then determines according to (project3) and needs The record of engineering 3 to be deleted.Assume that the engineering equipment information deleting field is (unset project 3 MAC module address), First parse unset field and determine that this engineering equipment information, for deleting field operations, then determines according to (project 3) Need to delete the field in engineering 3, finally according to (MAC, module's address), delete for needs delete mac and module's address this two Individual field.
Alternatively, as shown in Figure 4, include according to the method for analysis result synchronized update storage data base:
Step S3010, forms writing commands according to analysis result.
Step S3012, is synchronized to writing commands store data base so that storage database root performs more according to writing commands New operation.
Concrete, in above-mentioned steps S3010 and step S3012, having occurred that renewal according to renewal instruction parsing Facility information after, analysis result is formed writing commands, storage database root is according to writing commands more new database.
As a kind of optional embodiment, using redis data base as memory database, mongodb data base is as depositing Illustrate as a example by storage data base, it is assumed that the result after parsing is (Gree Electric Appliances Guangdong Province of insert project 3 Zhuhai City 2016+07+01+13:32:18), the result after above-mentioned parsing being formed writing commands, mongodb data base performs to insert behaviour Make, (project 3 Zhuhai City Gree Electric Appliances Guangdong Province 2016+07+01+13:32:18) is inserted into mongodb database table In corresponding row, complete the renewal of mongodb data base.
Alternatively, after according to analysis result synchronized update storage data base, as shown in Figure 4, storage data base is determined The method whether being updated successfully includes:
Step S3014, in the case of writing commands instruction needs to increase engineering equipment information, if the parameter value returned For nonnegative number, it is determined that storage data base successfully increases engineering equipment information;Need to revise engineering in writing commands instruction to set In the case of standby information, if the parameter value returned is nonnegative number, it is determined that storage data base successfully revises engineering equipment letter Breath;In the case of writing commands instruction needs to delete engineering equipment information, if the parameter value returned is nonnegative number, it is determined that Storage data base successfully deletes engineering equipment information;Wherein, in the case of any one parameter value nonnegative number, storage is determined Whether data base updates failure.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, right After order in redis queue resolves, the writing commands of composition mongodb data base, update mongodb.For difference Operation, if it is normal to connect mongodb, different operating results: WriteResult after performing order, can be returned:
In the case of writing commands instruction needs to increase engineering equipment information, perform Insert instruction, return NInserted parameter, if nInserted >=0, then judge to increase to operate successfully;
In the case of writing commands instruction needs to revise engineering equipment information, perform IUpsert instruction, return NMatched parameter, if nMatched >=0, it is judged that amendment operates successfully;
In the case of writing commands instruction needs to delete engineering equipment information, perform Remove instruction, return NRemoved parameter, if nRemoved >=0, it is judged that delete document function success;
In the case of writing commands instruction needs to delete engineering equipment information, perform Unset instruction, return nMatched Parameter, if nMatched >=0, it is judged that delete field operations success.
Embodiment 2
According to embodiments of the present invention, it is provided that the system embodiment of a kind of Simultaneous Engineering data, Fig. 5 is real according to the present invention Execute the system structure schematic diagram of the Simultaneous Engineering data of example, set including memorizer 401, real-time update equipment 403 and startup renewal Standby 405, as shown in Figure 5.
Memorizer 401, for storing the real-time update data of engineering equipment information.
It should be noted that memorizer is for storing real-time update equipment and starting the renewal project equipment letter of more new equipment Breath, memorizer can be mongodb data base, for long-term storage engineering equipment information, it is also possible to be used for for redis data base Deposit engineering facility information temporarily.
Real-time update equipment 403, for obtaining the real-time update data of memorizer, and resolves real-time update data, obtains Operational order after parsing, and update the engineering equipment information in storage data base according to operational order.
Concrete, before being updated engineering equipment information, server sends to memory database and updates instruction, interior After deposit data storehouse receives this renewal instruction, memory database is increased according to updating instruction, revises and deletion action;When same Step Programmable detection, to when updating existence renewal instruction in queue, illustrates that the engineering equipment information in memory database there occurs more Newly, now, update the engineering equipment information in memory queue according to updating instruction, and renewal instruction write is updated in queue; After engineering equipment information in memory database being detected there occurs renewal, the engineering equipment information updated is occurred to comprise this work What journey equipment occurred specifically updates instruction, sets including increasing engineering equipment information, deletion engineering equipment information and amendment engineering Standby information;According to the instruction that updates in memory database queue, the engineering equipment information having occurred that renewal is carried out at parsing Reason;Engineering equipment information updating after resolving, to storing in data base, just completes the real-time update of engineering equipment information.
Start more new equipment 405, all engineering equipment information in the queue obtaining memory database, and engineering is set Standby information updating is to storing in data base.
Concrete, use the query statement of memory database, according to the engineering keyword of input, can inquire and this pass The same or analogous all key words of key word;The keyword obtained according to traversal uses the key assignments of memory database to obtain instruction, The engineering equipment information corresponding to this keyword can be obtained;After having obtained all of engineering equipment information, by these engineerings Device information update is to storing in data base, and the startup just completing engineering equipment information updates.
It should be noted that startup updates and real-time update is that dual-thread is carried out simultaneously, both differences are to start more Newly need to read all of engineering equipment information from memory database, and these engineering equipment information is stored data In storehouse, after having traveled through all of engineering equipment information, start renewal and just stop not reruning;And real-time update is from interior poke According to obtaining engineering equipment information in the list in storehouse, obtain is the operation information more revised, and these information by top service device are Application server provides, and the thread of real-time update can run always.Particularly, synchronization program and real-time update program meeting Start simultaneously.
As known from the above, after Simultaneous Engineering facility information starts, the memory database of reading is deposited in key-value pair mode The engineering equipment information of storage, and by all engineering equipment synchronizing information in this memory database to storage data base or by interior Deposit data storehouse occurs the engineering equipment information updating updated to storing in data base, can realize internal storage data by said system Storehouse is synchronization with storage data base's, therefore, it can accelerate the access speed of server, promotes the performance of server, and then solves When in prior art, data base is directly operated by client or server, in the sharp increase of data unit operation makes Deposit data storehouse can not the technical problem of real-time synchronization with storage data base.
Embodiment 3
According to embodiments of the present invention, it is provided that the device embodiment of a kind of Simultaneous Engineering data, Fig. 6 is real according to the present invention Execute the apparatus structure schematic diagram of the Simultaneous Engineering data of example, including read module 501 and more new module 503, as shown in Figure 6.
Read module 501, for, in the case of starting Simultaneous Engineering facility information, reading at least from memory database Article one, engineering equipment information, wherein, stores any one engineering equipment information in the way of key-value pair in memory database.
Concrete, all of engineering equipment information is stored in memory database with the form of key-value pair, key word of the inquiry institute Corresponding value can read engineering equipment information from memory database.
It should be noted that above-mentioned memory database can be redis stores data base, from redis storage data base The mode of access data is: the value that keyword+keyword is corresponding.
As a kind of optional embodiment, by above-mentioned memory database for illustrating as a example by redis storage data base, Before starting Simultaneous Engineering facility information, the mode using key-value pair is needed to store engineering equipment information, it is possible to use hmset orders Order storage engineering equipment information, as performed statement " hmset project_id 1 engineering name Central Garden ", can be by engineering Being designated " 1 ", engineering name is that the engineering information of " Central Garden " is stored in redis storage data base, in above-mentioned statement, " project " represents engineering information, and unique mark " _ id " is first territory, and " 1 " is first value, and " engineering name " is second Individual territory, " Central Garden " is second value.In the case of starting Simultaneous Engineering facility information, can read in memory database Engineering equipment information, it is possible to use hmget order read engineering equipment information, as perform statement " hmget project_1_ Id engineering name ", engineering can be obtained and be designated unique mark and the engineering name information of " 1 ".
More new module 503, is used for all engineering equipment synchronizing information in memory database to storing data base, and/ Or, by memory database occurring the engineering equipment information real-time synchronization updated to storing data base, wherein, it is stored in interior poke Store to storage data base as an engineering record according to any one engineering equipment information in storehouse.
Concrete, in the case of starting Simultaneous Engineering facility information, during in order to prevent server from having had been started up one section Between, now need to use to start to update, will all engineering equipment synchronizing information in memory database to storing data base;Will Memory database occur the engineering equipment information real-time synchronization updated to the process that process is real-time update storing data base.
It should be noted that startup updates and real-time update is that dual-thread is carried out simultaneously, both differences are to start more Newly need to read all of engineering equipment information from memory database, and these engineering equipment information is stored data In storehouse, after having traveled through all of engineering equipment information, start renewal and just stop not reruning;And real-time update is from interior poke According to obtaining engineering equipment information in the list in storehouse, obtain is the operation information more revised, and these information by top service device are Application server provides, and the thread of real-time update can run always.Particularly, synchronization program and real-time update program meeting Start simultaneously.
As a kind of optional embodiment, above-mentioned storage data base can be mongodb data base, with above-mentioned internal storage data Storehouse is to illustrate as a example by redis stores data base, and when updating and start for two kinds simultaneously, real-time property may exist Special circumstances, the data in hash table are such as now:
(project_1 engineering name test1 location province Guangdong Province mac 123456781 module's address 1 time 2016+07+01 + 13+32+16,
Project_2 engineering name test2 location province Guangdong Province mac 123456782 module's address 2 time 2016+07+01+ 13+32+16,
Project_300 engineering name test3 location province Guangdong Province mac 123456783 module's address 2 time 2016+07+ 01+13+32+18,
…)
And the data of redis list sync_proj are:
(….
Gree Electric Appliances location, insert project 300 engineering name Zhuhai City province Guangdong Province time 2016+07+01+13: 32:18,
Upsert project 300 module's address 2)
When starting renewal speed and being faster than real-time update speed, it is assumed that got increase engineering equipment and be designated The data of 300, and it is written with each field, now real-time update data start the (insert processing in queue Project300 ...) data, if writing unsuccessful, twice write operation can be performed, being nInsert=0 when obtaining return value And code=11000, explanation has been written into, and does not reprocesses.When again processing, can update module's address is 2, and now In the project set of mongodb data base, the module's address of engineering 300 has been 2, and mongodb is for being updated to itself Data value will not operate again.
If having deleted engineering equipment to be designated the data of 300, hash table does not exist this field, But redis queue exists the operation of the amendment to engineering 300, when synchronization program first detects upsert in redis queue, Can write upsert order to mongodb, mongodb judges whether to have there is this engineering, if there is no rebuilding This engineering equipment information;When getting remove operation from redis queue, this project data will be deleted, now Redis with mongodb presents consistent.
If hash table have changed the engineering equipment information of field, and redis queue there is also this engineering Facility information, when starting to read hash table, can change field corresponding in mongodb set;The queue of redis is read when the later stage Time, the data field of mongodb is still last look.
If certain several field deleted by the document in hash table, redis queue first operates these fields, after Continue and delete these fields again, then mongodb first builds these fields, performs deletion action the most again.
When real-time update speed is more than when starting renewal speed, and real-time update data have updated the number in mongodb According to, from hash table, read the latest data of project.Synchronization program updates the data in mongodb data base, owing to updating After data with update before data consistent, mongodb data base no longer operates.It should be noted that mongodb data One operation in storehouse is called upsert, if document or field exist, is then updated, if it does not exist, then increase document or Field.
As known from the above, after Simultaneous Engineering facility information starts, the memory database of reading is deposited in key-value pair mode The engineering equipment information of storage, and by all engineering equipment synchronizing information in this memory database to storage data base or by interior Deposit data storehouse occurs the engineering equipment information updating updated to storing in data base, can realize internal storage data by above-mentioned steps Storehouse is synchronization with storage data base's, therefore, it can accelerate the access speed of server, promotes the performance of server, and then solves When in prior art, data base is directly operated by client or server, in the sharp increase of data unit operation makes Deposit data storehouse can not the technical problem of real-time synchronization with storage data base.
Alternatively, before starting Simultaneous Engineering facility information, as it is shown in fig. 7, said apparatus also includes:
First writing module 601, generates multiple engineering mark, and multiple engineerings mark is write successively in real time or regularly Enter in the memory queue being pre-created.
Concrete, before starting Simultaneous Engineering facility information, generate a number of in the queue of memory database Integer, these, as unique mark of engineering, are written to memory database as engineering uniquely identified integer by these integers Queue in.It should be noted that when Simultaneous Engineering facility information restarts, these integers can't be regenerated again, only Being to insert new integer at the tail of the queue of this queue, newly inserted integer is incremented by the basis of the maximum of tail of the queue last time, This queue will not disappear because of the closedown of Simultaneous Engineering facility information.
As a kind of optional embodiment, illustrate as a example by memory database using redis storage data base.Assume Generating 10 integers in redis queue, be inserted in the queue of redis by these 10 integers, these integers are in redis team Structure in row is as shown in table 7.
Table 7
1 2 3 4 5 6 7 8 9 10
Wherein, 1 is team's head, and 10 is tail of the queue.It should be noted that redis queue at most can store 4294967295 columns According to.
First read module 603, for after receiving the device data that at least one engineering equipment is uploaded, from internal memory Queue is successively read engineering mark.
Concrete, after server receives the data that an engineering equipment is uploaded, take from the queue of memory database Go out team's head data unique mark as this engineering;If after server receives the data that multiple engineering equipment is uploaded, successively Take out the unique mark as each engineering of the team's head data in memory database queue.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If server has received only the data of an engineering equipment, then from redis queue, take out team's head data 1 connect as server Unique mark of the engineering equipment received, the structure of now redis queue is as shown in table 8.
Table 8
2 3 4 5 6 7 8 9 10
First matching module 605, for each device data is associated with the engineering mark being successively read successively, And device data is inserted the position corresponding with the engineering of association mark, obtain at least one engineering equipment information, wherein, engineering Facility information at least includes: engineering equipment data and the unique engineering mark associated with engineering mark.
Concrete, the engineering obtaining engineering equipment information and get from memory database queue mark is carried out by server One_to_one corresponding, and the engineering equipment data of acquisition are sequentially inserted into corresponding to this engineering equipment information engineering identify institute right The position answered, the most just can get the engineering equipment information corresponding to above-mentioned engineering mark.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, logical Cross step S1022 and step S1024 has obtained the hash table of this engineering equipment, the named project_1 of this hash table, its engineering It is designated 1, the engineering equipment information that information is this engineering equipment of storage in this hash table.This hash table is as storage data base A record in table, and all hash tables with project beginning constitute project set in storage data base.
First memory module 607, obtains memory database for preserving at least one engineering equipment information.
It should be noted that the engineering equipment information after carrying out data association is sequentially stored in memory database, convenient Subsequent step uses.
As known from the above, said method takes full advantage of the characteristic of queue first in first out, and the tail of the queue in queue adds data, Team's head takes out data, and this mode both ensure that the uniqueness of mark, in turn ensure that the increasing property certainly of mark, and from the mark increased The information also making current engineering equipment can preferably show.
Alternatively, as shown in Figure 8, more new module 503 includes:
Search module 701, for traveling through memory database based on engineering key word, obtains the institute with engineering Keywords matching There is key word.
Concrete, use the query statement of memory database, according to the engineering keyword of input, can inquire and this pass The same or analogous all key words of key word.The method that it should be noted that above-mentioned search key word can be to search for generally, also It can be accurately search;In the case of searching for generally, input is incomplete key word;In the case of accurately search, Search is complete key word.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, The scan order of redis storage data base can be used to ergodic data storehouse, mates all of engineering equipment information.Such as use " scan 0 match project_* " order can travel through in whole redis storage data base all with " project_ " beginning The key assignments of hash table.In mentioned order, " * " is asterisk wildcard, and " 0 " represents and proceeds by operation from first occurrence.On Stating the result after order is finished is an array, and the element in this array is and this engineering key word " project_ " phase All key words of coupling, the elementary composition of this array may be " project_1 ", " project_2 ", " project_ 3 " ... this array element number and element value with in redis data base under concrete condition storage concrete data relevant.
Second matching module 703, the keyword for obtaining according to coupling determines the key assignments of correspondence, obtains all of storage Engineering equipment information, wherein, keyword is used for characterizing engineering mark, and key assignments identifies, with engineering, the number of devices associated for characterizing According to.
Concrete, by using the querying command of memory database to travel through whole memory database, obtain according to traversal Keyword uses the key assignments of memory database to obtain instruction, can obtain the engineering equipment information corresponding to this keyword.Need Illustrating, keyword is unique mark of engineering equipment, and key assignments represents this engineering equipment information.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, make After having traveled through memory database with the scan order of redis storage data base, obtain a key word array, it is assumed that this key word The component of array is " project_1 ", " project_2 ", " project_3 ".Then re-use redis and store data base " hgetall " order can obtain in this array the engineering equipment information corresponding to certain key word, as performed order " hgetall project_1 ", can obtain all engineering equipment information under engineering equipment " project_1 ", " project_ 1 " the engineering equipment information under may be " _ id 1 engineering name Central Garden ".
First synchronization module 705, is used for all engineering equipment synchronizing information to storing data base.
Concrete, after having obtained all of engineering equipment information, by these engineering equipment information updatings to storage data In storehouse, just complete the renewal of engineering equipment information.
Alternatively, engineering equipment information includes at least one following: engineering equipment title, location province, MAC Address, module Type and time.
Concrete, engineering equipment title represents the mark distinguishing this engineering equipment;Location province represents this engineering equipment place Province;MAC Address represents the physical address of engineering equipment;Concrete numerical value is used to represent module type, as used 1 representative Temperature detecting module, 2 representing fault display modules etc..
Alternatively, as it is shown in figure 9, more new module 503 also includes:
First read module 801, for if be detected that the engineering equipment information in memory database updates, reads There occurs the instruction of the renewal corresponding to engineering equipment information of renewal, update instruction and include at least one following: increase instruction, delete Except instruction and amendment instruction.
Concrete, after engineering equipment information in memory database being detected there occurs renewal, there is the engineering updated Facility information comprise this engineering equipment occur specifically update instruction, including increase engineering equipment information, delete engineering equipment letter Breath and amendment engineering equipment information.
First parsing module 803, for there occurs the engineering equipment information of renewal according to the different instruction parsings that updates.
Concrete, according to the instruction that updates in memory database queue, the engineering equipment information having occurred that renewal is entered Row dissection process.
Second synchronization module 805, for storing data base according to analysis result synchronized update.
As a kind of optional embodiment, illustrate as a example by memory database, in real time using redis storage data base More newer command is by the queue being placed on entitled sync_projdev, and first synchronization program uses " lindex " order to look into from queue See data, according to the data checked, carry out mongodb database update for different operations, after being updated successfully, from This engineering equipment information is taken out by redis queue, i.e. deletes information.
Alternatively, as shown in Figure 10, said apparatus also includes:
Receiver module 901, for receiving the renewal instruction that memory database is updated by server.
Concrete, before being updated engineering equipment information, server sends to memory database and updates instruction, interior After deposit data storehouse receives this renewal instruction, memory database is increased according to updating instruction, revises and deletion action.
Second writing module 903, sets the engineering of correspondence in the memory queue of memory database for using to update to instruct Standby information is updated, and renewal instruction write updates queue, wherein, exists if synchronization program detects in renewal queue Update instruction, it is determined that the engineering equipment information in memory database there occurs renewal.
Concrete, when there is renewal instruction during synchronization program detects renewal queue, the work in memory database is described Journey facility information there occurs renewal, now, updates the engineering equipment information in memory queue according to updating instruction, and renewal is referred to Order write updates in queue.
As a kind of optional embodiment, illustrate as a example by memory database, in real time using redis storage data base More newer command, by the queue being placed on entitled sync_projdev, refers to when the existence detected in sync_projdev queue updates Order, during such as amendment instruction, illustrates that the engineering equipment information in redis storage data base there occurs renewal, now, uses amendment to refer to Engineering equipment information in order amendment redis data base, and amendment instruction is written in sync_projdev queue.The most again Complete step S10406 to the operation of step S10410, realize the real-time update of synchronization program.
Alternatively, as shown in fig. 11a, there occurs the engineering equipment information updating of renewal according to the different instruction parsings that updates Module 503 includes:
Insert module 1001, for resolving the first character section updating instruction, if the content of first character section is for inserting Operation, it is determined that update instruction for increasing instruction;Resolve other fields updating instruction, obtain the first synchronized update information, its In, the first synchronized update information at least includes: the engineering mark of newly-increased engineering equipment information and device data.
Concrete, the engineering equipment information having occurred that renewal is resolved, when the content resolving first character section During for update, add character string one by one with key assignments, as shown in table 9 in added the engineering equipment information being designated 3.
Table 9
insert project 3 Engineering name name1 Module type 2
Wherein, engineering name, module type is the field information that this engineering equipment comprises.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If newly-increased engineering equipment information is (insert project 3 engineering name Zhuhai City Gree Electric Appliances location province's Guangdong Province's time 2016+07+01+13:32:18).Synchronization program obtains this engineering equipment information from redis storage data base, first resolves the One field insert, is known as increasing instruction, then resolves project, and explanation is operation engineering information, and 3 representatives are works Journey device identification, this engineering equipment is designated unique mark of engineering equipment information, then resolves engineering and be set to province, obtains field Zhuhai City's Gree Electric Appliances and Zhuhai City.
Alternatively, as shown in figure 11b, more new module 503 includes:
Modified module 1003, for resolving the first character section updating instruction, if the content of first character section is amendment Operation, it is determined that update instruction for amendment instruction;Resolve other fields updating instruction, obtain the second synchronized update information, its In, the second synchronized update information at least includes: the engineering mark of amended engineering equipment information and device data.
Concrete, the engineering equipment information having occurred that renewal is resolved, when the content resolving first character section During for amendment operation, revise data with the form of key-value pair, as amendment engineering is designated the information of 3, as shown in table 10.
Table 10
upsert project 3 Engineering name name2 Module type 3
Synchronization program will be changed into name2 to the engineering name of engineering 3 by original name1, and module type is changed into 3 by 2.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If the engineering equipment information of amendment is (upsert project 3 engineering name perfume (or spice) continent general merchandise), resolve first character section upsert, Be known as amendment instruction, (project 3) then represent be modified logo be the engineering equipment information of 3, (engineering name perfume (or spice) continent general merchandise) Represent and the engineering file-name field in this engineering equipment information is changed into fragrant continent general merchandise.
Alternatively, as shown in fig. 11c, more new module 503 includes:
Removing module 1005, for resolving the first character section updating instruction, if the content of first character section is for deleting Operation, it is determined that update instruction for deleting instruction;Resolve other fields updating instruction, obtain the 3rd synchronized update information, its In, the 3rd synchronized update information at least includes: the engineering mark of the engineering equipment information that needs are deleted and device data.
Concrete, the engineering equipment information having occurred that renewal is resolved, when the content resolving first character section During for deletion action, according to the operation of memory database with storage data base, it is classified as the deletion to document and to field Delete.
When the content resolving first character section is to delete document function, delete certain document, such as table according to unique mark Shown in 11.
Table 11
remove project 3
This operation is designated all information of 3 by deleting engineering.
When the content resolving first character section is to delete field operations, detailed operational character string is listed and needs deletion Field name, as shown in table 12.
Table 12
unset project 3 Engineering name MAC Address Module type Location saves
This operation will delete the information such as the engineering name of engineering 3, MAC Address, module type, location province.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, false If the engineering equipment information deleting document is (remove project 3), first resolves remove field and determine that this engineering sets Standby information, for deleting document function, then determines the record needing to delete engineering 3 according to (project 3).Assume to delete field Engineering equipment information be (unset project 3 MAC module address), first parse unset field and determine this engineering Facility information, for deleting field operations, then determines according to (project 3) and needs to delete the field in engineering 3, finally according to (MAC, module's address), deletes and deletes mac and module's address the two field for needs.
Alternatively, as shown in figure 12, the second synchronization module 805 includes:
3rd writing module 1101, for forming writing commands according to analysis result;It is synchronized to writing commands store number According to storehouse so that storage database root performs to update operation according to writing commands.
Concrete, after resolve the facility information having occurred that renewal according to renewal instruction, analysis result composition is write Entering order, storage database root is according to writing commands more new database.
As a kind of optional embodiment, using redis data base as memory database, mongodb data base is as depositing Illustrate as a example by storage data base, it is assumed that the result after parsing is (Gree Electric Appliances Guangdong Province of insert project 3 Zhuhai City 2016+07+01+13:32:18), the result after above-mentioned parsing being formed writing commands, mongodb data base performs to insert behaviour Make, (project 3 Zhuhai City Gree Electric Appliances Guangdong Province 2016+07+01+13:32:18) is inserted into mongodb database table In corresponding row, complete the renewal of mongodb data base.
Alternatively, after according to analysis result synchronized update storage data base, determine whether storage data base is updated to The method of merit includes: in the case of writing commands instruction needs to increase engineering equipment information, if the parameter value returned is non- Negative, it is determined that successfully increase engineering equipment information in storage data base;Need to revise engineering equipment letter in writing commands instruction In the case of breath, if the parameter value returned is nonnegative number, it is determined that storage data base successfully revises engineering equipment information;? In the case of writing commands instruction needs to delete engineering equipment information, if the parameter value returned is nonnegative number, it is determined that storage Data base successfully deletes engineering equipment information;Wherein, in the case of any one parameter value nonnegative number, storage data are determined Whether storehouse updates failure.
As a kind of optional embodiment, still illustrate as a example by memory database using redis storage data base, right After order in redis queue resolves, the writing commands of composition mongodb data base, update mongodb.For difference Operation, if it is normal to connect mongodb, different operating results: WriteResult after performing order, can be returned:
In the case of writing commands instruction needs to increase engineering equipment information, perform Insert instruction, return NInserted parameter, if nInserted >=0, then judge to increase to operate successfully;
In the case of writing commands instruction needs to revise engineering equipment information, perform IUpsert instruction, return NMatched parameter, if nMatched >=0, it is judged that amendment operates successfully;
In the case of writing commands instruction needs to delete engineering equipment information, perform Remove instruction, return NRemoved parameter, if nRemoved >=0, it is judged that delete document function success;
In the case of writing commands instruction needs to delete engineering equipment information, perform Unset instruction, return nMatched Parameter, if nMatched >=0, it is judged that delete field operations success.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not has in certain embodiment The part described in detail, may refer to the associated description of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents, can be passed through other Mode realizes.Wherein, device embodiment described above is only schematically, the division of such as unit, can be a kind of Logic function divides, actual can have when realizing other dividing mode, the most multiple unit or assembly can in conjunction with or can To be integrated into another system, or some features can be ignored, or does not performs.Another point, shown or discussed each other Coupling direct-coupling or communication connection can be the INDIRECT COUPLING by some interfaces, unit or module or communication connection, Can be being electrical or other form.
The unit illustrated as separating component can be or may not be physically separate, shows as unit Parts can be or may not be physical location, i.e. may be located at a place, or can also be distributed to multiple unit On.Some or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to two or more unit are integrated in a unit.Above-mentioned integrated list Unit both can realize to use the form of hardware, it would however also be possible to employ the form of SFU software functional unit realizes.
If integrated unit is using the form realization of SFU software functional unit and as independent production marketing or use, can To be stored in a computer read/write memory medium.Based on such understanding, technical scheme substantially or Say completely or partially can embodying of the part that prior art is contributed or this technical scheme with the form of software product Out, this computer software product is stored in a storage medium, including some instructions with so that a computer equipment (can be personal computer, server or the network equipment etc.) performs all or part of step of each embodiment method of the present invention Suddenly.And aforesaid storage medium includes: USB flash disk, read only memory (ROM, Read-Only Memory), random access memory The various media that can store program code such as (RAM, Random Access Memory), portable hard drive, magnetic disc or CD.
Below it is only the preferred embodiment of the present invention, it is noted that those skilled in the art are come Saying, under the premise without departing from the principles of the invention, it is also possible to make some improvements and modifications, these improvements and modifications also should be regarded as Protection scope of the present invention.

Claims (13)

1. the method for Simultaneous Engineering data, it is characterised in that including:
In the case of starting Simultaneous Engineering facility information, from memory database, read at least one engineering equipment information, its In, in the way of key-value pair, in described memory database, store described at least one engineering equipment information;
By all engineering equipment synchronizing information in described memory database to storing data base, and/or, by described internal storage data Storehouse occurs the engineering equipment information real-time synchronization updated to described storage data base, wherein, be stored in described memory database In described at least one engineering equipment information as an engineering record store to described storage data base.
Method the most according to claim 1, it is characterised in that before starting Simultaneous Engineering facility information, described method Including:
Generate multiple engineering mark in real time or regularly, and the plurality of engineering mark is write the memory queue being pre-created successively In;
After receiving the device data that at least one engineering equipment is uploaded, from described memory queue, it is successively read engineering mark Know;
Each device data is associated with the described engineering being successively read mark successively, and device data is inserted and closes The queue position of the engineering mark correspondence of connection, obtains described at least one engineering equipment information, wherein, described engineering equipment information At least include: described device data and the unique engineering mark associated with described device data;
Preserve described at least one engineering equipment information and obtain described memory database.
Method the most according to claim 1 and 2, it is characterised in that by all engineering equipments in described memory database Synchronizing information to storing data base, including:
Travel through described memory database based on engineering key word, obtain and all keywords of described engineering Keywords matching;
The keyword obtained according to coupling determines the key assignments of correspondence, obtains all engineering equipment information of storage, wherein, described pass Key word is used for characterizing engineering mark, and described key assignments identifies, with described engineering, the device data associated for characterizing;
By described all engineering equipment synchronizing information to described storage data base.
Method the most according to claim 3, it is characterised in that described engineering equipment information includes at least one following: work Journey device name, location province, MAC Address, module type and time.
Method the most according to claim 1 and 2, it is characterised in that the engineering updated will occur in described memory database Facility information real-time synchronization stores data base to described, including:
If be detected that the engineering equipment information in described memory database updates, read the engineering equipment that there occurs renewal Renewal instruction corresponding to information, described renewal instruction includes at least one following: increases instruction, delete instruction and amendment refers to Order;
The engineering equipment information of renewal is there occurs described in instruction parsing according to different updating;
According to storing data base described in analysis result synchronized update.
Method the most according to claim 5, it is characterised in that reading corresponding to the engineering equipment information that there occurs renewal Renewal operation before, described method also includes:
Receive the renewal instruction that described memory database is updated by server;
The described engineering equipment information instructed corresponding in the memory queue of described memory database that updates is used to be updated, and Instruction write renewal queue is updated by described;
Wherein, if synchronization program detects that there is described renewal in described renewal queue instructs, it is determined that described internal storage data Engineering equipment information in storehouse there occurs renewal.
Method the most according to claim 6, it is characterised in that there occurs renewal according to different renewal instruction parsings Engineering equipment information include:
Resolve the described first character section updating instruction, if the content of described first character section is update, it is determined that institute State renewal instruction and increase instruction for described;
Resolve described other fields updating instruction, obtain the first synchronized update information, wherein, described first synchronized update information At least include: the engineering mark of newly-increased engineering equipment information and device data.
Method the most according to claim 6, it is characterised in that there occurs renewal according to different renewal instruction parsings Engineering equipment information include:
Resolve the described first character section updating instruction, if the content of described first character section is amendment operation, it is determined that institute State renewal instruction for described amendment instruction;
Resolve described other fields updating instruction, obtain the second synchronized update information, wherein, described second synchronized update information At least include: the engineering mark of amended engineering equipment information and device data.
Method the most according to claim 6, it is characterised in that there occurs renewal according to different renewal instruction parsings Engineering equipment information include:
Resolve the described first character section updating instruction, if the content of described first character section is deletion action, it is determined that institute State renewal instruction and delete instruction for described;
Resolve described other fields updating instruction, obtain the 3rd synchronized update information, wherein, described 3rd synchronized update information At least include: the engineering mark of the engineering equipment information that needs are deleted and device data.
Method the most according to claim 5, it is characterised in that according to storing data base described in analysis result synchronized update, Including:
Writing commands is formed according to analysis result;
By said write command synchronization to described storage data base so that described storage database root performs according to said write order Update operation.
11. methods according to claim 10, it is characterised in that according to storing data described in analysis result synchronized update After storehouse, described method comprises determining that whether described storage data base is updated successfully, and this step includes:
In the case of said write order instruction needs to increase engineering equipment information, if the parameter value returned is nonnegative number, Then determine in described storage data base and successfully increase engineering equipment information;
In the case of said write order instruction needs to revise engineering equipment information, if the parameter value returned is nonnegative number, Then determine in described storage data base and successfully revise engineering equipment information;
In the case of said write order instruction needs to delete engineering equipment information, if the parameter value returned is nonnegative number, Then determine in described storage data base and successfully delete engineering equipment information;
Wherein, in the case of any one parameter value nonnegative number, determine whether described storage data base updates failure.
The system of 12. 1 kinds of Simultaneous Engineering data, it is characterised in that including:
Memorizer, for storing the real-time update data of engineering equipment information;
Real-time update equipment, for obtaining the described real-time update data of described memorizer, and resolves described real-time update data, Obtain the operational order after resolving, and update the described engineering equipment information in storage data base according to described operational order;
Start more new equipment, all described engineering equipment information in the queue obtaining memory database, and by described engineering Device information update stores in data base to described.
The device of 13. 1 kinds of Simultaneous Engineering data, it is characterised in that including:
Read module, for, in the case of starting Simultaneous Engineering facility information, reading at least one work from memory database Journey facility information, wherein, stores described at least one engineering equipment information in the way of key-value pair in described memory database;
More new module, is used for all engineering equipment synchronizing information in described memory database to storing data base, and/or, By described memory database occurring the engineering equipment information real-time synchronization updated to described storage data base, wherein, it is stored in Described at least one engineering equipment information in described memory database stores to described storage data as an engineering record Storehouse.
CN201610658456.6A 2016-08-11 2016-08-11 Method, system and device for synchronizing engineering data Active CN106294769B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610658456.6A CN106294769B (en) 2016-08-11 2016-08-11 Method, system and device for synchronizing engineering data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610658456.6A CN106294769B (en) 2016-08-11 2016-08-11 Method, system and device for synchronizing engineering data

Publications (2)

Publication Number Publication Date
CN106294769A true CN106294769A (en) 2017-01-04
CN106294769B CN106294769B (en) 2019-08-27

Family

ID=57668929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610658456.6A Active CN106294769B (en) 2016-08-11 2016-08-11 Method, system and device for synchronizing engineering data

Country Status (1)

Country Link
CN (1) CN106294769B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614442A (en) * 2018-11-02 2019-04-12 东软集团股份有限公司 Data synchronous data listing maintenance, device, storage medium and electronic equipment
CN109828994A (en) * 2018-12-05 2019-05-31 深圳市双合电气股份有限公司 A kind of data managing method and system of government's energy management platform
CN110597910A (en) * 2019-09-12 2019-12-20 聚好看科技股份有限公司 Remote data synchronization method, device and system
CN111984663A (en) * 2020-08-21 2020-11-24 西安寰宇卫星测控与数据应用有限公司 REDIS database updating method and device, computer equipment and storage medium
CN113064913A (en) * 2021-03-26 2021-07-02 北京深思数盾科技股份有限公司 Interactive statement processing method, electronic device and computer-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778225A (en) * 2015-03-27 2015-07-15 浙江大学 Method for synchronizing data in unstructured data multi-storage system
CN105262831A (en) * 2015-10-30 2016-01-20 北京奇艺世纪科技有限公司 Method, device, and synchronizing system for synchronizing data among memory systems
CN105589959A (en) * 2015-12-22 2016-05-18 北京京东尚科信息技术有限公司 Form processing method and form processing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104778225A (en) * 2015-03-27 2015-07-15 浙江大学 Method for synchronizing data in unstructured data multi-storage system
CN105262831A (en) * 2015-10-30 2016-01-20 北京奇艺世纪科技有限公司 Method, device, and synchronizing system for synchronizing data among memory systems
CN105589959A (en) * 2015-12-22 2016-05-18 北京京东尚科信息技术有限公司 Form processing method and form processing system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614442A (en) * 2018-11-02 2019-04-12 东软集团股份有限公司 Data synchronous data listing maintenance, device, storage medium and electronic equipment
CN109828994A (en) * 2018-12-05 2019-05-31 深圳市双合电气股份有限公司 A kind of data managing method and system of government's energy management platform
CN110597910A (en) * 2019-09-12 2019-12-20 聚好看科技股份有限公司 Remote data synchronization method, device and system
CN111984663A (en) * 2020-08-21 2020-11-24 西安寰宇卫星测控与数据应用有限公司 REDIS database updating method and device, computer equipment and storage medium
CN111984663B (en) * 2020-08-21 2024-03-12 西安寰宇卫星测控与数据应用有限公司 REDIS database updating method, REDIS database updating device, REDIS database updating computer equipment and REDIS database storage medium
CN113064913A (en) * 2021-03-26 2021-07-02 北京深思数盾科技股份有限公司 Interactive statement processing method, electronic device and computer-readable storage medium

Also Published As

Publication number Publication date
CN106294769B (en) 2019-08-27

Similar Documents

Publication Publication Date Title
CN106294769A (en) Method, system and device for synchronizing engineering data
US20180081938A1 (en) System and method for querying data sources
US11481440B2 (en) System and method for processing metadata to determine an object sequence
US9256665B2 (en) Creation of inverted index system, and data processing method and apparatus
US20150278268A1 (en) Data encoding and corresponding data structure
EP3251298B1 (en) Data extraction
CN104424287B (en) Data query method and apparatus
CN106407360B (en) Data processing method and device
CN105677683A (en) Batch data query method and device
CN110019384B (en) Method for acquiring blood edge data, method and device for providing blood edge data
CN104268216A (en) Data cleaning system based on internet information
CN103034735A (en) Big data distributed file export method
CN111726249B (en) Configuration file processing method and device of network equipment
CN106709066B (en) Data synchronization method and device
CN114153980A (en) Knowledge graph construction method and device, inspection method and storage medium
CN109657803B (en) Construction of machine learning models
US20090132607A1 (en) Techniques for log file processing
CN114116762A (en) Offline data fuzzy search method, device, equipment and medium
CN106033438A (en) Public sentiment data storage method and server
CN116452123A (en) Method and device for generating characteristic value of inventory item and computer equipment
JP2014035749A (en) Log generation rule creation device and method
US20180240053A1 (en) System and Method for Associating a Multi-segment Component Transaction
CN104463460B (en) Processing method and processing device for the waiting information that network data is launched
CN114186102A (en) Tree structure data construction method and device and computer equipment
CN106844553B (en) Data detection and expansion method and device based on sample data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant