Summary of the invention
For above situation, for the defect for overcoming the prior art, the purpose of the present invention is just to provide one kind and fast implements point
It is casually arranged with standby central controlled method, can effectively solve the problems, such as silo dispersing apparatus centralized control.
The technical solution that the present invention solves is: one kind fast implements the central controlled method of dispersing apparatus, including server,
Controller and field device, server connect up PC machine by communication port, connect controller downwards, and controller passes through nothing
Line or wire communication field equipment connecting, method includes the following steps:
One, it establishes virtual warehouse: opening up a block space in the memory headroom of server, for storing the institute in virtual warehouse
There are data, virtual warehouse is equal with real warehouse quantity and corresponds;
Two, virtual unit is installed in each virtual warehouse, in each virtual warehouse the type, quantity of virtual unit with
Type, the quantity of field device in the corresponding real warehouse in the virtual warehouse are corresponding;It is synchronous that storehouse is established in each virtual warehouse
List;The synchronous list in each storehouse respectively distributes two buffer areas, storehouse main buffering region and storehouse pair buffer area, storehouse main buffering region be used for and
PC machine, field device carry out directly interactive, confirmation of the storehouse pair buffer area for information;
Three, it establishes communication station: opening up a block space in the memory headroom of server, for storing all numbers of communication station
According to, 1 controller at the corresponding scene of each communication station, communication station and amount controller are equal and correspond;
Four, physical equipment is installed in communication station, each communication station establishes synchronous list of standing, and is the synchronous list in each station
Interior physical equipment is numbered, and type, quantity and station of physical equipment correspond to controller and controlled in each synchronous list of standing
Type, the quantity of the field device of system are corresponding, i.e., each corresponding field device of physical equipment;The synchronous list in each station
Respectively two buffer areas of distribution, the secondary buffer area in station owner buffer area and station, station owner buffer area is used for and PC machine, field device carry out directly
Interaction is connect, secondary buffer area of standing is used for the confirmation of information;
Five, storehouse, mapping ruler of standing are established
The corresponding virtual unit of physical equipment in the synchronous list in each station for belonging to the same virtual warehouse is same in storehouse
It is renumberd in step list, establishes the synchronous list virtual unit in storehouse list physical equipment synchronous with station and map pass correspondingly
System;
Six, storehouse buffer data is synchronous synchronous with station buffer data
A, storehouse buffer data is synchronous, comprising the following steps:
A, status data is run simultaneously
(1) according to storehouse, mapping ruler of standing, the respective counts of the corresponding physical equipment of virtual unit are read in slave station main buffering region
According to;
It (2), will be in the virtual unit of the corresponding data write-in storehouse main buffering region of reading according to storehouse, mapping ruler of standing;
(3) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
B, simultaneously operating director data
Check whether specified data of the virtual unit in the major and minor buffer area in storehouse are identical, if identical, execute (1)-
(3) step, if it is different, then executing (4)-(6) step;
(1) according to storehouse, mapping ruler of standing, the respective counts of the corresponding physical equipment of virtual unit are read in slave station main buffering region
According to;
It (2) will be in the virtual unit of the corresponding data write-in storehouse main buffering region of reading;
(3) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
(4) virtual device data is read from the main buffering region of storehouse;
(5) according to storehouse, mapping ruler of standing, the corresponding physical equipment in station owner buffer area is written in the data that step (4) are read
In;
(6) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
B, station buffer data is synchronous, comprising the following steps:
(1) check whether data of the physical equipment of retaining zone in major and minor buffer area of standing are identical, if identical,
(1)-(5) step is executed, if it is different, then executing (6)-(8) step;
(1) order is sent, corresponding data is read from field device;
(2) etc. corresponding data message to be received, receives and successfully then executes (3)-(5) step, otherwise terminate;
(3) check whether data of the physical equipment of retaining zone in major and minor buffer area of standing are identical, if identical,
(4)-(5) step is executed, is otherwise terminated;
(4) in the corresponding physical equipment in data write-in station owner buffer area read step (1);
(5) physical device data update in station owner buffer area is synchronized in the secondary buffer area in corresponding station, is terminated;
(6) order is sent, corresponding field device is written into the data of physical equipment in station owner buffer area;
(7) etc. corresponding data message to be received, receives and successfully then executes (8) step, otherwise terminate;
(8) physical device data update in station owner buffer area is synchronized in the pair buffer area of corresponding station storehouse, is terminated.
The present invention passes through establishes virtual warehouse and communication station in the server, installs virtual unit in virtual warehouse,
Physical equipment corresponding with field device is installed in communication station, while establishing virtual unit and being reflected correspondingly with physical equipment
Relationship is penetrated, so that the data finally showed are the data with real warehouse (between storehouse for grain, etc.) for unit.Due to each grain depot, very
The controlled device quantity that each storehouse in same grain depot is installed is not quite similar, and each reservoir area needs to install 1 service
Device, thus every server managed warehouse quantity, the quantity of controlled device is different from each storehouse.If server
Its internal control method cannot be modified using easy method, then will result in technical staff need to be directed to different reservoir areas
Write different server programs, large labor intensity, it has not been convenient to safeguard, the present invention passes through this silo device data configuration side
Method solves problem above, and general server is communicated between field controller using low-speed long-range, communication bandwidth compared with
It is low, if individually reading the data of each virtual unit from each field controller, it is logical to will lead to frequent short packages
Letter, causes bandwidth availability ratio low, and equipment state updates slow, poor user experience;The corresponding scene control in each station in the present invention
Device processed, when synchrodata, can read data in batches from field controller, i.e., long data packet communication, reduce server and
The frequency of on-scene communication, improves bandwidth availability ratio, and the arrive at a station data synchronization of buffer area of storehouse buffer area carries out in the chip,
Using the high speed data bus of chip interior, user is improved to the rate of interaction of field controller, improves user's operation body
It tests, and method is simple, easy to operate, easy to use, effect is good, is the innovation in silo data processing method, there is good society
And economic benefit.
Specific embodiment
Below in conjunction with attached drawing, specific embodiments of the present invention will be described in further detail.
It is provided by Fig. 1-5, the present invention includes server, controller and field device, and server is upward by communication port
PC machine is connected, connects controller downwards, for controller by wirelessly or non-wirelessly communicating to connect field device, this method includes following
Step:
One, it establishes virtual warehouse: opening up a block space in the memory headroom of server, for storing the institute in virtual warehouse
There are data, virtual warehouse is equal with real warehouse quantity and corresponds;
As shown in the embodiment of fig. 1, containing 2 real warehouses (H1 between H1, storehouse for grain, etc. between storehouse for grain, etc.), then 2 void are established on the server
Quasi- warehouse, i.e., virtual warehouse A and virtual warehouse B;
Two, virtual unit is installed in each virtual warehouse, in each virtual warehouse the type, quantity of virtual unit with
Type, the quantity of field device in the corresponding real warehouse in the virtual warehouse are corresponding;It is synchronous that storehouse is established in each virtual warehouse
List, device category mainly include two class of motorized window and blower;The synchronous list in each storehouse respectively distributes two buffer areas, and storehouse is main slow
Area and storehouse pair buffer area are rushed, storehouse main buffering region is used for and PC machine, field device directly interact, and storehouse pair buffer area is for believing
The confirmation of breath;
As shown in Fig. 1,2 embodiments, in real warehouse H1 include the side wall controlled by controller A field device A1,
Field device A2, field device A3 and field device B1, field device B2, scene by the controller B another side wall controlled
Include in equipment B3, real warehouse H2 the field device A4 controlled by controller A, field device A5, field device A6 and by
Field device B4, the field device B5, field device B6 of controller B control, therefore, 2 storehouses are established in 2 virtual warehouses respectively
Synchronous list includes that and the synchronous list in corresponding first storehouse virtual warehouse A and the second storehouse corresponding with virtual warehouse B synchronizes column
Table, includes 6 virtual units in the synchronous list in the first storehouse, this 6 virtual units and the field device A1 controlled by controller A,
Field device A2, field device A3 and the field device B1 controlled by controller B, field device B2, field device B3 are closed
It is corresponding to count 6 field device types, quantity;The synchronous list in first storehouse respectively distributes two buffer areas, i.e. the first storehouse main buffering region
With the first storehouse pair buffer area;Second storehouse synchronizes 6 virtual units of list packet, this 6 virtual unit with controlled by controller A
Field device A4, field device A5, field device A6 and the field device B4 controlled by controller B, field device B5, show
Field device B6 adds up to 6 field device types, quantity corresponding;The synchronous list in second storehouse respectively distributes two buffer areas, i.e., and the
Two storehouses main buffering region and the second storehouse pair buffer area;
Three, it establishes communication station: opening up a block space in the memory headroom of server, for storing all numbers of communication station
According to, 1 controller at the corresponding scene of each communication station, communication station and amount controller are equal and correspond;
As shown in the embodiment of fig. 1, scene includes 2 controllers, respectively controller A and controller B, then on the server
Establish 2 communication stations, i.e. communication station A and communication station B;
Four, physical equipment is installed in communication station, each communication station establishes synchronous list of standing, and is the synchronous list in each station
Interior physical equipment is numbered, and type, quantity and station of physical equipment correspond to controller and controlled in each synchronous list of standing
Type, the quantity of the field device of system are corresponding, i.e., each corresponding field device of physical equipment;The synchronous list in each station
Respectively two buffer areas of distribution, the secondary buffer area in station owner buffer area and station, station owner buffer area is used for and PC machine, field device carry out directly
Interaction is connect, secondary buffer area of standing is used for the confirmation of information;
As shown in Fig. 1,2 embodiments, the synchronous list in 2 stations is established, first stop synchronizes list list synchronous with second station, the
It includes 6 physical equipments that one, which stands, which synchronizes in list, this 6 physical equipments is numbered, i.e. physical equipment A1, physical equipment
A2, physical equipment A3, physical equipment A4, physical equipment A5 and physical equipment A6, this 6 physical equipments are controlled with controller A respectively
Field device A1, field device A2, field device A3, field device A4, field device A5, the field device A6 mono- of system are a pair of
It answers, includes 6 physical equipments in the synchronous list of second station, this 6 physical equipments are numbered, i.e. physical equipment B1, physics
Equipment B2, physical equipment B3, physical equipment B4, physical equipment B5 and physical equipment B6, this 6 physical equipments respectively with control
Field device B1, the field device B2, field device B3, field device B4, field device B5, field device B6 mono- of device B control
One is corresponding, and the synchronous list of first stop respectively distributes two buffer areas, i.e. first stop main buffering region and first stop pair buffer area, and second
Synchronous list of standing respectively distributes two buffer areas, i.e. second station main buffering region and second station pair buffer area;
Five, storehouse, mapping ruler of standing are established
The corresponding virtual unit of physical equipment in the synchronous list in each station for belonging to the same virtual warehouse is same in storehouse
It is renumberd in step list, establishes the synchronous list virtual unit in storehouse list physical equipment synchronous with station and map pass correspondingly
System;
List synchronous for the first storehouse, the physical equipment in the synchronous list in each station for belonging to virtual warehouse A is corresponding
Virtual unit renumbers in the synchronous list in the first storehouse, that is to say, that virtual by 6 belonged in the synchronous list in the first storehouse
Equipment is numbered: virtual unit A1, virtual unit A2, virtual unit A3, virtual unit A4, virtual unit A5 and virtually setting
Standby A6, and belong to 6 physical equipments of virtual warehouse A are as follows: physical equipment A1, physical equipment A2, physical equipment A3, physics are set
Standby B1, physical equipment B2 and physical equipment B3;
Wherein, as shown in Fig. 2, virtual unit A1 is corresponding with physical equipment A1;
Virtual unit A2 is corresponding with physical equipment A2;
Virtual unit A3 is corresponding with physical equipment A3;
Virtual unit A4 is corresponding with physical equipment B1;
Virtual unit A5 is corresponding with physical equipment B2;
Virtual unit A6 is corresponding with physical equipment B3;
List synchronous for the second storehouse, the physical equipment in the synchronous list in each station for belonging to virtual warehouse B is corresponding
Virtual unit renumbers in the synchronous list in the first storehouse, that is to say, that virtual by 6 belonged in the synchronous list in the second storehouse
Equipment is numbered: virtual unit B1, virtual unit B2, virtual unit B3, virtual unit B4, virtual unit B5 and virtually setting
Standby B6, and belong to 6 physical equipments of virtual warehouse B are as follows: physical equipment A4, physical equipment A5, physical equipment A6, physics are set
Standby B4, physical equipment B5 and physical equipment B6;
Wherein, as shown in Fig. 2, virtual unit B1 is corresponding with physical equipment A4;
Virtual unit B2 is corresponding with physical equipment A5;
Virtual unit B3 is corresponding with physical equipment A6;
Virtual unit B4 is corresponding with physical equipment B4;
Virtual unit B5 is corresponding with physical equipment B5;
Virtual unit B6 is corresponding with physical equipment B6;
From the synchronous one-to-one mapping relations of list virtual unit list physical equipment synchronous with station in thirty years of age of storehouse;
Six, storehouse buffer data is synchronous synchronous with station buffer data
A, storehouse buffer data is synchronous, comprising the following steps:
A, status data is run simultaneously
(1) according to storehouse, mapping ruler of standing, the respective counts of the corresponding physical equipment of virtual unit are read in slave station main buffering region
According to;
It (2), will be in the virtual unit of the corresponding data write-in storehouse main buffering region of reading according to storehouse, mapping ruler of standing;
(3) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
B, simultaneously operating director data
Check whether specified data of the virtual unit in the major and minor buffer area in storehouse are identical, if identical, execute (1)-
(3) step, if it is different, then executing (4)-(6) step;
(1) according to storehouse, mapping ruler of standing, the respective counts of the corresponding physical equipment of virtual unit are read in slave station main buffering region
According to;
It (2) will be in the virtual unit of the corresponding data write-in storehouse main buffering region of reading;
(3) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
(4) virtual device data is read from the main buffering region of storehouse;
(5) according to storehouse, mapping ruler of standing, the corresponding physical equipment in station owner buffer area is written in the data that step (4) are read
In;
(6) virtual device data update in the main buffering region of storehouse is synchronized in corresponding storehouse pair buffer area;
B, station buffer data is synchronous, comprising the following steps:
Before station buffer data is synchronous, check whether the communication of communication station and field device is normal, if normally,
The information for obtaining field device and processing are communicated with field device, are executed station buffer data and are synchronized, otherwise terminate and (exit);
(1) check whether data of the physical equipment of retaining zone in major and minor buffer area of standing are identical, if identical,
(1)-(5) step is executed, if it is different, then executing (6)-(8) step;
(1) order is sent, corresponding data is read from field device;
(2) etc. corresponding data message to be received, receives and successfully then executes (3)-(5) step, otherwise terminate;
(3) check whether data of the physical equipment of retaining zone in major and minor buffer area of standing are identical, if identical,
(4)-(5) step is executed, is otherwise terminated;
(4) in the corresponding physical equipment in data write-in station owner buffer area read step (1);
(5) physical device data update in station owner buffer area is synchronized in the secondary buffer area in corresponding station, is terminated;
(6) order is sent, corresponding field device is written into the data of physical equipment in station owner buffer area;
(7) etc. corresponding data message to be received, receives and successfully then executes (8) step, otherwise terminate;
(8) physical device data update in station owner buffer area is synchronized in the pair buffer area of corresponding station storehouse, is terminated.
Wherein station buffer area, mapping ruler and storehouse buffer area are located in server, and server is connected upwards by communication port
PC machine is connect, connects field controller downwards.
The virtual unit in physical equipment and virtual warehouse in field controller, communication station has identity property, i.e., all has
Standby read-only status attribute and readable writeable controlled attribute;Such as the operating status attribute of motorized window have current operating conditions,
Current opening angle etc., controlled attribute have windowing, pass window, stopping etc.;
Since the read-only status attribute of field device is only used for the displaying of PC machine, so data flow is one-way flow, i.e.,
It stands buffer area-mapping ruler-storehouse buffer area-PC machine from field controller-, and controlled attribute data that device-readable is writeable (
Claim operational order) both most Zhongdao field controller can be issued by PC machine to change the operating status of field device, it can also be from
Field controller feds back through execute-in-place to PC machine, to PC machine to change the result of equipment running status.Since operational order
Direction be two-way, and the access of PC is random, then when the access of the same data occurs simultaneously for both direction
When, it will result in data collision, in order to avoid conflict, it is also considered that actual use situation, setting PC machine has highest access
Power retains the data transmitted from PC machine to field controller direction, abandons from field controller to PC that is, when sending out conflict
Data.So needing to know whether PC machine changes equipment state in the operational order transmission for carrying out an equipment.And in server
Inside, various communications and mapping ruler all employ independent task and carry out data transmission, in order to improve reliability and can
Maintainability, it is necessary to the relevance as far as possible between reduction task, so the event of PC machine access storehouse buffer area appoints mapping ruler
Business can not directly be found out.In order to solve this problem, when creating storehouse buffer area, server can be created automatically for each storehouse
A secondary buffer area is built, PC machine can only access main buffering region, after PC machine changes the operational order in the main buffering region of storehouse, mapping
Regular Task is instructed by the data of comparison major-minor buffer area same position it can be learnt that whether PC machine changes equipment operation,
It is aware of the intention of PC machine.
In the buffer data synchronizing step of storehouse, detect the data currently to be synchronized if it is running state data, then such
The data flow of type is to read physical device data in slave station main buffering region first, then basis from field controller to PC machine
Mapping ruler, finding corresponding to the equipment is which virtual unit in which storehouse, then writes data into storehouse main buffering region
In corresponding position.Then this device data in the main buffering region of storehouse is updated into secondary buffer area again.If the number to be synchronized
According to being operational order, then first determine whether specified data of the virtual unit in the major and minor buffer area in storehouse are identical, if it is different,
Then illustrate that PC machine changes equipment state, then reading the device data in the main buffering region of storehouse according to the high principle of PC priority
Afterwards, mapping ruler table is searched, which physical equipment of the physical equipment corresponding to the virtual unit in which station is found, it will
Data are write in the physical equipment;If comparison is identical, the process that data are transmitted from field controller to PC machine is executed.
It stands in buffer data synchronizing step, checks data of the physical equipment of retaining zone in major and minor buffer area of standing
It is whether identical, if identical, major and minor buffer data comparison of standing twice has been carried out altogether, the reason is that station buffer data is synchronous
Task is by the controller communication of the physical communication port and scene of server, which is low-speed communication, the reading of every batch data
The time for taking needs to expend is longer, such as 100mS, and correlation data is identical before communication is read, in communication process, PC machine
The data in station owner buffer area may have been changed indirectly, due to the high priority principle of PC machine, the data flow being changed
Can only be from PC machine to field controller, so obtain from field device read data after, then carry out once compare sentence
Disconnected, the operational order for ensuring that PC machine issues so reliably reaches in field controller.
By above situation it should be apparent that the present invention by establishing virtual warehouse and communication station in the server,
Virtual unit is installed in virtual warehouse, physical equipment corresponding with field device is installed in communication station, while establishing and virtually setting
It is standby with the one-to-one mapping relations of physical equipment so that it is single that the data finally showed, which are with real warehouse (between storehouse for grain, etc.),
The data of position.Since the controlled device quantity that each storehouse in each grain depot, even same grain depot is installed is not quite similar, and
Each reservoir area needs to install 1 server, thus every server managed warehouse quantity, controlled device in each storehouse
Quantity is different from.If server cannot modify its internal control method using easy method, skill will result in
Art personnel need to write different server programs, large labor intensity for different reservoir areas, it has not been convenient to safeguard, the present invention passes through
This silo device data allocation method solves problem above, and method is simple, easy to operate, easy to use, and effect is good, is
Innovation in silo data processing method has good social and economic benefit, compared with prior art, have the advantage that
(1) present invention fast implements user to scene by opening a position, building a station and establishing the theory (method) of mapping ruler
The control of equipment, the thinking that this method is solved the problems, such as closer to ordinary people are easy to be slapped by the user of no professional technique background
It holds;
(2) equipment that each field controller is controlled is reintegrated so that be presented to the user be still with
Storehouse is managed for unit, more meets the demand of user;
(3) design philosophy for using task separate type, improves the reliability and maintainability of system, reduces exploitation
Difficulty and development amount;
(4) utilization rate for improving on-scene communication bandwidth improves user's operation experience;
(5) field wiring becomes single side wiring from the wiring of single storehouse, reduces field wiring difficulty, has saved wiring cost,
Improve execute-in-place experience.