Summary of the invention
In view of this, the invention provides a kind of control method of control point, can reduce the control time delay effectively.
For achieving the above object, the invention provides a kind of control method of control point, this method may further comprise the steps:
A. management server is after candidate user is successfully landed, and client is returned control information to the candidate user place;
B. candidate user sends the control command carry control information by client to the control point, and when determining that according to the control information that receives the control of control point distributed to this candidate user in the control point, the action of control command correspondence is carried out in the control point.
Wherein, the described control information of steps A comprises the Permission Levels and the affiliated area of candidate user, and then the described control point of step B determines that according to the control information that receives the control of control point is distributed to this candidate user is:
B1. the control point parses the Permission Levels and the affiliated area of candidate user from control command, the Permission Levels of judging candidate user whether greater than, be equal to or less than the current controlling grade of control point, if greater than, execution in step B3 then; If equal, execution in step B2 then; If less than, judge that then candidate user haves no right to obtain the control of control point, and finish this control allocation flow;
Whether the affiliated area of B2. judging candidate user is identical with the current region of control point, if, execution in step B3 then; Otherwise the judgement candidate user haves no right to obtain the control of control point, and finishes this control allocation flow;
B3. the control of control point gives candidate user, and the current control hierarchy of control point equals the Permission Levels of candidate user, and finishes this control allocation flow.
Wherein, further comprise in the described control command: the Internet Protocol IP address of candidate user, if step B1 is described equal after, further comprise:
Whether the affiliated area of judging candidate user is identical with the user's who has control affiliated area, if, then according to the IP address of candidate user with have the user's IP address of control, determine the distribution of control, and when described control is assigned to described candidate user, carry out described step B3; Otherwise, carry out described step B2.
Wherein, described IP address and the user's IP address that has control according to candidate user, determine being assigned as of control:
Whether the IP address of judging candidate user greater than the user's IP address that has control, if greater than, then judge control is distributed to this candidate user; If less than, judge that then candidate user haves no right to obtain the control of control point.
Wherein, whether the described IP address of judging candidate user further comprises greater than after the user's IP address that has control:
If the IP address of candidate user equals to have the user's IP address of control, then judge whether to give described candidate user with described control according to the user name of candidate user and the user name that has a user of control, if, execution in step B3 then; Otherwise the judgement candidate user haves no right to obtain the control of control point, and finishes this control allocation flow.
Wherein, the described control point of step B parses after the Permission Levels and affiliated area of candidate user, further comprises:
Whether the Permission Levels of judging this candidate user greater than 0, if, the then described judgement of execution in step B1; Otherwise, judge that this candidate user haves no right to obtain the control of control point, and finish this control allocation flow.
Wherein, described judgement candidate user haves no right to obtain further to comprise after the control of control point: determine that control obtains failure cause, and with described failure cause as the information of rejecting, return to client.
Wherein, before the described steps A, further comprise:
Candidate user is passed through the place client, sends the request of landing to management server, and management server is verified described candidate user according to the request of landing that receives, and by checking the time, the judgement candidate user is successfully landed.
Wherein, the described control point of step B is carried out after the action of control command correspondence, further comprises: the control point will move implementation status information and return to described client.
Wherein, set in advance control hierarchy thresholding recovery time, after the described step B, further comprise:
After described candidate user discharged control, if reach control hierarchy thresholding recovery time and do not have the control of the described control point of candidate user acquisition request, then this control point reduced to 1 with the current control hierarchy of self.
Wherein, set in advance waiting list and control hierarchy restore cycle, after the described step B, further comprise: when existence and candidate user are sent control command simultaneously but do not obtained the user of control, described user's user information corresponding is put into waiting list;
Described control point reduces to 1 with the current control hierarchy of self:
C1. judge whether there is the user in the waiting list, if, execution in step C2 then; Otherwise under the situation without any user's acquisition request control, directly the current control hierarchy with this control point is reduced to 1, and finishes to reduce the flow process of current control hierarchy;
C2. judge whether there be the user of Permission Levels in the waiting list more than or equal to the control hierarchy of control point, if, then with Permission Levels more than or equal to the user of the control hierarchy of control point as candidate user, and return and carry out described step B; Otherwise, execution in step C3;
Whether the current control hierarchy of C3. judging the control point greater than 1, if, then reaching control hierarchy during the restore cycle, the current control hierarchy of this control point is subtracted 1, and return execution in step C2; Otherwise end reduces the flow process of current control hierarchy.
The present invention also provides a kind of supervisory control system, can reduce the control time delay effectively.Supervisory control system among the present invention comprises:
Client, management server and control point, wherein,
Described client is used to receive the control information of the candidate user that comes from management server, and the control information of candidate user is carried in the control command, sends to the control point;
Described management server is used to preserve the candidate user control information corresponding, and control information is returned to the client at candidate user place;
Described control point is used to receive the control command that carries control information that comes from client, when giving this candidate user according to the definite control with the control point of the control information that receives, carries out the action of control command correspondence.
Wherein, described control point is further used for sending log-on message to management server, receives to come from the current region information of described management server, and stores;
Described management server is used to receive next in the log-on message of control point, is that this control point distributes current region, and described current region information is sent to the control point.
The present invention provides a kind of control point again, can reduce the control time delay effectively.Control point among the present invention comprises:
Transceiver module and control module, wherein,
Described transceiver module is used to receive the control command that comes from client, and the control command that receives is transmitted to control module;
Described control module is used to receive the control command that comes from transceiver module, from control command, parse control information, current state of a control information according to control information and control point, determine whether to transfer control, when determining to transfer control, the action message in the control command is sent.
Wherein, described control point further comprises: memory module, and the current state of a control information that is used to store the control point, and the current monitor state information of being stored sent to described control module.
Wherein, described control point further comprises: Executive Module is used to receive the action message that comes from control module, and carries out the action of the action message correspondence that receives.
Wherein, described control module is further used for determining to reject reason when resolved friendship control, and with the determined reason of rejecting as the information of rejecting, send to described transceiver module;
Described transceiver module is used to receive the information of rejecting that comes from control module, and the information of rejecting that will receive sends to described client.
Wherein, described Executive Module is further used for action implementation status information is sent to control module;
Described control module is used to receive the action implementation status that comes from Executive Module, and the action implementation status information that will receive sends to transceiver module;
Described transceiver module is further used for receiving the action implementation status information that comes from control module, and the action implementation status information that will receive returns to described client.
Wherein, described control module is further used for sending simultaneously under the situation of control command a plurality of users, after distributing control, the user profile of will sending control command but not obtaining control sends to memory module, after the user who obtains control discharges control, from memory module, read waiting list, carry out the reduction of current control hierarchy;
Described memory module also is used to receive the user profile that comes from control module, and the user profile that receives is kept in the waiting list that sets in advance.
Use the present invention, can reduce the control time delay the when control point controlled effectively.Particularly, the present invention has following beneficial effect:
1. the control command of sending by each control point direct reception client end among the present invention, and the distribution of responsible relevant control with this control point.Like this, therefore concentrating on originally in the management server of task changes by sharing each control point, and task amount is less relatively in each control point so, and the response delay of the control command that the user is sent by client is less, improve the control messages of supervisory control system, strengthened user experience.And, because control command can directly arrive the control point from client among the present invention, and need not forwarding through management server, therefore can further reduce the response delay of control command.
2. because client can be directly and the control point intercommunication among the present invention, further alleviated the load of management server, and when management server occurs when unusual, the client that has obtained control information still can normally be carried out control to the control point, has improved the anti-disaster ability of supervisory control system effectively.
Embodiment
For making purpose of the present invention, technical scheme clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
For the control method of control point among the present invention, its basic thought is: by the distribution of control point decision control authority.
Based on above-mentioned thought, Fig. 3 shows the exemplary process diagram of the control method of control point among the present invention.Referring to Fig. 3, this method comprises:
In step 301, management server is after candidate user is successfully landed, and client is returned control information to the candidate user place;
In step 302, candidate user sends the control command that carries control information by client to the control point, when determining that according to the control information that receives control with the control point gives this candidate user in the control point, the action of control command correspondence is carried out in the control point.
Be example with the audio/video monitoring below, the control point controlling schemes among the present invention is elaborated.
Fig. 4 shows the flow chart of control point control method in the present embodiment.Referring to Fig. 4, this method comprises:
In step 401~402, the user sends the request of landing that carries username and password by client to management server, and request is landed; Management server verifies that to username and password after by checking, the notice client is landed success and returned control information.
In the present embodiment, set up the user rights database be used to preserve user profile in the management server in advance, whether user profile wherein comprises user name, password, user right grade, user's affiliated area, activate and on-line time etc.In addition, the user right grade here is the grade that management server is provided with for the ease of the authority height of distinguishing each user, for example, the user right grade is minimum to be 0, is up to 15, and numeral is big more, grade is high more, and the possibility that obtains the control point control is also big more.
When management server receive come from client land request after, land from this and to parse username and password request, then with user's index by name, the retrieval user rights database, retrieving under this user name respective items purpose situation, judging whether the password that receives is consistent with the password in the project that retrieves, if, then decision verification passes through, otherwise the decision verification failure.In addition, if can't retrieve the project of user name correspondence, also decision verification failure.
If the user has passed through the checking of management server, then management server as control information, returns to the user with this user's Permission Levels and affiliated area, so as in the subsequent step control point with control information as the foundation that whether gives control.And after this this user can be used as the control that candidate user is grabbed the control point.
In step 403, candidate user sends the control command that carries control information by client to the control point, and request obtains the control of this control point.
When candidate user need obtain the control of control point, in this step by client to the control point transmitting control commands.For instance, present embodiment can adopt the control command of all forms as shown in table 1 to come control right request.
Header |
The IP address |
User name |
Permission Levels |
The user area |
Action |
8 bytes |
4 bytes |
16 bytes |
4 bytes |
4 bytes |
16 bytes |
Table 1
In table 1, header can be User Datagram Protocol (UDP) header, the action representative of consumer needs the performed action in control point, for example: certain camera that the control point connected turn to, adjust that aperture, numeral become doubly, the starting or stoping etc. of focusing, rain brush/spraying, the turning to of the microphone The Cloud Terrace that perhaps control point connected, volume or the like.
In step 404~405, the control point judges whether to give this candidate user with control, if then execution in step 406 according to self current state of a control and the control command that receives; Otherwise the control point returns the information of rejecting to client, rejects the request of user about the acquisition control, and finishes this control flow.
Here when the user can't obtain the control of control point, the control point returns rejects and includes control in the information and obtain failure cause, so that improve service quality, strengthens user experience.
In step 406, the action of control command correspondence is carried out in the control point, and returns implementation status information to client.
Successfully get access to the control of control point when candidate user after, candidate user becomes the user of user's control, and corresponding action is carried out according to control command in this step in the control point, and will reflect that the execution result of implementation status returns to client, so that the user checks.Particularly, when the action in the control command when audio frequency or vision signal are provided, client is given with the image or the sound feedback that collect in the control point; When the action in the control command when adjusting in to the control point, what then returned to this moment is the information that representative is adjusted successfully or failed.
So far, finish control point control flow in the present embodiment.
For above-mentioned steps 404, conduct determines whether that the factor that gives control can comprise: user's Permission Levels and user's affiliated area in the present embodiment.Fig. 5 shows the method flow diagram that control point in the present embodiment determines that control is distributed.Referring to Fig. 5, the distribution of this control comprises:
In step 501~503, the control point parses the Permission Levels and the affiliated area of candidate user from control command, and whether the Permission Levels of judging this candidate user are greater than 0, if then execution in step 504; Otherwise the reason of control being obtained failure is defined as: the user haves no right to control the control point, and finishes this control allocation flow.
In the present embodiment, the acquiescence initial rights grade of control point is 1, promptly has only Permission Levels more than or equal to 1 the candidate user control of just having the right to obtain, and the user right grade is that 0 candidate user then haves no right any control is carried out in the control point.Therefore, be that the request that only need directly reject this candidate user get final product, and need not to carry out other follow-up relatively judgement under 0 the situation in the Permission Levels of candidate user.
In step 504~505, the Permission Levels of judging candidate user whether greater than, be equal to or less than the current controlling grade of control point, if greater than, then execution in step 507; If equal, then execution in step 506; If less than, the reason of then control being obtained failure is defined as: the control of control point is in the control of advanced level user, and finishes this control method flow.
In the present embodiment, the current controlling grade of so-called control point is meant the minimum user right grade that the full user of control that can obtain this control point should possess, usually this current controlling grade equals to hold the user's of control Permission Levels, and when the control of each control point ownership changed, the current controlling grade of this control point all became consistent with the user's who has control Permission Levels.So, when the Permission Levels of candidate user were lower than the user who has control, candidate user can't be grabbed control, therefore wanted monitored point to reject.In addition, for candidate user can clearly be rejected reason, then definite control is obtained the concrete reason of failure, so that return to client in step 405.
In step 506, judge whether the affiliated area of candidate user is identical with the current region of control point, if then execution in step 507; Otherwise, execution in step 508.
In supervisory control system, each control point can only be monitored the scope of self physical address corresponding representative, then adopts current region to represent the scope of setting up of control point correspondence.Here, when candidate user has identical Permission Levels with the user who has control,, determine whether to give control by comparing the current region of user's affiliated area and control point.For example, the current region of supposing the control point is the Haidian District, and the affiliated area of candidate user A is the Haidian District, and user's affiliated area of control owner user B is the Chaoyang District.Because when initial configuration, user's affiliated area is represented this user's compass of competency, and therefore, candidate user A needs to obtain the picture or the sound of the control point feedback of corresponding region more, then when candidate user A sent control command, the control point was preferentially controlled by user A.
In step 507, the control of control point gives candidate user, and the current control hierarchy of control point equals the Permission Levels of candidate user, and finishes this control allocation flow.
In the Permission Levels of candidate user current control hierarchy greater than the control point, perhaps the Permission Levels of candidate user equal the current region of the current control hierarchy of control point and affiliated area and control point when identical, the control of control point is transferred this candidate user to, and the Permission Levels that the current control hierarchy of control point also becomes with candidate user are consistent.
In step 508, the reason of control being obtained failure is defined as: the control of control point is in the user's at the same level control, and finishes this control allocation flow.
The current region that equals the current control hierarchy of control point and affiliated area and control point in the Permission Levels of candidate user not simultaneously, the control of control point can not be had by this candidate user, therefore, rejects request.
So far, finish control allocation flow in the present embodiment.
In addition, can set in advance waiting list, when having the control of a plurality of user's acquisition request control point simultaneously, according to definite candidate user such as Permission Levels, affiliated area, IP address and user name of all users.After control assigned, the user that the request of will initiating does not still obtain control joined in the waiting list.In addition, can also set in advance control hierarchy thresholding recovery time and control hierarchy restore cycle, after the user discharges control, reach control hierarchy thresholding recovery time, reduce the current control hierarchy of control point according to each following step:
A. judge whether there is the user in the waiting list, if, execution in step b then; Otherwise under the situation without any user's acquisition request control, directly the current control hierarchy with this control point is reduced to 1, and finishes to reduce the flow process of current control hierarchy;
B. judge whether there be the user of Permission Levels in the waiting list more than or equal to the control hierarchy of control point, if, then with Permission Levels more than or equal to the user of the control hierarchy of control point as candidate user, and return execution in step 404 and subsequent step; Otherwise, execution in step c;
Whether the current control hierarchy of c. judging the control point greater than 1, if, then reaching control hierarchy during the restore cycle, the current control hierarchy of this control point is subtracted 1, and return execution in step b; Otherwise end reduces the flow process of current control hierarchy.
Certainly, there are a plurality of users to send under the situation of control command at the same time, also can not adopt waiting list, and directly the current control hierarchy of control point is reduced to 1.No matter adopt which kind of mode, the purpose of the current control hierarchy of above-mentioned reduction is: after preventing that the higher user of Permission Levels from discharging control, the user that Permission Levels are lower can't control the control point.
According to above-mentioned Fig. 4 and flow process shown in Figure 5, the current control hierarchy of supposing the control point is 1, and current region is a.User X is to the control point transmitting control commands, and the Permission Levels that indicate user X are 4, affiliated area is e.Since the unmanned control in control point this moment, and the Permission Levels of user X are higher than the current control hierarchy of control point, and therefore, user X obtains control.When user X did not discharge control as yet, Permission Levels were respectively 1,0 and 3 user Y, Z, W and send control command in succession, but since their Permission Levels all less than the Permission Levels 4 of user X, so control is still had by user X.During user X has control, user V sends and requires to obtain control, because the Permission Levels of user V are the same with user X to be 4, whether the affiliated area of then judging user V is identical with the current region a of control point, and the affiliated area of user V is a, control is transferred user V to so, and this moment, the current control hierarchy of control point still was 4.When user V did not discharge control, user U sent control command, because the Permission Levels of user U are 6, greater than the current controlling grade 4 of control point, therefore, user U obtains control, and the current controlling grade of control point is updated to 6.
Suppose that control hierarchy thresholding recovery time is 5 seconds, the control hierarchy restore cycle is 3 seconds, if after then beginning 5 seconds from user U release control, and has the user to wait for the acquisition control in waiting list, be the cycle then, reduce the current control hierarchy of control point step by step with 3 seconds.Suppose that there is not 3 user T of Permission Levels in waiting list, then user T obtained the control of control point in 14 seconds after user U discharges control.Perhaps, after discharging control from user U and beginning 5 seconds, there is not the user in the waiting list and do not have other user's acquisition request controls yet, the current control hierarchy of control point directly is reduced to 1 from 6.
In addition, consider that candidate user may have identical Permission Levels and affiliated area with the user who has control, then can utilize the IP address in the control information in the present embodiment, further compare.In other words, when the Permission Levels of candidate user in the step 504 equal the current control hierarchy of control point, whether the affiliated area of judging candidate user is identical with the user's who has control affiliated area, if then carry out candidate user and the comparison that has the user's IP address of control; Otherwise, execution in step 506.When IP address relatively, whether the IP address of judging candidate user greater than the user's IP address that has control, if greater than, then give control in the execution in step 507 and make current control hierarchy equal the operation of the Permission Levels of this candidate user; If less than, such according to step 508, the reason of control being obtained failure is defined as: the control of control point is in the user's at the same level control.When the IP address equates, can judge further whether the letter or the phonetic of the user name correspondence of candidate user is positioned at before the user who has control in alphabet, if then execution in step 407; Otherwise, execution in step 508.
More than only there is a candidate user to send the situation of control command,, also can determines whether to give control according to above-mentioned thought if a plurality of user sends control command simultaneously for the same time.In other words, a plurality of candidate user are compared simultaneously with the user who has control.
By above-mentioned description as seen, when carrying out control point control, determine the ownership of control by each control point, but not carry out unified management in the present embodiment by management server.Like this, because the processing of the control relevant with self only is responsible in each control point, workload reduces greatly, thus the response time significantly reduce, response speed increases substantially.
In order to guarantee carrying out smoothly of above-mentioned control point control procedure, present embodiment also provides a kind of supervisory control system.Fig. 6 shows the system construction drawing of supervisory control system in the present embodiment.Referring to Fig. 5, this supervisory control system comprises: client, management server and control point.
In the supervisory control system of present embodiment, client is used to receive the control information of the candidate user that comes from management server, and the control information of candidate user is carried in the control command, sends to the control point.Management server is used to preserve the candidate user control information corresponding, and control information is returned to the client at candidate user place.The control point is used to receive the control command that carries control information that comes from client, when giving this candidate user according to the definite control with the control point of the control information that receives, carries out the action of control command correspondence.
Control point in the present embodiment comprises: transceiver module, memory module, control module and Executive Module.Wherein, transceiver module is used to receive the control command that comes from client, and the control command that receives is transmitted to control module.Memory module is used to store the current state of a control information of control point.Control module is used to receive the control command that comes from transceiver module, from control command, parse control information, and from memory module, obtain the current state of a control information of control point, current state of a control information according to control information and control point, determine whether to transfer control, when determining to transfer control, the action message in the control command is sent to Executive Module.Executive Module is used to receive the action message that comes from control module, carries out the action of the action message correspondence that receives.
In addition, control module can also determine to reject reason when resolved friendship control, and with the determined reason of rejecting as the information of rejecting, send to transceiver module.Executive Module can also send to control module with action implementation status information, and the action implementation status information that control module will receive again sends to transceiver module.At this moment, transceiver module receives and to come from the action implementation status information of control module or to reject information, and the action implementation status information that will receive or the information of rejecting return to client.
And, control module is under the situation of a plurality of users' while acquisition request controls, after distributing control, the user profile that to initiate request but not obtain control sends to memory module, after the user who obtains control discharges control, from memory module, read waiting list, carry out the reduction of current control hierarchy.Memory module also is used to receive the user profile that comes from control module, and the user profile that receives is kept in the waiting list that sets in advance.
Generally, the control point also needed to send log-on message to management server before using, management server is that the control point distributes current region, and the current region information of being distributed returned to the control point, set up the control point current region information that receives is stored in the memory module of self.
As seen from the above technical solutions, the control command of sending by each control point direct reception client end in the present embodiment, and the distribution of responsible relevant control with this control point.Like this, therefore concentrating on originally in the management server of task changes by sharing each control point, and task amount is less relatively in each control point so, and the response delay of the control command that the user is sent by client is less, improve the control messages of supervisory control system, strengthened user experience.In addition, because client can be directly and the control point intercommunication, further alleviated the load of management server, and occurred when unusual when management server, the client that has obtained control information still can normally be carried out control to the control point, has improved the anti-disaster ability of supervisory control system effectively.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being made, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.