Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a device management method, which can be specifically executed by gateway equipment and comprises the following steps:
the gateway receives an acquisition mode sent by the DMS, acquires the management information of the local area equipment from the local area equipment according to the acquisition mode, and returns the management information of the local area equipment to the DMS according to a received acquisition command, wherein the acquisition command indicates that the DMS needs to acquire the management information of the local area equipment; and/or
The gateway receives the acquisition requirement sent by the DMS, returns the management information of the local area equipment to the DMS according to the received acquisition command and the acquisition command indicates that the DMS needs to acquire the management information of the local area equipment.
The acquisition mode is used for indicating the mode of the gateway for acquiring the management information from the local device, the acquisition request is used for representing the requirement of the DMS on the management information, and the gateway is indicated to return the management information meeting the requirement to the DMS according to the acquisition request when receiving the acquisition command. The DMS can flexibly set an acquisition mode and/or an acquisition requirement for the gateway according to specific conditions, so that the gateway can adjust the management information returned to the DMS according to the specific conditions, the success rate of the DMS for acquiring the local device management information through the gateway is improved, and the management information meeting the requirements can be accurately acquired.
Example one
Fig. 1 is a flowchart of an apparatus management method according to an embodiment of the present invention, where an acquisition requirement and an acquisition requirement may be set relatively independently, and this embodiment takes setting an acquisition requirement and an acquisition requirement at the same time as an example to describe, and specifically includes the following steps:
step 110, the gateway receives the acquisition mode from the DMS so as to set a mode for the gateway to acquire the management information from the local area equipment;
step 120, the gateway receives the acquisition request from the DMS, and the acquisition request indicates a requirement of the DMS for the management information to be acquired in a manner of setting the gateway to return the management information to the DMS;
step 130, the gateway receives the acquisition command from the DMS, and returns management information to the DMS according to the acquisition request, where the management information is acquired from the local device according to the acquisition mode and the acquisition request.
In particular applications, the DMS may provide the acquisition requirements and/or the acquisition mode to the gateway in a variety of forms. For example, the acquisition request and/or the acquisition mode sent by the DMS may be received before the acquisition command is received.
Alternatively, the acquisition request and/or the acquisition mode may be analyzed from an acquisition command sent by the DMS. That is, when the DMS sends an acquisition command to acquire management information, the gateway is instructed about the acquisition manner and/or acquisition requirement of the local device.
The setting of the acquisition mode and/or the acquisition requirement mode can be divided into static setting and dynamic setting, which are described below.
Example two
Fig. 2 is a flowchart of a device management method according to a second embodiment of the present invention, specifically, a static setting obtaining manner and a obtaining requirement manner. The static setting mode is to set the acquisition mode and/or the acquisition requirement before sending the acquisition command, and is implemented by, for example, the following procedures:
step 210, the gateway receives a setting command sent by the DMS;
step 220, the gateway sets a local acquisition requirement flag bit of the gateway according to the setting command to represent the acquisition requirement, and/or sets a local acquisition mode flag bit of the gateway according to the setting command to represent the acquisition mode.
In step 220, the representation of the acquisition mode and the acquisition requirement can be represented by the nodes of the management tree, that is:
the gateway sets node attributes of corresponding nodes in a management object corresponding to local equipment in a local management tree or sets a node value of a specified node in the local management tree according to a setting command, wherein the node value is used as an acquisition requirement flag bit and/or an acquisition mode flag bit to indicate that management information of the corresponding node or management information of a management sub-tree started from the corresponding node is acquired according to an acquisition requirement and/or an acquisition mode.
The DM management tree, the management object, is composed of nodes, such as a root node, an internal node, and a leaf node. The root node is the uppermost node in the management tree, the leaf node may have a node value but no child node, and the internal node may not have a node value but may have a child node. One internal node other than the root node and all nodes below it are called a management sub-tree. Some attributes of the internal node may be used to represent related information of its child node or all nodes below it, for example, an Access Control List (ACL) attribute of the internal node may be used to carry a change authority of the server to the child node below it, and for example, a "Type" attribute of the internal node may represent an identifier of the entire management sub-tree. In this embodiment, the designated node may be configured to enable the gateway to implement a function of controlling a manner in which the gateway acquires the management information from the local device, or may indicate a requirement when the server acquires the management information from the gateway. The designated node may be configured to indicate an acquisition manner or an acquisition requirement for all management information, or may be configured to add management object identification information to the designated node to indicate an acquisition manner or an acquisition requirement for part of the management information.
The technical scheme utilizes the function of the existing management tree, and controls the mode of providing the management information corresponding to the node to the DMS by setting the node attribute or adding the designated node.
In practical application, the setting command may be carried by an existing command, for example, by using a "Replace" command, and the contents of the command are as follows:
<Replace>
<CmdID>2</CmdID>
<Item>
<Target>
<LocURI>./UPnP_Device_1/UPnP/MD/DeviceInfo/EE/Status?
prop=GetProp</LocURI>
</Target>
<Data>2</Data>
</Item>
</Replace>
the above "Replace" command represents setting the "getprep" attribute value of the "Status" node to "2". "getprep" is an acquisition mode identifier, and "2" represents a certain acquisition mode that is agreed. The command to set the acquisition requirement is similar. When the node value of the designated node is set, a node named "getprep" may be set.
EXAMPLE III
The device management method provided by the third embodiment of the invention specifically is a method for dynamically setting an acquisition mode and an acquisition requirement. The dynamic setting mode is to set the acquisition mode and/or the acquisition requirement when the acquisition command is sent, and the acquisition mode and/or the acquisition requirement are carried in the acquisition command.
In practical application, the obtaining command may adopt an existing command, for example, a "Get" command, and the command content is as follows:
<Get>
<CmdID>4</CmdID>
<Item>
<Target>
<LocURI>./AGetFlag=1&GetProp=1</LocURI>
</Target>
</Item>
</Get>
in the "LocURI" field of the above-mentioned get command, is a Uniform Resource Identifier (URI) used later? The number carries an acquisition mode identification field "getprep ═ 1", and an acquisition requirement identification field "GetFlag ═ 1". The acquisition mode identifier and the acquisition request identifier may also be carried in a "Data" element of the "Get" command, such as < Data > "GetFlag ═ 1& getprep ═ 1" </Data >, and may also be placed in other fields in the "Get" command. The "Get" command may also carry only the acquisition mode, or only the acquisition requirement.
In specific application, the acquisition mode and the acquisition requirement can be set according to the situation, and some identifiers can be appointed between the gateway and the DMS to represent some set acquisition modes.
When acquiring management information corresponding to a certain node, several preferred acquisition modes are as follows:
1) when the gateway recognizes that the acquisition mode is the first mode, for example, recognizes that "getprep ═ 1", the management information is acquired from the local device when the acquisition command is received.
The first mode is a direct acquisition mode, which takes the reception of an acquisition command as a trigger condition.
2) When the gateway recognizes that the acquisition mode is the second mode, for example, recognizes that "getprep ═ 2", the gateway subscribes to the local area device for the management information, receives the management information sent by the local area device according to the subscription, and stores the management information locally.
The second mode is a subscription mode, that is, the gateway needs to subscribe the change of a certain management object to the local area device, and the local area device reports the changed management information to the gateway when the management information of the management object changes, so as to ensure that the management information is up-to-date. The subscription mode is realized by the local area equipment to report in real time, and is irrelevant to whether the gateway receives the acquisition command or not. In the subscription mode, the management information stored locally by the gateway may be considered to be up-to-date. If the local area device is online and the management information is updated, the local area device reports the latest management information according to a subscription mode, and if the local area device is in an offline state or the management information is not updated, the gateway cannot acquire the latest management information at the moment, and the currently stored management information is still the latest management information which can be currently acquired.
3) When the gateway recognizes that the acquisition mode is the third mode, for example, recognizes that "gethop ═ 3", the local area device is set to report the management information according to the set period, and receives the management information sent by the local area device according to the set period, and stores the management information locally.
The third mode is a periodic acquisition mode, the gateway needs to set a periodic reporting rule to the local area device, the local area device periodically initiates a session to inform the change condition of the gateway management object, and the gateway needs to report even if the management information does not change, so that the gateway can determine the latest condition of the management information.
In a third mode, the DMS may further specify a specific length of the Period, for example, every minute, hour, day, etc., and the specified method may be to use a Period identifier, for example, a "Period" identifier, such as setting "Period ═ 1 min" or "Period ═ 60 min", etc. The period identifier may be stored in a node as a node attribute value, or as a node value of another designated node. The period identification is valid in a third mode.
For the second mode and the third mode, the gateway needs to communicate with the local area device when setting the acquisition mode, and the local area device is set to realize the setting of the acquisition mode. After subscribing the management information to the local device or setting the local device to report the management information according to the set period, the gateway can also return the subscription or setting result to the DMS.
4) When the gateway recognizes that the acquisition mode is the fourth mode, for example, recognizes that "gethop ═ 4", the management information is synchronized from the local device and stored locally when the acquisition command is received.
The fourth mode is a synchronization mode, that is, the gateway initiates synchronization to the local area device when receiving the acquisition command, for example, synchronization is performed using an OMA DS protocol, or other synchronization protocols supported by the gateway and the local area device, for example, a function of extending a Universal Plug and Play (UPnP) DM protocol to support synchronization.
The aim of synchronization is to reduce the amount of information transmission between the gateway and the local area device as much as possible, and to send only the management information changed on the local area device after the last synchronization is completed to the gateway.
The fourth mode may be set on a leaf node, but is preferably set for an internal node, so that the gateway performs a synchronization operation on a lower-layer management sub-tree node of the internal node, which may prevent the gateway from acquiring redundant node information, and if the acquisition mode of the internal node is set to the first mode, the gateway may acquire management information of all lower-layer nodes, which may cause resource waste.
In the case of the fourth mode, the DMS may also specify a synchronization period, such as every minute, every hour, every day, and the like, and specifically may also be implemented by setting a period identifier. The synchronous period identifier and the period identifier reported periodically can adopt the same node attribute field, and when the acquisition mode is set to be the third mode or the fourth mode to be effective, other acquisition modes are not effective.
The above-mentioned acquisition modes can be arbitrarily selected and combined or individually adopted, and the actual acquisition modes include, but are not limited to, the above-mentioned several.
In specific applications, several preferred acquisition requirement forms are as follows:
1) when the gateway recognizes that the acquisition request is the first request, for example, "GetFlag" is 1 ", it indicates that the gateway should acquire the latest management information from the local device or search the latest management information of the local device locally, and return the latest acquired or locally stored management information to the DMS.
The first requirement indicates that the gateway is required to acquire the latest management information from the local area device when receiving the acquisition command, or the gateway is required to return the current latest management information of the local area device. The latest management information of the local device stored in the gateway is a case where the currently stored management information can be regarded as the latest management information. For example, when the gateway acquires the management information of the local device in a subscription manner, the management information currently stored by the gateway is regarded as the latest management information. The gateway can judge whether the management information is up to date by means of detecting the state of the local equipment, detecting the storage time of the local management information, analyzing the acquisition mode and the like.
2) When the gateway recognizes that the acquisition request is the second request, for example, "GetFlag ═ 2", it indicates that the gateway should return the local device management information stored locally by the gateway to the DMS.
The second requirement indicates that the gateway does not need to acquire the local area device, or does not need to reply to the current latest information of the local area device and only replies to the existing management information of the gateway.
3) When the gateway recognizes that the acquisition request is the third request, for example, "GetFlag" is 3 ", it indicates that the gateway should determine whether the latest management information can be acquired from the local device or can be found locally, if so, the latest management information is returned to the DMS, and if not, the local device management information stored locally by the gateway is returned to the DMS. When the gateway identifies that the local area equipment is not online when acquiring the latest management information from the local area equipment, the management information currently stored by the gateway is the latest management information which can be acquired.
The third requirement indicates that the gateway is required to acquire the local area device, or the gateway is required to reply the current latest management information of the local area device, and if the current latest management information cannot be acquired or cannot be provided, the existing management information of the gateway can be replied.
4) When the gateway recognizes that the acquisition request is the fourth request, for example, "GetFlag" is 4 ", it indicates that the gateway should determine whether the latest management information can be acquired from the local device or whether the latest management information of the local device can be found locally, if so, the latest management information is returned to the DMS, and if not, the latest management information is returned to the DMS when the latest management information of the local device can be acquired.
The fourth requirement indicates that the gateway is required to acquire the local area device, or the gateway is required to reply the current latest management information of the local area device, if the latest management information cannot be acquired or cannot be provided, the management information is not returned temporarily until the gateway can acquire the latest management information from the local area device, and then the acquired latest management information is returned to the DMS.
5) When the gateway recognizes that the acquisition request is the fifth request, for example, "GetFlag" is 5 ", it indicates that the gateway should determine whether the latest management information can be acquired from the local device or can be found locally, if so, the latest management information is returned to the DMS, and if not, the local device management information stored locally by the gateway is returned to the DMS, and when the latest management information of the local device can be acquired, the acquired latest management information is returned to the DMS.
The fifth requirement indicates that the gateway is required to acquire the local area device, or the gateway is required to reply the current latest management information of the local area device, if the latest management information cannot be acquired or cannot be provided, the existing management information can be replied, and the latest management information is returned again after the latest management information can be acquired.
In the fifth requirement, the step of returning, by the gateway, the locally stored local device management information to the DMS, and returning the acquired latest management information to the DMS when the latest management information of the local device can be acquired, preferably includes:
the gateway returns the local device management information stored locally to the DMS;
when the gateway can acquire the latest management information of the local equipment, comparing the acquired latest management information with the returned management information;
the gateway returns the change information between the acquired latest management information and the returned management information to the DMS, or returns confirmation information when the latest management information is the same as the returned management information.
The scheme only returns the change information to the DMS in the subsequent process, so that the transmitted data volume can be reduced, and the repeated transmission of the same data is avoided.
The above acquisition requirements can be arbitrarily selected and combined or adopted individually, and the actual acquisition requirements include, but are not limited to, the above.
In the above-mentioned cases of returning the management information, when the gateway returns the management information to the DMS, any one or more of the update time of the management information local to the gateway, the time when the local device generates or updates the management information, the time when the gateway receives the management information, and the information indicating whether the management information is the information that the gateway acquires from the local device in real time may be returned to the DMS, so that the DMS can know more accurate information.
In the above-mentioned cases of returning management information, when the gateway determines that the management information cannot be acquired from the local device, the reason why the gateway cannot acquire the management information from the local device may also be returned to the DMS.
In the case of the fourth requirement and the fifth requirement, the process of returning the acquired latest management information to the DMS when the gateway can acquire the latest management information of the local device specifically includes:
when the gateway can acquire the latest management information of the local device, the gateway initiates a session to the DMS, and returns the latest management information through the session or notifies the DMS to acquire the latest management information through the session. This method is a case where management information is returned using an existing session form.
Example four
Fig. 3 is a signaling flowchart of a device management method according to a fourth embodiment of the present invention. The present embodiment provides a complete flow in practical application, and introduces some combinations of the possible acquisition modes and acquisition requirements. The embodiment specifically comprises the following steps:
step 310, the DMS sends a "Replace" command to the gateway, where the "Replace" command carries an acquisition mode identifier "getprep" and a node corresponding to the acquisition mode.
And step 320, the gateway sets an acquisition mode attribute value 'GetProp' of the corresponding node in the management tree according to the 'Replace' command.
Step 330, the gateway returns a setup confirm response to the DMS.
Step 330 is that the gateway returns the information of success or failure of the acquisition mode setting to the DMS. Because some acquisition modes need to be set after communication is performed between the gateway and the local area device, for example, in the case of the second mode and the third mode, a subscription or periodic reporting mode needs to be set in the local area device, and whether the setting is successful is judged by information fed back by the local area device. The first and fourth modes do not require feedback from the local area device. Step 330 may specifically include the following three cases.
The first case applies to the first and fourth ways, the gateway replies to the DMS with a response that has been successfully set up on the gateway.
The second case is applicable to the second mode and the third mode, and the gateway replies a response which is successfully set on the gateway to the DMS; the gateway sets the local area equipment, for example, a change of a certain parameter is subscribed or the information of the certain parameter needs to be periodically obtained by setting, and the local area equipment replies a result of successful or failed setting to the gateway; the gateway replies the DMS with a response that the local device has been successfully or unsuccessfully configured.
The third situation is similar to the second situation, the gateway sets the local area device, and the local area device replies the result of successful or failed setting to the gateway; the gateway replies to the DMS with the result that the setting on the local device has succeeded or failed. This applies to the case where the gateway determines that the setup of the local device can be completed within the session timeout period with the DMS, omitting to reply with a response that the setup has succeeded or failed at the gateway.
Step 340, the gateway receives an acquisition command sent by the DMS, for example, a "Get" command, which carries an acquisition requirement identifier, for example, a "GetFlag" field, and sets an acquisition requirement of a corresponding node according to the acquisition requirement identifier.
Step 350, the gateway analyzes the set acquisition mode and the set acquisition requirement in a certain node or certain nodes pointed by the acquisition command according to the received acquisition command so as to determine how to return the management information.
In step 350, the gateway needs to consider not only the acquisition requirement when returning the management information, but actually the acquisition mode also affects how to return the management information, for example, whether the currently stored management information is the latest is judged according to the acquisition mode. If the mode is the first mode or the fourth mode, the gateway acquires the latest management information from the local area device, and if the mode is the second mode or the third mode, the gateway determines that the management information is not acquired from the local area device in real time when the acquisition command is received, but can inform the DMS whether the local area device is online currently.
At step 360, the gateway, upon receiving the acquisition command, returns a temporary reply to the DMS indicating that the acquisition command has been received or is being processed. This is an optional step, which can be omitted if the gateway can determine that the operation of returning the management information can be completed within the session timeout period with the DMS, and this step is mainly used in the case where the gateway needs to acquire information from the local device, and has no strict timing relationship with step 350.
Step 370, by analyzing the acquisition request and the acquisition mode, in this embodiment, assuming that it is determined that management information needs to be acquired from the local device, the gateway sends a parameter acquisition message to the local device, where the parameter to be acquired is management information corresponding to a node that the DMS needs to acquire, and the DMS may correspond to multiple parameters if it acquires information of multiple nodes or acquires information of one internal node;
380, the gateway receives the management information returned by the local area equipment;
step 390, the gateway returns the management information to the DMS according to the acquisition request.
In step 390, several possible management information returns as follows:
1) if the GetFlag is 1, the gateway returns the latest management information acquired from the local device in real time to the DMS, or returns the latest management information stored locally to the DMS. At this time, the gateway can also inform the DMS whether the management information is acquired in real time, and can also inform the DMS of the update time of the management information. The update time may be used to indicate whether the management information is acquired in real time. If the management information cannot be acquired in real time or is not the latest management information stored locally, the management information is not returned, and a response that the management information cannot be provided is returned.
The update time may use an existing attribute value of the node, that is, timestamp (TStamp) information of the node, but the update time is not necessarily the time when the local device generates the management information. In order for the DMS to obtain more time information, the local device may send the time at which the management information was generated to the gateway, which sends this time to the DMS. Thus, there may be two timestamps at the gateway, one for the node update and one for the node information generated at the local device. The gateway may further record a third timestamp, that is, a time when the local device management information corresponding to the node is received.
2) If "GetFlag" is 2 ", the gateway provides the existing management information to the DMS, and provides the update time of the management information.
3) If "GetFlag" is 3 "and" getprep "is 1" or "getprep" is 4 ", step 370 acquires the latest management information in a form of direct acquisition or synchronous acquisition, and the gateway replies to the DMS according to the execution of step 370.
If step 370 is able to be performed, e.g., the local device is online and the operations requested in step 370 are normally performed, the gateway replies the management information received in step 380 to the DMS, and may further inform the DMS that the management information is obtained from the local device in real time.
If step 370 cannot be performed, for example, the local device is not on-line, powered off or processing other transaction and cannot reply or cannot reply in time, the gateway replies the existing management information to the DMS, and simultaneously informs the DMS of the reason why the management information cannot be acquired in real time and/or cannot be acquired, and additionally informs the DMS of the update time of the existing management information. The update time may be used to indicate whether the gateway has acquired the management information to the local device in real time.
If "GetFlag" is 3 ", and" getprep "is 2" or "getprep" is 3 ", the combined meaning of the acquisition mode and the acquisition requirement setting is not obvious, but the gateway can still directly reply the existing management information to the DMS, and can also inform the DMS of the update time of the management information, and also inform the DMS whether the local device is online.
4) If the "GetFlag" is 4 ", the gateway replies to the DMS according to the execution of step 370.
If step 370 can be executed, the gateway returns the received management information to the DMS, and may also notify that the management information is obtained from the local device in real time;
if step 370 cannot be performed, the gateway informs the DMS that the local device management information cannot be obtained in real time and the reason thereof, and replies later, or informs the DMS that the acquisition operation is in process, and then returns the acquired management information to the DMS when the gateway can acquire the management information from the local device.
If the latter case is true, step 370 cannot be executed. When the local area device is in a starting, on-line or idle state, the gateway acquires the management information which is required to be acquired by the DMS from the local area device, and after the management information is acquired, the gateway initiates a session to the DMS to return the management information to the DMS. The gateway can also send a correlation identification, which is issued while the DMS issues the acquisition command, and is used for identifying the correlation of the operation and the operation result in different sessions. The above-mentioned scheme is applicable to the cases of the first mode and the fourth mode, and for the cases of the second mode and the third mode, if the local area device is online, the existing management information may be replied without obtaining the local area device, and if the local area device is offline, the existing management information may also be replied to the DMS after obtaining the management information of the local area device in the following, and similarly, the session may carry the correlation identifier.
5) If "GetFlag" is 5 ", the gateway replies to the DMS according to the execution of step 370.
If step 370 is enabled, the gateway returns the received management information to the DMS and informs the DMS that the management information is obtained from the local device in real time.
If step 370 cannot be performed, the gateway returns the existing management information to the server, and informs the DMS that the management information cannot be obtained in real time and the reason for the non-obtaining, and also informs the DMS of the update time of the management information. The update time of whether to reply information to the DMS may also be used to indicate whether the gateway has acquired the management information to the local device in real time.
If step 370 is not performed, the gateway needs to reply to the DMS again after obtaining the local device management information subsequently, for example, when the local device is in a power-on, online, or idle state, the gateway requests the DMS to obtain the management information that the gateway has previously obtained the DMS. And after the management information is acquired, the gateway initiates a session to the DMS and sends the management information to the DMS. The session may employ dependency identification.
By comparison, if the management information acquired by the gateway is consistent with the management information previously replied to the DMS, the gateway can only confirm the management information to the DMS without replying the specific information again. If the acquired management information includes management information that was previously returned to the DMS, only the added portion needs to be returned.
The above scheme is applicable to the cases of "getprep ═ 1" and "getprep ═ 4", and for the cases of "getprep ═ 2" and "getprep ═ 3", if the local device is online, the local device may reply to the existing information without acquiring it, and if the local device is not online, the local device may reply to the DMS after subsequently acquiring the management information of the local device, and similarly, the correlation identifier may be carried.
EXAMPLE five
Fig. 4 is a flowchart of a device management method according to a fifth embodiment of the present invention.
In this embodiment, it is assumed that the DMS needs to acquire Status information of an Execution Environment (EE) in a certain local device supporting UPnP. The data model of the state is mapped into the gateway in advance, and the URI of the EE state mapping in the gateway is "./UPnP _ Device _ 1/UPnP/MD/DeviceInfo/EE/Status". The DMS sends an acquire command for the URI to obtain the corresponding status information. The existing node value of the "Status" node is set as "Up", that is, the state information of EE. Since the gateway and the local device do not necessarily guarantee information synchronization, the DMS cannot determine whether the obtained status information is the latest status information, that is, whether the real situation of the local device is reflected, so that the DMS can guarantee acquisition of the latest status information by specifying the acquisition requirement.
Step 410, the DMS sends an acquisition command, i.e. a "Get" command to acquire a node value of "Status", and designates the acquisition requirement as the first requirement before or at the time of sending the acquisition command.
The method for specifying comprises the aforementioned dynamic and static methods, and the following method is a dynamic specifying method:
<Get>
<CmdID>4</CmdID>
<Item>
<Target>
<LocURI>./UPnP_Device_1/UPnP/MD/DeviceInfo/EE/StatusGetflag=1</LocURI>
</Target>
<Data>correlator1</Data>
</Item>
</Get>
in the "Get" command, a dependency identifier "corrlator 1" may also be included in the "Data" element for asynchronous notification.
Step 420, the gateway receives the acquisition command, identifies an acquisition requirement, determines whether an existing node value of a "Status" node is the current latest state information of the local area device according to a set first requirement when the acquisition requirement is identified as "Getflag ═ 1", if so, executes step 450, and if the gateway determines that an acquisition operation needs to be initiated to the local area device according to the identified acquisition requirement, executes step 430;
step 430, the gateway initiates a status information obtaining operation to the local area device, the local area device sends the status information of the EE to the gateway, and the status information is assumed to be "Up _ but _ to _ reboot" at this time, which indicates that the EE of the device is in a state of "running but about to restart";
step 440, the gateway updates the state information to the node value of the "Status" node, or the gateway compares the state information with the original "Status" node value, and if the state information is different from the original "Status" node value, the state information is updated to the node value.
The gateway can also record the node value update time of the Status node, and has two recording modes. One is that the update time is recorded in the 'TStamp' attribute of the node no matter whether the data model information acquired by the gateway is the same as the information originally stored in the node, and the recorded value is specifically the time when the gateway updates the acquired information to the 'Status' node; the other method is to add a 'TStamp _ Monitor' attribute for recording the time when the gateway acquires the local device reply information, and only when the data model information acquired by the gateway is different from the information originally stored in the node, the update time is recorded in the 'TStamp' attribute. The local device may provide another time to the gateway, where the time represents an update time of the state information on the local device or a time length of the state parameter keeping a certain parameter value, and at this time, a "TStamp _ LanDevice" attribute may be added to store the time, or a node value may be used to store the time. By adopting the scheme, rich time information related to the state information can be provided for the DMS.
Step 450, the gateway sends the node value of the "Status" node to the DMS, and the node value may be carried in a Result (Result) protocol element.
In addition, the gateway may reply to the DMS with a "Status" protocol element, where the "Status" protocol element may carry acknowledgement information, where the acknowledgement information indicates that the gateway sends the current latest Status information of the local device to the DMS, or indicates that the gateway has obtained the latest Status information from the local device, and the acknowledgement information may be carried with a Status code, for example, "220". In summary, the message returned by the gateway to the DMS may be:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>4</CmdRef>
<CmdID>4</CmdID>
<Cmd>Get</Cmd>
<TargetRef>./UPnP_Device_1/UPnP/MD/DeviceInfo/EE/Status</TargetRef>
<Data>220</Data>
</Status>
<Results>
<MsgRef>1</MsgRef><CmdRef>4</CmdRef>
<CmdID>3</CmdID>
<Item>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/DeviceInfo/EE/Status</LocURI>
</Source>
<Data>Up_but_about_to_reboot</Data>
</Item>
</Results>
the gateway may also send timestamp information of the "Status" node to the DMS, the timestamp information including one or more of "TStamp", "TStamp _ Monitor", and "TStamp _ LanDevice". The DMS may thus know one or more of the time at which the "Status" node value is updated on the gateway, the time at which the gateway receives the node value, and the time at which the corresponding Status parameter is updated in the local device.
On the basis of the present embodiment, various changes may be added to the above-described procedure.
The first variation is as follows:
before the step 430, if the gateway determines that the time for acquiring the state information from the local device is long, which may exceed the session timeout time between the gateway and the DMS, or if the gateway finds that the session is about to timeout during the process of acquiring the state information from the local device, it may reply a "202" status code to the DMS, which indicates that the acquisition operation is in progress, and end the session with the DMS. Thereafter steps 430, 440 are performed normally. In step 450, the gateway establishes a session with the DMS, informs the DMS that the acquisition operation is completed, and sends the node value of the "Status" node to the DMS. It may be that a Generic Alert (Generic Alert) is used to inform in the newly created session, for example:
<Alert>
<CmdID>2</CmdID>
<Data>1226</Data>
<Correlator>correlator1</Correlator>
<Item>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/DeviceInfo/EE/Status</LocURI>
</Source>
<Meta>
<Type””xmlns=“syncml:metinf”>
urn:oma:at:dm:2.0:GetComplete
</Type>
<Format””xmlns=“syncml:metinf”>text/plain</Format>
<Mark””xmlns=“syncml:metinf”>warning</Mark>
</Meta>
<Data>Up_but_about_to_reboot</Data>
</Item>
</Alert>
the dependency identifier, in this case "corrlator 1", is carried in the "corelator" element, i.e. the dependency identifier specified by the DMS in the acquisition command, to inform the DMS that the generic alert is for the acquisition operation of the session. The URI of a 'Status' node is carried in a 'Source/LocURI' element, and indicates the node to which the obtaining operation aims; an identifier of 'urn: oma: at: dm:2.0: GetComplete' is carried in the 'Meta/Type' element to indicate that the execution of the acquisition operation is completed; the node value of the "Status" node is carried in the "Data" element, and is "Up _ but _ about _ to _ rebot".
Or the node value of the "Status" node may not be carried in the general alarm, so that the general alarm only plays a role of notification, and the DMS sends an acquisition command to acquire the node value of the "Status" node after receiving the instruction. The re-sent acquire command may change the acquire request to a second request or not set the acquire request so that the gateway replies to the existing status information.
The second variation is as follows:
before step 410, the following steps may also be included:
step 401, the DMS sets an acquisition mode to the gateway in a static manner through a "Replace" command, specifically, sets a "getprep" attribute value of a "Status" node to 2, that is, adopts a subscription mode;
step 402, the gateway sets the acquisition mode and replies a response of successful setting to the DMS;
step 403, according to the acquiring mode of "gethop ═ 2", the gateway subscribes to the change of the corresponding "Status" parameter to the local area device, and can reply a response of successful subscription to the DMS after successful subscription;
step 404, when the Status parameter of EE changes, the local area device sends the changed Status information to the gateway, and the gateway records the changed Status information into the node value of the Status node.
Through the implementation of the above-mentioned obtaining method, in step 420, after receiving the obtaining command, the gateway recognizes that the obtaining request is the first request, and recognizes that the obtaining method is the second method, and then it is determined that the existing state information is the latest state information, and it can directly go to step 450, because the gateway has already guaranteed the instant update of the information with the local device through the subscription.
If the first mode of "getprep ═ 1" is set, in step 420, after receiving the acquisition command, the gateway recognizes that the acquisition request is the first request, recognizes that the acquisition mode is the first mode, and directly initiates an acquisition operation to the local area device, and proceeds to step 430 to continue execution.
The third variation is as follows:
if the DMS does not set the acquisition requirement, that is, the acquisition requirement flag is empty or not present, or the acquisition requirement is set as the second requirement, when or before the DMS sends the acquisition command to acquire the node value of the "Status" node, the gateway directly proceeds to step 450 to execute step 420, that is, directly replies to the DMS an existing node value of the "Status" node, where the node value is "Up". The Status protocol element may carry a Status code "200" indicating that the acquisition is successful, or a Status code "230" indicating that the gateway replies with an existing node value of the gateway, and does not acquire corresponding Status information from the local area device in real time, or does not guarantee that the node value is up to date. The reply to the DMS may also be time stamped with information including one or more of "TStamp," "TStamp _ Monitor," and "TStamp _ LanDevice," as described in step 450.
EXAMPLE six
Fig. 5 is a flowchart of a device management method according to a sixth embodiment of the present invention. The fifth embodiment describes the case where the DMS acquires a leaf node, and this embodiment is directed to the case where the internal node acquires management information. Assuming that the DMS needs to acquire Software information installed in a local Device supporting UPnP, the Software information is regarded as management information that needs to be acquired from the local Device, and a Software data model of the local Device is mapped into the gateway, the DMS may send an acquisition command to an internal node, such as node "/UPnP _ Device _ 1/UPnP/MD/Software/DU".
Step 510, the DMS sends the following acquisition command to the gateway:
<Get>
<CmdID>5</CmdID>
<Item>
<Target>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DUGetFlag=5&list=StructData</LocURI>
</Target>
<Data>correlator2</Data>
</Item>
</Get>
after the URI "? GetFlag ═ 5 "specifies that the acquisition request is the fifth request, and" list ═ StructData "is used to specify the structure and data information of the management subtree under the Unit of execution requiring acquisition (default Unit, DU for short) node. The "Data" element contains a dependency identifier "corrlator 2" for asynchronous notification.
Since the DU node is an internal node, the acquisition request applies to all its children, for example, the acquisition request is a first request indicating that the DMS requests the gateway to provide the latest management information of all the children of the DU node, i.e. the latest management information of all the parameters of the DU data model in the local device.
Step 520, the gateway receives the acquisition command, recognizes that the acquisition requirement is ' GetFlag ' is 5 ', tries to connect the local area device to acquire the software information according to the acquisition requirement, but the local area device is not on line, or is shut down, or is busy in processing other transactions, and determines to reply to the existing software information according to the instruction of the acquisition requirement when the gateway cannot acquire the software information;
step 530, the gateway replies the existing software information to the DMS, and if the software information of the two local devices has been mapped in the gateway, replies the following information to the DMS:
<Status>
<MsgRef>1</MsgRef>
<CmdRef>5</CmdRef>
<CmdID>5</CmdID>
<Cmd>Get</Cmd>
<TargetRef>./UPnP_Device_1/UPnP/MD/Software/DU</TargetRef>
<Data>240</Data>
</Status>
<Results>
<MsgRef>1</MsgRef><CmdRef>5</CmdRef>
<CmdID>6</CmdID>
<Item>
<Meta>
<TStamp>20050713T163817Z</TStamp>
</Meta>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DU</LocURI>
</Source>
</Item>
<Item>
<Meta>
<TStamp>20050711T163817Z</TStamp>
<TStamp_Monitor>20050712T163817Z</TStamp_Monitor>
<TStamp_LanDevice>20050710T163817Z</TStamp_LanDevice>
</Meta>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DU/1/DUID</LocURI>
</Source>
<Data>”123”</Data>
</Item>
<Item>
<Meta>
<TStamp>20050712T163817Z</TStamp>
<TStamp_Monitor>20050712T163817Z</TStamp_Monitor>
<TStamp_LanDevice>20050711T163817Z</TStamp_LanDevice>
</Meta>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DU/2/DUID</LocURI>
</Source>
<Data>”456”</Data>
</Item>
</Results>
the message replied by the gateway to the DMS firstly contains a Status protocol element, wherein the Status protocol element contains a Status code of 240, which means that the local area device cannot be acquired temporarily or is not on-line, and replied software information is the existing software information on the gateway; the following is a "Result" element, which contains information of the whole management sub-tree under the DU node, and contains two instances, instance 1 and instance 2, in each instance there are nodes such as "DUID", "State", "Type", "EU" and their information, the above code omits other parts, lists only "DUID" in instance 1 and instance 2, respectively "123" and "456", which shows that two software components with ID "123" and "456" are installed in the local device.
Since the gateway replies with the existing software information instead of the latest software information obtained in real time to the local device, the gateway may add timestamp information to the reply information, and as in the previous embodiment, the timestamp information may include one or more of "TStamp", "TStamp _ Monitor", and "TStamp _ LanDevice", which respectively indicate the time at which the node value on the gateway is changed, the time at which the node value provided by the local device is received by the gateway, and the time at which the parameter value corresponding to the node is generated on the local device. For example, the three pieces of information in the above code are carried in the "Meta" element:
<Meta>
<TStamp>20050711T163817Z</TStamp>
<TStamp_Monitor>20050712T163817Z</TStamp_Monitor>
<TStamp_LanDevice>20050710T163817Z</TStamp_LanDevice>
</Meta>
this means that the node value of "/UPnP _ Device _ 1/UPnP/MD/Software/DU/1/DUID" is generated on the local Device at 7/10 th 2005, and is sent to the gateway at 7/11 th 2005, and the gateway updates to the management tree, and acquires the node value of this node again at 7/12 th 2005.
Step 540, after the local area device can be accessed, the gateway acquires software information from the local area device, acquires the installed software information, for example, the software information comprises '123' and '789' and the detailed information of the two pieces of software, and updates the information to the management tree of the gateway, specifically, the related information of the software '456' is deleted, the information of the software '789' is added, and the information of the software '123' is updated;
in step 550, since the acquisition request is the fifth request, and the gateway is requested to confirm the condition of acquiring the software information to the DMS again, the gateway initiates a new session, where the session includes a general warning, as follows:
<Alert>
<CmdID>2</CmdID>
<Data>1226</Data>
<Correlator>correlator2</Correlator>
<Item>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DU</LocURI>
</Source>
<Meta>
<Type””xmlns=“syncml:metinf”>
urn:oma:at:dm:2.0:GetComplete
</Type>
<Format””xmlns=“syncml:metinf”>text/plain</Format>
<Mark””xmlns=“syncml:metinf”>warning</Mark>
</Meta>
</Item>
</Alert>
the association identifier 2 is carried, which indicates that the association identifier is reply information related to the acquisition command, and the Source/LocURI carries the URI of the DU node, which indicates the node to which the acquisition operation is directed; an "urn: oma: at: dm:2.0: GetComplete" identifier is carried in the "Meta/Type" element to indicate that the fetch operation is complete.
Step 560, the DMS receives the above general warning, and according to the correlation identifier and the acquisition requirement set in step 510, it can know that the gateway has obtained the latest software information from the local device, and then sends an acquisition command to the gateway to acquire all information under the DU node, where the acquisition requirement may be set as the second requirement, or the acquisition requirement is not set, so that the gateway replies to the existing software information;
step 570, the gateway replies the software information of the local devices on the existing management tree, including all node information of the software "123" and "789", to the DMS.
On the basis of the present embodiment, various changes may be added to the above-described procedure.
The first variation is as follows:
before step 510, the method may further include:
step 501, the DMS sets an acquisition mode to the gateway, that is, sets the attribute value "getprep ═ 4" of the DU node by using the "Replace" command, and acquires the software information in a synchronous mode. Such as:
<Replace>
<CmdID>2</CmdID>
<Item>
<Target>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DUprop=
GetProp</LocURI>
</Target>
<Data>4</Data>
</Item>
</Replace>
step 502, the gateway replies the information of successful setting to the DMS;
since "getprep is 4", in the above step 540, when the gateway acquires the software information from the local area device, a synchronization method is adopted, that is, the local area device only sends the software information changed since last synchronization with the gateway to the gateway, for example, the gateway is notified that the software "456" has been deleted, and the software "789" is added, and the software information of the software "123" is updated. Software "123" does not have to be sent to the gateway if no change has occurred.
And if the "getprep" is 1 ", the gateway will initiate an acquisition operation to the local area device, and at this time, the local area device sends all the software information of the software" 123 "and" 789 "to the gateway.
If the "getprep" is 2 ", the gateway will subscribe the DU data model information to the local device, and when the" DU "data model in the local device changes, the gateway will inform the changed software information to the gateway, and the gateway updates to the management tree.
It is also possible to set "gethop ═ 2" to the child node of the DU node or to the lower level nodes, for example, to set "gethop ═ 2" to "/UPnP _ Device _ 1/UPnP/MD/Software/DU/1", and the gateway subscribes only to the change of the node, that is, the information change of the Software "123". Thus, the gateway obtains the software information from the local device in step 540, and may not obtain the software information because the information has been synchronized by the subscription. That is, when the gateway performs the step 540 to acquire the lower node of the internal node, the gateway may analyze the acquisition mode of the lower node, so as to save the amount of acquired information.
The second variation is as follows:
in the above steps 550-570, if the software information acquired by the gateway in step 540 is consistent with the software information previously replied to the DMS, the confirmation may be made only to the DMS without sending the software information to the DMS, which may be sending a general warning confirmation in step 550, as follows:
<Alert>
<CmdID>2</CmdID>
<Data>1226</Data>
<Correlator>correlator2</Correlator>
<Item>
<Source>
<LocURI>./UPnP_Device_1/UPnP/MD/Software/DU</LocURI>
</Source>
<Meta>
<Type””xmlns=“syncml:metinf”>
urn:oma:at:dm:2.0:GetComplete
</Type>
<Format””xmlns=“syncml:metinf”>text/plain</Format>
<Mark””xmlns=“syncml:metinf”>warning</Mark>
</Meta>
<Data>
<![CDATA[
<ResultCode>250</ResultCode>
]]>
</Data>
</Item>
</Alert>
the "Item/Data" element in the generic alert above contains a "ResultCode" with a value of "250" indicating that the software information previously sent to the DMS is up to date. The process then ends without performing steps 560 and 570.
In the above steps 550-570, if the software information acquired by the gateway in step 540 includes information previously replied to the DMS, the gateway may send only the added or updated or deleted part or the combination thereof to the DMS, which may be implemented by using the parameter "list ═ StructDataDelta" when the DMS sends the acquisition command to acquire the DU node information from the gateway in step 560.
EXAMPLE seven
The seventh embodiment of the present invention provides another device management method, which is executed by the DMS and can complete a device management scheme in cooperation with the device management method executed by the gateway in the foregoing embodiments. The method of the embodiment comprises the following steps:
the DMS sends an acquisition mode to the gateway, and is used for indicating the gateway to acquire the management information of the local area equipment from the local area equipment according to the acquisition mode and indicating the gateway to return the management information of the local area equipment to the DMS according to a received acquisition command, wherein the acquisition command indicates that the DMS needs to acquire the management information of the local area equipment; and/or
And the DMS sends an acquisition request to the gateway, and the acquisition request is used for indicating the gateway to return the management information of the local area equipment to the DMS according to the received acquisition command, and the acquisition command indicates that the DMS needs to acquire the management information of the local area equipment.
The DMS sending the acquisition request and/or the acquisition mode to the gateway may specifically be: the DMS carries the acquisition request and/or the acquisition mode in the acquisition command and sends the acquisition command to the gateway.
The technical scheme provided by each embodiment of the invention can achieve the complete control of the network side on the information acquisition mode, reduce the human intervention and improve the user experience; the network side can control the obtained result to obtain the required data; the gateway automatically informs the DMS node of the updating time, so that the network side knows the novelty degree of the information; when the management information is not acquired, the gateway replies the existing management information to enable the network side to acquire the management information of some local area devices as much as possible, and then further informs the DMS of the latest management information, so that the DMS can flexibly acquire the management information of the local area devices by using the acquisition requirement and the acquisition mode.
Example eight
Fig. 6 is a schematic structural diagram of a gateway according to an eighth embodiment of the present invention, where the gateway includes: an acquisition mode processing module 620 and/or an acquisition requirement processing module 610. The acquisition mode processing module 620 is configured to receive an acquisition mode sent by the DMS, acquire management information of the local area device from the local area device according to the acquisition mode, and return management information of the local area device to the DMS according to a received acquisition command, where the acquisition command indicates that the DMS needs to acquire the management information of the local area device; the acquisition request processing module 610 is configured to receive an acquisition request sent by the DMS, and return management information of the local device to the DMS according to the received acquisition command, where the acquisition command indicates that the DMS needs to acquire the management information of the local device.
The acquisition request processing module 610 may specifically include an acquisition request receiving unit 611 and an acquisition request setting unit 612, wherein the acquisition request receiving unit 611 is configured to receive an acquisition request sent by the DMS; the acquisition requirement setting unit 612 includes: a first requirement setting subunit, a second requirement setting subunit, a third requirement setting subunit, a fourth requirement setting subunit, and/or a fifth requirement setting subunit. The first requirement setting subunit is used for acquiring the management information from the local area equipment or searching the latest management information of the local area equipment locally when the acquisition requirement is identified as the first requirement, and returning the management information to the DMS; the second requirement setting subunit is used for returning the locally stored local area device management information to the DMS when recognizing that the acquisition requirement is the second requirement; the third requirement setting subunit is configured to, when it is identified that the acquisition requirement is the third requirement, determine whether management information can be acquired from the local area device or whether the latest management information of the local area device can be found locally, if yes, return the management information to the DMS, and if not, return the locally stored management information of the local area device to the DMS; the fourth requirement setting subunit is configured to, when it is identified that the acquisition requirement is the fourth requirement, determine whether management information can be acquired from the local area device or whether the latest management information of the local area device can be found locally, if yes, return the management information to the DMS, and if not, return the acquired management information to the DMS when the management information of the local area device can be acquired; the fifth requirement setting subunit is configured to, when it is identified that the acquisition requirement is the fifth requirement, determine whether management information can be acquired from the local area device or whether the latest management information of the local area device can be found locally, if yes, return the management information to the DMS, if not, return the locally stored management information of the local area device to the DMS, and return the acquired management information to the DMS when the management information of the local area device can be acquired.
The acquisition requirement setting unit 612 may further include: and the time feedback subunit is used for returning the local updating time of the management information, the time of the local device for generating or updating the management information, the time of receiving the management information and one or more items of information which represents whether the management information is acquired from the local device in real time to the DMS when the management information is returned to the DMS.
The acquiring method processing module 620 may specifically include an acquiring method receiving unit 621, an acquiring method setting unit 622, and an information returning unit 623, where the acquiring method receiving unit 621 is configured to receive an acquiring method sent by the DMS; the obtaining manner setting unit 622 may specifically include: the device comprises a first mode setting subunit, a second mode setting subunit, a third mode setting subunit and/or a fourth mode setting subunit. The first mode setting subunit is used for acquiring the management information from the local area equipment when receiving the acquisition command when recognizing that the acquisition mode is the first mode; the second mode setting subunit is used for subscribing the management information to the local area equipment and receiving the management information sent by the local area equipment according to the subscription when the acquisition mode is identified as the second mode; the third mode setting subunit is used for setting the local area equipment to report the management information according to the set period and receiving the management information sent by the local area equipment according to the set period when the acquisition mode is identified to be the third mode; the fourth mode setting subunit is configured to synchronize the management information from the local area device when receiving the acquisition command when recognizing that the acquisition mode is the fourth mode. The information returning unit 623 is configured to return the management information of the local device to the DMS according to the received acquisition command.
The gateway provided by the embodiment of the invention can execute the equipment management method provided by any embodiment of the invention and is provided with a corresponding functional module. The DMS can flexibly set an acquisition mode and/or an acquisition requirement for the gateway according to specific conditions, so that the gateway can adjust the management information returned to the DMS according to the specific conditions, the success rate of the DMS for acquiring the local device management information through the gateway is improved, and the management information meeting the requirements can be accurately acquired.
Example nine
Fig. 7 is a schematic structural diagram of a DMS according to a ninth embodiment of the present invention, where the DMS includes an acquisition mode setting module 710 and/or an acquisition requirement setting module 720. The acquisition mode setting module 710 is configured to send an acquisition mode to the gateway, and is configured to instruct the gateway to acquire the management information of the local area device from the local area device according to the acquisition mode, and return the management information of the local area device to the DMS according to the received acquisition command, where the acquisition command indicates that the DMS needs to acquire the management information of the local area device; the acquisition requirement setting module 720 is configured to send an acquisition requirement to the gateway, and is configured to instruct the gateway to return the management information of the local device to the DMS according to the received acquisition requirement, where the acquisition requirement indicates that the DMS needs to acquire the management information of the local device.
The DMS provided in the embodiments of the present invention may cooperate with the gateway to execute the device management method provided in any embodiments of the present invention, and has corresponding functional modules. The DMS can flexibly set an acquisition mode and/or an acquisition requirement for the gateway according to specific conditions, so that the gateway can adjust the management information returned to the DMS according to the specific conditions, the success rate of the DMS for acquiring the local device management information through the gateway is improved, and the management information meeting the requirements can be accurately acquired.
The embodiment of the invention also provides a device management system which comprises the DMS and the gateway, and the device management method is executed to improve the reliability of the DMS for obtaining the local device management information from the gateway.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.