Resource publishing method, device, gateway, cloud platform and computer storage medium
By receiving and forwarding resource links from the server through the gateway, the problems of rationality of resource release methods and smooth links in the Internet of Things are solved, and the efficiency of resource uploading is achieved.
Patent Information
- Application Number
- CN202211472349.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-16
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-06-16
AI Technical Summary
In the Internet of Things scenario, how to provide a reasonable release method of server device resources to cope with the problem of increasing resources, especially how to ensure the smoothness of the link for resource links to be uploaded to the cloud platform.
The gateway receives the resource link to be released sent by the server, determines and forwards it to the cloud platform, and implements resource release and upload. The gateway replaces the server for resource release, thereby ensuring the smoothness of the resource link upload link.
It effectively solves the problem of rationality of resource release methods, ensures the smoothness of resource links uploaded to the cloud platform, and simplifies the resource release process of the server.
Smart Images

Figure CN115834582B_ABST
Abstract
Description
[0001] This application is a divisional application of the PCT international patent application PCT / CN2020 / 096412 with an application date of June 16, 2020, which has entered the Chinese national phase and has Chinese patent application number 202080093626.5 and the invention name is "Resource publishing method, device, gateway, cloud platform and computer storage medium". Technical Field
[0002] The embodiments of the present application relate to but are not limited to Internet of Things technology, and in particular to a resource publishing method, device, gateway, cloud platform and computer storage medium. Background Art
[0003] The Internet of Things (IOT) is an important part of the new generation of information technology. As the IoT scenarios become more and more complex, the number of devices exchanging information increases, and the increase in server-side devices leads to an increase in resources. How to provide a reasonable way to publish resources for server-side devices is an urgent problem to be solved in this field. Summary of the invention
[0004] Embodiments of the present application provide a resource publishing method, device, gateway, cloud platform and computer storage medium.
[0005] In a first aspect, a resource publishing method is provided, comprising: a gateway receiving a first resource link of a resource to be published sent by a server;
[0006] Determine a second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published;
[0007] The second resource link of the resource to be published is sent to the cloud platform; the second resource link of the resource to be published is used by the cloud platform to publish the resource to be published on the resource directory.
[0008] In a second aspect, a resource publishing method is provided, including: a cloud platform receiving a second resource link of a resource to be published sent by a gateway;
[0009] Determine a third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published;
[0010] Based on the third resource link of the resource to be published, the resource to be published is published on the resource directory.
[0011] In a third aspect, a resource publishing method is provided, comprising: a gateway receiving a first resource link of a resource to be published sent by a server;
[0012] Based on the obtained identification of the server, establishing a new session between the gateway and the cloud platform;
[0013] Based on the new session, a first resource link of the resource to be published is sent to the cloud platform.
[0014] In a fourth aspect, a resource publishing method is provided, comprising: a cloud platform receiving a first resource link of a to-be-published resource sent by the gateway based on a new session between the gateway and the cloud platform;
[0015] Based on the first resource link of the resource to be published, the resource to be published is published on a resource directory.
[0016] In a fifth aspect, a resource publishing device is provided, comprising:
[0017] A first resource link sending unit, configured to receive a first resource link of a resource to be published sent by a server;
[0018] A second resource link determining unit, configured to determine a second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published;
[0019] The second resource link sending unit is used to send the second resource link of the resource to be released to the cloud platform; the second resource link of the resource to be released is used by the cloud platform to release the resource to be released on the resource directory.
[0020] In a sixth aspect, a resource publishing device is provided, comprising:
[0021] A second resource link receiving unit, configured to receive a second resource link of a to-be-published resource sent by a gateway;
[0022] A third resource link determining unit, configured to determine a third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published;
[0023] A publishing unit is used to publish the resource to be published on a resource directory based on a third resource link of the resource to be published.
[0024] In a seventh aspect, a resource publishing device is provided, comprising:
[0025] A first resource link sending unit, configured to receive a first resource link of a resource to be published sent by a server;
[0026] A session establishing unit, configured to establish a new session between the gateway and the cloud platform based on the obtained identifier of the server;
[0027] The first resource link sending unit is used to send the first resource link of the to-be-published resource to the cloud platform based on the new session.
[0028] In an eighth aspect, a resource publishing device is provided, comprising:
[0029] A first resource link receiving unit, configured to receive a first resource link of a to-be-published resource sent by the gateway based on a new session between the gateway and the cloud platform;
[0030] The publishing unit is used to publish the resource to be published on the resource directory based on the first resource link of the resource to be published.
[0031] In a ninth aspect, a gateway is provided, comprising: a memory and a processor,
[0032] The memory stores a computer program executable on the processor.
[0033] When the processor executes the program, the steps in the above method are implemented.
[0034] In a tenth aspect, a cloud platform is provided, comprising: a memory and a processor,
[0035] The memory stores a computer program executable on the processor.
[0036] When the processor executes the program, the steps in the above method are implemented.
[0037] In an eleventh aspect, a computer storage medium is provided, wherein the computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the above method.
[0038] In a twelfth aspect, a chip is provided, comprising: a processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the steps in the above method.
[0039] In a thirteenth aspect, a computer program product is provided, the computer program product comprising a computer storage medium, the computer storage medium storing computer program code, the computer program code comprising instructions executable by at least one processor, and the steps in the above method are implemented when the instructions are executed by the at least one processor.
[0040] In an embodiment of the present application, the gateway receives the first resource link of the resource to be published sent by the server; based on the obtained server identifier and the first resource link of the resource to be published, the second resource link of the resource to be published is determined; the second resource link of the resource to be published is sent to the cloud platform; the second resource link of the resource to be published is used by the cloud platform to publish the resource to be published on the resource directory. In this way, the gateway receives the first resource link of the resource to be published sent by the server, and sends the second resource link of the resource to be published to the cloud platform, so that the resource link of the resource to be published of the server is forwarded through the gateway, and the gateway can publish resources on behalf of the server, thereby ensuring the smoothness of the link in the process of uploading the resource link to the cloud, making the publishing method of the server's resources reasonable. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of the structure of an Internet of Things architecture provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a server uploading resources through a gateway provided in an embodiment of the present application;
[0043] Figure 3 A flowchart of a resource publishing method provided for related technologies;
[0044] Figure 4 A flowchart of another resource publishing method provided for related technologies;
[0045] Figure 5 A schematic diagram of a resource publishing method provided in an embodiment of the present application;
[0046] Figure 6 A flowchart of another resource publishing method provided in an embodiment of the present application;
[0047] Figure 7 A flowchart of another resource publishing method provided in an embodiment of the present application;
[0048] Figure 8 A flowchart of another resource publishing method provided in an embodiment of the present application;
[0049] Fig. 9 A flowchart of a resource publishing method provided in another embodiment of the present application;
[0050] Fig.10 A flowchart of a resource publishing method provided in another embodiment of the present application;
[0051] Fig.11 A flowchart of a resource publishing method provided in yet another embodiment of the present application;
[0052] Fig.12 A flowchart of another resource publishing method provided in another embodiment of the present application;
[0053] Fig.13 A schematic diagram of the composition structure of a resource publishing device provided in an embodiment of the present application;
[0054] Fig.14 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application;
[0055] Fig.15 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application;
[0056] Fig.16 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application;
[0057] Fig.17 A schematic diagram of a hardware entity of a gateway provided in an embodiment of the present application;
[0058] Fig.18 A schematic diagram of a hardware entity of a cloud platform provided in an embodiment of the present application;
[0059] Fig.19 It is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems through embodiments and in conjunction with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0061] It should be noted that in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0062] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0063] Figure 1 A schematic diagram of the structure of an Internet of Things architecture provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the IoT architecture 100 includes:
[0064] Server 101 , Gateway 102 , Configurator 103 , Cloud Platform 104 , and Client 105 .
[0065] The server 101 may be a server device, a bridged server, an Open Connectivity Foundation (OCF) server device, a resource device, a D2D (Device-to-Device) device, or a D2C (Device-to-Client) device, etc. The server 101 may be any device that can provide resources, for example, a kettle that can provide water temperature resources, an air conditioner that can provide resources for turning the air conditioner on or off, etc. The resource device may be a device that can provide resources, for example, a resource device may be used to provide temperature resources or may provide a certain controlled object resource. The server 101 may upload resources or the state of resources to the cloud platform 104, or the server 101 may upload resources or the state of resources to the cloud platform 104 through the gateway 102. The state of resources is, for example, a temperature value, state information of a controlled object, etc.
[0066] Gateway 102 may be a cloud proxy, a cloud proxy platform, a cloud gateway, a cloud gateway platform, a gateway device, a cloud proxy device or an OCF gateway, etc. Gateway 102 may also be a wireless access gateway, a home access gateway, a dial-up access gateway, a dedicated line access gateway, a VPN access gateway or an enterprise access gateway, etc.
[0067] The configurator 103 may be any device capable of performing information configuration, and the configurator 103 may be a mediator. In one embodiment, the configurator 103 may configure at least one of the server 101, the gateway 102, the cloud platform 104, and the client 105. For example, in one embodiment, the configurator 103 only configures the server 101, the gateway 102, and the client 105. In another embodiment, the configuration may configure the server 101, the gateway 102, the cloud platform 104, and the client 105.
[0068] The cloud platform 104 may be a cloud, a cloud end, a cloud device, or an OCF cloud, etc. The cloud platform 104 is used to display resources or resource status uploaded by the server 101 for query or retrieval by the client 105 .
[0069] The client 105 may be a client, a cloud client, or an OCF cloud client. Cloud users may access resources on the cloud platform 104 through the client 105, or initiate a resource status query request to the cloud platform 104 to query the resource status.
[0070] The server 101, configurator 103 or client 105 in the embodiments of the present application may be a mobile phone, tablet computer, laptop computer, PDA, personal digital assistant, portable media player, smart speaker, navigation device, display device, wearable device such as smart bracelet, virtual reality (VR) device, augmented reality (AR) device, pedometer, digital TV, desktop computer or terminal device in 5G network, etc.
[0071] Figure 2 A schematic diagram of a server uploading resources through a gateway provided in an embodiment of the present application, such as Figure 2 As shown, the gateway can upload the server resources to the cloud in the following ways:
[0072] First, the gateway can discover the server in the network, or the server can discover the gateway, and the gateway connects with the server. The connection between the gateway and the server can include the server registering and / or logging in to the gateway.
[0073] Secondly, the gateway can connect to the server through a virtual bridge client to obtain the server's resources. The resources here can be the resources to be released in the embodiment of the present application.
[0074] Again, the gateway maps the resources of the server device to the resource directory client (RD Client) through a bridging function. In some implementations, the RD Client may also be a virtual client.
[0075] Then, the RD Client publishes the mapped server device resources to the cloud resource directory (RD) of the cloud platform.
[0076] Finally, the cloud resource directory of the cloud platform is used to present the resources to the corresponding cloud users.
[0077] In some embodiments, when the client obtains the status of a resource from the cloud, the cloud resource directory can send the acquisition information to the resource directory client, and the virtual bridge client forwards the acquisition information to the server, thereby obtaining the server's resources. Correspondingly, the server can send the status information of the resource to the virtual bridge client, and then the resource directory client sends the status of the resource to the cloud resource directory, and the cloud resource directory sends the status of the resource to the client, so that the user can see the status of the resource from the client.
[0078] Figure 2The corresponding gateway may be the same gateway as the gateway in other embodiments. The server communicates with the virtual bridge client in the gateway via the OCF protocol (OCF Protpcol). The resource directory client in the gateway communicates with the cloud resource directory via the OCF protocol (OCF Protpcol).
[0079] Figure 3 A flowchart of a resource publishing method provided for related technologies, such as Figure 3 As shown, the method may include the following steps:
[0080] S301. A Mediator configures (onboards) an OCF server device (D2D Device).
[0081] The configurator may send configuration information to the OCF server device to configure the OCF server device.
[0082] S303, the configurator configures the OCF gateway (Cloud-Proxy).
[0083] The configurator may send configuration information to the OCF gateway to configure the OCF gateway.
[0084] S305, the OCF gateway (Cloud-Proxy) discovers the OCF server device (D2DDevice) in the network.
[0085] S307. The OCF gateway connects to the server device and obtains resources of the server device.
[0086] The gateway sends a request to the server device to obtain the resources to be published on the server device.
[0087] S309. The OCF gateway registers the sub-device (sub_di) on the cloud (OCF-Cloud).
[0088] S309 can be implemented in the following manner: the OCF gateway can send an update request to the account resource of the cloud platform, where the update request includes a sub_di attribute, and the attribute information or attribute value of the sub_di attribute is a device identifier (d2d_di) of the server device.
[0089] In the implementation manner of the present application, the identifier may refer to an ID or a Uniform Resource Identifier (URI). For example, the identifier of a server may be a server ID, the identifier of a gateway may be a gateway ID, and so on.
[0090] S311. The OCF gateway publishes the acquired server device resources to the cloud RD.
[0091] The OCF gateway sends an update request to the resource directory resource of the cloud platform. The update request includes a payload attribute, and the attribute information or attribute value of the payload attribute is a resource link of the server device.
[0092] In some implementations, the server-side device resources may be resources such as temperature, brightness, and workable status of the server.
[0093] S313. The cloud RD presents the resource to the corresponding cloud user (OCF Cloud Client).
[0094] In the embodiment of the present application, the cloud RD presenting the resource to the corresponding cloud user can be understood as the cloud RD publishing the resource.
[0095] The context URI corresponding to the resource presented by the cloud RD is<d2d_di> , the attribute information of the hypertext reference (href) attribute corresponding to the resource presented by the cloud RD is<d2d_di> and<d2d_href> . Resource path
[0096] S315: The client sends a request to the cloud to obtain the resource status of the server device.
[0097] The client can send a request to the cloud, which includes<d2d_di> and<d2d_href> .
[0098] S317. The cloud forwards the acquisition request to the OCF gateway.
[0099] After receiving the acquisition request, if the cloud determines to forward the acquisition request to the gateway, it will include<d2d_di> and<d2d_href> In other embodiments, if the cloud directly sends a request to the server device, it will include<d2d_href> The acquisition request is sent to the server device.
[0100] S319. The OCF gateway forwards the acquisition request to the server device.
[0101] The gateway will include<d2d_href> The acquisition request is sent to the server device.
[0102] After receiving the acquisition request, the server device sends an acquisition response to the gateway, and the response includes the status information of the server device; the gateway forwards the acquisition response to the cloud platform, and the cloud platform forwards the acquisition response to the client.
[0103] However, in the current cloud platform, when forwarding the acquisition request to the gateway, it is not necessary to send<d2d_di> However, this resource publishing method of the related technology requires modifying the current request forwarding strategy of the cloud platform, that is, retaining<d2d_di> , resulting in redundancy in cloud processing logic.
[0104] Figure 4 A flowchart of another resource publishing method provided for related technologies, such as Figure 4 As shown, the method may include the following steps:
[0105] S401. The Mediator registers with the Cloud.
[0106] Before executing S401, a step of user registration to the cloud may also be executed. For example, a user on the configurator side may register to the cloud through the configurator.
[0107] S403, the configurator configures the OCF gateway (Cloud Proxy Platform).
[0108] S405. The OCF gateway is registered to the cloud.
[0109] S407, the configurator configures the OCF server device (OCF Server).
[0110] S409, the OCF gateway discovers the OCF server device in the network, the OCF gateway connects to the server device, obtains the device's resources, and the device registers with the OCF gateway.
[0111] S411. The configurator registers the OCF server device on the cloud and obtains the AccessToken of the device.
[0112] S413, the OCF gateway publishes the acquired server device resources to the cloud RD.
[0113] S415. The configurator configures the client to register with the cloud.
[0114] S417: The client obtains resources published on the cloud.
[0115] S419: The client requests the cloud to obtain the resource status of the server device.
[0116] S421. The cloud forwards the request to the OCF gateway to obtain the resource status of the server device.
[0117] S423. The OCF gateway forwards the request to the server device to obtain resource status.
[0118] S425. The server device returns a response to the OCF gateway, the OCF gateway returns a response to the cloud platform, and the cloud platform returns a response to the client.
[0119] The processing flow of the resource publishing method of this solution requires multiple interventions by the configurator, which increases the complexity of user operations.
[0120] Figure 5 A schematic diagram of a resource publishing method provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the method includes:
[0121] S501: A gateway receives a first resource link of a resource to be published sent by a server.
[0122] The resource to be published may be a resource in the server. The server may include one or more resources, for example, the server may include a resource for obtaining temperature, a resource for obtaining brightness, a resource for obtaining the open or closed state of a door, and the like.
[0123] The resource link in the embodiment of the present application can also be described as a resource reference or a resource link or resource link information.
[0124] In one implementation, after discovering the server, the gateway may send acquisition information for acquiring device resources to the server, and then the server sends a response to the gateway, the response including the first resource link. In one implementation, the response may include a / oic / res resource, wherein the / oic / res resource may include the first resource link.
[0125] Taking the resource light as an example, the first resource link may include:
[0126] {
[0127] "anchor":"ocf: / / 550E8400-E29B-41D4-A716-446655440000",
[0128] "href": " / light",
[0129] "rt":["oic.r.swtch.binary"],
[0130] "if":["oic.if.a","oic.if.baseline"]
[0131] }
[0132] Wherein, anchor is an anchor point, indicating the URI of the context. The first link resource may include an anchor attribute, an href attribute, an rt attribute, and an if attribute. The attribute value or attribute information of the anchor attribute is <deviceid>, where deviceId indicates the host device of the target resource. In the first resource link, deviceID is the ID of the server, for example, the ID of the server can be 550E8400-E29B-41D4-A716-446655440000. The attribute value or attribute information of the href attribute is the target URI, that is, the target resource referenced by the Link. In the embodiment of the present application, the target URI is the URI of the resource to be published, for example, in terms of brightness, it can be / light. The attribute value or attribute information of rt is the resource type identifier of the target resource, which is a mandatory attribute. The attribute value or attribute information of if is the interface set supported by the target resource, which is a mandatory attribute.
[0133] In some implementations, the gateway may receive resource links of the resources to be published sent by multiple servers, thereby uploading the resource links of the resources to be published sent by the multiple servers to the cloud platform.
[0134] S503: The gateway determines a second resource link of the resource to be published based on the obtained server identifier and the first resource link of the resource to be published.
[0135] After obtaining the first resource link, the gateway can obtain the identification of the server. In one embodiment, the gateway can obtain the identification of the server (the ID of the server) from the first resource link. In another embodiment, the gateway can obtain the identification of the server by other means, for example, when the gateway is connected to the server, the identification of the server can be obtained, etc. The embodiment of the present application does not limit the method for obtaining the identification of the server.
[0136] In some implementations, the gateway may add the identifier of the server to the first resource link to obtain the second resource link. In other implementations, the gateway may bind the identifier of the server to the first resource link to obtain the second resource link. The embodiment of the present application does not limit the method of obtaining the second resource link, as long as the second resource link is determined based on the first resource link and the identifier of the server.
[0137] In the implementation manner of the present application, the anchor point of the first resource link is the identifier of the server, and the anchor point of the second resource link is the identifier of the gateway. In some implementation manners, after the gateway obtains the first resource link, the anchor point in the first resource link can be modified to the identifier of the gateway to obtain the second resource link.
[0138] S505. The gateway sends a second resource link of the resource to be published to the cloud platform. The second resource link of the resource to be published is used by the cloud platform to publish the resource to be published in the resource directory.
[0139] In some implementations, the cloud platform publishing the resources to be released on the resource directory can be understood as: the cloud platform presenting the resources to be released on the resource directory.
[0140] The anchor of the resource link corresponding to the resource to be published presented in the resource directory is the identifier of the gateway.
[0141] In an embodiment of the present application, the gateway receives a first resource link of a resource to be published sent by a server, and sends a second resource link of the resource to be published to the cloud platform, so that the resource link of the server's resource to be published is forwarded through the gateway. The gateway can publish resources on behalf of the server, thereby ensuring the smoothness of the link during the process of uploading the resource link to the cloud, making the server's resource publishing method reasonable.
[0142] Figure 6 A flow chart of another resource publishing method provided in an embodiment of the present application is as follows: Figure 6 As shown, the method includes:
[0143] S601: A gateway receives a first resource link of a resource to be published sent by a server.
[0144] S603: The gateway determines a second resource link of the resource to be published based on the obtained server identifier and the first resource link of the resource to be published.
[0145] S605. The gateway sends a second resource link of the resource to be published to the cloud platform; the cloud platform receives the second resource link of the resource to be published sent by the gateway.
[0146] S607: The cloud platform determines a third resource link of the resource to be published based on the obtained gateway identifier and the second resource link of the resource to be published.
[0147] After receiving the second resource link of the resource to be released, the cloud platform can obtain the identification of the gateway. In one embodiment, the gateway can obtain the identification of the gateway (the ID of the gateway) from the second resource link. In another embodiment, the cloud platform can obtain the identification of the gateway when the gateway is connected to the cloud platform. In yet another embodiment, the gateway can obtain the identification of the gateway based on the registration and / or login of the gateway to the cloud platform. The embodiment of the present application does not limit the method for how the cloud platform obtains the identification of the gateway.
[0148] In some implementations, the cloud platform may add the identifier of the gateway to the second resource link to obtain the third resource link. In other implementations, the cloud platform may bind the identifier of the gateway to the second resource link to obtain the third resource link. The embodiment of the present application does not limit the method of obtaining the third resource link, as long as the third resource link is determined based on the identifier of the second resource link and the gateway.
[0149] S609: The cloud platform publishes the resource to be published in the resource directory based on the third resource link of the resource to be published.
[0150] The resource directory may be a cloud resource directory (Cloud RD). In some implementations, the cloud platform publishing the to-be-published resource on the resource directory may include: the cloud platform publishing a third resource link of the to-be-published resource on the resource directory.
[0151] The cloud platform publishes the third resource link in the resource directory, so that the cloud platform makes the resources it carries public in the resource directory of the cloud to facilitate remote access to these resources.
[0152] In an embodiment of the present application, since the gateway determines the second resource link of the resource to be published based on the identification of the server and the first resource link of the resource to be published, and the cloud platform determines the third resource link of the resource to be published based on the identification of the gateway and the second resource link of the resource to be published, an implementation method for uploading the resources of the server to the cloud platform through the gateway is provided, so that the resources to be published can be easily uploaded to the cloud through this implementation method.
[0153] See also Figure 7 , Figure 7 A flow chart of another resource publishing method provided in an embodiment of the present application is as follows: Figure 7 As shown, the method includes:
[0154] S701: A gateway receives a first resource link of a resource to be published sent by a server.
[0155] The first resource link of the resource to be published may include an identifier of the resource to be published.
[0156] S703: The gateway adds the server identifier before the identifier of the resource to be published in the first resource link of the resource to be published, and modifies the anchor point of the first resource link to the gateway identifier to obtain a second resource link.
[0157] The second resource link may include: an identifier of the resource to be published, and an identifier of a server preceding the identifier of the resource to be published.
[0158] During the implementation process, the server identifier is added before the identifier of the resource to be published in the first resource link of the resource to be published. Another description method is: the attribute information or attribute value of the href attribute in the first resource link of the resource to be published is modified from the identifier of the resource to be published ( / path) to the identifier of the server ( / ServerID) and the identifier of the resource to be published ( / path) in sequence, thereby obtaining ( / ServerID / path).
[0159] Taking the resource light as an example, the second resource link may include:
[0160] {
[0161] "anchor":"ocf: / / 88B7C7F0-4B51-4E0A-9FAA-CfB439FD7F49",
[0162] "href":" / 550E8400-E29B-41D4-A716-446655440000 / light",
[0163] "rt":["oic.r.swtch.binary"],
[0164] "if":["oic.if.a","oic.if.baseline"]
[0165] }
[0166] The difference between the second resource link and the first resource link is that the attribute value or attribute information of the href attribute of the first resource link is / light, while the attribute value or attribute information of the href attribute of the second resource link is / ServerID / light, and the anchor of the first resource link is ServerID, while the anchor of the second resource link is GatewayID. Among them, / 550E8400-E29B-41D4-A716-446655440000 is the server ID (ServerID), and 88B7C7F0-4B51-4E0A-9FAA-CfB439FD7F49 is the gateway ID (GatewayID).
[0167] S705. The gateway sends a second resource link of the resource to be published to the cloud platform; the cloud platform receives the second resource link of the resource to be published sent by the gateway.
[0168] S707: The cloud platform adds the gateway identifier before the server identifier of the second resource link of the resource to be published, to obtain the third resource link of the resource to be published.
[0169] The third resource link may include: an identifier of the resource to be published, an identifier of a server preceding the identifier of the resource to be published, and an identifier of a gateway preceding the identifier of the server.
[0170] During the implementation process, the gateway identifier is added before the server identifier of the second resource link of the resource to be published. Another description method is: the attribute information or attribute value of the href attribute in the second resource link of the resource to be published is changed from the server identifier ( / ServerID) and the identifier of the resource to be published ( / path) in sequence ( / ServerID / path) to the gateway identifier ( / GatewayID), the server identifier ( / ServerID) and the identifier of the resource to be published ( / path) in sequence ( / GatewayID / ServerID / path).
[0171] Taking the resource light as an example, the third resource link may include:
[0172] {
[0173] "anchor":"ocf: / / 88B7C7F0-4B51-4E0A-9FAA-CfB439FD7F49",
[0174] "href":
[0175] " / 88B7C7F0-4B51-4E0A-9FAA-CfB439FD7F49 / 550E8400-E29B-41D4-A716-446655440000 / light",
[0176] "rt":["oic.r.swtch.binary"],
[0177] "if":["oic.if.a","oic.if.baseline"]
[0178] }
[0179] S709: The cloud platform publishes the resource to be published in the resource directory based on the third resource link of the resource to be published.
[0180] Through S709, the resources to be published are published on the RD of the cloud platform, so that the client can obtain the resources to be published from the RD of the cloud platform. In addition, the client can also use the cloud platform to obtain the status information of the resources to be published.
[0181] S711. The cloud platform receives a third request sent by the client; the third request includes an identifier of the resource to be published, an identifier of the server before the identifier of the resource to be published, and an identifier of the gateway before the identifier of the server.
[0182] S713. The cloud platform deletes the gateway identifier in the third request to obtain the first request.
[0183] S715. The cloud platform sends a first request to the gateway; the gateway receives the first request sent by the cloud platform.
[0184] The first request includes an identifier of a resource to be published and an identifier of a server preceding the identifier of the resource to be published.
[0185] S717: The gateway deletes the server identifier in the first request to obtain a second request.
[0186] S719: Send a second request to the server.
[0187] In some embodiments, the first request, the second request, or the third request may be a retrieve request, which instructs the client to retrieve the status of the resource to be published. For example, the retrieve request is used to obtain the brightness information of the server. In other embodiments, the first request, the second request, or the third request may be an update request, which is used to indicate the update status of the resource to be published. For example, the update request here is used to update the brightness of the server to a specific brightness.
[0188] After receiving the second request, the server may send a response to the gateway. In some embodiments, the response may include or indicate the status of the resource to be published. In other embodiments, the response may include or indicate that the status update of the resource to be published is complete. The gateway then forwards the response to the cloud platform, and the cloud platform forwards the response to the client, so that the client obtains the status of the resource to be published.
[0189] In an embodiment of the present application, since the gateway determines the second resource link of the resource to be published based on the identification of the server and the first resource link of the resource to be published, and the cloud platform determines the third resource link of the resource to be published based on the identification of the gateway and the second resource link of the resource to be published, the resource to be published can be easily uploaded to the cloud, and the request generated by the client can also be easily sent to the server.
[0190] See also Figure 8 , Figure 8 A flow chart of another resource publishing method provided in an embodiment of the present application is as follows: Figure 8 As shown, the method includes:
[0191] S801. The configurator obtains a gateway access token (Gateway Access Token) from the cloud platform.
[0192] Before S801, at least one of the following can be performed: registering the user on the cloud platform, registering and logging the configurator on the cloud platform, and registering and logging the client on the cloud platform. The user can configure the security policies of the gateway and the server so that the two can establish a local secure connection. By registering the user on the cloud platform, the user can configure the device in the resource publishing system, for example, the user can configure the authority to access resources, etc.
[0193] In some implementations, the configurator may send a request to the cloud platform for a user to obtain an access token, and the cloud platform responds to the request and sends the gateway's access token to the configurator.
[0194] S803: The configurator configures the cloud configuration resources of the gateway.
[0195] The cloud configuration resource may be a CoAPCloudConf (CCC) resource, which provides configuration information for the device to connect to the cloud. When configuring the cloud configuration resource of the gateway, the configurator may first obtain the attribute information of the cloud configuration resource, which includes the gateway's access token, cloud URI, and cloud ID. The configurator may configure the cloud configuration resource of the gateway according to the attribute information of the cloud configuration resource.
[0196] S805. The gateway registers and logs in to the cloud platform.
[0197] The gateway can register and log in to the cloud platform based on the attribute information of the CCC resources.
[0198] S807. The gateway discovers the server (D2D Server) and obtains the / oic / res resource of the server, wherein the / oic / res resource includes resource links (Resources links), and the "href" in the resource links is / path.
[0199] The gateway discovers the server, which may be implemented when the server is connected to the network. The gateway obtains the / oic / res resource of the server, which may include: the gateway sends a resource request to the server, and the server responds to the resource request and sends the / oic / res resource to the gateway.
[0200] The / oic / res resource includes the first resource link of the resource to be published. The anchor in the first resource link of the resource to be published is the identifier of the server, and the href (or the URL of the link target) in the first resource link of the resource to be published is the identifier of the resource to be published (for example, / path).
[0201] S809: After the gateway receives the resource responded by the device, the gateway further obtains the ID of the server.
[0202] S811: The gateway modifies the href of the first resource link of the resource to be published to the identifier of the resource to be published and the server identifier (eg, / ServerID / path) before the identifier of the resource to be published.
[0203] Furthermore, the gateway may also modify the attribute value or attribute information of the anchor of the first resource link to the identifier of the gateway.
[0204] Where ServerID is the server ID obtained by the gateway. / path is the "href" value of the first resource link.
[0205] After modifying the href of the first resource link of the resource to be published, a second resource link of the resource to be published is obtained.
[0206] S813. The gateway publishes resources to the cloud platform.
[0207] In some implementations, the gateway publishes the modified resource link to the cloud platform RD.
[0208] S815. The cloud platform RD presents the published resource. The anchor of the published resource link is the gateway ID, and the href of the published resource link is / GatewayID / ServerID / path.
[0209] S817: The user's client discovers the published resource in the cloud and presents the resource to the user.
[0210] S819: The user initiates a RETRIEVE request through the client to query the server resource status. The RETRIEVE request in this step includes / GatewayID / ServerID / path.
[0211] In one implementation, the RETRIEVE request may include the attribute information or attribute value of the href of the third resource link of the resource to be published. For example, the RETRIEVE request may include / GatewayID / ServerID / path.
[0212] S821. After receiving the RETRIEVE request, the cloud platform first removes the gateway identifier ( / GatewayID) in the URI in the RETRIEVE request, finds the gateway corresponding to the GatewayID, and forwards the request to the gateway.
[0213] The RETRIEVE request forwarded by the cloud platform to the gateway may include the attribute information or attribute value of the href of the second resource link of the resource to be published. For example, the RETRIEVE request may include / ServerID / path.
[0214] S823. After receiving the RETRIEVE request, the gateway parses the ServerID and finds the corresponding server according to the ServerID. The RETRIEVE request in this step includes / ServerID / path.
[0215] S825. The gateway removes the ServerID in the request URI.
[0216] S827: The gateway forwards the RETRIEVE request to the server. The RETRIEVE request in this step includes / path.
[0217] The RETRIEVE request in S827 may include the attribute information or attribute value of the href of the first resource link of the resource to be published. For example, the RETRIEVE request may include / path.
[0218] S829. After receiving the request, the server executes it and returns a response with the resource status.
[0219] The server can send a response with the resource status to the gateway, the gateway can send the response with the resource status to the cloud platform, and the cloud platform can send the response with the resource status to the user's client, so that the user can see the resource status of the resources to be released on the client.
[0220] In the application embodiment, after the server is connected to the gateway, the gateway sends the resource address corresponding to the server device to the cloud platform, and the cloud platform uploads the resources, so that the resources can be easily published to the cloud platform through the gateway, and the remote access link can be guaranteed to be smooth.
[0221] Fig. 9 A schematic diagram of a resource publishing method provided in another embodiment of the present application is shown in FIG. Fig. 9 As shown, the method includes:
[0222] S901: A gateway receives a first resource link of a resource to be published sent by a server.
[0223] S903: The gateway establishes a new session between the gateway and the cloud platform based on the obtained server identifier.
[0224] The new session in the embodiment of the present application may be an application layer session, and information may be transmitted between the gateway and the cloud platform through the new session.
[0225] In some implementations, the gateway may register and log in to the cloud platform based on the server's identification, and establish or start a new session.
[0226] S905: The gateway sends a first resource link of the resource to be published to the cloud platform based on the new session.
[0227] In one embodiment, the gateway can save the new session and correspond the new session to the server identifier, so that the session corresponding to the server can be determined based on the server identifier. When the gateway receives multiple server identifiers, different sessions corresponding to different server identifiers can be determined based on the identifier of each server in the multiple server identifiers, so that the first resource link of the to-be-published resource sent by the multiple servers is sent to the cloud platform through the multiple sessions corresponding to the multiple server identifiers.
[0228] In the embodiment of the present application, since a session is established between the gateway and the cloud platform, the gateway and the cloud platform can communicate data with each other, so that the resources to be published can be uploaded to the cloud platform without complicated operations, for example, there is no need to go through the complicated steps of registering sub-devices as in the related art, or there is no need to go through complicated configurations through the configurator.
[0229] Fig.10 A flowchart of a resource publishing method provided in another embodiment of the present application is as follows: Fig.10 As shown, the method includes:
[0230] S1001: A gateway receives a first resource link of a resource to be published sent by a server.
[0231] The anchor point of the first resource link of the resource to be published is the identifier of the server, and the href of the first resource link of the resource to be published is the identifier of the resource to be published.
[0232] In one embodiment, the content of the first resource chain of resources to be published may include:
[0233] {
[0234] "anchor":"ocf: / / 550E8400-E29B-41D4-A716-446655440000",
[0235] "href":" / light",
[0236] "rt":["oic.r.swtch.binary"],
[0237] "if":["oic.if.a","oic.if.baseline"]
[0238] }
[0239] S1003: The gateway establishes a new session between the gateway and the cloud platform based on the obtained server identifier.
[0240] In some implementations, a session may be established in the following manner: the gateway sends an UPDATE request to the session resource " / oic / sec / session" of the cloud platform. After the cloud successfully verifies the request, the cloud responds to the update operation, a new session is established, and data may be exchanged between the gateway and the cloud platform.
[0241] S1005. The gateway sends a first resource link of the resource to be published to the cloud platform based on the new session. The cloud platform receives the first resource link of the resource to be published sent by the gateway based on the new session between the gateway and the cloud platform.
[0242] After a new session is initiated or established, the gateway and the cloud platform can send messages to each other.
[0243] S1007: The cloud platform displays the resource to be published in the resource directory based on the first resource link of the resource to be published.
[0244] In an embodiment of the present application, the gateway can receive the first resource link of the resource to be published sent by the server, and send the first resource link of the resource to be published to the cloud platform through a new session established based on the server identifier, thereby providing a way for the gateway to send the first resource link of the resource to be published to the cloud platform instead of the server, and ensuring the smooth flow of the remote access link.
[0245] Fig.11 A schematic diagram of a resource publishing method provided in another embodiment of the present application is shown in FIG. Fig.11 As shown, the method includes:
[0246] S1101. A gateway receives a first resource link of a resource to be published sent by a server.
[0247] S1103: The gateway determines a new entry based on the server identifier; the new entry may at least include: the server identifier and the cloud configuration resource identifier. In some implementations, the new entry may also include: the resource directory client identifier.
[0248] The cloud configuration resource and / or resource directory client may be a running instance on the gateway.
[0249] In some embodiments, the gateway determines a new entry based on the server identifier, which may include: when the server is determined to be a newly connected device based on the server identifier, generating an identifier of a resource directory client corresponding to the server identifier, and an identifier of a cloud configuration resource corresponding to the server identifier; determining a new entry based on the server identifier, the identifier of the resource directory client, and the identifier of the cloud configuration resource.
[0250] In some implementations, the entry may be Entry, and the data structure of Entry may be<ServerID,RDC,CCC> , that is, Entry:<ServerID,RDC,CCC> .
[0251] The ServerID in Entry is the identifier of the server. The RDC in Entry can be the handle of the resource directory (RD) client, or the RDC in Entry can be the internal identifier of the instance of the RD client running on the gateway. For example, in some embodiments, the value of RDC can be 11111111. The CCC in Entry can be the URI of the CoapCloudConf resource, or the CCC in Entry can be the identifier of the running instance of the cloud configuration resource CoapCloudConf. For example, in some embodiments, the value of CCC can be / light1 / CoapCloudConf.
[0252] In some embodiments, after determining a new entry based on the server identifier, the gateway may further perform the following steps: obtaining a first server list, the first server list including at least one entry; different entries correspond to different server identifiers; adding the new entry to the first server list, obtaining a second server list, and saving the second server list.
[0253] The gateway may store a first server list inside, and the gateway may maintain and / or update the first server list. Each entry in the first server list may include an identifier of a server, an identifier of a resource directory client, and an identifier of a cloud configuration resource. In other embodiments of the present application, each entry in the first server list may include one or two of an identifier of a server, an identifier of a resource directory client, and an identifier of a cloud configuration resource.
[0254] Through the first server list, the gateway can correspond each entry in the first server list to each server, and each entry corresponds to each session, so that the gateway can send the first resource links of the resources to be published sent by different servers to the cloud platform through different sessions, so that the cloud platform can determine the server or server identifier corresponding to the first resource link of the resources to be published through the session.
[0255] The data structure of the new entry may be the same as the data structure of each entry in the first server list. The second server list is obtained by adding the new entry to the first server list. The embodiment of the present application does not limit the implementation method of how the new entry is added to the first server list. For example, the new entry can be added at the beginning, end or middle of the first server list.
[0256] The gateway may also update the second server list, for example, may delete one or at least two entries in the second server list, or may add one or at least two entries to the second server list to obtain a third server list, etc. In other words, the server list stored in the gateway may be continuously updated.
[0257] The gateway can configure the cloud configuration resources in the following ways: the gateway sends a notification message to the configurator; the notification message includes the server identifier and the cloud configuration resource identifier; the server identifier is used by the configurator to determine the attribute information of the cloud configuration resource; the attribute information of the cloud configuration resource is used by the configurator to configure the cloud configuration resource in the gateway corresponding to the identifier of the cloud configuration resource.
[0258] The attribute information of the cloud configuration resource may include: the server's Access Token, the cloud access URI, the cloud universally unique identifier (UUID), the authorization provider name, etc.
[0259] After receiving the notification message sent by the gateway, the configurator can obtain the attribute information of the cloud configuration resource in the following way: the configurator sends a request to the cloud platform to obtain the server's Access Token, the cloud platform returns the server's Access Token to the configurator, and then the configurator determines the attribute information of the cloud configuration resource based on the server's Access Token. Next, the configurator can determine the cloud configuration resource in the gateway that corresponds to the identifier of the cloud configuration resource based on the identifier of the cloud configuration resource, and the configurator sends the attribute information of the cloud configuration resource to the cloud configuration resource.
[0260] In some implementations, the configurator sends attribute information of the cloud configuration resource to the cloud configuration resource, which may include: the configurator sends an update (UPDATE) request to the cloud configuration resource, and the request includes information such as the server's Access Token, cloud access URI, cloud UUID, and authorization provider name.
[0261] S1105. The gateway establishes a new session between the gateway and the cloud platform based on the server identifier and the attribute information of the cloud configuration resource; the new session corresponds to the new entry, and the attribute information of the cloud configuration resource corresponds to the identifier of the cloud configuration resource.
[0262] In some embodiments, the gateway establishes a new session between the gateway and the cloud platform based on the server identification and attribute information of the cloud configuration resources. This can be achieved through the following steps S1107, S1109, and S1111, or can be achieved through the following steps S1107, S1109, S1113, and S1115.
[0263] S1107. The gateway sends a first update request to the cloud platform; the cloud platform receives the first update request sent by the gateway.
[0264] The first update request includes: the server identifier and the attribute information of the cloud configuration resource, the attribute information of the cloud configuration resource includes the access token, and the attribute information of the cloud configuration resource may also include the cloud access URI and the cloud UUID.
[0265] The access token can be obtained in the following way: after receiving the notification message, the configurator sends a token acquisition request to the cloud platform to request the server's access token, and the cloud platform receives the server's token acquisition request sent by the configurator; the cloud platform sends a request response to the configurator, and the request response includes the server's access token; the access token is used by the gateway to establish a new session between the gateway and the cloud platform.
[0266] S1109. The cloud platform sends a first update response to the gateway; the gateway receives the first update response sent by the cloud platform.
[0267] The first update response includes: a user identifier and a new token; the user identifier and the new token are used to instruct the gateway to send a second update request to the cloud platform to establish a new session between the gateway and the cloud platform.
[0268] In some implementations, S1107 and S1109 may be processes for registering the gateway with the cloud platform.
[0269] In some implementations, the gateway may send a first update (UPDATE) request to the account resource " / oic / sec / account" of the cloud platform. The update request may include part or all of the resource attributes of the cloud configuration resources configured in the "oic.r.coapcloudconf" resource, and may also include the server identifier. The account resource of the cloud platform may respond to the first update (UPDATE) request and feedback a first update response to the gateway. The feedback first update response may include the user identifier and the new token. In some embodiments, the feedback first update response may also include the expiration time of the new token, etc.
[0270] The first update request may include:
[0271] UPDATE / oic / sec / account
[0272] {
[0273] "di":"550E8400-E29B-41D4-A716-446655440000",
[0274] "authprovider":"github",
[0275] "accesstoken":"8802f2eaf8b5e147a936"
[0276] }
[0277] The attribute information or attribute value of the di (deviceID) attribute in the first update request is: the identifier of the server or the ID of the server; the accesstoken in the first update request may be an access token.
[0278] The new token and access token in the embodiment of the present application may be different tokens or the same token.
[0279] S1111. The gateway establishes a new session between the gateway and the cloud platform based on the user identifier and the new token.
[0280] The gateway may save the user identification and the new token and associate the user identification and the new token with the new entry.
[0281] The gateway establishes a new session between the gateway and the cloud platform based on the user identifier and the new token, which can be achieved through the following steps S1113 to S1115:
[0282] S1113. The gateway sends a second update request to the cloud platform; the cloud platform receives the second update request sent by the gateway.
[0283] The second update request includes: the server's identifier, the user's identifier, and a new token.
[0284] S1115. The cloud platform sends a second update response to the gateway; the gateway receives the second update response sent by the cloud platform.
[0285] The second update response is used to indicate that the new session is established successfully.
[0286] In some implementations, S1113 to S1115 may be a process for the gateway to log in to the cloud platform.
[0287] In some implementations, the gateway may send a second update (UPDATE) request to the session resource " / oic / sec / session" of the cloud platform. The session resource of the cloud platform sends a second update response to the gateway.
[0288] The second update request may include:
[0289] UPDATE / oic / sec / session
[0290] {
[0291] "di":"550E8400-E29B-41D4-A716-446655440000",
[0292] "uid":"123e4567-e89b-12d3-a456-d6e313b71d9f",
[0293] "accesstoken":"8802f2eaf8b5e147a936",
[0294] "login":true
[0295] }
[0296] The attribute information or attribute value of the di attribute in the second update request is: the server identifier or the server ID; the accesstoken in the second update request is the access token. It should be understood that in other implementations, the accesstoken in the second update request is a new token different from the access token. The uid in the second update request is the user identifier.
[0297] S1117. The gateway sends the first resource link of the resource to be published to the cloud platform based on the new session and the resource directory client corresponding to the identifier of the resource directory client; the cloud platform receives the first resource link of the resource to be published sent by the gateway based on the new session between the gateway and the cloud platform.
[0298] In some implementations, different server identifiers may correspond to different resource directory client identifiers, and the server identifiers may correspond to the resource directory client identifiers one-to-one. In other implementations, the identifier of a resource directory client may correspond to the identifiers of at least two servers. For example, a running instance of a resource directory client may send resource links of resources to be published sent by at least two servers to the cloud platform.
[0299] In some implementations, a resource link of at least two resources to be published sent by a server may be sent to the cloud platform through a running instance of a resource directory client. In other implementations, a resource link of at least two resources to be published sent by a server may be published through at least two running instances of resource directory clients corresponding to the resource links of at least two resources to be published.
[0300] S1119. The cloud platform publishes the resource to be published in the resource directory based on the first resource link of the resource to be published.
[0301] The cloud platform may present the resource to be published based on the first resource link of the resource to be published. In some implementations, the cloud platform may determine the fourth resource link of the resource to be published based on the first resource link of the resource to be published, and upload the fourth resource link of the resource to be published to the RD.
[0302] The anchor point of the first resource link is the identifier of the server, and the href of the first resource link is the identifier of the resource to be published.
[0303] The anchor point of the fourth resource link is the identifier of the server, and the href of the fourth resource link is the identifier of the resource to be published and the identifier of the server before the identifier of the resource to be published.
[0304] For example, the fourth resource link may include:
[0305] {
[0306] "anchor":"ocf: / / 550E8400-E29B-41D4-A716-446655440000",
[0307] "href": / 550E8400-E29B-41D4-A716-446655440000 / light",
[0308] "rt":["oic.r.swtch.binary"],
[0309] "if":["oic.if.a","oic.if.baseline"]
[0310] }
[0311] S1121. The cloud platform receives a first request sent by the client.
[0312] The first request includes an identifier of a resource to be published and an identifier of a server preceding the identifier of the resource to be published.
[0313] The first request includes an identifier of a resource to be published and an identifier of a server preceding the identifier of the resource to be published.
[0314] S1123: The cloud platform deletes the server identifier in the first request, obtains a second request, and determines a new session based on the server identifier.
[0315] The cloud platform may store the correspondence between the new session and the server identifier, so that the cloud platform may determine the new session corresponding to the server identifier based on the server identifier.
[0316] S1125. The cloud platform sends a second request to the gateway based on the new session; the gateway receives the second request sent by the cloud platform based on the new session.
[0317] The second request includes an identifier of the resource to be published.
[0318] S1127: The gateway determines a new entry corresponding to the new session, and determines the identifier of the server from the new entry.
[0319] Since the gateway stores the correspondence between the new session and the new entry, the new entry can be determined based on the new session. In some implementations, the gateway can determine the new entry from the server list stored in the gateway based on the new session. In the implementation process, the entry included in the server list stored here includes the entry included in the second server list. For example, the entry included in the server list stored here can be the same as or different from the entry included in the second server list.
[0320] S1129. The gateway sends a second request to the server corresponding to the identifier of the server.
[0321] S1131. The gateway receives a response sent by the server, where the response includes the resource status of the resource to be published.
[0322] S1133. The gateway forwards the response to the cloud platform.
[0323] S1135. The cloud platform forwards the response to the client.
[0324] In some embodiments, the first request or the second request may be a retrieve request, which instructs the client to retrieve the status of the resource to be published. For example, the retrieve request is used to obtain the brightness information of the server. In other embodiments, the first request or the second request may be an update request, which is used to indicate the update status of the resource to be published. For example, the update request here is used to update the brightness of the server to a specific brightness.
[0325] In an embodiment of the present application, a server list is stored and maintained in the gateway, and each entry in the server list corresponds to each session, so that the gateway can determine the session uniquely corresponding to the server according to the server identifier, and upload the resources to be published on behalf of the server, and can avoid the problems in related technologies such as the trouble of uploading resources to be published or the trouble of the client obtaining the status of resources to be published.
[0326] Fig.12 A flow chart of another resource publishing method provided in another embodiment of the present application is as follows: Fig.12 As shown, the method includes:
[0327] S1201. The server accesses the network and the gateway discovers the device.
[0328] S1203: The gateway obtains device resources.
[0329] In one implementation, the device resource may be a / oic / res resource of the device.
[0330] Here is an excerpt from the / oic / res resource, which contains the link information of a resource (Light):
[0331] {
[0332] "anchor":"ocf: / / 550E8400-E29B-41D4-A716-446655440000",
[0333] "href":" / light",
[0334] "rt":["oic.r.swtch.binary"],
[0335] "if":["oic.if.a","oic.if.baseline"]
[0336] }
[0337] The server ID is 550E8400-E29B-41D4-A716-446655440000.
[0338] S1205: After the gateway receives the resource responded by the device, the gateway further obtains the ID of the server.
[0339] The resource of the response can be a resource link, where the "href" of the resource link is / path.
[0340] S1207: The gateway determines that it is a newly connected device and generates a new RD Client and CCC resource.
[0341] S1209. The gateway adds an entry to the maintained ServerList:<ServerID,RDC,CCC> .
[0342] in,<ServerID,RDC,CCC> Used to maintain the connection between the server, the new RD Client, and the CCC resource. For example, RDC is the handle of the RD client, and its value is 11111111. CCC is the URI of the CoapCloudConf resource, and its value is / light1 / CoapCloudConf. The device connects to the cloud based on the CoapCloudConf resource, and each server A has a corresponding 3C resource.
[0343] S1211. The gateway notifies the configurator that a new device has been discovered, and sends the ServerID and CCC resource URI to the configurator.
[0344] S1213. The configurator obtains the server access token (Server Access Token) from the cloud platform.
[0345] S1215. The configurator uses the obtained AccessToken to configure the CCC resource corresponding to the ServerID.
[0346] S1217. The configurator configures the gateway.
[0347] S1219. The configurator configures the server.
[0348] Through S1217 and S1219, the gateway can access the server resources.
[0349] S1221. The gateway uses the configured AccessToken to register with the cloud platform with di=ServerID.
[0350] The cloud platform returns the user ID and a new AccessToken, which the gateway saves and associates with the entry added to the ServerList: <550E8400-E29B-41D4-A716-446655440000,11111111, / light1 / CoapCloudConf>.
[0351] S1223. After successful registration, the gateway logs in to the cloud platform with di=ServerID and establishes a new session.
[0352] The session is mapped to the entry added to ServerList: <550E8400-E29B-41D4-A716-446655440000,11111111, / light1 / CoapCloudConf>.
[0353] S1225. The gateway's RD Client (11111111) publishes the acquired server resource link to the cloud RD.
[0354] S1227. Present the Server resource in the RD of the cloud platform; wherein the "anchor" of the resource link is ServerID, and the "href" of the resource link is / ServerID / path.
[0355] S1229. The user client discovers the published resources on the cloud platform and presents the resources to the user.
[0356] S1231. The user initiates a request (RETRIEVE request) through the client to query the server resource status; the request in this step may include: / ServerID / path.
[0357] For example, the request in this step may include: RETRIEVE / 550E8400-E29B-41D4-A716-446655440000 / light
[0358] S1233. After receiving the request, the cloud platform first removes / ServerID from the request URI, finds the session corresponding to ServerID, and forwards the request (RETRIEVE request) to the OCF gateway; the RETRIEVE request in this step may include / path.
[0359] For example, the request forwarded to the OCF gateway in this step may include: RETRIEVE / light
[0360] S1235. After receiving the request, the gateway finds the entry: <550E8400-E29B-41D4-A716-446655440000,11111111, / light1 / CoapCloudConf> according to the session.
[0361] S1237. The gateway finds the corresponding server according to the ServerID in the Entry.
[0362] S1239. The gateway forwards the request (RETRIEVE request) to the server; the request in this step may include / path.
[0363] For example, the request forwarded to the server in this step may include: / light.
[0364] S1241. After receiving the request, the server executes it and returns a response with resource status.
[0365] In the present application example, by mapping the server device ID to the cloud session, the gateway can publish resources on behalf of the device while maintaining the correspondence between the cloud resources and the server, thereby ensuring the smooth flow of the remote access link.
[0366] Based on the foregoing embodiments, an embodiment of the present application provides a resource publishing device, which includes the various units included and the various modules included in the units, which can be implemented by a processor in the device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0367] Fig.13 A schematic diagram of the composition structure of a resource publishing device provided in an embodiment of the present application is shown in FIG. Fig.13 As shown, the resource publishing device 1300 includes:
[0368] The first resource link sending unit 1301 is used to receive a first resource link of a resource to be published sent by a server;
[0369] A second resource link determining unit 1302, configured to determine a second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published;
[0370] The second resource link sending unit 1303 is used to send the second resource link of the resource to be published to the cloud platform; the second resource link of the resource to be published is used by the cloud platform to publish the resource to be published in the resource directory.
[0371] In some embodiments, the first resource link of the resource to be published includes an identifier of the resource to be published;
[0372] The second resource link determining unit 1302 is further configured to add the identifier of the server before the identifier of the resource to be published in the first resource link of the resource to be published, and modify the anchor point of the first resource link to the identifier of the gateway to obtain the second resource link.
[0373] In some embodiments, the resource publishing device 1300 further includes:
[0374] A first request receiving unit 1304 is configured to receive a first request sent by the cloud platform; the first request includes an identifier of the resource to be published and an identifier of the server before the identifier of the resource to be published;
[0375] The second request sending unit 1305 is used to delete the server identifier in the first request to obtain a second request; send the second request to the server; wherein the first request or the second request is used to instruct the client to obtain the status of the resource to be published.
[0376] Fig.14 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application, such as Fig.14 As shown, the resource publishing device 1400 includes:
[0377] The second resource link receiving unit 1401 is used to receive the second resource link of the resource to be published sent by the gateway;
[0378] A third resource link determining unit 1402, configured to determine a third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published;
[0379] The publishing unit 1403 is configured to publish the resource to be published in the resource directory based on the third resource link of the resource to be published.
[0380] In some embodiments, the anchor point of the second resource link is the identifier of the gateway, and includes the identifier of the resource to be published, and the identifier of the server before the identifier of the resource to be published;
[0381] The third resource link determining unit 1402 is further configured to add the gateway identifier before the server identifier of the second resource link of the to-be-published resource to obtain the third resource link of the to-be-published resource.
[0382] In some embodiments, the resource publishing device 1400 further includes:
[0383] A third request receiving unit 1404 is used to receive a third request sent by the client; the third request includes the identifier of the resource to be published, the identifier of the server before the identifier of the resource to be published, and the identifier of the gateway before the identifier of the server;
[0384] The first request sending unit 1405 is configured to delete the identifier of the gateway in the third request to obtain a first request; and send the first request to the gateway;
[0385] The first request or the third request is used to instruct the client to obtain the status of the resource to be published.
[0386] Fig.15 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application is shown in FIG. Fig.15 As shown, the resource publishing device 1500 includes:
[0387] The first resource link receiving unit 1501 is used to receive a first resource link of a resource to be published sent by a server;
[0388] A session establishing unit 1502, configured to establish a new session between the gateway and the cloud platform based on the obtained identifier of the server;
[0389] The first resource link sending unit 1503 is configured to send the first resource link of the to-be-published resource to the cloud platform based on the new session.
[0390] In some embodiments, the session establishing unit 1502 is also used to determine a new entry based on the identifier of the server; the new entry includes: the identifier of the server and the identifier of the cloud configuration resource; based on the identifier of the server and the attribute information of the cloud configuration resource, the new session between the gateway and the cloud platform is established; the new session corresponds to the new entry, and the attribute information of the cloud configuration resource corresponds to the identifier of the cloud configuration resource.
[0391] In some embodiments, the new entry further includes: an identification of the resource directory client;
[0392] The first resource link sending unit 1503 is further configured to send the first resource link of the to-be-published resource to the cloud platform based on the new session and the resource directory client corresponding to the identifier of the resource directory client.
[0393] In some embodiments, the session establishing unit 1502 is also used to generate an identifier of the resource directory client corresponding to the identifier of the server and an identifier of the cloud configuration resource corresponding to the identifier of the server when the server is determined to be a newly connected device based on the identifier of the server; and determine the new entry based on the identifier of the server, the identifier of the resource directory client and the identifier of the cloud configuration resource.
[0394] In some embodiments, the resource publishing device 1500 also includes: a list maintenance unit 1504, used to obtain a first server list, the first server list includes at least one entry; different entries correspond to different server identifiers; add the new entry to the first server list, obtain the second server list, and save the second server list.
[0395] In some embodiments, the notification message sending unit 1505 is used to send a notification message to the configurator; the notification message includes an identifier of the server and an identifier of the cloud configuration resource; the identifier of the server is used by the configurator to determine the attribute information of the cloud configuration resource; the attribute information of the cloud configuration resource is used by the configurator to configure the cloud configuration resource in the gateway corresponding to the identifier of the cloud configuration resource.
[0396] In some embodiments, the session establishment unit 1502 is also used to send a first update request to the cloud platform, the first update request including: the identification of the server and the attribute information of the cloud configuration resources; receive a first update response sent by the cloud platform, the first update response including: the user identification and the new token; based on the user identification and the new token, establish the new session between the gateway and the cloud platform.
[0397] In some embodiments, the associating unit 1506 is used to save the user identifier and the new token, and associate the user identifier and the new token with the new entry.
[0398] In some embodiments, the session establishment unit 1502 is also used to send a second update request to the cloud platform, the second update request including: the server identifier, the user identifier and the new token; and receive a second update response sent by the cloud platform, the second update response being used to indicate that the new session is successfully established.
[0399] In some embodiments, the resource publishing device 1500 further includes:
[0400] A second request receiving unit 1507 is configured to receive a second request sent by the cloud platform based on the new session; the second request includes an identifier of the resource to be published;
[0401] The second request sending unit 1508 is used to determine the new entry corresponding to the new session, determine the identifier of the server from the new entry, and send the second request to the server corresponding to the identifier of the server.
[0402] Fig.16 A schematic diagram of the composition structure of another resource publishing device provided in an embodiment of the present application is shown in FIG. Fig.16 As shown, the resource publishing device 1600 includes:
[0403] A first resource link receiving unit 1601 is configured to receive a first resource link of a to-be-published resource sent by the gateway based on a new session between the gateway and the cloud platform;
[0404] The publishing unit 1602 is configured to publish the resource to be published in a resource directory based on the first resource link of the resource to be published.
[0405] In some embodiments, the resource publishing device 1600 also includes: an access token acquisition unit 1603, which is used to receive a token acquisition request from the server sent by the configurator; send a request response to the configurator, and the request response includes the access token of the server; the access token is used by the gateway to establish a new session between the gateway and the cloud platform.
[0406] In some embodiments, the resource publishing device 1600 also includes: an account unit 1604, used to receive a first update request sent by the gateway, the first update request includes: the identification of the server and the attribute information of the cloud configuration resource, the attribute information of the cloud configuration resource includes the access token; send a first update response to the gateway, the first update response includes: a user identification and a new token; the user identification and the new token are used to instruct the gateway to send a second update request to the cloud platform to establish a new session between the gateway and the cloud platform.
[0407] In some embodiments, the resource publishing device 1600 also includes: a session unit 1605, used to receive a second update request sent by the gateway, the second update request includes: the server identifier, the user identifier and the new token; send a second update response to the gateway, the second update response is used to indicate that the new session is successfully established.
[0408] In some embodiments, the resource publishing device 1600 further includes:
[0409] A first request receiving unit 1606 is configured to receive a first request sent by a client; the first request includes an identifier of the resource to be published and an identifier of the server before the identifier of the resource to be published;
[0410] The second request sending unit 1607 is configured to send the second request to the gateway based on the new session.
[0411] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0412] It should be noted that in the embodiment of the present application, if the above-mentioned resource publishing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0413] Fig.17 A schematic diagram of a hardware entity of a gateway provided in an embodiment of the present application, such as Fig.17 As shown, the hardware entity of the gateway 1700 includes: a processor 1701 and a memory 1702, wherein the memory 1702 stores a computer program that can be run on the processor 1701, and the processor 1701 executes the program to implement Figures 3 to 12 The steps in the method executed by the gateway of any embodiment.
[0414] Fig.18 A schematic diagram of a hardware entity of a cloud platform provided in an embodiment of the present application, such as Fig.18 As shown, the hardware entity of the cloud platform 1800 includes: a processor 1801 and a memory 1802, wherein the memory 1802 stores a computer program that can be run on the processor 1801, and the processor 1801 executes the program to implement Figures 3-4 , steps in the method executed by the cloud platform of the embodiments corresponding to 6~8, 10~12.
[0415] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the method executed by the gateway in the above method.
[0416] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the method executed by the cloud platform in the above method.
[0417] Fig.19 It is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Fig.19 The chip 1900 shown includes a processor 1901, which can call and run a computer program from a memory 1902 to implement the steps of the method executed by the gateway / cloud platform in the embodiment of the present application.
[0418] Alternatively, if Fig.19 As shown, the chip 1900 may further include a memory 1902. The processor 1901 may call and run a computer program from the memory 1902 to implement the steps of the method executed by the gateway / cloud platform in the embodiment of the present application.
[0419] The memory 1902 may be a separate device independent of the processor 1901 , or may be integrated into the processor 1901 .
[0420] Optionally, the chip 1900 may further include an input interface 1903. The processor 1901 may control the input interface 1903 to communicate with other devices or chips, and specifically, may obtain information or data sent by other devices or chips.
[0421] Optionally, the chip 1900 may further include an output interface 1904. The processor 1901 may control the output interface 1904 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.
[0422] Optionally, the chip can be applied to the network device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the network device in each method of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0423] Optionally, the chip can be applied to the gateway / cloud platform in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the gateway / cloud platform in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0424] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0425] An embodiment of the present application provides a computer program product, which includes a computer storage medium, the computer storage medium stores computer program code, and the computer program code includes instructions that can be executed by at least one processor. When the instructions are executed by at least one processor, the steps of the method executed by the gateway / cloud platform in the above method are implemented.
[0426] Optionally, the computer program product can be applied to the gateway / cloud platform in the embodiments of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the gateway / cloud platform in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.
[0427] It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and performed. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0428] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0429] It should be understood that "one embodiment" or "an embodiment" or "an embodiment of the present application" or "the aforementioned embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "an embodiment of the present application" or "the aforementioned embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0430] Unless otherwise specified, the gateway / cloud platform executes any step in the embodiments of the present application, and the processor of the gateway / cloud platform may execute the step. Unless otherwise specified, the embodiments of the present application do not limit the order in which the gateway / cloud platform executes the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be independently executed by the gateway / cloud platform, that is, when the gateway / cloud platform executes any step in the following embodiments, it may not rely on the execution of other steps.
[0431] In the several embodiments provided in the present application, it should be understood that the disclosed gateway / cloud platform and method can be implemented in other ways. The gateway / cloud platform embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of resource devices or units can be electrical, mechanical or other forms.
[0432] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0433] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0434] The features disclosed in the several method or gateway / cloud platform embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or gateway / cloud platform embodiments.
[0435] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage resource devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0436] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling the gateway / cloud platform to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage resource devices, ROM, magnetic disks or optical disks.
[0437] In the embodiments of the present application, the descriptions of the same steps and the same contents in different embodiments can refer to each other. In the embodiments of the present application, the term "and" does not affect the order of the steps. For example, the gateway / cloud platform executes A and executes B, which may be the case that the gateway / cloud platform executes A first and then executes B, or the gateway / cloud platform executes B first and then executes A, or the gateway / cloud platform executes A and B at the same time.
[0438] It should be understood that in the present application, A included in a message means that A is present in the message. A indicated in a message means that the message includes the identifier of A, so that A can be obtained based on the identifier of A. It should be understood that when different resource devices execute the same steps, the execution method can be the same.
[0439] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0440] Industrial Applicability
[0441] The embodiments of the present application provide a resource publishing method, device, gateway, cloud platform and computer storage medium. By adopting the resource publishing scheme in the present application, the gateway can publish resources instead of the server, thereby ensuring the smoothness of the link during the process of uploading the resource link to the cloud, making the server's resource publishing method reasonable.< / deviceid>
Claims
1. A resource publishing method, comprising: The gateway receives the first resource link of the resource to be published sent by the server; Determine a second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published; Sending a second resource link of the resource to be published to the cloud platform; the second resource link of the resource to be published is used by the cloud platform to publish the resource to be published on the resource directory; Wherein, the first resource link of the resource to be published includes the identifier of the resource to be published; The method of determining the second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published includes: adding the identifier of the server before the identifier of the resource to be published in the first resource link of the resource to be published, and modifying the anchor point of the first resource link to the identifier of the gateway to obtain the second resource link.
2. The method according to claim 1, wherein: After sending the second resource link of the resource to be published to the cloud platform, the method further includes: Receiving a first request sent by the cloud platform; the first request includes an identifier of the resource to be published and an identifier of the server before the identifier of the resource to be published; Deleting the server identifier in the first request to obtain a second request; The second request is sent to the server.
3. A resource publishing method, comprising: The cloud platform receives the second resource link of the resource to be published sent by the gateway; Determine a third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published; Based on the third resource link of the resource to be published, publishing the resource to be published on the resource directory; The anchor point of the second resource link is the identifier of the gateway, and includes the identifier of the resource to be published and the identifier of the server before the identifier of the resource to be published; Determining the third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published includes: adding the identifier of the gateway before the server identifier of the second resource link of the resource to be published to obtain the third resource link of the resource to be published.
4. The method according to claim 3, wherein: The third resource link based on the resource to be published, after publishing the resource to be published on the resource directory, further comprises: receiving a third request sent by a client; the third request including an identifier of the resource to be published, an identifier of the server preceding the identifier of the resource to be published, and an identifier of the gateway preceding the identifier of the server; Deleting the identifier of the gateway in the third request to obtain a first request; The first request is sent to the gateway.
5. A resource publishing device, comprising: A first resource link sending unit, configured to receive a first resource link of a resource to be published sent by a server; A second resource link determining unit, configured to determine a second resource link of the resource to be published based on the obtained identifier of the server and the first resource link of the resource to be published; A second resource link sending unit is used to send a second resource link of the resource to be published to the cloud platform; the second resource link of the resource to be published is used by the cloud platform to publish the resource to be published on the resource directory; The first resource link of the resource to be published includes an identifier of the resource to be published; and The second resource link determining unit is further configured to add the identifier of the server before the identifier of the resource to be published of the first resource link of the resource to be published, and modify the anchor point of the first resource link to the identifier of the gateway to obtain the second resource link.
6. A resource publishing device, comprising: A second resource link receiving unit, configured to receive a second resource link of a to-be-published resource sent by a gateway; A third resource link determining unit, configured to determine a third resource link of the resource to be published based on the obtained identifier of the gateway and the second resource link of the resource to be published; A publishing unit, configured to publish the resource to be published on a resource directory based on a third resource link of the resource to be published; The anchor point of the second resource link is the identifier of the gateway, and includes the identifier of the resource to be published and the identifier of the server before the identifier of the resource to be published; The third resource link determining unit is further configured to add the gateway identifier before the server identifier of the second resource link of the resource to be published, so as to obtain the third resource link of the resource to be published.
7. A gateway, comprising: Memory and processor, The memory stores a computer program executable on the processor. When the processor executes the program, the steps in the method of claim 1 or 2 are implemented.
8. A cloud platform comprising: a memory and a processor, the memory storing a computer program executable on the processor, When the processor executes the program, the steps in the method of claim 3 or 4 are implemented.
9. A computer storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the steps in the method of claim 1 or 2, or to implement the steps in the method of claim 3 or 4.
10. A chip, comprising: A processor, used to call and run a computer program from a memory so that a device equipped with the chip executes the steps in the method as claimed in claim 1 or 2, or a device equipped with the chip executes the steps in the method as claimed in claim 3 or 4.
