WO2015062421A1 - Gateway replacement method, gateway, and server - Google Patents

Gateway replacement method, gateway, and server Download PDF

Info

Publication number
WO2015062421A1
WO2015062421A1 PCT/CN2014/088798 CN2014088798W WO2015062421A1 WO 2015062421 A1 WO2015062421 A1 WO 2015062421A1 CN 2014088798 W CN2014088798 W CN 2014088798W WO 2015062421 A1 WO2015062421 A1 WO 2015062421A1
Authority
WO
WIPO (PCT)
Prior art keywords
gateway
replacement
service capability
identifier
capability layer
Prior art date
Application number
PCT/CN2014/088798
Other languages
French (fr)
Chinese (zh)
Inventor
李娜
Original Assignee
华为终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为终端有限公司 filed Critical 华为终端有限公司
Publication of WO2015062421A1 publication Critical patent/WO2015062421A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Definitions

  • the present invention relates to the field of communications, and in particular, to a gateway replacement method, a gateway, and a server.
  • M2M (English name: Machine-to-Machine, full name in Chinese: machine-to-machine) Communication is a general term for a series of technical and technical combinations of data communication and interaction between machines and machines.
  • the M2M service capability layer (English name: M2M Service Capability Layer) includes the network side service capability layer, the gateway service capability layer, and the MSM terminal service capability layer, and the interface for communication between the layers.
  • the service capability layer of the network side, the gateway, and the M2M terminal provides a service function, which may also be called a common service layer (English name Common Service Layer).
  • This layer contains the general service entity (English name Common Service Entity), and the general business entity is the instantiation of the common business function (English name: Common Service Function).
  • the general business function is the business function provided by the business capability layer.
  • the service capability layer identifier may also be referred to as a general service layer identifier or a general service entity identifier.
  • the notification of the device replacement by the old device is given to the service capability layer (Hosting SCL) of the device, and the Hosting SCL determines the authority of the device.
  • Hosting SCL marks the resources corresponding to this device and replies to notify the old device that it can go offline.
  • Hosting SCL waits for new devices to join to replace the old devices that are offline.
  • the new device initiates the creation of the request to the Hosting SCL, and carries the replacement indication and the identification information of the replaced old device.
  • the Hosting SCL associates the related information and updates the differentiated information of the corresponding resource, that is, the replacement process is completed. .
  • the replaceable device in the prior art only has application capability and no business capability, so it only needs to store information related to its own application, and does not need to store and manage information of other devices.
  • a gateway or device with SCL provides service capabilities and needs to store and manage resources of gateways or devices without service capabilities. Therefore, the prior art cannot solve the replacement problem of a gateway with business capability.
  • the first aspect provides a gateway replacement method, the method comprising:
  • the server receives a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries Instructing, the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • the server generates a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement
  • the server receives a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second service capability layer identifier And the gateway replacement identifier is sent by the second gateway or the server to the first gateway;
  • the server updates the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is requested by the server according to the gateway replacement notification or the resource creation request. obtain;
  • the server sends a first message to the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
  • the gateway replacement notification further includes the first service capability layer identifier of the first gateway.
  • the first service capability layer identifier and the replacement indication are sent by the first gateway to Said second gateway.
  • the server sends the first service capability layer identifier and the replacement indication to the second gateway.
  • the method further includes:
  • the server detects whether the first service capability layer identifier is valid
  • the server generates the gateway replacement identifier when the first service capability layer identifier is valid.
  • the method further includes:
  • the server checks whether the second gateway can be replaced
  • the server generates the gateway replacement identifier when the second gateway can be replaced.
  • the server sends the gateway replacement identifier to the second gateway, and further to the second The gateway sends a wait indication, where the wait indication is used to indicate that the second gateway needs to wait for a downline indication.
  • the method further includes:
  • the server sends a notification to the second gateway, where the notification carries a first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate that the gateway replacement is completed.
  • a gateway replacement method comprising:
  • the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway;
  • the first gateway sends a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the first gateway.
  • the first service capability layer identifier and the second service capability layer identifier are updated, and the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway. ;
  • the first gateway receives the second message sent by the second gateway, where the second information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway;
  • the first gateway updates the gateway information to the device registered to the second gateway according to the received second information.
  • the first gateway before the receiving, by the first gateway, the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, the first gateway further includes:
  • the first gateway sends the first service capability layer identifier and the replacement indication of the first gateway to the second gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
  • the second gateway is configured to send the gateway replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  • the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway.
  • the gateway information includes the first gateway A uniform resource locator of the service capability layer and a uniform resource locator of the service capability layer of the second gateway.
  • the first gateway updates the gateway information to the device that is registered to the second gateway, and specifically includes:
  • the first gateway Transmitting, by the first gateway, a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway, and the second gateway.
  • the uniform resource locator of the service capability layer; the application resource refers to the corresponding resource of the device registered to the second gateway.
  • the first gateway sends a third message to the device corresponding to the application resource of the first gateway, and then includes
  • the first gateway receives a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
  • the fourth message further carries, by the online device, a uniform resource locator of the service capability layer of the second gateway Information of a uniform resource locator of the service capability layer of the second gateway.
  • a seventh possible implementation manner the receiving the confirmation message of the online device, and then the following:
  • the first gateway marks the online device corresponding to the fourth message received by the first gateway.
  • the first gateway updates the device that is registered to the second gateway according to the received second information Gateway information, further including:
  • the first gateway checks whether the resource corresponding to the device that is not updated expires, and if it expires, deletes the resource corresponding to the device that is not updated.
  • a gateway replacement method where the method includes:
  • the second gateway sends a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication and a first service capability layer identifier of the first gateway, where the replacement indication is used to indicate that the second gateway Replaced by the first gateway;
  • the second gateway sends a second message to the first gateway, where the second message includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
  • the method further includes:
  • the second gateway receives the first service capability layer identifier and the replacement indication of the first gateway that are sent by the first gateway, and the gateway replacement identifier further includes the first service capability layer identifier.
  • the second gateway sends a network replacement notification to the server, where the gateway replacement notification carries a replacement indication, and then includes:
  • the second gateway receives the gateway replacement identifier and the waiting indication sent by the server.
  • the sending by the first gateway, the second service capability layer identifier and the gateway replacement identifier of the second gateway;
  • the second gateway receives a uniform resource locator of the service capability layer of the first gateway and the replacement indication sent by the server.
  • the second gateway sends a second message to the first gateway, where the second message includes a registration that is stored by the second gateway to the first
  • the resource information corresponding to the device of the second gateway and then includes:
  • the second gateway After receiving the acknowledgement message sent by the first gateway, the second gateway goes offline, and the acknowledgement message is used to confirm that the first gateway receives the second message.
  • a server comprising:
  • a first receiving unit configured to receive, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • a generating unit configured to generate a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement
  • a first sending unit configured to send the gateway replacement identifier to the second gateway
  • a second receiving unit configured to receive a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second The service capability layer identifier and the gateway replacement identifier are sent by the second gateway or the server to the first gateway;
  • An update unit configured to update a service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway replacement notification or the creation Resource request is obtained;
  • the second sending unit is configured to send a first message to the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
  • the gateway replacement notification further includes the first service capability layer identifier of the first gateway
  • the first service capability layer identifier and the replacement indication are sent by the first gateway to the Second gateway.
  • the gateway replacement notification further includes a first service capability layer identifier of the first gateway, where the server further includes:
  • a third receiving unit configured to receive a first service capability layer identifier and a replacement indication sent by the first gateway
  • a third sending unit configured to send the first service capability layer identifier and the replacement indication to the second gateway.
  • the server further includes:
  • the detecting unit is configured to detect whether the first service capability layer identifier is valid.
  • the generating unit is configured to generate the gateway replacement identifier when the first service capability layer identifier is valid.
  • the second sending unit is further configured to send, by the second gateway, a waiting indication, to notify the The second gateway needs to wait for the offline indication.
  • the server further includes:
  • a fourth sending unit configured to send a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate a gateway Replacement is complete.
  • a gateway is provided, where the gateway includes:
  • a first receiving unit configured to receive a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway;
  • a first sending unit configured to send a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the Updating the first service capability layer identifier and the second service capability layer identifier of the first gateway, and updating the service capability layer resource, where the first service capability layer identifier is included in the creation resource request or the second gateway
  • the gateway is sent in the replacement notification;
  • a second receiving unit configured to receive a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
  • a third receiving unit configured to receive a second message sent by the second gateway, where the second message includes resource information corresponding to a device that is stored by the second gateway and registered to the second gateway;
  • an updating unit configured to update the gateway information to the device registered to the second gateway according to the second message received by the third receiving unit.
  • the gateway further includes:
  • a second sending unit configured to send, to the second gateway, a first service capability layer identifier and a replacement indication of the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the second gateway
  • the second gateway sends a network replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  • the gateway further includes:
  • a third sending unit configured to send the first service capability layer identifier and the replacement indication to the server, so that the server sends the first service capability layer identifier and the replacement indication to the Second gateway.
  • the first gateway according to the received a second message, the gateway information is updated to the device registered to the second gateway, where the gateway information includes a uniform resource locator of the service capability layer of the first gateway and a service capability layer of the second gateway. Resource locator.
  • the updating unit is specifically configured to:
  • the first gateway Transmitting, by the first gateway, a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway, and the second a uniform resource locator of the service capability layer of the gateway; the application resource refers to a corresponding resource of the device registered to the second gateway.
  • the gateway further includes:
  • the fourth receiving unit is configured to receive a fourth message sent by the online device, where the fourth message carries the information that the online device receives the update message.
  • the gateway further includes:
  • a marking unit configured to mark a device corresponding to the fourth message received by the fourth receiving unit.
  • the gateway further includes:
  • the processing unit is configured to determine whether the resource corresponding to the device that is not updated is expired, and if it is determined that the resource corresponding to the unupdated device is expired, the resource corresponding to the unupdated device is deleted.
  • a gateway is provided, where the gateway includes:
  • a first sending unit configured to send a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • a first receiving unit configured to receive a gateway replacement identifier sent by the server, where the gateway replacement identifier is used to identify a gateway replacement
  • a second sending unit configured to send, to the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier;
  • a second receiving unit configured to receive a first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
  • a third sending unit configured to send a second message to the first gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and registered to the second gateway.
  • the gateway further includes:
  • a third receiving unit configured to receive the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, where the gateway replacement identifier further includes the first service capability layer identifier.
  • the gateway further includes: a fourth receiving unit, configured to receive a gateway replacement identifier sent by the server And waiting for instructions.
  • the gateway further includes:
  • a fifth receiving unit configured to receive a uniform resource locator and a replacement indication of a service capability layer of the first gateway sent by the server;
  • the gateway further includes:
  • a sixth receiving unit configured to receive an acknowledgement message sent by the first gateway
  • the processing unit is configured to go offline according to the confirmation message received by the sixth receiving unit, where the confirmation message is used to confirm that the first gateway receives the second message.
  • the gateway replacement method provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the stored information transmission fee with the gateway, it needs to replace the verification of the macro access server, at the gateway. Before the replacement is completed, the replaced gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
  • FIG. 1 is a schematic structural diagram of an embodiment of the present invention
  • FIG. 2 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention
  • FIG. 3 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 5 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 6 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 7 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 8 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention.
  • FIG. 9 is a structural diagram of an embodiment of a server according to an embodiment of the present invention.
  • FIG. 10 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention.
  • FIG. 11 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention.
  • FIG. 12 is a structural diagram of an embodiment of a server according to an embodiment of the present invention.
  • FIG. 13 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention.
  • FIG. 14 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention.
  • FIG. 1 is an architectural diagram of a gateway replacement method according to an embodiment of the present invention.
  • an application architecture of the method mainly includes a second gateway 20, a first gateway 10 and a server 30, and a second gateway 20 is registered.
  • At least one device 40 wherein the device 40 may be an M2M terminal with service capability or an M2M terminal without service capability, and both the first gateway 10 and the second gateway 20 have service capabilities, and the second gateway 20
  • the second gateway 20 stores the information of all the devices registered to the second gateway 20, with the second gateway service capability layer identifier (English name: Gateway Service Capability Layer Identity, GSCL ID).
  • the second gateway 20 needs to be replaced, and the second gateway 20 is replaced by the first gateway 10.
  • the process may be a process of a bootstrap process and a service connection, where the bootstrap process obtains a first service capability layer identifier (GSCL ID) for the first gateway, a service connection process generates a corresponding key, and a key and a SCL ID are provided.
  • the network service capability layer (NSCL) of the server 30 stores the related data for authenticating the first gateway 10 in the server 30.
  • an embodiment of the present invention provides a gateway replacement method.
  • the method is deployed in a server 30 having a service capability layer. As shown in FIG. 2, the method includes:
  • the server receives the gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
  • the server generates a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement.
  • the server sends the gateway replacement identifier to the second gateway.
  • the server receives a request for creating a resource sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, and the service capability of the second gateway
  • the layer identifier and the gateway replacement identifier are sent by the second gateway or server to the first gateway;
  • the server updates the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway.
  • the notification or the creation of the resource request is obtained;
  • the first service capability layer identifier may be obtained in different manners, for example, may be carried in a gateway replacement notification, or may be carried in a resource creation request.
  • the server sends a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
  • the initiator of the replacement process is different, and therefore, the information carried in different notifications is also different.
  • the replacement process may be initiated by the first gateway, where the gateway replacement notification further includes a first service capability layer identifier of the first gateway, the first service capability layer identifier and the replacement The indication is sent by the first gateway to the second gateway, a more specific embodiment, which will be described later.
  • the gateway replacement notification further includes a first service capability layer identifier of the first gateway; and the receiving the gateway replacement notification sent by the second gateway, before:
  • the server sends the first service capability layer identifier and the replacement indication to the second gateway.
  • the gateway replacement identifier is generated when the first service capability layer identifier is valid, and before the generating gateway replaces the identifier, the method further includes:
  • the server generates the gateway replacement identifier when the first service capability layer identifier is valid.
  • the method further includes:
  • the server checks whether the second gateway can be replaced
  • the server generates the gateway replacement identifier when the server is replaceable by the second gateway.
  • the server While the server sends the gateway replacement identifier to the second gateway, the server further sends a waiting indication to the second gateway, where the waiting indication is used to indicate that the second gateway needs to wait for an offline indication. That is to say, after waiting for the first gateway to join, the second gateway can go offline to ensure normal operation of the system.
  • the method further includes:
  • the server sends a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate that the gateway is replaced. to make.
  • the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
  • the embodiment of the present invention further provides a gateway replacement method.
  • the execution body in this embodiment is the first gateway 10 in FIG.
  • the methods described include:
  • the first gateway receives a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway.
  • the first gateway sends a request for creating a resource to the server, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the creation resource request triggers Updating, by the server, the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is included in the creation resource request or the gateway replacement sent by the second gateway In the notice;
  • the first gateway receives a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource.
  • the first gateway receives the second message sent by the second gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and is registered to the second gateway.
  • the first gateway updates the gateway information to the device registered to the second gateway according to the received second message.
  • the first gateway before receiving the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, the first gateway further includes:
  • the first gateway sends the first service capability layer identifier and the replacement indication of the first gateway to the second gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
  • the second gateway is configured to send the gateway replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  • the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, where the gateway replacement identifier is sent by the server and sent to the The second gateway; before, it also includes:
  • the gateway information includes a uniform resource locator of a service capability layer of the first gateway and a uniform resource locator of a service capability layer of the second gateway.
  • the first gateway updates the gateway information to the device registered on the second gateway according to the received second message, which specifically includes:
  • the first gateway sends a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway and a service of the second gateway.
  • the first gateway After the first gateway sends a third message to the device corresponding to the application resource of the first gateway, the first gateway receives a fourth message sent by the online device, where the fourth message is received by the online device.
  • the information of the update message is not limited to the third message.
  • the fourth message further carries the information that the online device updates the uniform resource locator of the service capability layer of the second gateway to the uniform resource locator of the service capability layer of the first gateway.
  • the method further includes:
  • the first gateway marks the online device corresponding to the fourth message received by the first gateway
  • the first gateway updates the gateway information to the device registered to the second gateway according to the received second information, and further includes:
  • the first gateway checks whether the resource corresponding to the device that is not updated expires, and if it expires, deletes the resource corresponding to the device that is not updated.
  • the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
  • the embodiment of the present invention further provides a gateway replacement method.
  • the execution entity is the second gateway 20 in FIG.
  • the gateway to be replaced in this embodiment, the method includes:
  • the second gateway sends a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
  • the second gateway receives the gateway replacement identifier sent by the server, where the gateway replacement identifier is generated by the server, and the gateway replacement identifier is used to identify the gateway replacement.
  • the second gateway sends, to the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier.
  • the second gateway receives the first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
  • the second gateway sends a second message to the first gateway, where the second message information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
  • the method further includes:
  • the second gateway receives the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, where the gateway replacement identifier further includes the first service capability layer identifier.
  • step 401 after that, further includes:
  • the second gateway receives the illustrated gateway replacement identifier and the waiting indication sent by the server.
  • Step 403, before, further includes:
  • Step 405, after that, further includes:
  • the second gateway After receiving the acknowledgement message sent by the first gateway, the second gateway goes offline, and the acknowledgement message is used to confirm that the first gateway receives the storage device message.
  • the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
  • the process of the Bootstrap process and the service connection is required. Through the two processes, the first gateway obtains the SCL ID and generates a corresponding key, and the NSCL also obtains the first gateway. Information about rights;
  • the first gateway sends a first GSCL ID and a replacement indication of the first gateway to the second gateway.
  • the message that the second gateway receives the first gateway includes the first GSCL ID and the replacement finger.
  • the second gateway sends a gateway replacement notification to the NSCL of the server, where the gateway replacement notification carries the replacement indication and the first GSCL ID.
  • the NSCL of the server detects whether the first GSCL ID is valid.
  • the NSCL detects whether the first GSCL ID is verified by the MSBF and the MAS. If the first GSCL ID is valid, step 504 is performed, and if invalid, a reject message is sent to the second gateway.
  • the NSCL allocates a gateway replacement identifier and replies to the second gateway.
  • the second gateway sends the second GSCL ID of the second gateway and the gateway replacement identifier to the first gateway.
  • the first gateway sends a create resource request message to the NSCL, where the create resource request carries the second GSCL ID and the gateway replacement identifier.
  • the NSCL updates the SCL resource created by the server for the second gateway according to the second GSCL ID, the first GSCL ID, and the network replacement identifier.
  • the NSCL detects the content in the created resource message sent by the first gateway, and if the created resource message carries the replacement identifier, it indicates that the created resource message is used for updating the resource, so the NSCL is configured according to the second gateway.
  • the GSCL ID finds a resource registered by the second gateway on the network side, and the server compares the content included in the resource with the content in the created resource request sent by the first gateway, and updates different content, and maintains the same content. constant.
  • the NSCL sends a first message to the first gateway, where the first message carries information that the service capability layer resource has been successfully updated.
  • the first gateway replies to the second gateway, indicating that the NSCL resource is successfully updated.
  • the second gateway sends the second message information to the first gateway, and goes offline.
  • the second message includes information about the device registered by the second gateway and registered to the second gateway, for example, the time of the device registration, the attribute of the device, the content stored by the device to the gateway, and the like.
  • the device here can also be an application.
  • the first gateway updates the gateway information of the device registered to the second gateway according to the information included in the received second message.
  • gateway information including the URI of the first gateway and the URI of the second gateway.
  • the first gateway updates the addressing information to the device registered to the gateway, which can be implemented by the process shown in FIG. 6, and the second gateway has been offline.
  • the first gateway sends a third message to a device corresponding to all application resources of the first gateway.
  • the first gateway may send an update message by using a multicast mode or a broadcast, where the update message includes a URI of the second gateway and a URI of the first gateway.
  • the third message includes a uniform resource locator of the service capability layer of the second gateway and a uniform resource locator of the service capability layer of the second gateway; the application resource refers to the registration to the second gateway The corresponding resource of the device on it.
  • the online device receives the third message of the first gateway, finds a corresponding resource according to the URI of the second gateway, and then updates the URI of the second gateway to a URI of the first gateway, and then passes the fourth The message replies to the first gateway, and the fourth message indicates that the online device receives the update message.
  • the first gateway sets a flag for the application resource corresponding to the replied device, indicating that the device has been updated.
  • the expiration time of the resource corresponding to the unupdated device is checked, and it is judged whether it is expired. If it expires, the resource is deleted; a timer is set to count the time when the update message is sent.
  • the sleep terminal is online.
  • the online dormant terminal sends a message to the app resource second gateway, but since the second gateway is offline, the online dormant terminal does not receive any reply.
  • the sleeping terminal on the line starts the timer and waits for the update message; if it receives the update message, it stops the timer.
  • the timer of the first gateway sends the multicast update message again after the time expires.
  • the online dormant terminal receives the update message stop timer and replies to the first gateway updated information.
  • the gateway is reselected.
  • FIG. 7 is an interaction diagram of another embodiment of a gateway replacement method. Compared with the embodiment shown in FIG. 5, the difference is that there is no communication mechanism between the first gateway and the second gateway. Therefore, the first gateway is The first GSCL ID and the gateway replacement indication that need to be sent to the second gateway need to be transited through the NSCL of the server. Therefore, before the second gateway sends the gateway replacement notification to the server, the method further includes:
  • the first gateway sends a first service capability layer identifier and a replacement indication to the server;
  • the server sends the first service capability layer identifier and the replacement indication to the second gateway.
  • FIG. 8 is an interaction diagram of another implementation manner of a gateway replacement method.
  • a replacement flow is used. The process is initiated by the second gateway.
  • the method includes:
  • the second gateway sends a gateway replacement notification to the NSCL of the server, where the gateway replacement notification carries a replacement indication.
  • the NSCL checks the rights of the second gateway.
  • the second gateway writes its own attribute to the created resource when registering, and the NSCL detects whether the second gateway has the replaced right, so as to prevent the criminal from randomly replacing the gateway. This permission is saved in the properties of the second gateway.
  • step 803 is performed, otherwise a rejection message is sent to the second gateway.
  • the NSCL generates a gateway replacement identifier and sends the identifier to the second gateway, and sends a waiting indication to the second gateway.
  • the second gateway receives the waiting indication sent by the NSCL, that is, the second gateway is not available in the following line, and needs to wait for the first gateway to join, and can be offline when it can work instead. Thereafter, the second gateway waits for the first gateway to join and continues to work.
  • the second gateway needs to interact with the first gateway to send the second GSCL ID of the second gateway and the gateway replacement identifier to the first gateway.
  • the first gateway and the second gateway may perform information interaction by using a wired manner or a wireless local area network manner.
  • the first gateway sends a resource request to the NSCL, where the second GSCL ID of the second gateway, the first GSCL ID, and the gateway replacement identifier are included.
  • the NSCL verifies the validity of the first gateway, and then the NSCL updates the SCL resource that the server created for the second gateway according to the first GSCLID, the second GSCL ID, and the replacement identifier.
  • the NSCL detects the content in the created resource message sent by the first gateway, and if the replacement identifier is carried, it indicates that the message is used for updating the resource, so the NSCL finds the second gateway according to the second GSCL ID of the second gateway.
  • the resource registered on the network side the server compares the content included in the resource to the content of the created resource request sent by the first gateway, and updates different content, and the same remains unchanged.
  • the NSCL sends a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer.
  • the GSCL of the second gateway replies to the NSCL of the server, and notifies the user that the notification is received;
  • the GSCL of the second gateway sends the stored resource information to the GSCL of the first gateway by using a second message according to the GSCL URI of the first gateway.
  • the GSCL of the first gateway replies to the GSCL of the second gateway, and indicates that the second message sent by the second gateway is received.
  • the second message includes information stored by the second gateway and registered to the device on the second gateway, for example:
  • the device here can also be an application.
  • the GSCL of the second gateway is offline
  • the first gateway updates the gateway information to the device registered to the second gateway according to the received information in the second message, where the gateway information includes a new URI and an old URI.
  • step 813 is similar to the embodiment shown in FIG. 6, and therefore, no further details are provided.
  • FIG. 9 is a schematic structural diagram of the embodiment.
  • the server includes:
  • the first receiving unit 901 is configured to receive, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • the generating unit 902 is configured to generate a gateway replacement identifier, where the gateway replacement identifier is used to notify the network that the gateway replacement is to be performed;
  • the first sending unit 903 is configured to send the gateway replacement identifier to the second gateway.
  • the second receiving unit 904 is configured to receive a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where The second service capability layer identifier and the gateway replacement identifier are sent by the second gateway or the server to the first gateway;
  • the updating unit 905 is configured to update the service capability layer resource according to the correspondence between the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway replacement notification Or the creation resource request is obtained;
  • the second sending unit 906 is configured to send a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
  • the gateway replacement notification further includes a first service capability layer identifier of the first gateway, where the first service capability layer identifier and the replacement indication are sent by the first gateway to the Said second gateway.
  • the server further includes:
  • a third receiving unit configured to receive a first service capability layer identifier and a replacement indication sent by the first gateway
  • a third sending unit configured to send the first service capability layer identifier and the replacement indication to the second gateway.
  • the service server further includes:
  • the detecting unit is configured to detect whether the first service capability layer identifier is valid.
  • the generating unit is further configured to generate the gateway replacement identifier when the first service capability layer identifier is valid.
  • the server further includes:
  • a verification unit configured to verify whether the second gateway can be replaced
  • the generating unit 902 is further configured to generate the gateway replacement identifier when the second gateway can be replaced.
  • the second sending unit is further configured to send a waiting indication to the second gateway, to notify the second gateway that the offline indication needs to be waited for.
  • the server further includes:
  • a fourth sending unit configured to send a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate a gateway Replacement is complete.
  • the server provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. It is verified that the replaced gateway works normally before the gateway replacement is completed, and will not go offline before the replacement is completed, so that the device registered to the replaced gateway can work normally.
  • the embodiment of the present invention further provides a gateway, which may be, for example, the first gateway in FIG. 1 , and FIG. 10 is a structural diagram of the gateway. As shown in FIG. 10 , the gateway includes:
  • the first receiving unit 1001 is configured to receive a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway, where the gateway replacement identifier is generated by the server and sent to the second gateway.
  • the first sending unit 1002 is configured to send a request for creating a resource to the server, where the created resource carries the second service capability layer identifier and the gateway replacement identifier, and the created resource request server is configured according to the first service.
  • the relationship between the capability layer identifier and the second service capability layer identifier is updated.
  • a service capability layer resource where the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway;
  • the second receiving unit 1003 is configured to receive a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
  • the third receiving unit 1004 is configured to receive a second message sent by the second gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and registered to the second gateway;
  • the updating unit 1005 is configured to update the gateway information to the device registered on the second gateway according to the second message received by the third receiving unit.
  • the gateway further includes:
  • a second sending unit configured to send, to the second gateway, the first service capability layer identifier and the replacement indication of the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the second gateway
  • the second gateway sends a network replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  • the gateway further includes: a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the server, so that the server identifies the first service capability layer and the The replacement indication is sent to the second gateway.
  • a third sending unit configured to send the first service capability layer identifier and the replacement indication to the server, so that the server identifies the first service capability layer and the The replacement indication is sent to the second gateway.
  • the updating unit is configured to send a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource location of the service capability layer of the first gateway. And a uniform resource locator of the service capability layer of the second gateway; the application resource refers to a corresponding resource of the device registered to the second gateway.
  • the gateway further includes:
  • the fourth receiving unit is configured to receive a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
  • the gateway further includes:
  • a marking unit configured to mark a device corresponding to the fourth message received by the fourth receiving unit.
  • the gateway further includes:
  • the processing unit is configured to determine whether the resource corresponding to the device that is not updated is expired, and if it is determined that the resource corresponding to the unupdated device is expired, the resource corresponding to the unupdated device is deleted.
  • the gateway provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. Verify that the replaced gateway is working properly before the gateway replacement is completed. If the replacement is not completed before the replacement is completed, it can ensure that the device registered to the replaced gateway can work normally.
  • the embodiment of the present invention further provides a gateway, which may be, for example, the second gateway in FIG. 1
  • a gateway which may be, for example, the second gateway in FIG. 1
  • FIG. 11 is a structural diagram of the gateway.
  • the gateway includes:
  • a first sending unit 1101 configured to send a network replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • the first receiving unit 1102 is configured to receive a gateway replacement identifier sent by the server, where the gateway replacement identifier is generated by a server, and the gateway replacement identifier is used to identify a gateway replacement.
  • the second sending unit 1103 is configured to send, by the first gateway, its second service capability layer identifier and the gateway replacement identifier.
  • a second receiving unit 1104 configured to receive a first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
  • the third sending unit 1105 is configured to send second information to the first gateway, where the second information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
  • the gateway further includes:
  • a third receiving unit configured to receive the first service capability layer identifier and the replacement indication sent by the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway, where the gateway is replaced
  • the identifier further includes the first service capability layer identifier, where the gateway replacement notification carries a replacement indication and a first service capability layer identifier of the first gateway.
  • a fourth receiving unit configured to receive the gateway replacement identifier and the waiting indication sent by the server.
  • the gateway further includes:
  • a fifth receiving unit configured to receive a uniform resource locator and a replacement indication of a service capability layer of the first gateway sent by the server;
  • the gateway further includes:
  • a sixth receiving unit configured to receive an acknowledgement message sent by the first gateway
  • the processing unit is configured to go offline according to the confirmation message received by the sixth receiving unit, where the confirmation message is used to confirm that the first gateway receives the second message.
  • server and gateway can respectively perform the method of the foregoing method embodiment, and details are not described herein again.
  • the gateway provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. Verify that the replaced gateway is working properly before the gateway replacement is completed. If the replacement is not completed before the replacement is completed, it can ensure that the device registered to the replaced gateway can work normally.
  • an embodiment of the present invention provides a server, where the server may be deployed to perform the method shown in FIG. 2 of the embodiment of the present invention; as shown in FIG. 12, the server includes a network interface 1201 and a processor. 1202 and memory 1203.
  • System bus 1204 is used to connect network interface 1201, processor 1202, and memory 1203.
  • Network interface 1201 is used to communicate with other network nodes.
  • the memory 1203 is used to store programs.
  • the program can include program code, the program code including computer operating instructions.
  • the memory 1203 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory.
  • a device driver may also be included in the memory 1203.
  • the processor 1202 executes a program stored in the memory 1203 for performing:
  • the gateway replacement identifier is sent by the second gateway or the server to the first gateway;
  • processor 1202 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
  • the embodiment of the present invention further provides a gateway, which is used to perform the method shown in FIG. 3 in the embodiment of the present invention; as shown in FIG. 13, the gateway includes a network interface 1301 and a processor. 1302 and memory 1303.
  • System bus 1304 is used to connect network interface 1301, processor 1302, and memory 1403.
  • Network interface 1301 is used to communicate with other network nodes.
  • the memory 1303 is used to store programs.
  • the program can include program code, the program code including computer operating instructions.
  • the memory 1303 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory.
  • a device driver may also be included in the memory 1303.
  • the processor 1302 executes a program stored in the memory 1303 for executing:
  • the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the first service capability of the server according to the first gateway
  • the layer identifier and the second service capability layer identifier are updated, and the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway;
  • processor 1302 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
  • the embodiment of the present invention further provides a gateway, which is used to perform the method shown in FIG. 3 of the embodiment of the present invention; as shown in FIG. 14, the gateway includes a network interface 1301 and a processor 1402. And memory 1403.
  • the system bus 1404 is used to connect the network interface 1401, the processor 1402, and the memory 1403.
  • Network interface 1401 is used to communicate with other network nodes.
  • the memory 1403 is used to store programs.
  • the program can include program code, the program code including computer operating instructions.
  • the memory 1403 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory.
  • the device 1403 may further include a device driver program.
  • the processor 1402 executes a program stored in the memory 1403 for execution:
  • the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
  • processor 1402 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A gateway replacement method comprises: receiving a gateway replacement notification sent by a second gateway, the gateway replacement notification carrying a replacement instruction, and the replacement instruction being for indicating that the second gateway will be replaced with a first gateway; generating a gateway replacement identifier, the gateway replacement identifier being for identifying gateway replacement; sending the gateway replacement identifier to the second gateway; receiving a create resource request sent by the first gateway, the create resource request carrying a service capability layer identifier of the second gateway and the gateway replacement identifier; updating a service capability layer resource according to a first service capability layer identifier and a second service capability layer identifier, the first service capability layer identifier being obtained by the server according to the gateway replacement notification or the create resource request; and sending a first message to the first gateway, the first message carrying the information about that the server has successfully created the service capability layer resource.

Description

网关替换方法、网关及服务器Gateway replacement method, gateway and server 技术领域Technical field
本发明涉及通信领域,具体涉及一种网关替换方法、网关及服务器。The present invention relates to the field of communications, and in particular, to a gateway replacement method, a gateway, and a server.
背景技术Background technique
M2M(英文全称:Machine-to-Machine,中文全称:机器对机器)通信是指机器与机器之间进行数据通信和交互的一系列技术及技术组合的总称。M2M业务能力层(英文全称:M2M Service Capability Layer),包括网络侧业务能力层、网关业务能力层和MSM终端业务能力层,以及各层之间通信的接口。网络侧、网关和M2M终端的业务能力层提供业务功能,也可以叫做通用业务层(英文全称Common Service Layer)。此层中包含通用业务实体(英文全称Common Service Entity),通用业务实体是通用业务功能(英文全称:Common Service Function)的实例化。通用业务功能即是业务能力层提供的业务功能。业务能力层标识也可以叫做通用业务层标识,或者通用业务实体标识。M2M (English name: Machine-to-Machine, full name in Chinese: machine-to-machine) Communication is a general term for a series of technical and technical combinations of data communication and interaction between machines and machines. The M2M service capability layer (English name: M2M Service Capability Layer) includes the network side service capability layer, the gateway service capability layer, and the MSM terminal service capability layer, and the interface for communication between the layers. The service capability layer of the network side, the gateway, and the M2M terminal provides a service function, which may also be called a common service layer (English name Common Service Layer). This layer contains the general service entity (English name Common Service Entity), and the general business entity is the instantiation of the common business function (English name: Common Service Function). The general business function is the business function provided by the business capability layer. The service capability layer identifier may also be referred to as a general service layer identifier or a general service entity identifier.
现有技术中,在需要替换不带业务能力层的设备时,由旧设备发起设备替换的通知给制设备的业务能力层(Hosting SCL),Hosting SCL判断此设备的权限,通过权限认证后,Hosting SCL标记此设备对应的资源,并回复通知旧设备可以下线了。Hosting SCL等待新的设备加入以替代下线的旧设备。新设备发起创建的请求给Hosting SCL,并携带替代指示和被替代的旧设备的标识信息,Hosting SCL收到此请求后,关联相关的信息,并更新对应资源的差异化信息,即完成替换流程。In the prior art, when the device that does not have the service capability layer needs to be replaced, the notification of the device replacement by the old device is given to the service capability layer (Hosting SCL) of the device, and the Hosting SCL determines the authority of the device. Hosting SCL marks the resources corresponding to this device and replies to notify the old device that it can go offline. Hosting SCL waits for new devices to join to replace the old devices that are offline. The new device initiates the creation of the request to the Hosting SCL, and carries the replacement indication and the identification information of the replaced old device. After receiving the request, the Hosting SCL associates the related information and updates the differentiated information of the corresponding resource, that is, the replacement process is completed. .
现有技术中可替换的设备只具备应用能力,不具备业务能力,因此它只需存储与自身应用相关的信息,不需要存储和管理其它设备的信息。而带有SCL的网关或者设备,提供业务能力,需要对没有业务能力的网关或设备的资源进行存储和管理。因此,现有技术无法解决具备业务能力的网关的替换问题。The replaceable device in the prior art only has application capability and no business capability, so it only needs to store information related to its own application, and does not need to store and manage information of other devices. A gateway or device with SCL provides service capabilities and needs to store and manage resources of gateways or devices without service capabilities. Therefore, the prior art cannot solve the replacement problem of a gateway with business capability.
发明内容Summary of the invention
本发明的目的是提供一种网关替换方法,以实现对具备业务能力的网关进行替换。It is an object of the present invention to provide a gateway replacement method for implementing replacement of a service capable gateway.
第一方面提供了一种网关替换方法,所述方法包括:The first aspect provides a gateway replacement method, the method comprising:
服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替 换指示,所述替换指示用于指示所述第二网关将被第一网关替换;The server receives a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries Instructing, the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
所述服务器生成网关替换标识,所述网关替换标识用于标识网关替换;The server generates a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement;
所述服务器向所述第二网关发送所述网关替换标识;Sending, by the server, the gateway replacement identifier to the second gateway;
所述服务器接收所述第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;The server receives a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second service capability layer identifier And the gateway replacement identifier is sent by the second gateway or the server to the first gateway;
所述服务器根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;The server updates the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is requested by the server according to the gateway replacement notification or the resource creation request. obtain;
所述服务器向所述第一网关发送第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息。The server sends a first message to the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
基于第一方面,在第一种可能的实施方式中,所述网关替换通知中还包含所述第一网关的所述第一业务能力层标识。Based on the first aspect, in a first possible implementation manner, the gateway replacement notification further includes the first service capability layer identifier of the first gateway.
基于第一方面,或第一方面的第一种可能的实施方式,在第二种可能的实施方式中,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关。Based on the first aspect, or the first possible implementation manner of the first aspect, in a second possible implementation manner, the first service capability layer identifier and the replacement indication are sent by the first gateway to Said second gateway.
基于第一方面,或第一方面的第一种可能的实施方式,在第三种可能的实施方式中,所述接收第二网关发送的网关替换通知,之前,还包括:Based on the first aspect, or the first possible implementation manner of the first aspect, in a third possible implementation manner, the receiving, by the second gateway, the gateway replacement notification, before:
所述服务器接收所述第一网关发送的所述第一业务能力层标识和替换指示;Receiving, by the server, the first service capability layer identifier and the replacement indication sent by the first gateway;
所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。The server sends the first service capability layer identifier and the replacement indication to the second gateway.
基于第一方面的第一种可能的实施方式或第二种可能的实施方式,在第四种可能的实施方式中,所述服务器生成网关替换标识之前,还包括:Based on the first possible implementation manner or the second possible implementation manner of the first aspect, in the fourth possible implementation manner, before the server generates the gateway replacement identifier, the method further includes:
所述服务器检测所述第一业务能力层标识是否有效;The server detects whether the first service capability layer identifier is valid;
所述服务器在所述第一业务能力层标识有效时,生成所述网关替换标识。The server generates the gateway replacement identifier when the first service capability layer identifier is valid.
基于第一方面,在第五种可能的实施方式中,在所述服务器接收第二网关发送的网关替换通知,之后,所述方法还包括:Based on the first aspect, in a fifth possible implementation manner, after the server receives the gateway replacement notification sent by the second gateway, the method further includes:
所述服务器检验所述第二网关是否可以被替换;The server checks whether the second gateway can be replaced;
所述服务器在所述第二网关可以被替换时,生成所述网关替换标识。 The server generates the gateway replacement identifier when the second gateway can be replaced.
基于第一方面,或第一方面的第一种可能的实施方式,在第六种可能的实施方式中,所述服务器向第二网关发送所述网关替换标识的同时,还向所述第二网关发送等待指示,所述等待指示用于指示所述第二网关需要等待下线指示。Based on the first aspect, or the first possible implementation manner of the first aspect, in a sixth possible implementation, the server sends the gateway replacement identifier to the second gateway, and further to the second The gateway sends a wait indication, where the wait indication is used to indicate that the second gateway needs to wait for a downline indication.
基于第一方面,在第七种可能的实施方式中,在所述服务器向所述第一网关发送第一消息,之后,还包括:Based on the first aspect, in a seventh possible implementation, after the server sends the first message to the first gateway, the method further includes:
所述服务器向所述第二网关发送通知,所述通知中携带第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完成。The server sends a notification to the second gateway, where the notification carries a first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate that the gateway replacement is completed.
第二方面,提供了一种网关替换方法,所述方法包括:In a second aspect, a gateway replacement method is provided, the method comprising:
第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;The first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway;
所述第一网关向服务器发送创建资源请求,所述创建资源请求中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据所述第一网关的第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;The first gateway sends a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the first gateway. The first service capability layer identifier and the second service capability layer identifier are updated, and the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway. ;
所述第一网关接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving, by the first gateway, the first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
所述第一网关接收所述第二网关发送的第二消息,所述第二信息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;The first gateway receives the second message sent by the second gateway, where the second information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway;
所述第一网关根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息。The first gateway updates the gateway information to the device registered to the second gateway according to the received second information.
基于第二方面,在第一种可能的实施方式中,所述第一网关在接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识,之前,还包括:Based on the second aspect, in a first possible implementation manner, before the receiving, by the first gateway, the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, the first gateway further includes:
所述第一网关向所述第二网关发送所述第一网关的所述第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第一网关替换,以便于所述第二网关向服务器发送所述网关替换通知,所述网关替换通知中携带有所述替换指示和所述第一业务能力层标识。The first gateway sends the first service capability layer identifier and the replacement indication of the first gateway to the second gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway. The second gateway is configured to send the gateway replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
基于第二方面,在第二种可能的实施方式中,所述第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;之前,还包括:Based on the second aspect, in a second possible implementation, the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway.
所述第一网关向所述服务器发送所述第一业务能力层标识和所述替换指示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述 第二网关。Sending, by the first gateway, the first service capability layer identifier and the replacement indication to the server, so that the server sends the first service capability layer identifier and the replacement indication to the Second gateway.
基于第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式,在第三种可能的实施方式中,所述网关信息包括所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符。Based on the second aspect or the second possible implementation manner of the second aspect, or the second possible implementation manner of the second aspect, in a third possible implementation manner, the gateway information includes the first gateway A uniform resource locator of the service capability layer and a uniform resource locator of the service capability layer of the second gateway.
基于第二方面,在第四种可能的实施方式中,所述第一网关根据接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息,具体包括:Based on the second aspect, in a fourth possible implementation manner, the first gateway, according to the received second message, updates the gateway information to the device that is registered to the second gateway, and specifically includes:
所述第一网关向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Transmitting, by the first gateway, a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway, and the second gateway The uniform resource locator of the service capability layer; the application resource refers to the corresponding resource of the device registered to the second gateway.
基于第二方面的第四种可能的实施方式,在第五种可能的实施方式中,所述第一网关向所述第一网关的应用资源对应的设备发送第三消息,之后,还包括According to a fourth possible implementation manner of the second aspect, in a fifth possible implementation, the first gateway sends a third message to the device corresponding to the application resource of the first gateway, and then includes
所述第一网关接收在线设备发送的第四消息,所述第四消息携带所述在线设备接收到所述更新消息的信息。The first gateway receives a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
基于第二方面的第五种可能的实施方式,在第六种可能的实施方式中,所述第四消息还携带所述在线设备更新所述第二网关的业务能力层的统一资源定位符为所述所述第二网关的业务能力层的统一资源定位符的信息。According to a fifth possible implementation manner of the second aspect, in a sixth possible implementation, the fourth message further carries, by the online device, a uniform resource locator of the service capability layer of the second gateway Information of a uniform resource locator of the service capability layer of the second gateway.
基于第二方面的第五种可能的实施方式,在第七种可能的实施方式中,所述接收在线的设备的确认消息,之后还包括:Based on the fifth possible implementation manner of the second aspect, in a seventh possible implementation manner, the receiving the confirmation message of the online device, and then the following:
所述第一网关标记所述第一网关接收到的所述第四消息对应的所述在线设备。The first gateway marks the online device corresponding to the fourth message received by the first gateway.
基于第二方面的第五种可能的实施方式,在第八种可能的实施方式中,所述第一网关根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息,进一步包括:According to a fifth possible implementation manner of the second aspect, in an eighth possible implementation manner, the first gateway updates the device that is registered to the second gateway according to the received second information Gateway information, further including:
所述第一网关检查未更新的设备对应的资源是否过期,如果过期,则删除所述未更新的设备对应的资源。The first gateway checks whether the resource corresponding to the device that is not updated expires, and if it expires, deletes the resource corresponding to the device that is not updated.
第三方面,提供了一种网关替换方法,所述方法包括;In a third aspect, a gateway replacement method is provided, where the method includes:
第二网关向服务器发送网关替换通知,所述网关替换通知中携带有替换指示和第一网关的第一业务能力层标识,所述替换指示用于指示所述第二网关将 被第一网关替换;;The second gateway sends a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication and a first service capability layer identifier of the first gateway, where the replacement indication is used to indicate that the second gateway Replaced by the first gateway;
所述第二网关接收所述服务器发送的网关替换标识,所述网关替换标识用于标识网关替换;Receiving, by the second gateway, a gateway replacement identifier sent by the server, where the gateway replacement identifier is used to identify a gateway replacement;
所述第二网关向所述第一网关发送所述第二网关的第二业务能力层标识和所述网关替换标识;Sending, by the second gateway, the second service capability layer identifier of the second gateway and the gateway replacement identifier to the first gateway;
所述第二网关接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving, by the second gateway, the first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
所述第二网关向所述第一网关发送第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。The second gateway sends a second message to the first gateway, where the second message includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
基于第三方面,在第一种可能的实施方式中,在所述第二网关向服务器发送网关替换通知,之前,还包括:Based on the third aspect, in a first possible implementation manner, before the second gateway sends a gateway replacement notification to the server, the method further includes:
所述第二网关接收所示第一网关发送的所述第一网关的第一业务能力层标识和所示替换指示,所述网关替换标识中还包含所述第一业务能力层标识。The second gateway receives the first service capability layer identifier and the replacement indication of the first gateway that are sent by the first gateway, and the gateway replacement identifier further includes the first service capability layer identifier.
基于第三方面,在第二种可能的实施方式中,所述第二网关向服务器发送网络替换通知,所述网关替换通知中携带有替换指示,之后,还包括:Based on the third aspect, in a second possible implementation manner, the second gateway sends a network replacement notification to the server, where the gateway replacement notification carries a replacement indication, and then includes:
所述第二网关接收所述服务器发送的所述网关替换标识和等待指示。The second gateway receives the gateway replacement identifier and the waiting indication sent by the server.
基于第三方面,在第三种可能的实施方式中,所述向所述第一网关发送所述第二网关的所述第二业务能力层标识和所述网关替换标识;之前,还包括:Based on the third aspect, in a third possible implementation, the sending, by the first gateway, the second service capability layer identifier and the gateway replacement identifier of the second gateway;
所述第二网关接收服务器发送的所述第一网关的业务能力层的统一资源定位符和所述替换指示.The second gateway receives a uniform resource locator of the service capability layer of the first gateway and the replacement indication sent by the server.
基于第三方面,在第四种可能的实施方式中,所述第二网关向所述第一网关发送第二消息,所述第二消息中包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息,之后,还包括:According to the third aspect, in a fourth possible implementation, the second gateway sends a second message to the first gateway, where the second message includes a registration that is stored by the second gateway to the first The resource information corresponding to the device of the second gateway, and then includes:
所述第二网关在接收到所述第一网关发送的确认消息后下线,所述确认消息用于确认所述第一网关接收到所述第二消息。After receiving the acknowledgement message sent by the first gateway, the second gateway goes offline, and the acknowledgement message is used to confirm that the first gateway receives the second message.
第四方面,提供了一种服务器,所述服务器包括:In a fourth aspect, a server is provided, the server comprising:
第一接收单元,用于服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;a first receiving unit, configured to receive, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
生成单元,用于生成网关替换标识,所述网关替换标识用于标识网关替换;a generating unit, configured to generate a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement;
第一发送单元,用于向所述第二网关发送所述网关替换标识; a first sending unit, configured to send the gateway replacement identifier to the second gateway;
第二接收单元,用于接收所述第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;a second receiving unit, configured to receive a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second The service capability layer identifier and the gateway replacement identifier are sent by the second gateway or the server to the first gateway;
更新单元,用于根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;An update unit, configured to update a service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway replacement notification or the creation Resource request is obtained;
第二发送单元,用于向所述第一网关发送第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息。The second sending unit is configured to send a first message to the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
基于第四方面,在第一种可能的实施方式中,所述网关替换通知中还包含所述第一网关的所述第一业务能力层标识;According to the fourth aspect, in a first possible implementation, the gateway replacement notification further includes the first service capability layer identifier of the first gateway;
基于第四方面或者第四方面的第一种可能的实现方式,在第二种可能的实施方式中,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关。According to the fourth aspect, or the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the first service capability layer identifier and the replacement indication are sent by the first gateway to the Second gateway.
基于第四方面,在第三种可能的实施方式中,所述网关替换通知中还包含第一网关的第一业务能力层标识;所述服务器还包括:According to the fourth aspect, in a third possible implementation manner, the gateway replacement notification further includes a first service capability layer identifier of the first gateway, where the server further includes:
第三接收单元,用于接收第一网关发送的第一业务能力层标识和替换指示;a third receiving unit, configured to receive a first service capability layer identifier and a replacement indication sent by the first gateway;
第三发送单元,用于将所述第一业务能力层标识和所述替换指示发送给所述第二网关。And a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the second gateway.
基于第四方面或第四方面的第一种可能的实现方式或第四方面的第二种可能的实现方式,在第四种可能的实施方式中,所述服务器还包括:Based on the fourth aspect or the first possible implementation manner of the fourth aspect, or the second possible implementation manner of the fourth aspect, in a fourth possible implementation manner, the server further includes:
检测单元,用于检测所述第一业务能力层标识是否有效。The detecting unit is configured to detect whether the first service capability layer identifier is valid.
所述生成单元,用于在所述第一业务能力层标识有效时,生成所述网关替换标识。The generating unit is configured to generate the gateway replacement identifier when the first service capability layer identifier is valid.
基于第四方面,在第五种可能的实施方式中,所述第二发送单元,还用于发送所述网关替换标识的同时,向所述第二网关发送等待指示,用于通知所述第二网关需要等待下线指示。According to the fourth aspect, in a fifth possible implementation, the second sending unit is further configured to send, by the second gateway, a waiting indication, to notify the The second gateway needs to wait for the offline indication.
基于第四方面,在第六种可能的实施方式中,所述服务器还包括:Based on the fourth aspect, in a sixth possible implementation, the server further includes:
第四发送单元,用于向所述第二网关发送通知,所述通知中携带所述第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完成。 a fourth sending unit, configured to send a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate a gateway Replacement is complete.
第五方面,提供了一种网关,所述网关包括:In a fifth aspect, a gateway is provided, where the gateway includes:
第一接收单元,用于接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;a first receiving unit, configured to receive a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway;
第一发送单元,用于向所述服务器发送创建资源请求,所述创建资源请求中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据所述第一网关的第一业务能力层标识和所述第二业务能力层标识,更新所述业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;a first sending unit, configured to send a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the Updating the first service capability layer identifier and the second service capability layer identifier of the first gateway, and updating the service capability layer resource, where the first service capability layer identifier is included in the creation resource request or the second gateway The gateway is sent in the replacement notification;
第二接收单元,用于接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;a second receiving unit, configured to receive a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
第三接收单元,用于接收所述第二网关发送的第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;a third receiving unit, configured to receive a second message sent by the second gateway, where the second message includes resource information corresponding to a device that is stored by the second gateway and registered to the second gateway;
更新单元,用于根据所述第三接收单元接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息。And an updating unit, configured to update the gateway information to the device registered to the second gateway according to the second message received by the third receiving unit.
基于第五方面,在第一种可能的实施方式中,所述网关还包括:Based on the fifth aspect, in a first possible implementation manner, the gateway further includes:
第二发送单元,用于向所述第二网关发送所述第一网关的第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第二网关替换,以便于所述第二网关向服务器发送网络替换通知,所述网关替换通知中携带有所述替换指示和所述第一业务能力层标识。a second sending unit, configured to send, to the second gateway, a first service capability layer identifier and a replacement indication of the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the second gateway The second gateway sends a network replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
基于第五方面,在第二种可能的实施方式中,所述网关还包括:Based on the fifth aspect, in a second possible implementation manner, the gateway further includes:
第三发送单元,用于向所述服务器发送所述第一业务能力层标识和所述替换指示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the server, so that the server sends the first service capability layer identifier and the replacement indication to the Second gateway.
基于第五方面或第五方面的第一种可能的实现方式或第五方面的第二种可能的实现方式,在第三种可能的实施方式中,所述第一网关根据接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息,其中,所述网关信息包括所述第一网关的业务能力层的统一资源定位符和第二网关的业务能力层的统一资源定位符。Based on the fifth aspect or the first possible implementation manner of the fifth aspect, or the second possible implementation manner of the fifth aspect, in a third possible implementation manner, the first gateway, according to the received a second message, the gateway information is updated to the device registered to the second gateway, where the gateway information includes a uniform resource locator of the service capability layer of the first gateway and a service capability layer of the second gateway. Resource locator.
基于第五方面,在第四种可能的实施方式中,所述更新单元具体用于:Based on the fifth aspect, in a fourth possible implementation, the updating unit is specifically configured to:
所述第一网关向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含所述第一网关的业务能力层的统一资源定位符和所述第二 网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Transmitting, by the first gateway, a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway, and the second a uniform resource locator of the service capability layer of the gateway; the application resource refers to a corresponding resource of the device registered to the second gateway.
基于第五方面的第四种可能的实现方式,在第五种可能的实施方式中,所述网关还包括:Based on the fourth possible implementation manner of the fifth aspect, in a fifth possible implementation manner, the gateway further includes:
第四接收单元,用于接收在线设备发送的第四消息,所述第四消息所述第四消息携带所述在线设备接收到所述更新消息的信息。The fourth receiving unit is configured to receive a fourth message sent by the online device, where the fourth message carries the information that the online device receives the update message.
基于第五方面的第四种可能的实现方式,在第六种可能的实施方式中,所述网关还包括:Based on the fourth possible implementation manner of the fifth aspect, in a sixth possible implementation manner, the gateway further includes:
标记单元,用于标记所述第四接收单元接收到的第四消息对应的设备。a marking unit, configured to mark a device corresponding to the fourth message received by the fourth receiving unit.
基于第五方面的第四种可能的实现方式,在第七种可能的实施方式中,所述网关还包括:Based on the fourth possible implementation manner of the fifth aspect, in a seventh possible implementation, the gateway further includes:
处理单元,用于确定未更新的设备对应的资源是否过期,若确定所述未更新的设备对应的资源过期,则删除所述未更新的设备对应的资源。The processing unit is configured to determine whether the resource corresponding to the device that is not updated is expired, and if it is determined that the resource corresponding to the unupdated device is expired, the resource corresponding to the unupdated device is deleted.
第六方面,提供了一种网关,所述网关包括;In a sixth aspect, a gateway is provided, where the gateway includes:
第一发送单元,用于向服务器发送网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;a first sending unit, configured to send a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
第一接收单元,用于接收服务器发送的网关替换标识,所述网关替换标识用于标识网关替换;a first receiving unit, configured to receive a gateway replacement identifier sent by the server, where the gateway replacement identifier is used to identify a gateway replacement;
第二发送单元,用于向所述第一网关发送所述第二网关的第二业务能力层标识和所述网关替换标识;a second sending unit, configured to send, to the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier;
第二接收单元,用于接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;a second receiving unit, configured to receive a first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
第三发送单元,用于向所述第一网关发送第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。And a third sending unit, configured to send a second message to the first gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and registered to the second gateway.
基于第六方面,在第一种可能的实施方式中,所述网关还包括:Based on the sixth aspect, in a first possible implementation manner, the gateway further includes:
第三接收单元,用于所述接收第一网关发送的所述第一网关的第一业务能力层标识和所述替换指示,所述网关替换标识中还包括所述第一业务能力层标识。And a third receiving unit, configured to receive the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, where the gateway replacement identifier further includes the first service capability layer identifier.
基于第六方面或第六方面的第一种可能的实现方式,在第二种可能的实施方式中,所述网关,还包括:第四接收单元,用于接收所述服务器发送的网关替换标识和等待指示。 According to the sixth aspect, or the first possible implementation manner of the sixth aspect, in a second possible implementation, the gateway, further includes: a fourth receiving unit, configured to receive a gateway replacement identifier sent by the server And waiting for instructions.
基于第六方面或第六方面的第一种可能的实现方式,在第三种可能的实施方式中,所述网关还包括:Based on the sixth aspect or the first possible implementation manner of the sixth aspect, in a third possible implementation manner, the gateway further includes:
第五接收单元,用于接收服务器发送的第一网关的业务能力层的统一资源定位符和替换指示;a fifth receiving unit, configured to receive a uniform resource locator and a replacement indication of a service capability layer of the first gateway sent by the server;
基于第六方面或第六方面的第一种可能的实现方式或第六方面的第二种可能的实现方式或第六方面的第二种可能的实现方式,在第四种可能的实施方式中,所述网关还包括:The fourth possible implementation manner of the sixth aspect or the sixth aspect or the second possible implementation manner of the sixth aspect or the second possible implementation manner of the sixth aspect, in the fourth possible implementation manner The gateway further includes:
第六接收单元,用于接收所述第一网关发送的确认消息;a sixth receiving unit, configured to receive an acknowledgement message sent by the first gateway;
处理单元,用于根据所述第六接收单元接收到的所述确认消息下线,所述确认消息用于确认所述第一网关接收到所述第二消息。The processing unit is configured to go offline according to the confirmation message received by the sixth receiving unit, where the confirmation message is used to confirm that the first gateway receives the second message.
通过本发明实施例提供的网关替换方法,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。The gateway replacement method provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the stored information transmission fee with the gateway, it needs to replace the verification of the macro access server, at the gateway. Before the replacement is completed, the replaced gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the description of the prior art will be briefly described below. It is obvious that the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art in light of the inventive workability.
图1是本发明实施例的架构示意图;1 is a schematic structural diagram of an embodiment of the present invention;
图2是本发明实施例提供的网关替换方法的一种实施例的流程图;2 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图3是本发明实施例提供的网关替换方法的一种实施例的流程图;3 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图4是本发明实施例提供的网关替换方法的一种实施例的流程图;4 is a flowchart of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图5是本发明实施例提供的网关替换方法的一种实施例的交互图;FIG. 5 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图6是本发明实施例提供的网关替换方法的一种实施例的交互图;FIG. 6 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图7是本发明实施例提供的网关替换方法的一种实施例的交互图;FIG. 7 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图8是本发明实施例提供的网关替换方法的一种实施例的交互图;FIG. 8 is an interaction diagram of an embodiment of a gateway replacement method according to an embodiment of the present invention;
图9是本发明实施例提供的服务器的一种实施例的结构图;FIG. 9 is a structural diagram of an embodiment of a server according to an embodiment of the present invention;
图10是本发明实施例提供的网关的一种实施例的结构图;FIG. 10 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention;
图11是本发明实施例提供的网关的一种实施例的结构图; FIG. 11 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention;
图12是本发明实施例提供的服务器的一种实施例的结构图;FIG. 12 is a structural diagram of an embodiment of a server according to an embodiment of the present invention;
图13是本发明实施例提供的网关的一种实施例的结构图;FIG. 13 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention;
图14是本发明实施例提供的网关的一种实施例的结构图。FIG. 14 is a structural diagram of an embodiment of a gateway according to an embodiment of the present invention.
具体实施方式detailed description
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solution of the present invention will be further described in detail below through the accompanying drawings and embodiments.
图1是本发明实施例提供的网关替换方法的架构图,如图1所示,本方法的应用架构,主要包括第二网关20,第一网关10和服务器30,以及注册到第二网关20的至少一个设备40,其中,所述设备40可以是具有业务能力的M2M终端,也可以是不具备业务能力的M2M终端,第一网关10和第二网关20都具备业务能力,第二网关20具有第二网关业务能力层标识(英文全称:Gateway Service Capability Layer Identity,英文缩写:GSCL ID),第二网关20存储有注册到第二网关20的全部设备的信息。在特定的情况下,需要对第二网关20进行替换,用第一网关10替换第二网关20,在第一网关10加入网络进行通信之前,需要进行验证和安全保护流程,其中验证和安全保护流程可以是bootstrap流程和业务连接的流程,其中,bootstrap流程为第一网关获取第一业务能力层标识(GSCL ID),业务连接流程生成相应的密钥,密钥和SCL ID等信息被提供给服务器30的网络业务能力层(Network Service Capability Layer,NSCL),因此服务器30中存储有对第一网关10进行鉴权的相关数据。1 is an architectural diagram of a gateway replacement method according to an embodiment of the present invention. As shown in FIG. 1 , an application architecture of the method mainly includes a second gateway 20, a first gateway 10 and a server 30, and a second gateway 20 is registered. At least one device 40, wherein the device 40 may be an M2M terminal with service capability or an M2M terminal without service capability, and both the first gateway 10 and the second gateway 20 have service capabilities, and the second gateway 20 The second gateway 20 stores the information of all the devices registered to the second gateway 20, with the second gateway service capability layer identifier (English name: Gateway Service Capability Layer Identity, GSCL ID). In a specific case, the second gateway 20 needs to be replaced, and the second gateway 20 is replaced by the first gateway 10. Before the first gateway 10 joins the network for communication, a verification and security protection process is required, where authentication and security protection are performed. The process may be a process of a bootstrap process and a service connection, where the bootstrap process obtains a first service capability layer identifier (GSCL ID) for the first gateway, a service connection process generates a corresponding key, and a key and a SCL ID are provided. The network service capability layer (NSCL) of the server 30 stores the related data for authenticating the first gateway 10 in the server 30.
基于图1所示的架构,本发明实施例提供了一种网关替换方法,所述方法部署在具有业务能力层的服务器30,由图2可见,所述方法包括:Based on the architecture shown in FIG. 1 , an embodiment of the present invention provides a gateway replacement method. The method is deployed in a server 30 having a service capability layer. As shown in FIG. 2, the method includes:
201,服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;The server receives the gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
202,所述服务器生成网关替换标识,所述网关替换标识用于标识网关替换;202. The server generates a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement.
203,所述服务器向所述第二网关发送所述网关替换标识;203. The server sends the gateway replacement identifier to the second gateway.
204,所述服务器接收第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二网关的业务能力层标识和所述网关替换标识由所述第二网关或者服务器发送给所述第一网关;204. The server receives a request for creating a resource sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, and the service capability of the second gateway The layer identifier and the gateway replacement identifier are sent by the second gateway or server to the first gateway;
205,所述服务器根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换 通知或所述创建资源请求获得;205. The server updates the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway. The notification or the creation of the resource request is obtained;
在不同的实施例中,所述第一业务能力层标识可以通过不同的方式获得,例如可以携带在网关替换通知中,也可以携带在创建资源请求中。In different embodiments, the first service capability layer identifier may be obtained in different manners, for example, may be carried in a gateway replacement notification, or may be carried in a resource creation request.
206,所述服务器向所述第一网关发送第一消息,所述第一消息中携带所述服务器已经成功更新所述业务能力层资源的信息。206. The server sends a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
在不同的实施例中,替换流程的发起方有所不同,因此,不同的通知中,携带的信息也相应不同。例如,在一种实施方式中,可以由第一网关发起替换流程,则所述网关替换通知中还包含第一网关的第一业务能力层标识,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关,更具体的实施例,在后面进行阐述。In different embodiments, the initiator of the replacement process is different, and therefore, the information carried in different notifications is also different. For example, in an implementation manner, the replacement process may be initiated by the first gateway, where the gateway replacement notification further includes a first service capability layer identifier of the first gateway, the first service capability layer identifier and the replacement The indication is sent by the first gateway to the second gateway, a more specific embodiment, which will be described later.
在另一种实施例中,所述网关替换通知中还包含第一网关的第一业务能力层标识;所述接收第二网关发送的网关替换通知,之前,还包括:In another embodiment, the gateway replacement notification further includes a first service capability layer identifier of the first gateway; and the receiving the gateway replacement notification sent by the second gateway, before:
所述服务器接收所述第一网关发送的第一业务能力层标识和替换指示;Receiving, by the server, a first service capability layer identifier and a replacement indication sent by the first gateway;
所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。The server sends the first service capability layer identifier and the replacement indication to the second gateway.
在上述的两种实施方式中,所述网关替换标识是在所述第一业务能力层标识有效时生成的,所述生成网关替换标识之前,还包括:In the foregoing two implementation manners, the gateway replacement identifier is generated when the first service capability layer identifier is valid, and before the generating gateway replaces the identifier, the method further includes:
检测所述第一业务能力层标识是否有效;Detecting whether the first service capability layer identifier is valid;
在所述第一业务能力层标识有效时,所述服务器生成所述网关替换标识。The server generates the gateway replacement identifier when the first service capability layer identifier is valid.
在一种由第二网关发起替换流程的实施方式中,在接收第二网关发送的网关替换通知,之后,还包括:In an implementation manner in which the second gateway initiates the replacement process, after receiving the gateway replacement notification sent by the second gateway, the method further includes:
所述服务器检验所述第二网关是否可以被替换;The server checks whether the second gateway can be replaced;
所述服务器在所述第二网关可以被替换时,所述服务器生成所述网关替换标识。The server generates the gateway replacement identifier when the server is replaceable by the second gateway.
所述服务器向所述第二网关发送所述网关替换标识的同时,所述服务器还向所述第二网关发送等待指示,所述等待指示用于指示所述第二网关需要等待下线指示,也就是说需要等待该第一网关加入后,该第二网关才能够下线,以确保系统正常运行。While the server sends the gateway replacement identifier to the second gateway, the server further sends a waiting indication to the second gateway, where the waiting indication is used to indicate that the second gateway needs to wait for an offline indication. That is to say, after waiting for the first gateway to join, the second gateway can go offline to ensure normal operation of the system.
在所述服务器向所述第一网关发送该第一消息之后,还包括:After the server sends the first message to the first gateway, the method further includes:
所述服务器向所述第二网关发送通知,所述通知中携带所述第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完 成。The server sends a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate that the gateway is replaced. to make.
通过上述的实施例,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。Through the above embodiments, the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
如图3所示,基于图1所示的架构,本发明实施例还提供了一种网关替换方法,在本实施例中的执行主体为图1中第一网关10,由图3可见,所述的方法包括:As shown in FIG. 3, based on the architecture shown in FIG. 1, the embodiment of the present invention further provides a gateway replacement method. The execution body in this embodiment is the first gateway 10 in FIG. The methods described include:
301,第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;301. The first gateway receives a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway.
302,所述第一网关向所述服务器发送创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;302. The first gateway sends a request for creating a resource to the server, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the creation resource request triggers Updating, by the server, the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is included in the creation resource request or the gateway replacement sent by the second gateway In the notice;
303,所述第一网关接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;303. The first gateway receives a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource.
304,所述第一网关接收所述第二网关发送的第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;304. The first gateway receives the second message sent by the second gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and is registered to the second gateway.
305,所述第一网关根据接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息。305. The first gateway updates the gateway information to the device registered to the second gateway according to the received second message.
在一种实施方式中,所述第一网关在接收该第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识,之前,还包括:In an embodiment, before receiving the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, the first gateway further includes:
所述第一网关向所述第二网关发送所述第一网关的所述第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第一网关替换,以便于所述第二网关向服务器发送所述网关替换通知,所述网关替换通知中携带有所述替换指示和所述第一业务能力层标识。The first gateway sends the first service capability layer identifier and the replacement indication of the first gateway to the second gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway. The second gateway is configured to send the gateway replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
在第二种实施方式中,步骤301所述第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识,所述网关替换标识由服务器生成后发送给所述第二网关;之前,还包括:In the second implementation, the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, where the gateway replacement identifier is sent by the server and sent to the The second gateway; before, it also includes:
所述第一网关向所述服务器发送所述第一业务能力层标识和所述替换指 示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。Transmitting, by the first gateway, the first service capability layer identifier and the replacement finger to the server So that the server sends the first service capability layer identifier and the replacement indication to the second gateway.
根据上述的两种实施方式中的任意一种,所述网关信息包括第一网关的业务能力层的统一资源定位符和第二网关的业务能力层的统一资源定位符。According to any of the foregoing two implementation manners, the gateway information includes a uniform resource locator of a service capability layer of the first gateway and a uniform resource locator of a service capability layer of the second gateway.
在成功替换第一网关之后,步骤305中,所述第一网关根据接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息,具体包括:After the first gateway is successfully replaced, in step 305, the first gateway updates the gateway information to the device registered on the second gateway according to the received second message, which specifically includes:
所述第一网关向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符,所述应用资源是指所述注册到所述第二网关上的设备的对应资源。The first gateway sends a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway and a service of the second gateway. A uniform resource locator of the capability layer, where the application resource refers to a corresponding resource of the device registered to the second gateway.
在所述第一网关向所述第一网关的应用资源对应的设备发送第三消息之后,所述第一网关接收在线设备发送的第四消息,所述第四消息携带所述在线设备接收到所述更新消息的信息。After the first gateway sends a third message to the device corresponding to the application resource of the first gateway, the first gateway receives a fourth message sent by the online device, where the fourth message is received by the online device. The information of the update message.
进一步的,所述第四消息还携带所述在线设备更新所述第二网关的业务能力层的统一资源定位符为所述第一网关的业务能力层的统一资源定位符的信息。Further, the fourth message further carries the information that the online device updates the uniform resource locator of the service capability layer of the second gateway to the uniform resource locator of the service capability layer of the first gateway.
所述第一网关接收在线的设备的第四消息之后,还包括:After the first gateway receives the fourth message of the online device, the method further includes:
所述第一网关标记所述第一网关接收到的第四消息对应的该在线设备;The first gateway marks the online device corresponding to the fourth message received by the first gateway;
所述第一网关根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息,进一步包括:The first gateway updates the gateway information to the device registered to the second gateway according to the received second information, and further includes:
所述第一网关检查未更新的设备对应的资源是否过期,如果过期,则删除所述未更新的设备对应的资源。The first gateway checks whether the resource corresponding to the device that is not updated expires, and if it expires, deletes the resource corresponding to the device that is not updated.
通过上述的实施例,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。Through the above embodiments, the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
相应的,如图4所示,基于图1所示的网络架构,本发明实施例还提供了一种网关替换方法,该实施例中,执行主体为图1中的第二网关20,也就是被替换的网关,在本实施例中,所述的方法包括:Correspondingly, as shown in FIG. 4, based on the network architecture shown in FIG. 1, the embodiment of the present invention further provides a gateway replacement method. In this embodiment, the execution entity is the second gateway 20 in FIG. The gateway to be replaced, in this embodiment, the method includes:
401,第二网关向服务器发送网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换; 401. The second gateway sends a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway.
402,第二网关接收所述服务器发送的网关替换标识,所述网关替换标识由服务器生成,所述网关替换标识用于标识网关替换;The second gateway receives the gateway replacement identifier sent by the server, where the gateway replacement identifier is generated by the server, and the gateway replacement identifier is used to identify the gateway replacement.
403,第二网关向所述第一网关发送第二网关的第二业务能力层标识和所述网关替换标识;403. The second gateway sends, to the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier.
404,第二网关接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;404. The second gateway receives the first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
405,第二网关向所述第一网关发送第二消息,所述第二消息信息包含所述第二网关存储的注册到第二网关的设备对应的资源信息。405. The second gateway sends a second message to the first gateway, where the second message information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
在第一种实施方式中,步骤401之前,还包括:In the first embodiment, before step 401, the method further includes:
第二网关接收第一网关发送的所述第一网关的第一业务能力层标识和替换指示,所述网关替换标识中还包含所述第一业务能力层标识。The second gateway receives the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, where the gateway replacement identifier further includes the first service capability layer identifier.
在另一种实施方式中,步骤401,之后,还包括:In another embodiment, step 401, after that, further includes:
所述第二网关接收所述服务器发送的所示网关替换标识和等待指示。The second gateway receives the illustrated gateway replacement identifier and the waiting indication sent by the server.
步骤403,之前,还包括: Step 403, before, further includes:
所述第二网关接收服务器发送的所示第一网关的业务能力层的统一资源定位符和所述替换指示;Receiving, by the second gateway, a uniform resource locator of the service capability layer of the first gateway that is sent by the server, and the replacement indication;
步骤405,之后,还包括: Step 405, after that, further includes:
所述第二网关在接收到所述第一网关发送的确认消息后,下线,所述确认消息用于确认所述第一网关接收到所述存储设备消息。After receiving the acknowledgement message sent by the first gateway, the second gateway goes offline, and the acknowledgement message is used to confirm that the first gateway receives the storage device message.
通过上述的实施例,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。Through the above embodiments, the replacement of the gateway with the service capability layer can be implemented. Before the replaced gateway replaces the information sent by the gateway to replace the gateway, the verification of the macro access server needs to be replaced, and before the gateway replacement is completed, The replacement gateway works normally and will not go offline before the replacement is completed. It can ensure that the device registered to the replaced gateway can work normally.
结合上述图2至图4的三种实施例提供的网关替换方法,以下介绍本发明实施例提供的网关替换方法的三种实施方式的交互图,如图5所示,在第一种实施方式中:In conjunction with the gateway replacement method provided by the foregoing three embodiments of FIG. 2 to FIG. 4, an interaction diagram of three implementation manners of the gateway replacement method provided by the embodiment of the present invention is described below, as shown in FIG. 5, in the first implementation manner. in:
第一网关在加入网络进行通信之前,需要进行Bootstrap流程和业务连接的流程;通过这两个流程该第一网关会获得SCL ID并生成相应的密钥,NSCL也会获取对该第一网关鉴权的相关信息;Before the first gateway joins the network for communication, the process of the Bootstrap process and the service connection is required. Through the two processes, the first gateway obtains the SCL ID and generates a corresponding key, and the NSCL also obtains the first gateway. Information about rights;
501、该第一网关发送该第一网关的第一GSCL ID和替换指示给第二网关。501. The first gateway sends a first GSCL ID and a replacement indication of the first gateway to the second gateway.
502、该第二网关接收到该第一网关的消息中包含该第一GSCL ID和替换指 示,该第二网关发送网关替换通知给服务器的NSCL,该网关替换通知中携带该替换指示和该第一GSCL ID。502. The message that the second gateway receives the first gateway includes the first GSCL ID and the replacement finger. The second gateway sends a gateway replacement notification to the NSCL of the server, where the gateway replacement notification carries the replacement indication and the first GSCL ID.
503、该服务器的该NSCL检测该第一GSCL ID是否有效;503. The NSCL of the server detects whether the first GSCL ID is valid.
具体的,该NSCL检测该第一GSCL ID是否经过MSBF和MAS的验证,如果第一GSCL ID有效,则执行步骤504,如果无效则发送拒绝消息给该第二网关。Specifically, the NSCL detects whether the first GSCL ID is verified by the MSBF and the MAS. If the first GSCL ID is valid, step 504 is performed, and if invalid, a reject message is sent to the second gateway.
504、NSCL分配一个网关替换标识并答复该第二网关;504. The NSCL allocates a gateway replacement identifier and replies to the second gateway.
505、该第二网关将该第二网关的第二GSCL ID和该网关替换标识发送给该第一网关;505. The second gateway sends the second GSCL ID of the second gateway and the gateway replacement identifier to the first gateway.
506、该第一网关发送创建资源请求消息给该NSCL,所述创建资源请求中携带该第二GSCL ID和该网关替换标识;506. The first gateway sends a create resource request message to the NSCL, where the create resource request carries the second GSCL ID and the gateway replacement identifier.
507、该NSCL根据该第二GSCL ID、该第一GSCL ID和该网络替换标识,更新该服务器为该第二网关创建的SCL资源;507. The NSCL updates the SCL resource created by the server for the second gateway according to the second GSCL ID, the first GSCL ID, and the network replacement identifier.
具体为:该NSCL检测该第一网关发送的创建资源消息中的内容,如果该创建资源消息携带替换标识,则表示该创建资源消息是用于资源的更新,所以该NSCL根据该第二网关的该GSCL ID找到该第二网关在网络侧注册的资源,该服务器将此资源所包含内容与该第一网关发送的该创建资源请求中的内容进行对照,将不同的内容进行更新,相同的保持不变。Specifically, the NSCL detects the content in the created resource message sent by the first gateway, and if the created resource message carries the replacement identifier, it indicates that the created resource message is used for updating the resource, so the NSCL is configured according to the second gateway. The GSCL ID finds a resource registered by the second gateway on the network side, and the server compares the content included in the resource with the content in the created resource request sent by the first gateway, and updates different content, and maintains the same content. constant.
508、该NSCL向该第一网关发送第一消息,所述第一消息携带已经成功更新所述业务能力层资源的信息。508. The NSCL sends a first message to the first gateway, where the first message carries information that the service capability layer resource has been successfully updated.
509、该第一网关答复该第二网关,表示成功更新该NSCL资源。509. The first gateway replies to the second gateway, indicating that the NSCL resource is successfully updated.
510、该第二网关向所述第一网关发送第二消息信息,并下线;510. The second gateway sends the second message information to the first gateway, and goes offline.
其中,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备的信息,例如:设备注册的时间,设备的属性,设备存储到网关上的内容等。此处的设备也可以是一种应用。The second message includes information about the device registered by the second gateway and registered to the second gateway, for example, the time of the device registration, the attribute of the device, the content stored by the device to the gateway, and the like. The device here can also be an application.
511、该第一网关根据接收到的该第二消息中包含的信息,更新注册到所述第二网关上的设备的网关信息;511. The first gateway updates the gateway information of the device registered to the second gateway according to the information included in the received second message.
例如,其中更新网关信息,包括该第一网关的URI和该第二网关的URI。For example, where the gateway information is updated, including the URI of the first gateway and the URI of the second gateway.
更具体的,步骤511,该第一网关向注册到网关上的设备更新寻址信息,可以通过图6所示的流程实现,此时该第二网关已经下线。More specifically, in step 511, the first gateway updates the addressing information to the device registered to the gateway, which can be implemented by the process shown in FIG. 6, and the second gateway has been offline.
601、该第一网关向该第一网关的所有应用资源对应的设备发送第三消息; 601. The first gateway sends a third message to a device corresponding to all application resources of the first gateway.
具体而言,该第一网关可以通过多播方式或者广播发送更新消息,此更新消息中包含该第二网关的URI和该第一网关的URI。所述第三消息中包含所述第二网关的业务能力层的统一资源定位符和第二网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Specifically, the first gateway may send an update message by using a multicast mode or a broadcast, where the update message includes a URI of the second gateway and a URI of the first gateway. The third message includes a uniform resource locator of the service capability layer of the second gateway and a uniform resource locator of the service capability layer of the second gateway; the application resource refers to the registration to the second gateway The corresponding resource of the device on it.
602、在线的设备收到该第一网关的该第三消息,根据该第二网关的URI找到对应的资源,然后更新此该第二网关的URI为该第一网关的URI,然后通过第四消息答复该第一网关,该第四消息表示该在线设备接收到所述更新消息。602. The online device receives the third message of the first gateway, finds a corresponding resource according to the URI of the second gateway, and then updates the URI of the second gateway to a URI of the first gateway, and then passes the fourth The message replies to the first gateway, and the fourth message indicates that the online device receives the update message.
603、该第一网关为答复的设备对应的应用资源设置标记,表示此设备已更新过。603. The first gateway sets a flag for the application resource corresponding to the replied device, indicating that the device has been updated.
同时,检查未更新的设备对应的资源的过期时间,判断是否过期,如果过期,则删除此资源;设置计时器,以计下一次发送更新消息的时刻。At the same time, the expiration time of the resource corresponding to the unupdated device is checked, and it is judged whether it is expired. If it expires, the resource is deleted; a timer is set to count the time when the update message is sent.
604、休眠终端上线。604. The sleep terminal is online.
具体的,上线的休眠终端发送消息到app资源第二网关,但是由于该第二网关已下线,所以上线的休眠终端不会收到任何回复。Specifically, the online dormant terminal sends a message to the app resource second gateway, but since the second gateway is offline, the online dormant terminal does not receive any reply.
此时上线的休眠终端启动计时器,并等待更新消息;如果收到更新消息,则停止计时器。At this point, the sleeping terminal on the line starts the timer and waits for the update message; if it receives the update message, it stops the timer.
605、该第一网关的计时器到时间后再次发送多播更新消息。605. The timer of the first gateway sends the multicast update message again after the time expires.
606、在线的休眠终端收到更新消息停止计时器,并答复该第一网关已更新信息。606. The online dormant terminal receives the update message stop timer and replies to the first gateway updated information.
如果在整个计时器的时间内上线的休眠终端都没有收到任何的更新消息,则重新选择网关。If the sleeping terminal that went online during the entire timer has not received any update message, the gateway is reselected.
图7为网关替换方法的另一种实施方式的交互图,与图5所示的实施例相比,其区别在于,第一网关和第二网关之间没有通信机制,因此,该第一网关需要发送给该第二网关的第一GSCL ID和网关替换指示需要通过服务器的NSCL进行中转,因此,在该第二网关向该服务器发送网关替换通知之前,还包括:7 is an interaction diagram of another embodiment of a gateway replacement method. Compared with the embodiment shown in FIG. 5, the difference is that there is no communication mechanism between the first gateway and the second gateway. Therefore, the first gateway is The first GSCL ID and the gateway replacement indication that need to be sent to the second gateway need to be transited through the NSCL of the server. Therefore, before the second gateway sends the gateway replacement notification to the server, the method further includes:
该第一网关向所述服务器发送第一业务能力层标识和替换指示;The first gateway sends a first service capability layer identifier and a replacement indication to the server;
所述服务器将所述第一业务能力层标识和该替换指示发送给所述第二网关。The server sends the first service capability layer identifier and the replacement indication to the second gateway.
其余的步骤都与图5所示的实施例相同,因此不多赘述。The rest of the steps are the same as those of the embodiment shown in FIG. 5, and therefore will not be described again.
图8为网关替换方法的另一种实施方式的交互图,在本实施例中,替换流 程由第二网关发起,由图8可见,所述的方法包括:FIG. 8 is an interaction diagram of another implementation manner of a gateway replacement method. In this embodiment, a replacement flow is used. The process is initiated by the second gateway. As can be seen from FIG. 8, the method includes:
801、第二网关发送网关替换通知给服务器的NSCL,所述网关替换通知携带替换指示;801. The second gateway sends a gateway replacement notification to the NSCL of the server, where the gateway replacement notification carries a replacement indication.
802、该NSCL检验该第二网关的权限;802. The NSCL checks the rights of the second gateway.
具体而言,该第二网关在注册时会将自己的属性写入创建的资源中,该NSCL检测该第二网关是否有被替换的权限,以防不法分子随意替换网关。而此权限会保存在该第二网关的属性中。Specifically, the second gateway writes its own attribute to the created resource when registering, and the NSCL detects whether the second gateway has the replaced right, so as to prevent the criminal from randomly replacing the gateway. This permission is saved in the properties of the second gateway.
在检验通过后,执行步骤803,否则发送拒绝消息给该第二网关。After the verification is passed, step 803 is performed, otherwise a rejection message is sent to the second gateway.
803、该NSCL生成网关替换标识并发送给该第二网关,同时向该第二网关发送等待指示;803. The NSCL generates a gateway replacement identifier and sends the identifier to the second gateway, and sends a waiting indication to the second gateway.
具体而言,该第二网关收到该NSCL发送的该等待指示,即表示该第二网关此时不可以下线,需要等待第一网关加入后,可以替代它工作时才可以下线。之后,该第二网关等待该第一网关加入并继续工作。Specifically, the second gateway receives the waiting indication sent by the NSCL, that is, the second gateway is not available in the following line, and needs to wait for the first gateway to join, and can be offline when it can work instead. Thereafter, the second gateway waits for the first gateway to join and continues to work.
步骤803之后,在804中,该第二网关需要与该第一网关进行交互将该第二网关的第二GSCL ID和该网关替换标识发送给该第一网关。具体而言,该第一网关和该第二网关可以通过有线方式或者无线局域网方式等进行信息交互。After step 803, in 804, the second gateway needs to interact with the first gateway to send the second GSCL ID of the second gateway and the gateway replacement identifier to the first gateway. Specifically, the first gateway and the second gateway may perform information interaction by using a wired manner or a wireless local area network manner.
805、该第一网关的发送创建资源请求给该NSCL,其中包含该第二网关的第二GSCL ID,第一GSCL ID和该网关替换标识;805. The first gateway sends a resource request to the NSCL, where the second GSCL ID of the second gateway, the first GSCL ID, and the gateway replacement identifier are included.
806、该NSCL验证第一网关的该有效性,然后该NSCL根据该第一GSCLID、该第二GSCL ID和该替换标识,更新该服务器曾为该第二网关创建的SCL资源;806. The NSCL verifies the validity of the first gateway, and then the NSCL updates the SCL resource that the server created for the second gateway according to the first GSCLID, the second GSCL ID, and the replacement identifier.
该NSCL检测该第一网关发送的创建资源消息中的内容,如果携带替换标识,则表示此消息是用于资源的更新,所以NSCL根据该第二网关的该第二GSCL ID找到该第二网关在网络侧注册的资源,该服务器将此资源所包含内容于该第一网关发送的该创建资源请求中的内容进行对照,将不同的内容进行更新,相同的保持不变。The NSCL detects the content in the created resource message sent by the first gateway, and if the replacement identifier is carried, it indicates that the message is used for updating the resource, so the NSCL finds the second gateway according to the second GSCL ID of the second gateway. The resource registered on the network side, the server compares the content included in the resource to the content of the created resource request sent by the first gateway, and updates different content, and the same remains unchanged.
808、该NSCL向所述第二网关发送通知,所述通知中携带所述第一指示和所述第一网关业务能力层的统一资源定位符。808. The NSCL sends a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer.
809、该第二网关的GSCL答复服务器的该NSCL,通知其收到通知;809. The GSCL of the second gateway replies to the NSCL of the server, and notifies the user that the notification is received;
810、该第二网关的GSCL根据第一网关的GSCL URI通过第二消息将其存储的资源信息发送给该第一网关的GSCL; 810. The GSCL of the second gateway sends the stored resource information to the GSCL of the first gateway by using a second message according to the GSCL URI of the first gateway.
811、该第一网关的GSCL答复该第二网关的GSCL,表示收到该第二网关发送的第二消息;811. The GSCL of the first gateway replies to the GSCL of the second gateway, and indicates that the second message sent by the second gateway is received.
具体的,与前述的实施例类似,所述第二消息包含该第二网关存储的,注册到该第二网关上的设备的信息,例如:Specifically, similar to the foregoing embodiment, the second message includes information stored by the second gateway and registered to the device on the second gateway, for example:
设备注册的时间,设备的属性,设备存储到网关上的内容等。此处的设备也可以是应用。The time when the device is registered, the attributes of the device, the contents of the device stored on the gateway, and so on. The device here can also be an application.
812、该第二网关的GSCL下线;812, the GSCL of the second gateway is offline;
813、该第一网关根据接收到的该第二消息中的信息,向注册到所述第二网关上的设备更新网关信息,该网关信息包括新的URI和旧的URI。813. The first gateway updates the gateway information to the device registered to the second gateway according to the received information in the second message, where the gateway information includes a new URI and an old URI.
具体的,步骤813与图6所示的实施例类似,因此,不多赘述。Specifically, step 813 is similar to the embodiment shown in FIG. 6, and therefore, no further details are provided.
相应的,如图9所示,本发明实施例提供了一种服务器,图9是该实施例的结构示意图,由图9可见,所述的服务器包括:Correspondingly, as shown in FIG. 9, the embodiment of the present invention provides a server, and FIG. 9 is a schematic structural diagram of the embodiment. As shown in FIG. 9, the server includes:
第一接收单元901,用于服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;The first receiving unit 901 is configured to receive, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
生成单元902,用于生成网关替换标识,所述网关替换标识用于告知网络即将进行网关替换;The generating unit 902 is configured to generate a gateway replacement identifier, where the gateway replacement identifier is used to notify the network that the gateway replacement is to be performed;
第一发送单元903,用于向所述第二网关发送所述网关替换标识;The first sending unit 903 is configured to send the gateway replacement identifier to the second gateway.
第二接收单元904,用于接收所述第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;The second receiving unit 904 is configured to receive a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where The second service capability layer identifier and the gateway replacement identifier are sent by the second gateway or the server to the first gateway;
更新单元905,用于根据第一业务能力层标识和所述第二业务能力层标识的对应关系,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;The updating unit 905 is configured to update the service capability layer resource according to the correspondence between the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway replacement notification Or the creation resource request is obtained;
第二发送单元906,用于向所述第一网关发送第一消息,所述第一消息中携带所述服务器已经成功更新所述业务能力层资源的信息。The second sending unit 906 is configured to send a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
在一种可能的实施方式中,所述网关替换通知中还包含第一网关的第一业务能力层标识,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关。In a possible implementation manner, the gateway replacement notification further includes a first service capability layer identifier of the first gateway, where the first service capability layer identifier and the replacement indication are sent by the first gateway to the Said second gateway.
所述服务器还包括: The server further includes:
第三接收单元,用于接收所述第一网关发送的第一业务能力层标识和替换指示;a third receiving unit, configured to receive a first service capability layer identifier and a replacement indication sent by the first gateway;
第三发送单元,用于将所述第一业务能力层标识和所述替换指示发送给所述第二网关。And a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the second gateway.
可选的,所述服服务器还包括:Optionally, the service server further includes:
检测单元,用于检测所述第一业务能力层标识是否有效。The detecting unit is configured to detect whether the first service capability layer identifier is valid.
所述生成单元,还用于在所述第一业务能力层标识有效时,生成所述网关替换标识。The generating unit is further configured to generate the gateway replacement identifier when the first service capability layer identifier is valid.
在另一种可能的实施方式中,所述的服务器还包括:In another possible implementation manner, the server further includes:
检验单元,用于验证所述第二网关是否可以被替换;a verification unit, configured to verify whether the second gateway can be replaced;
所述生成单元902还用于在所述第二网关可以被替换时,生成所述网关替换标识。The generating unit 902 is further configured to generate the gateway replacement identifier when the second gateway can be replaced.
可选的,所述第二发送单元,还用于向第二网关发送等待指示,用于通知所述第二网关需要等待下线指示。Optionally, the second sending unit is further configured to send a waiting indication to the second gateway, to notify the second gateway that the offline indication needs to be waited for.
可选的,所述的服务器,还包括:Optionally, the server further includes:
第四发送单元,用于向所述第二网关发送通知,所述通知中携带所述第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完成。a fourth sending unit, configured to send a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate a gateway Replacement is complete.
通过本发明实施例提供通过本发明实施例提供的服务器,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。The server provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. It is verified that the replaced gateway works normally before the gateway replacement is completed, and will not go offline before the replacement is completed, so that the device registered to the replaced gateway can work normally.
相应的,本发明实施例还提供了一种网关,所述网关例如可以是图1中的第一网关,图10是所述网关的结构图,由图10可见,所述网关包括:Correspondingly, the embodiment of the present invention further provides a gateway, which may be, for example, the first gateway in FIG. 1 , and FIG. 10 is a structural diagram of the gateway. As shown in FIG. 10 , the gateway includes:
第一接收单元1001,用于接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识,所述网关替换标识由服务器生成后发送给所述第二网关;The first receiving unit 1001 is configured to receive a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway, where the gateway replacement identifier is generated by the server and sent to the second gateway.
第一发送单元1002,用于向所述服务器发送创建资源请求,所述创建资源中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触服务器根据第一业务能力层标识和所述第二业务能力层标识的对于关系,更新 业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;The first sending unit 1002 is configured to send a request for creating a resource to the server, where the created resource carries the second service capability layer identifier and the gateway replacement identifier, and the created resource request server is configured according to the first service. The relationship between the capability layer identifier and the second service capability layer identifier is updated. a service capability layer resource, where the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway;
第二接收单元1003,用于接收所述服务器发送的第一消息,,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;The second receiving unit 1003 is configured to receive a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
第三接收单元1004,用于接收所述第二网关发送的第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;The third receiving unit 1004 is configured to receive a second message sent by the second gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and registered to the second gateway;
更新单元1005,用于根据所述第三接收单元接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息。The updating unit 1005 is configured to update the gateway information to the device registered on the second gateway according to the second message received by the third receiving unit.
在一种实施方式中,所述网关还包括:In an embodiment, the gateway further includes:
第二发送单元,用于向所示第二网关发送所述第一网关的第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第二网关替换,以便于所述第二网关向服务器发送网络替换通知,所述网关替换通知中携带有所述替换指示和第一业务能力层标识。a second sending unit, configured to send, to the second gateway, the first service capability layer identifier and the replacement indication of the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the second gateway The second gateway sends a network replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
可选的,所述网关还包括:第三发送单元,用于向所述服务器发送所述第一业务能力层标识和替换指示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。Optionally, the gateway further includes: a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the server, so that the server identifies the first service capability layer and the The replacement indication is sent to the second gateway.
可选的,所述更新单元,具体用于向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Optionally, the updating unit is configured to send a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource location of the service capability layer of the first gateway. And a uniform resource locator of the service capability layer of the second gateway; the application resource refers to a corresponding resource of the device registered to the second gateway.
可选的,所述网关还包括:Optionally, the gateway further includes:
第四接收单元,用于接收在线设备发送的第四消息,所述第四消息携带所述在线设备接收到所述更新消息的信息。The fourth receiving unit is configured to receive a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
可选的,所述网关还包括:Optionally, the gateway further includes:
标记单元,用于标记所述第四接收单元接收到的第四消息对应的设备。a marking unit, configured to mark a device corresponding to the fourth message received by the fourth receiving unit.
可选的,所述网关还包括:Optionally, the gateway further includes:
处理单元,用于确定未更新的设备对应的资源是否过期,若确定所述未更新的设备对应的资源过期,则删除所述未更新的设备对应的资源。The processing unit is configured to determine whether the resource corresponding to the device that is not updated is expired, and if it is determined that the resource corresponding to the unupdated device is expired, the resource corresponding to the unupdated device is deleted.
通过本发明实施例提供通过本发明实施例提供的网关,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工 作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。The gateway provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. Verify that the replaced gateway is working properly before the gateway replacement is completed. If the replacement is not completed before the replacement is completed, it can ensure that the device registered to the replaced gateway can work normally.
相应的,本发明实施例还提供了一种网关,所述网关例如可以是图1中的第二网关,图11是所述网关的结构图,由图11可见,所述网关包括:Correspondingly, the embodiment of the present invention further provides a gateway, which may be, for example, the second gateway in FIG. 1 , and FIG. 11 is a structural diagram of the gateway. As shown in FIG. 11 , the gateway includes:
第一发送单元1101,用于向服务器发送网络替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;a first sending unit 1101, configured to send a network replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
第一接收单元1102,用于接收服务器发送的网关替换标识,所述网关替换标识由服务器生成,所述网关替换标识用于标识网关替换;The first receiving unit 1102 is configured to receive a gateway replacement identifier sent by the server, where the gateway replacement identifier is generated by a server, and the gateway replacement identifier is used to identify a gateway replacement.
第二发送单元1103,用于向所述第一网关发送自身的第二业务能力层标识和所述网关替换标识;The second sending unit 1103 is configured to send, by the first gateway, its second service capability layer identifier and the gateway replacement identifier.
第二接收单元1104,用于接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;a second receiving unit 1104, configured to receive a first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
第三发送单元1105,用于向所述第一网关发送第二信息,所述第二信息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。The third sending unit 1105 is configured to send second information to the first gateway, where the second information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
在一种实施方式中,所网关还包括:In an embodiment, the gateway further includes:
第三接收单元,用于接收第一网关发送的所述第一业务能力层标识和所述替换指示,所述替换指示用于指示第二网关将被所述第一网关替换,所述网关替换标识中还包括所述第一业务能力层标识,所述网关替换通知中携带有替换指示和第一网关的第一业务能力层标识。a third receiving unit, configured to receive the first service capability layer identifier and the replacement indication sent by the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway, where the gateway is replaced The identifier further includes the first service capability layer identifier, where the gateway replacement notification carries a replacement indication and a first service capability layer identifier of the first gateway.
第四接收单元,用于接收所述服务器发送的所述网关替换标识和等待指示。And a fourth receiving unit, configured to receive the gateway replacement identifier and the waiting indication sent by the server.
另一种实施方式中,所述的网关还包括:In another implementation manner, the gateway further includes:
第五接收单元,用于接收服务器发送的第一网关的业务能力层的统一资源定位符和替换指示;a fifth receiving unit, configured to receive a uniform resource locator and a replacement indication of a service capability layer of the first gateway sent by the server;
可选的,所述的网关还包括:Optionally, the gateway further includes:
第六接收单元,用于接收所述第一网关发送的确认消息;a sixth receiving unit, configured to receive an acknowledgement message sent by the first gateway;
处理单元,用于根据所述第六接收单元接收到的所述确认消息下线,所述确认消息用于确认所述第一网关接收到所述第二消息。The processing unit is configured to go offline according to the confirmation message received by the sixth receiving unit, where the confirmation message is used to confirm that the first gateway receives the second message.
上述的服务器,网关分别可以执行上述方法实施例的方法,此处不再赘述。The above-mentioned server and gateway can respectively perform the method of the foregoing method embodiment, and details are not described herein again.
通过本发明实施例提供通过本发明实施例提供的网关,能够实现带有业务能力层的网关的替换,在被替换的网关将其存储的信息发送费替换网关之前,需要替换玩宏观通过服务器的验证,在网关替换完成之前,被替换网关正常工 作,在替换完成之前不会下线,可以保证注册到被替换网关的设备能够正常工作。The gateway provided by the embodiment of the present invention can implement the replacement of the gateway with the service capability layer. Before the replaced gateway replaces the gateway with the information transmission fee, the gateway needs to replace the macro access server. Verify that the replaced gateway is working properly before the gateway replacement is completed. If the replacement is not completed before the replacement is completed, it can ensure that the device registered to the replaced gateway can work normally.
如图12所示,本发明实施例提供了一种服务器,所述服务器可以部署用于执行本发明实施例图2所示方法;如图12所示,所述服务器包括网络接口1201、处理器1202和存储器1203。系统总线1204用于连接网络接口1201、处理器1202和存储器1203。As shown in FIG. 12, an embodiment of the present invention provides a server, where the server may be deployed to perform the method shown in FIG. 2 of the embodiment of the present invention; as shown in FIG. 12, the server includes a network interface 1201 and a processor. 1202 and memory 1203. System bus 1204 is used to connect network interface 1201, processor 1202, and memory 1203.
网络接口1201用于与其他网络节点通信。Network interface 1201 is used to communicate with other network nodes.
存储器1203用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器1203可能包含高速随机存取存储器(random access memory,简称RAM)存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。所述存储器1203中还可以包括设备驱动程序。The memory 1203 is used to store programs. In particular, the program can include program code, the program code including computer operating instructions. The memory 1203 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory. A device driver may also be included in the memory 1203.
处理器1202执行存储器1203中存放的程序,用于执行:The processor 1202 executes a program stored in the memory 1203 for performing:
接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;Receiving a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
生成网关替换标识,所述网关替换标识用于标识网关替换;Generating a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement;
向所述第二网关发送所述网关替换标识;Sending the gateway replacement identifier to the second gateway;
接收所述第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;And receiving, by the first gateway, a request for creating a resource, where the request for creating a resource carries a second service capability layer identifier of the second gateway, and the gateway replacement identifier, where the second service capability layer identifier is The gateway replacement identifier is sent by the second gateway or the server to the first gateway;
根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;Updating the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is obtained by the server according to the gateway replacement notification or the resource creation request;
向所述第一网关发送第一消息,所述第一消息携带所述服务器已经成功更新所述业务能力层资源的信息。Sending a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
需要说明的是:该处理器1202还可以进一步执行相应方法实施例中的其他步骤,此处不再赘述。It should be noted that the processor 1202 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
如图34所示,本发明实施例还提供了一种网关,所述网关用于执行本发明实施例中图3所示方法;如图13所示,所述网关包括网络接口1301、处理器1302和存储器1303。系统总线1304用于连接网络接口1301、处理器1302和存储器1403。 As shown in FIG. 34, the embodiment of the present invention further provides a gateway, which is used to perform the method shown in FIG. 3 in the embodiment of the present invention; as shown in FIG. 13, the gateway includes a network interface 1301 and a processor. 1302 and memory 1303. System bus 1304 is used to connect network interface 1301, processor 1302, and memory 1403.
网络接口1301用于与其他网络节点通信。 Network interface 1301 is used to communicate with other network nodes.
存储器1303用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器1303可能包含高速随机存取存储器(random access memory,简称RAM)存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。所述存储器1303中还可以包括设备驱动程序。The memory 1303 is used to store programs. In particular, the program can include program code, the program code including computer operating instructions. The memory 1303 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory. A device driver may also be included in the memory 1303.
处理器1302执行存储器1303中存放的程序,用于执行:The processor 1302 executes a program stored in the memory 1303 for executing:
接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;Receiving, by the second gateway, a gateway replacement identifier and a second service capability layer identifier of the second gateway;
向服务器发送创建资源请求,所述创建资源请求中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据所述第一网关的第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;Sending a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the first service capability of the server according to the first gateway The layer identifier and the second service capability layer identifier are updated, and the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway;
接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
接收所述第二网关发送的第二消息,所述第二信息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;Receiving a second message sent by the second gateway, where the second information includes resource information corresponding to a device registered by the second gateway and registered to the second gateway;
根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息。And updating the gateway information to the device registered to the second gateway according to the received second information.
需要说明的是:该处理器1302还可以进一步执行相应方法实施例中的其他步骤,此处不再赘述。It should be noted that the processor 1302 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
如图14所示,本发明实施例还提供了一种网关,所述网关用于执行本发明实施例图3所示方法;如图14所示,所述网关包括网络接口1301、处理器1402和存储器1403。系统总线1404用于连接网络接口1401、处理器1402和存储器1403。As shown in FIG. 14, the embodiment of the present invention further provides a gateway, which is used to perform the method shown in FIG. 3 of the embodiment of the present invention; as shown in FIG. 14, the gateway includes a network interface 1301 and a processor 1402. And memory 1403. The system bus 1404 is used to connect the network interface 1401, the processor 1402, and the memory 1403.
网络接口1401用于与其他网络节点通信。 Network interface 1401 is used to communicate with other network nodes.
存储器1403用于存放程序。具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器1403可能包含高速随机存取存储器(random access memory,简称RAM)存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。所述存储器1403中还可以包括设备驱动 程序。The memory 1403 is used to store programs. In particular, the program can include program code, the program code including computer operating instructions. The memory 1403 may include a high speed random access memory (RAM) memory, and may also include a non-volatile memory such as at least one disk memory. The device 1403 may further include a device driver program.
处理器1402执行存储器1403中存放的程序,用于执行:The processor 1402 executes a program stored in the memory 1403 for execution:
向服务器发送网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;Sending a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
接收所述服务器发送的网关替换标识,所述网关替换标识用于标识网关替换;Receiving a gateway replacement identifier sent by the server, where the gateway replacement identifier is used to identify a gateway replacement;
向所述第一网关发送所述第二网关的第二业务能力层标识和所述网关替换标识;Sending, by the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier;
接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving, by the first gateway, the first message, where the first message carries information that the server has successfully created the service capability layer resource;
向所述第一网关发送第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。Sending a second message to the first gateway, where the second message includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
需要说明的是:该处理器1402还可以进一步执行相应方法实施例中的其他步骤,此处不再赘述。It should be noted that the processor 1402 may further perform other steps in the corresponding method embodiments, and details are not described herein again.
专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。A person skilled in the art should further appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both, in order to clearly illustrate hardware and software. Interchangeability, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the preferred embodiments of the present invention. All modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (42)

  1. 一种网关替换方法,其特征在于,所述方法包括:A gateway replacement method, the method comprising:
    服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;Receiving, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
    所述服务器生成网关替换标识,所述网关替换标识用于标识网关替换;The server generates a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement;
    所述服务器向所述第二网关发送所述网关替换标识;Sending, by the server, the gateway replacement identifier to the second gateway;
    所述服务器接收所述第一网关发送的创建资源请求,所述创建资源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;The server receives a request for creating a resource that is sent by the first gateway, where the request for creating a resource carries a second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second service capability layer identifier And the gateway replacement identifier is sent by the second gateway or the server to the first gateway;
    所述服务器根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;The server updates the service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is requested by the server according to the gateway replacement notification or the resource creation request. obtain;
    所述服务器向所述第一网关发送第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息。The server sends a first message to the first gateway, where the first message carries information that the server has successfully created the service capability layer resource.
  2. 如权利要求1所述的方法,其特征在于,所述网关替换通知中还包含所述第一网关的所述第一业务能力层标识。The method according to claim 1, wherein the gateway replacement notification further includes the first service capability layer identifier of the first gateway.
  3. 如权利要求1或2所述的方法,其特征在于,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关。The method according to claim 1 or 2, wherein the first service capability layer identifier and the replacement indication are sent by the first gateway to the second gateway.
  4. 如权利要求1或2所述的方法,其特征在于,在所述服务器接收第二网关发送的网关替换通知之前,所述方法还包括:The method according to claim 1 or 2, wherein before the server receives the gateway replacement notification sent by the second gateway, the method further includes:
    所述服务器接收所述第一网关发送的所述第一业务能力层标识和所述替换指示;Receiving, by the server, the first service capability layer identifier and the replacement indication sent by the first gateway;
    所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。The server sends the first service capability layer identifier and the replacement indication to the second gateway.
  5. 如权利要求2或3所述的方法,其特征在于,所述服务器生成网关替换标识之前,还包括:The method according to claim 2 or 3, wherein before the server generates the gateway replacement identifier, the method further includes:
    所述服务器检测所述第一业务能力层标识是否有效;The server detects whether the first service capability layer identifier is valid;
    所述服务器在所述第一业务能力层标识有效时,生成所述网关替换标识。The server generates the gateway replacement identifier when the first service capability layer identifier is valid.
  6. 如权利要求1所述的方法,其特征在于,在所述服务器接收第二网关发送的网关替换通知之后,所述方法还包括: The method of claim 1, wherein after the server receives the gateway replacement notification sent by the second gateway, the method further includes:
    所述服务器检验所述第二网关是否可以被替换;The server checks whether the second gateway can be replaced;
    所述服务器在所述第二网关可以被替换时,生成所述网关替换标识。The server generates the gateway replacement identifier when the second gateway can be replaced.
  7. 如权利要求1所述的方法,其特征在于,所述服务器向所述第二网关发送所述网关替换标识的同时,还向所述第二网关发送等待指示,所述等待指示用于指示所述第二网关需要等待下线指示。The method according to claim 1, wherein the server sends a waiting indication to the second gateway while transmitting the gateway replacement identifier to the second gateway, where the waiting indication is used to indicate The second gateway needs to wait for the offline indication.
  8. 如权利要求1所述的方法,其特征在于,在所述服务器向所述第一网关发送第一消息,之后,还包括:The method according to claim 1, wherein after the server sends the first message to the first gateway, the method further includes:
    所述服务器向所述第二网关发送通知,所述通知中携带第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完成。The server sends a notification to the second gateway, where the notification carries a first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate that the gateway replacement is completed.
  9. 一种网关替换方法,其特征在于,所述方法包括:A gateway replacement method, the method comprising:
    第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;The first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway;
    所述第一网关向服务器发送创建资源请求,所述创建资源请求中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据所述第一网关的第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;The first gateway sends a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the first gateway. The first service capability layer identifier and the second service capability layer identifier are updated, and the first service capability layer identifier is included in the creation resource request or the gateway replacement notification sent by the second gateway. ;
    所述第一网关接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving, by the first gateway, the first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
    所述第一网关接收所述第二网关发送的第二消息,所述第二信息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;The first gateway receives the second message sent by the second gateway, where the second information includes resource information corresponding to the device registered by the second gateway and registered to the second gateway;
    所述第一网关根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息。The first gateway updates the gateway information to the device registered to the second gateway according to the received second information.
  10. 如权利要求9所述的方法,其特征在于,所述第一网关在接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识,之前,还包括:The method according to claim 9, wherein the first gateway, before receiving the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway, further includes:
    所述第一网关向所述第二网关发送所述第一网关的所述第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第一网关替换,以便于所述第二网关向所述服务器发送所述网关替换通知,所述网关替换通知中携带有所述替换指示和所述第一业务能力层标识。The first gateway sends the first service capability layer identifier and the replacement indication of the first gateway to the second gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway. The second gateway is configured to send the gateway replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  11. 如权利要求9所述的方法,其特征在于,所述第一网关接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识;之前,还包括: The method of claim 9, wherein the first gateway receives the gateway replacement identifier sent by the second gateway and the second service capability layer identifier of the second gateway;
    所述第一网关向所述服务器发送所述第一业务能力层标识和所述替换指示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。Sending, by the first gateway, the first service capability layer identifier and the replacement indication to the server, so that the server sends the first service capability layer identifier and the replacement indication to the second gateway .
  12. 如权利要求9至11任一项所述的方法,其特征在于,所述网关信息包括所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符。The method according to any one of claims 9 to 11, wherein the gateway information comprises a uniform resource locator of a service capability layer of the first gateway and a uniform resource of a service capability layer of the second gateway. Locator.
  13. 如权利要求9所述的方法,其特征在于,所述第一网关根据接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息,具体包括:The method according to claim 9, wherein the first gateway updates the gateway information to the device registered to the second gateway according to the received second message, which specifically includes:
    所述第一网关向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Transmitting, by the first gateway, a third message to the device corresponding to the application resource that is included in the first gateway, where the third message includes a uniform resource locator of the service capability layer of the first gateway, and the second gateway The uniform resource locator of the service capability layer; the application resource refers to the corresponding resource of the device registered to the second gateway.
  14. 如权利要求13所述方法,其特征在于,在所述第一网关向所述第一网关的应用资源对应的设备发送第三消息之后,还包括The method of claim 13, after the third gateway sends a third message to the device corresponding to the application resource of the first gateway,
    所述第一网关接收在线设备发送的第四消息,所述第四消息携带所述在线设备接收到所述更新消息的信息。The first gateway receives a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
  15. 如权利要求14所述方法,其特征在于,所述第四消息还携带所述在线设备更新所述第二网关的业务能力层的统一资源定位符为所述第一网关的业务能力层的统一资源定位符的信息。The method of claim 14, wherein the fourth message further carries the online device to update a uniform resource locator of the service capability layer of the second gateway as a unified service capability layer of the first gateway. Resource locator information.
  16. 如权利要求13所述的方法,其特征在于,所述第一网关接收在线的设备的第四消息之后,还包括:The method according to claim 13, wherein after the first gateway receives the fourth message of the online device, the method further includes:
    所述第一网关标记所述第一网关接收到的所述第四消息对应的所述在线设备。The first gateway marks the online device corresponding to the fourth message received by the first gateway.
  17. 如权利要求13所述的方法,其特征在于,所述第一网关根据接收到的所述第二信息,向注册到所述第二网关上的设备更新网关信息,进一步包括:The method of claim 13, wherein the first gateway updates the gateway information to the device registered to the second gateway according to the received second information, and further includes:
    所述第一网关检查未更新的设备对应的资源是否过期,如果过期,则删除所述未更新的设备对应的资源。The first gateway checks whether the resource corresponding to the device that is not updated expires, and if it expires, deletes the resource corresponding to the device that is not updated.
  18. 一种网关替换方法,其特征在于,所述方法包括;A gateway replacement method, characterized in that the method comprises:
    第二网关向服务器发送网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;The second gateway sends a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
    所述第二网关接收所述服务器发送的网关替换标识,所述网关替换标识用 于标识网关替换;The second gateway receives a gateway replacement identifier sent by the server, where the gateway replaces the identifier Replace the identity gateway;
    所述第二网关向所述第一网关发送所述第二网关的第二业务能力层标识和所述网关替换标识;Sending, by the second gateway, the second service capability layer identifier of the second gateway and the gateway replacement identifier to the first gateway;
    所述第二网关接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;Receiving, by the second gateway, the first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
    所述第二网关向所述第一网关发送第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。The second gateway sends a second message to the first gateway, where the second message includes resource information corresponding to the device registered by the second gateway and registered to the second gateway.
  19. 如权利要求18所述的方法,其特征在于,在所述第二网关向服务器发送网关替换通知,之前,还包括:The method of claim 18, wherein before the second gateway sends a gateway replacement notification to the server, the method further includes:
    所述第二网关接收所述第一网关发送的所述第一网关的第一业务能力层标识和所述替换指示,所述网关替换标识中还包含所述第一业务能力层标识。The second gateway receives the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, and the gateway replacement identifier further includes the first service capability layer identifier.
  20. 如权利要求18所述的方法,其特征在于,所述第二网关向服务器发送网络替换通知,所述网关替换通知中携带有替换指示,之后,还包括:The method of claim 18, wherein the second gateway sends a network replacement notification to the server, where the gateway replacement notification carries a replacement indication, and thereafter, the method further includes:
    所述第二网关接收所述服务器发送的所述网关替换标识和等待指示。The second gateway receives the gateway replacement identifier and the waiting indication sent by the server.
  21. 如权利要求18所述的方法,其特征在于,所述第二网关向所述第一网关发送所述第二网关的所述第二业务能力层标识和所述网关替换标识;之前,还包括:The method according to claim 18, wherein the second gateway sends the second service capability layer identifier and the gateway replacement identifier of the second gateway to the first gateway; :
    所述第二网关接收所述服务器发送的所述第一网关的业务能力层的统一资源定位符和所述替换指示.The second gateway receives the uniform resource locator of the service capability layer of the first gateway and the replacement indication sent by the server.
  22. 如权利要求18所述的方法,其特征在于,The method of claim 18, wherein
    所述第二网关向所述第一网关发送第二消息,所述第二消息中包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息,之后,还包括:The second gateway sends a second message to the first gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and is registered to the second gateway, and then includes:
    所述第二网关在接收到所述第一网关发送的确认消息后下线,所述确认消息用于确认所述第一网关接收到所述第二消息。After receiving the acknowledgement message sent by the first gateway, the second gateway goes offline, and the acknowledgement message is used to confirm that the first gateway receives the second message.
  23. 一种服务器,其特征在于,包括:A server, comprising:
    第一接收单元,用于服务器接收第二网关发送的网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;a first receiving unit, configured to receive, by the server, a gateway replacement notification sent by the second gateway, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
    生成单元,用于生成网关替换标识,所述网关替换标识用于标识网关替换;a generating unit, configured to generate a gateway replacement identifier, where the gateway replacement identifier is used to identify a gateway replacement;
    第一发送单元,用于向所述第二网关发送所述网关替换标识;a first sending unit, configured to send the gateway replacement identifier to the second gateway;
    第二接收单元,用于接收所述第一网关发送的创建资源请求,所述创建资 源请求中携带有所述第二网关的第二业务能力层标识和所述网关替换标识,所述第二业务能力层标识和所述网关替换标识由所述第二网关或者所述服务器发送给所述第一网关;a second receiving unit, configured to receive a request for creating a resource sent by the first gateway, where the resource is created The source request carries the second service capability layer identifier of the second gateway and the gateway replacement identifier, where the second service capability layer identifier and the gateway replacement identifier are sent by the second gateway or the server The first gateway;
    更新单元,用于根据第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识由所述服务器根据所述网关替换通知或所述创建资源请求获得;An update unit, configured to update a service capability layer resource according to the first service capability layer identifier and the second service capability layer identifier, where the first service capability layer identifier is replaced by the server according to the gateway replacement notification or the creation Resource request is obtained;
    第二发送单元,用于向所述第一网关发送第一消息,所述第一消息携带所述服务器已经成功更新所述业务能力层资源的信息。The second sending unit is configured to send a first message to the first gateway, where the first message carries information that the server has successfully updated the service capability layer resource.
  24. 如权利要求23所述的服务器,其特征在于,所述网关替换通知中还包含所述第一网关的所述第一业务能力层标识;The server according to claim 23, wherein the gateway replacement notification further includes the first service capability layer identifier of the first gateway;
  25. 如权利要求23或24所述的服务器,其特征在于,所述第一业务能力层标识和所述替换指示由所述第一网关发送给所述第二网关。The server according to claim 23 or 24, wherein the first service capability layer identifier and the replacement indication are sent by the first gateway to the second gateway.
  26. 如权利要求23所述的服务器,其特征在于,所述网关替换通知中还包含第一网关的第一业务能力层标识;所述服务器还包括:The server according to claim 23, wherein the gateway replacement notification further includes a first service capability layer identifier of the first gateway; the server further includes:
    第三接收单元,用于接收所述第一网关发送的第一业务能力层标识和替换指示;a third receiving unit, configured to receive a first service capability layer identifier and a replacement indication sent by the first gateway;
    第三发送单元,用于将所述第一业务能力层标识和所述替换指示发送给所述第二网关。And a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the second gateway.
  27. 如权利要求24或25所述的服务器,其特征在于,所述服务器还包括:The server according to claim 24 or 25, wherein the server further comprises:
    检测单元,用于检测所述第一业务能力层标识是否有效。The detecting unit is configured to detect whether the first service capability layer identifier is valid.
    所述生成单元,还用于在所述第一业务能力层标识有效时,生成所述网关替换标识。The generating unit is further configured to generate the gateway replacement identifier when the first service capability layer identifier is valid.
  28. 如权利要求23所述的服务器,其特征在于,所述第二发送单元,还用于向所述第二网关发送等待指示,用于通知所述第二网关需要等待下线指示。The server according to claim 23, wherein the second sending unit is further configured to send a waiting indication to the second gateway, to notify the second gateway that it needs to wait for an offline indication.
  29. 如权利要求23所述的服务器,其特征在于,还包括:The server of claim 23, further comprising:
    第四发送单元,用于向所述第二网关发送通知,所述通知中携带所述第一指示和所述第一网关业务能力层的统一资源定位符,所述第一指示用于指示网关替换完成。a fourth sending unit, configured to send a notification to the second gateway, where the notification carries the first indication and a uniform resource locator of the first gateway service capability layer, where the first indication is used to indicate a gateway Replacement is complete.
  30. 一种网关,其特征在于,A gateway, characterized in that
    第一接收单元,用于接收第二网关发送的网关替换标识和所述第二网关的第二业务能力层标识; a first receiving unit, configured to receive a gateway replacement identifier sent by the second gateway and a second service capability layer identifier of the second gateway;
    第一发送单元,用于向所述服务器发送创建资源请求,所述创建资源请求中携带有所述第二业务能力层标识和所述网关替换标识,所述创建资源请求触发所述服务器根据所述第一网关的第一业务能力层标识和所述第二业务能力层标识,更新业务能力层资源,所述第一业务能力层标识包含在所述创建资源请求或所述第二网关发送的网关替换通知中;a first sending unit, configured to send a request for creating a resource to the server, where the request for creating a resource carries the identifier of the second service capability layer and the gateway replacement identifier, where the request for creating a resource triggers the server according to the The first service capability layer identifier and the second service capability layer identifier of the first gateway are updated, and the service capability layer resource is updated, where the first service capability layer identifier is included in the creation resource request or sent by the second gateway. Gateway replacement notification;
    第二接收单元,用于接收所述服务器发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;a second receiving unit, configured to receive a first message sent by the server, where the first message carries information that the server has successfully created the service capability layer resource;
    第三接收单元,用于接收所述第二网关发送的第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息;a third receiving unit, configured to receive a second message sent by the second gateway, where the second message includes resource information corresponding to a device that is stored by the second gateway and registered to the second gateway;
    更新单元,用于根据所述第三接收单元接收到的所述第二消息,向注册到所述第二网关上的设备更新网关信息。And an updating unit, configured to update the gateway information to the device registered to the second gateway according to the second message received by the third receiving unit.
  31. 如权利要求30所述的网关,其特征在于,还包括:The gateway of claim 30, further comprising:
    第二发送单元,用于向所述第二网关发送所述第一网关的第一业务能力层标识和替换指示,所述替换指示用于指示所述第二网关将被所述第二网关替换,以便于所述第二网关向服务器发送网络替换通知,所述网关替换通知中携带有所述替换指示和所述第一业务能力层标识。a second sending unit, configured to send, to the second gateway, a first service capability layer identifier and a replacement indication of the first gateway, where the replacement indication is used to indicate that the second gateway is to be replaced by the second gateway The second gateway sends a network replacement notification to the server, where the gateway replacement notification carries the replacement indication and the first service capability layer identifier.
  32. 如权利要求30所述的网关,其特征在于,还包括:The gateway of claim 30, further comprising:
    第三发送单元,用于向所述服务器发送所述第一业务能力层标识和所述替换指示,以便于所述服务器将所述第一业务能力层标识和所述替换指示发送给所述第二网关。a third sending unit, configured to send the first service capability layer identifier and the replacement indication to the server, so that the server sends the first service capability layer identifier and the replacement indication to the Second gateway.
  33. 如权利要求30至32任一项所述的网关,其特征在于,所述网关信息包括所述第一网关的业务能力层的统一资源定位符和第二网关的业务能力层的统一资源定位符。The gateway according to any one of claims 30 to 32, wherein the gateway information comprises a uniform resource locator of the service capability layer of the first gateway and a uniform resource locator of the service capability layer of the second gateway. .
  34. 如权利要求33所述的网关,其特征在于,所述更新单元具体用于:The gateway according to claim 33, wherein the updating unit is specifically configured to:
    向所述第一网关包含的应用资源对应的设备发送第三消息,所述第三消息中包含所述第一网关的业务能力层的统一资源定位符和所述第二网关的业务能力层的统一资源定位符;所述应用资源是指所述注册到所述第二网关上的设备的对应资源。Transmitting, by the device corresponding to the application resource that is included in the first gateway, a third message, where the third message includes a uniform resource locator of the service capability layer of the first gateway and a service capability layer of the second gateway a uniform resource locator; the application resource refers to a corresponding resource of the device registered to the second gateway.
  35. 如权利要求34所述的网关,其特征在于,还包括:The gateway of claim 34, further comprising:
    第四接收单元,用于接收在线设备发送的第四消息,所述第四消息携带所述在线设备接收到所述更新消息的信息。 The fourth receiving unit is configured to receive a fourth message sent by the online device, where the fourth message carries information that the online device receives the update message.
  36. 如权利要求34所述的网关,其特征在于,还包括:The gateway of claim 34, further comprising:
    标记单元,用于标记所述第四接收单元接收到的第四消息对应的设备。a marking unit, configured to mark a device corresponding to the fourth message received by the fourth receiving unit.
  37. 如权利要求34所述的网关,其特征在于,还包括:The gateway of claim 34, further comprising:
    处理单元,用于确定未更新的设备对应的资源是否过期,若确定所述未更新的设备对应的资源过期,则删除所述未更新的设备对应的资源。The processing unit is configured to determine whether the resource corresponding to the device that is not updated is expired, and if it is determined that the resource corresponding to the unupdated device is expired, the resource corresponding to the unupdated device is deleted.
  38. 一种网关,其特征在于,包括;A gateway, characterized in that:
    第一发送单元,用于向服务器发送网关替换通知,所述网关替换通知中携带有替换指示,所述替换指示用于指示所述第二网关将被第一网关替换;a first sending unit, configured to send a gateway replacement notification to the server, where the gateway replacement notification carries a replacement indication, where the replacement indication is used to indicate that the second gateway is to be replaced by the first gateway;
    第一接收单元,用于接收服务器发送的网关替换标识,所述网关替换标识用于标识网关替换;a first receiving unit, configured to receive a gateway replacement identifier sent by the server, where the gateway replacement identifier is used to identify a gateway replacement;
    第二发送单元,用于向所述第一网关发送所述第二网关的第二业务能力层标识和所述网关替换标识;a second sending unit, configured to send, to the first gateway, a second service capability layer identifier of the second gateway and the gateway replacement identifier;
    第二接收单元,用于接收所述第一网关发送的第一消息,所述第一消息携带所述服务器已经成功创建所述业务能力层资源的信息;a second receiving unit, configured to receive a first message sent by the first gateway, where the first message carries information that the server has successfully created the service capability layer resource;
    第三发送单元,用于向所述第一网关发送第二消息,所述第二消息包含所述第二网关存储的注册到所述第二网关的设备对应的资源信息。And a third sending unit, configured to send a second message to the first gateway, where the second message includes resource information corresponding to the device that is stored by the second gateway and registered to the second gateway.
  39. 如权利要求38所述的网关,其特征在于,还包括:The gateway of claim 38, further comprising:
    第三接收单元,用于接收所述第一网关发送的所述第一网关的第一业务能力层标识和所述替换指示,所述网关替换标识中还包括所述第一业务能力层标识。And a third receiving unit, configured to receive the first service capability layer identifier and the replacement indication of the first gateway sent by the first gateway, where the gateway replacement identifier further includes the first service capability layer identifier.
  40. 如权利要求38或39所述的网关,其特征在于,还包括:第四接收单元,用于接收所述服务器发送的所述网关替换标识和等待指示。The gateway according to claim 38 or 39, further comprising: a fourth receiving unit, configured to receive the gateway replacement identifier and the waiting indication sent by the server.
  41. 如权利要求38或39所述的网关,其特征在于,还包括:The gateway according to claim 38 or 39, further comprising:
    第五接收单元,用于接收服务器发送的第一网关的业务能力层的统一资源定位符和替换指示。The fifth receiving unit is configured to receive a uniform resource locator and a replacement indication of the service capability layer of the first gateway sent by the server.
  42. 如权利要求38至41任一项所述的网关,其特征在于,还包括:The gateway according to any one of claims 38 to 41, further comprising:
    第六接收单元,用于接收所述第一网关发送的确认消息;a sixth receiving unit, configured to receive an acknowledgement message sent by the first gateway;
    处理单元,用于根据所述第六接收单元接收到的所述确认消息下线,所述确认消息用于确认所述第一网关接收到所述第二消息。 The processing unit is configured to go offline according to the confirmation message received by the sixth receiving unit, where the confirmation message is used to confirm that the first gateway receives the second message.
PCT/CN2014/088798 2013-10-30 2014-10-17 Gateway replacement method, gateway, and server WO2015062421A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310529521.1A CN104601456B (en) 2013-10-30 2013-10-30 Gateway replacement method, gateway and server
CN201310529521.1 2013-10-30

Publications (1)

Publication Number Publication Date
WO2015062421A1 true WO2015062421A1 (en) 2015-05-07

Family

ID=53003322

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/088798 WO2015062421A1 (en) 2013-10-30 2014-10-17 Gateway replacement method, gateway, and server

Country Status (2)

Country Link
CN (1) CN104601456B (en)
WO (1) WO2015062421A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110061885A (en) * 2019-04-29 2019-07-26 新华三技术有限公司 Gateway discharging method, device, gateway and medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981803B (en) * 2017-12-27 2022-04-29 中兴通讯股份有限公司 Service request processing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870636A (en) * 2005-11-10 2006-11-29 华为技术有限公司 Method and system for client redirection
CN101959192A (en) * 2009-07-17 2011-01-26 华为技术有限公司 Business processing method and communication device
CN102170641A (en) * 2010-02-26 2011-08-31 中兴通讯股份有限公司 Method and system for resource allocation and distribution of M2M business group

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222374B (en) * 2008-01-30 2010-09-22 华为技术有限公司 System, device and method for implementing service upgrade
MX2012010363A (en) * 2010-03-09 2012-11-30 Interdigital Patent Holdings Method and apparatus for supporting machine-to-machine communications.
CN102685786B (en) * 2011-03-18 2017-05-03 中兴通讯股份有限公司 Method and system for accessing wireless sensor network (WSN) to telecommunication network
CN102577483A (en) * 2011-12-23 2012-07-11 华为技术有限公司 Method, device and system for service realization when failures occur in media gateway controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870636A (en) * 2005-11-10 2006-11-29 华为技术有限公司 Method and system for client redirection
CN101959192A (en) * 2009-07-17 2011-01-26 华为技术有限公司 Business processing method and communication device
CN102170641A (en) * 2010-02-26 2011-08-31 中兴通讯股份有限公司 Method and system for resource allocation and distribution of M2M business group

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110061885A (en) * 2019-04-29 2019-07-26 新华三技术有限公司 Gateway discharging method, device, gateway and medium
CN110061885B (en) * 2019-04-29 2022-03-29 新华三技术有限公司 Gateway equipment unloading method and device, gateway equipment and medium

Also Published As

Publication number Publication date
CN104601456B (en) 2017-11-07
CN104601456A (en) 2015-05-06

Similar Documents

Publication Publication Date Title
CN108140031B (en) Peer-to-peer synchronizable storage system
JP4896946B2 (en) Apparatus, method and storage medium using apparatus identifier
EP2819342A1 (en) Method and apparatus for authenticating access authority for specific resource in wireless communication system
CN112822222B (en) Login verification method, automatic login verification method, server and client
CN110956474A (en) Electronic invoice system based on block chain
US20210320923A1 (en) Method and apparatus for revoking authorization of api invoker
JP6385842B2 (en) Information processing terminal, information processing method, and information processing system
JP2012506594A5 (en)
CN114706634A (en) System, program, and computer-readable storage medium
JP2009520252A5 (en)
WO2014048236A1 (en) Method and apparatus for registering terminal
JP4753953B2 (en) Software execution management apparatus, method and program thereof
CN107026738B (en) Digital certificate updating method, digital signature verification method and digital authentication device
JP5631940B2 (en) Information processing apparatus, method, and program
CN107534556A (en) Use CRL following certificate revocation
US8224962B2 (en) Automatic network domain diagnostic repair and mapping
WO2015062421A1 (en) Gateway replacement method, gateway, and server
CN110163003B (en) Password management method and device
WO2023273059A1 (en) Device monitoring method, system and apparatus, and computer device and storage medium
CN109299053B (en) File operation method, device and computer storage medium
CN102761520B (en) Method and system for processing authentication information
KR20130085544A (en) Apparatus and method for control of applications using application sign authentication
US9094417B2 (en) Status transfer within a group of computing entities
JP6515052B2 (en) Communication apparatus, communication system, communication method and program
CN111932326B (en) Data processing method based on block chain network and related equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14858112

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14858112

Country of ref document: EP

Kind code of ref document: A1