Abstract:
Provided is a method for managing a terminal peripheral, including that an M2M gateway obtains a policy definition of an event, and obtains, from the policy definition of the event, an operation priority indication corresponding to an operation in the event; and when the event is triggered by the M2M gateway and if it is determined that an operation of the same type as the operation in the event exists in a corresponding terminal peripheral, whether to deliver the operation in the event to the corresponding terminal peripheral is decided according to the operation priority indication in the policy definition of the event and a priority judgment policy. An M2M gateway is also provided. Processing priorities of operations of the same type can be determined according to priority indications of the operations by adopting the present disclosure, thereby avoiding operation conflict and system error reporting occurring on a terminal peripheral, and improving the efficiency of an M2M gateway in managing a terminal peripheral or a terminal peripheral group.

Description:
TECHNICAL FIELD 
       [0001]    The present disclosure relates to a Machine-to-Machine/Man (M2M) technology in the field of mobile communications, and particularly to a terminal peripheral management method and an M2M gateway. 
       BACKGROUND 
       [0002]    At present, a terminal peripheral in an M2M stub network is managed via an M2M gateway in an M2M communication system, including that: the M2M gateway configures an event defined by a policy; when determining to execute the event according to an event trigger condition, the M2M gateway delivers an operation defined in the event to a corresponding terminal peripheral or a terminal peripheral group and receives operation execution information returned by the terminal peripheral or the terminal peripheral group. 
         [0003]    However, the aforementioned method for an M2M gateway to manage a terminal peripheral is only capable of delivering operations to a corresponding terminal peripheral or terminal peripheral group according to a triggering sequence of all events, but fails to determine, according to a current operation of the terminal peripheral or the terminal peripheral group, whether to deliver an operation of the same type to the corresponding terminal peripheral or the terminal peripheral group. Thus operation conflict and system error reporting may occur on the terminal peripheral or the terminal peripheral group, thereby further affecting the efficiency of the M2M gateway in managing the terminal peripheral or the terminal peripheral group. 
         [0004]    Thus, a method for an M2M gateway to manage a terminal peripheral in the prior art fails to avoid operation conflict and system error reporting occurring on a terminal peripheral and thus further affects the efficiency of the M2M gateway in managing the terminal peripheral or a terminal peripheral group. 
       SUMMARY 
       [0005]    In view of this, a purpose of the present disclosure is to provide a method for managing a terminal peripheral and to provide an M2M gateway, so that priorities for processing operations of the same type can be determined according to priority indications of the operations, thus avoiding operation conflict on a terminal peripheral and system error reporting, and improving the efficiency of the M2M gateway in managing a terminal peripheral or a terminal peripheral group. 
         [0006]    To achieve the foregoing purpose, technical solutions of embodiments of the present disclosure are implemented by the following way. 
         [0007]    An embodiment of the present disclosure provides a method for managing a terminal peripheral. An M2M gateway obtains a policy definition of an event, and obtains from the policy definition of the event, an operation priority indication corresponding to an operation in the event. The method further may include that: 
         [0008]    when the event is triggered by the M2M gateway and if it is determined that an operation of the same type as the operation in the event exists on a corresponding terminal peripheral, whether to deliver the operation in the event to the corresponding terminal peripheral is decided according to the operation priority indication in the policy definition of the event and a priority judgment policy. 
         [0009]    In the foregoing solution, the operation that the policy definition of the event is obtained may include that an M2M service platform delivers the policy definition of the event to the M2M gateway, or the policy definition of the event is configured on the M2M gateway. 
         [0010]    In the foregoing solution, before it is determined that the operation of the same type as the operation in the event exists on the corresponding terminal peripheral, the method further may include that whether the operation of the same type as the operation in the event exists in the corresponding terminal peripheral is judged; 
         [0011]    wherein the judgement may include that whether a current operation exists on a corresponding terminal peripheral or terminal peripheral group is detected locally according to an identifier of a terminal peripheral or a terminal peripheral group of the operation in the event; if the operation exists, then an operation type is extracted from the current operation, the operation type is compared with an operation type corresponding to the operation in the event; if the two operation types are consistent, then the two operations are of the same type, otherwise, the two operations are of different types; 
         [0012]    if the current operation does not exist, then it is determined that the two operations are of different types. 
         [0013]    In the foregoing solution, the operation that whether to deliver the operation in the event to the corresponding terminal peripheral is decided according to the operation priority indication in the policy definition of the event and the priority judgment policy may include that: 
         [0014]    the M2M gateway retrieves, according to a current operation of a terminal peripheral or a terminal peripheral group corresponding to the operation in the event existing on the M2M gateway, an operation priority indication corresponding to the current operation from the policy definition of the event; and 
         [0015]    whether to deliver the operation in the event to the corresponding terminal peripheral or terminal peripheral group is determined according to the priority judgment policy and by virtue of the operation priority indication corresponding to the current operation and the operation priority indication corresponding to the operation in the event. 
         [0016]    In the foregoing solution, the priority judgment policy may include that: 
         [0017]    whether the operation priority indication corresponding to the operation in the event is not higher than an operation priority indication corresponding to a current operation is judged; if not higher, then the operation in the event is dropped and a terminal peripheral or a terminal peripheral group continues executing the current operation; 
         [0018]    if higher, then the current operation is replaced by the operation in the event, and the operation in the event is delivered according to an identifier of the terminal peripheral or the terminal peripheral group of the operation in the event. 
         [0019]    In the foregoing solution, the priority judgment policy may include that: 
         [0020]    whether the operation priority indication corresponding to the operation in the event is not lower than an operation priority indication corresponding to a current operation is judged; if not lower, then the current operation is replaced by the operation in the event, and the operation in the event is delivered according to an identifier of a terminal peripheral or a terminal peripheral group of the operation in the event; 
         [0021]    otherwise, the operation in the event is dropped, and the terminal peripheral or the terminal peripheral group continues to perform the current operation. 
         [0022]    An embodiment of the present disclosure further provides an M2M gateway. The M2M gateway includes a management module and a priority judgement module, wherein 
         [0023]    the management module is configured to obtain a policy definition of an event, and obtain from the policy definition of the event, an operation priority indication corresponding to an operation in the event; and configured to, when the event is triggered and if it is determined that an operation of the same type as the operation in the event exists on a corresponding terminal peripheral, send the operation priority indication in the policy definition of the event to the priority judgement module; and 
         [0024]    the priority judgement module is configured to decide, according to a priority judgment policy and the operation priority indication in the policy definition of the event from the management module, whether the operation in the event is delivered to the corresponding terminal peripheral. 
         [0025]    In the foregoing solution, the management module may be configured to receive from an M2M service platform the policy definition of the event or configure the policy definition of the event locally. 
         [0026]    In the foregoing solution, the management module may be configured to judge whether the operation of the same type as the operation in the event exists on the corresponding terminal peripheral, 
         [0027]    wherein the judgement may include whether a current operation exists on a corresponding terminal peripheral or terminal peripheral group is detected locally according to an identifier of a terminal peripheral or a terminal peripheral group of the operation in the event; if the operation exists, an operation type is extracted from the current operation, and the operation type is compared with an operation type corresponding to the operation in the event; if the two operation types are consistent, then the two operations are determined to be of the same type, otherwise, the two operations are determined to be of different types; if the current operation does not exist, then it is determined that the two operations are of different types. 
         [0028]    In the foregoing solution, the priority judgement module may be configured to retrieve according to a current operation of a terminal peripheral or a terminal peripheral group corresponding to the operation in the event existing on the M2M gateway, an operation priority indication corresponding to the current operation from the policy definition obtained by the management module; determine, according to the priority judgment policy and by virtue of the operation priority indication corresponding to the current operation and the operation priority indication corresponding to the operation in the event, whether to deliver the operation in the event to the corresponding terminal peripheral or terminal peripheral group; 
         [0029]    accordingly, the management module may be configured to provide the operation priority indication corresponding to the current operation for the priority judgement module. 
         [0030]    In the foregoing solution, the priority judgement module is configured to execute the priority judgement policy; 
         [0031]    wherein the priority judgment policy may include that whether the operation priority indication corresponding to the operation in the event is not higher than an operation priority indication corresponding to a current operation is judged; if not higher, then the operation in the event is dropped; and a terminal peripheral or a terminal peripheral group continues executing the current operation; if higher, then the current operation is replaced by the operation in the event, and the operation in the event is delivered according to an identifier of the terminal peripheral or the terminal peripheral group of the operation in the event. 
         [0032]    In the foregoing solution, the priority judgement module may be configured to execute the priority judgement policy; 
         [0033]    the priority judgment policy may include that whether the operation priority indication corresponding to the operation in the event is not lower than an operation priority indication corresponding to a current operation is judged; if not lower, then the current operation is replaced by the operation in the event, and the operation in the event is delivered according to an identifier of a terminal peripheral or a terminal peripheral group of the operation in the event; if lower, then the operation in the event is dropped, and the terminal peripheral or the terminal peripheral group continues executing the current operation. 
         [0034]    An M2M gateway and a method for managing a terminal peripheral according to the embodiments of the present disclosure are able to obtain a policy definition of an event, and obtain from the policy definition of the event, an operation priority indication corresponding to an operation in the event; and when the event is triggered and if it is determined that an operation of the same type as the operation in the event exists on a corresponding terminal peripheral, whether the operation in the event is delivered to the corresponding terminal peripheral is decided according to the operation priority indication in the policy definition of the event and a priority judgment policy. In this way, whether delivery of the operation of the same type to the terminal peripheral is determined in combination with a current operation situation of the terminal peripheral, thus ensuring that operation conflict and system error reporting occurring on a terminal peripheral can be avoided and improving the efficiency of the M2M gateway in managing a terminal peripheral or a terminal peripheral group. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0035]      FIG. 1  is a flowchart of a method for managing a terminal peripheral according to an embodiment of the present disclosure; and 
           [0036]      FIG. 2  is a schematic diagram of structure of an M2M gateway according to an embodiment of the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0037]    The basic idea of the embodiments of the present disclosure is that an M2M gateway obtains a policy definition of an event, and obtains, from the policy definition of the event, an operation priority indication corresponding to an operation in the event; and when the event is triggered by the M2M gateway and if it is determined that an operation of the same type as the operation in the event exists on a corresponding terminal peripheral, whether the operation in the event is delivered to the corresponding terminal peripheral is decided according to the operation priority indication in the policy definition of the event and a priority judgment policy. 
         [0038]    The present disclosure will be further expounded hereinafter in combination with the accompanying drawings and specific embodiments. 
         [0039]    As shown in  FIG. 1 , a method for managing a terminal peripheral according to an embodiment of the present disclosure includes the following steps. 
         [0040]    Step  101  is that an M2M gateway obtains a policy definition of an event, and obtains from the policy definition of the event, an operation priority indication corresponding to an operation in the event. 
         [0041]    Here, the event is a group of associated operations directed to terminal peripherals by the M2M gateway. The operation may include an identifier of a terminal peripheral or a terminal peripheral group, operation information, and an operation priority indication corresponding to the operation. The operation information may include an operation type and operation content. The operation priority indication may be a parameter preset according to a practical condition. 
         [0042]    The operation that the policy definition of the event is obtained may include that an M2M service platform delivers the policy definition of the event to the M2M gateway, or the policy definition of the event is configured on the M2M gateway, including one or more events, and a trigger condition of each event. 
         [0043]    A trigger condition of the event is a condition that the M2M gateway needs to satisfy when executing an operation directed to a terminal peripheral. For example, the trigger condition may be a time value directed to a system time or a timer, a data value of one or more monitor data directed to a terminal peripheral and/or a terminal peripheral group, a state value of one or more running states directed to a terminal peripheral and/or a terminal peripheral group. 
         [0044]    Step  102  is that when the event is triggered by the M2M gateway, whether an operation of the same type as the operation in the event exists on a corresponding terminal peripheral is judged. If such an operation exists, Step  103  is performed, otherwise, the M2M gateway delivers the operation to the corresponding terminal peripheral according to the event, and the process is terminated. 
         [0045]    Here, triggering the event by the M2M gateway belongs to the prior art and will not be described repeatedly here. 
         [0046]    The operation that whether the operation of the same type as the operation in the event exists on a corresponding terminal peripheral is judged may include that: whether a current operation exists on a corresponding terminal peripheral or terminal peripheral group is detected locally according to an identifier of a terminal peripheral or a terminal peripheral group corresponding to the operation in the event; if the current operation exists, an operation type is extracted from the current operation, the operation type is compared with an operation type corresponding to the operation in the event; if the two operations are consistent, the two operations are determined to be of the same type, otherwise, the two operations are determined to be of different types; if the current operation does not exist, it is determined that the two operations are of different types. 
         [0047]    Delivering the operation to the terminal peripheral corresponding to the event by the M2M gateway belongs to the prior art and will not be described repeatedly here. 
         [0048]    Step  103  is that the M2M gateway decides, according to the operation priority indication in the policy definition of the event and a priority judgment policy, whether to deliver the operation in the event to the corresponding terminal peripheral. 
         [0049]    Specifically, the M2M gateway retrieves, according to a current operation of a terminal peripheral or a terminal peripheral group corresponding to the operation in the event existing on the M2M gateway, an operation priority indication corresponding to the current operation from the policy definition of the event. Whether to deliver the operation in the event to the corresponding terminal peripheral or terminal peripheral group is determined according to the priority judgment policy and by virtue of the operation priority indication corresponding to the current operation and the operation priority indication corresponding to the operation in the event. 
         [0050]    Here, the priority judgment policy is that whether the operation priority indication corresponding to the operation in the event is not higher than the operation priority indication corresponding to the current operation is judged; if not higher, the operation in the event is dropped and the terminal peripheral or the terminal peripheral group continues executing the current operation; if higher, the current operation is replaced by the operation in the event, and the operation in the event is delivered according to the identifier of the terminal peripheral or the terminal peripheral group of the operation in the event. 
         [0051]    Or the priority judgment policy is that whether the operation priority indication corresponding to the operation in the event is not lower than the operation priority indication corresponding to the current operation is judged; if not lower, the current operation is replaced by the operation in the event, and the operation in the event is delivered according to the identifier of the terminal peripheral or the terminal peripheral group of the operation in the event; if lower, the operation in the event is dropped, and the terminal peripheral or the terminal peripheral group continues executing the current operation. 
         [0052]    Preferably, after Step  103  is completed, the M2M gateway may further receive operation execution information returned by the terminal peripheral or the terminal peripheral group, delete an operation corresponding to a corresponding terminal peripheral or terminal peripheral group and record operation execution information, wherein the operation execution information may include an identifier of the terminal peripheral or an identifier of the terminal peripheral group, an indication of an operation execution success or failure, a state value obtained after execution of an operation succeeds, or a reason value obtained after the execution of the operation fails. 
         [0053]    As shown in  FIG. 2 , an embodiment of the present disclosure provides an M2M gateway. The M2M gateway includes a management module  21  and a priority judgement module  22 , wherein 
         [0054]    the management module  21  is configured to obtain a policy definition of an event, and obtain from the policy definition of the event, an operation priority indication corresponding to an operation in the event; when the event is triggered and if it is determined that an operation of the same type as the operation in the event exists in a corresponding terminal peripheral, send the operation priority indication in the policy definition of the event to the priority judgement module  22 ; and 
         [0055]    the priority judgement module  22  is configured to decide, according to a priority judgment policy and the operation priority indication in the policy definition of the event from the management module  21 , whether to deliver the operation in the event to the corresponding terminal peripheral. 
         [0056]    The management module  21  is configured to obtain a group of associated operations directed to terminal peripherals as the event, wherein the operation may include an identifier of a terminal peripheral or a terminal peripheral group, operation information, and an operation priority indication corresponding to the operation. The operation information may include an operation type and operation content. 
         [0057]    The management module  21  is configured to receive from an M2M service platform the policy definition of the event or directly configure the policy definition of the event locally. 
         [0058]    The management module  21  is configured to, when the event is triggered, judge whether the operation of the same type as the operation in the event exists on the corresponding terminal peripheral; if such an operation exists, send the operation priority indication in the policy definition of the event to the priority judgement module  22 , otherwise, deliver the operation to the corresponding terminal peripheral. 
         [0059]    The management module  21  is configured to locally detect, according to an identifier of a terminal peripheral or a terminal peripheral group of the operation in the event, whether a current operation exists on a corresponding terminal peripheral or terminal peripheral group; if the current operation exists, extract an operation type from the current operation, compare the operation type with an operation type corresponding to the operation in the event; if the two operations are consistent, the two operations are determined to be of the same type, otherwise, the two operations are determined to be of different types; and if the current operation does not exist, it is determined that the two operations are of different types. 
         [0060]    The priority judgement module  22  is configured to retrieve, according to a current operation of a terminal peripheral or a terminal peripheral group sent by the management module  21 , an operation priority indication corresponding to the current operation from the policy definition obtained by the management module  21 ; determine whether to deliver the operation in the event to the corresponding terminal peripheral or terminal peripheral group according to the priority judgment policy and by virtue of the operation priority indication corresponding to the current operation and the operation priority indication corresponding to the operation in the event from the management module  21 . Accordingly, the management module  21  is configured to provide the priority judgement module  22  with the local current operation of the terminal peripheral or the terminal peripheral group corresponding to the operation in the event, the operation priority indication corresponding to the operation, and the operation priority indication corresponding to the operation in the triggered event. 
         [0061]    The priority judgement module  22  is configured to execute the priority judgement policy; 
         [0062]    wherein the priority judgment policy may include that whether the operation priority indication corresponding to the operation in the event is not higher than the operation priority indication corresponding to the current operation is judged; if not higher, the operation in the event is dropped, and the terminal peripheral or the terminal peripheral group continues executing the current operation; otherwise, the current operation is replaced by the operation in the event, and the operation in the event is delivered according to the identifier of the terminal peripheral or the terminal peripheral group of the operation in the event. 
         [0063]    Or the priority judgment policy may include that whether the operation priority indication corresponding to the operation in the event is not lower than the operation priority indication corresponding to the current operation is judged; if not lower, the current operation is replaced by the operation in the event, and the operation in the event is delivered according to the identifier of the terminal peripheral or the terminal peripheral group of the operation in the event; otherwise, the operation in the event is dropped, and the terminal peripheral or the terminal peripheral group continues executing the current operation. 
         [0064]    The management module  21  is configured to receive operation execution information returned by the terminal peripheral or the terminal peripheral group, delete an operation corresponding to a corresponding terminal peripheral or terminal peripheral group and record operation execution information, wherein the operation execution information may include an identifier of the terminal peripheral or an identifier of the terminal peripheral group, an indication of an operation execution success or failure, a state value obtained after execution of an operation succeeds, or a reason value obtained after the execution of the operation fails. 
         [0065]    The management module  21  and the priority judgement module  22  may be implemented by a Digital Signal Processor (DSP) in the M2M gateway. 
         [0066]    The above are only preferred embodiments of the present disclosure, but are not used for limiting the protection scope of the present disclosure.