WO2020220272A1 - 更改资源状态的方法、系统、终端及存储介质 - Google Patents
更改资源状态的方法、系统、终端及存储介质 Download PDFInfo
- Publication number
- WO2020220272A1 WO2020220272A1 PCT/CN2019/085216 CN2019085216W WO2020220272A1 WO 2020220272 A1 WO2020220272 A1 WO 2020220272A1 CN 2019085216 W CN2019085216 W CN 2019085216W WO 2020220272 A1 WO2020220272 A1 WO 2020220272A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- resource
- leaf node
- resources
- link information
- request
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/82—Miscellaneous aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/78—Architectures of resource allocation
- H04L47/782—Hierarchical allocation of resources, e.g. involving a hierarchy of local and centralised entities
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16Y—INFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
- G16Y10/00—Economic sectors
- G16Y10/75—Information technology; Communication
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16Y—INFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
- G16Y10/00—Economic sectors
- G16Y10/80—Homes; Buildings
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/80—Actions related to the user profile or the type of traffic
- H04L47/803—Application aware
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/82—Miscellaneous aspects
- H04L47/822—Collecting or measuring resource availability data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
Definitions
- This application relates to the field of smart homes, and in particular to a method, system, terminal and storage medium for changing the state of resources.
- IoT Internet of Things
- a smart home system needs to control all devices in the system.
- the controlled devices are all in the position of leaf nodes.
- the higher-level device transmits the control request layer by layer through the established network until all controlled devices receive the control request and respond Should be requested.
- the embodiments of the present application provide a method, system, terminal, and storage medium for changing the state of a resource.
- the technical solution is as follows:
- a system for changing the state of resources includes a first collective resource, a first intermediate-level resource, m second intermediate-level resources, and n leaf node resources.
- the first collective resource is directly linked to The first middle-level resource and/or directly link n1 of the leaf node resources, the first middle-level resource links m second middle-level resources and/or the link n-n1 leaf node resources, m is Natural number, n is a positive integer, n1 is a natural number not greater than n; in the system that changes the resource state:
- the first set of resources is used to generate a second request according to the link information acquisition interface when the first request sent by the client is received, and the first request is used to instruct the operation of changing the state of the leaf node resource ,
- the link information obtaining interface is used to obtain link information of the corresponding resource;
- the first set of resources are used to send the second request to the first middle-level resource
- the first middle-level resource is used to obtain link information of the leaf node resource when the second request is received;
- the first middle-level resource is used to send link information of the leaf node resource to the first collection resource
- the first set of resources is used to generate a third request according to the link information of the leaf node resource, the third request includes that the state change interface is the default interface of the leaf node resource, and the state change interface Used to change the state of the leaf node resource;
- the first set of resources are used to send the third request to the leaf node resources.
- a method for changing the state of a resource is provided, which is applied to a first collection of resources.
- the first collection of resources is directly linked to a first intermediate-level resource and/or directly linked to n1 leaf node resources.
- the middle-level resource links m second middle-level resources and/or links n-n1 of the leaf node resources, m is a natural number, n is a positive integer, and n1 is a natural number not greater than n.
- the method includes:
- a second request is generated according to the link information acquisition interface.
- the first request is used to instruct the leaf node resource to perform an operation to change the state
- the second request is used to obtain all Link information of the leaf node resource
- the link information acquisition interface is used to acquire the link information of the resource corresponding to the link information acquisition interface;
- a third request is generated according to the link information of the leaf node resource.
- the third request includes a state change interface, and the state The change interface is the default interface of the leaf node resource and is used to change the state of the leaf node resource;
- a method for changing the state of a resource is provided, which is applied to a first middle-level resource.
- the first set of resources directly link the first middle-level resource and/or directly link n1 leaf node resources.
- a middle-level resource links m second middle-level resources and/or links n-n1 of the leaf node resources, m is a natural number, n is a positive integer, and n1 is a natural number not greater than n.
- the method includes:
- the link information of the leaf node resource is obtained.
- the second request is a request generated by the link information obtaining interface when the first set of resources receives the first request sent by the client.
- the link information obtaining interface is used to obtain link information of the resource corresponding to the link information obtaining interface;
- the link information of the leaf node resource is sent to the first collection resource, and the link information of the leaf node resource is used to instruct the first collection resource to generate a third request, and the third request includes a state change interface ,
- the state change interface is the default interface of the leaf node resource, and is used to change the state of the leaf node resource.
- a device for changing the state of a resource which is applied to a first collection of resources.
- the first collection of resources is directly linked to a first intermediate-level resource and/or directly linked to n1 leaf node resources.
- the middle-level resource links m second middle-level resources and/or links n-n1 leaf node resources, and the device includes:
- the first generation module is configured to generate a second request according to the link information acquisition interface when the first request sent by the client is received, and the first request is used to instruct the leaf node resource to perform the operation of changing the state, the The second request is used to obtain the link information of the leaf node resource, and the link information obtaining interface is used to obtain the link information of the resource corresponding to the link information obtaining interface;
- a first sending module configured to send the second request to the first middle-level resource
- the second generating module is configured to generate a third request according to the link information of the leaf node resource when receiving the link information of the leaf node resource sent by the first middle-level resource, and the third request includes A state change interface, where the state change interface is the default interface of the leaf node resource and is used to change the state of the leaf node resource;
- the second sending module is configured to send the third request to the leaf node resource.
- a device for changing the state of resources is provided, which is applied to a first intermediate-level resource.
- the first set of resources directly link the first intermediate-level resource and/or directly link n1 leaf node resources.
- a middle-level resource links m second middle-level resources and/or links n-n1 leaf node resources, m is a natural number, n is a positive integer, and n1 is a natural number not greater than n.
- the device includes:
- the information acquisition module is configured to acquire the link information of the leaf node resource when a second request is received.
- the second request is that the first collection of resources receives the first request sent by the client according to the link A request generated by an information obtaining interface, where the link information obtaining interface is used to obtain link information of a resource corresponding to the link information obtaining interface;
- the third sending module is configured to send the link information of the leaf node resource to the first set of resources, and the link information of the leaf node resource is used to instruct the first set of resources to generate a third request, and the first set of resources
- the three requests include a state change interface, which is the default interface of the leaf node resource and is used to change the state of the leaf node resource.
- a terminal in another aspect, includes a processor and a memory, and at least one instruction is stored in the memory.
- the instruction is loaded and executed by the processor to implement the application provided by the embodiment of the present application.
- a terminal in another aspect, includes a processor and a memory, and at least one instruction is stored in the memory.
- the instruction is loaded and executed by the processor to implement the application provided by the embodiment of the present application.
- the method of changing the resource state in the first middle-level resource is provided.
- a computer-readable storage medium is provided, and at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement a method for changing a resource state applied to a first set of resources.
- a computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by a processor to implement a method for changing a resource state applied in a first intermediate-level resource.
- This embodiment can build a system that includes the first set of resources, the first middle-level resources, and the leaf node resources to change the resource state.
- the first set of resources can obtain the link information of the leaf node resources from the first intermediate level resource when the client needs to control the leaf node resources, thereby determining the default interface of the leaf node resources.
- the first set of resources can generate a third request, and the state change interface in the third request is the default interface of the leaf node resource.
- the third request received by the leaf node resource is an interface that the leaf node resource can call, which avoids changing the first set of resources
- the control request is directly sent to the leaf node resources layer by layer, resulting in the problem that the interface in the control request is not the default interface of the leaf node resource. Therefore, the present application enables the control request issued by the client to be recognized and executed by each leaf node resource, which improves the reliability and stability of the control system.
- FIG. 1 is a schematic diagram of a link relationship between resources provided by an embodiment of the present application
- FIG. 2 is a schematic diagram of another link relationship between resources provided by an embodiment of the present application.
- FIG. 3 is a system architecture diagram for changing the state of resources disclosed in an embodiment of the present application.
- FIG. 4 is a flowchart of a method for changing the state of a resource provided by an embodiment of the present application
- FIG. 5 is a flowchart of another method for changing the state of a resource provided by an embodiment of the present application.
- FIG. 6 is a schematic diagram of a model in a smart home system provided by an embodiment of the present application.
- FIG. 7 is an interaction diagram of an application scenario for changing resource status provided by an embodiment of the present application.
- FIG. 8 is an interaction diagram of another application scenario for changing the state of a resource provided by an embodiment of the present application.
- Fig. 9 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application.
- FIG. 10 shows a structural block diagram of an apparatus for changing a resource state provided by an exemplary embodiment of the present application
- Fig. 11 shows a structural block diagram of an apparatus for changing a resource state provided by an exemplary embodiment of the present application.
- a smart home system based on REST (English: Representational State Transfer, Chinese: Representational State Transfer) architecture can describe things or devices in the network as resources. It can be seen that the things or devices in this architecture are relatively easy to control, making the REST architecture a widely chosen architecture for smart home system designers.
- REST Simple: Representational State Transfer
- the system, method, device, terminal, and storage medium for changing the resource state disclosed in this application can all be applied in the REST architecture.
- CURDN may specifically be Create (Chinese: Create), Update (Chinese: Modify), retrieve (Chinese: Get), Delete (Chinese: Delete), Notification (Chinese: Notification). It should be noted that CURDN is the basic operation type of the REST architecture.
- a collection (English: collection) resource is defined in the process of resource description.
- a collective resource can include multiple linked resources (English: linked resources). It should be noted that a resource can be both a link resource and a collection resource, or only a link resource, or only a collection resource.
- the resource may be a linked collection resource (English: linked collection), and the linked collection resource is both a linked resource and a collection resource.
- a request includes: operation method + operation target + operation means.
- the foregoing operation method may be at least one of CURDN operations.
- the operation target can be the address of the resource in the network, such as URI (English: Uniform Resource Identifier, Chinese: Uniform Resource Identifier).
- the operation means can be an interface type, which can also be called an interface attribute (English: interface).
- each resource has its own list of supported interfaces when it is designed for networking.
- the interface list there are default interfaces supported by the resource correspondence.
- the list of supported interfaces is as follows:
- the interfaces that resource R1 can support include A interface, B interface and C interface.
- the resource R1 can call the relevant interface correctly and complete the corresponding operation.
- resource R1 will call the default interface to perform the corresponding operation.
- the resource R1 will return an error indication, so that the resource sending the related request or the resource R1 cannot correctly execute the related request.
- the first collection of resources can, when receiving a request including a batch interface (Chinese: batch interface), use the number of leaf node resources linked to the first collection of resources.
- the request is broken down into a corresponding number of subrequests. Send the decomposed sub-request to the leaf node resource, and hope that the leaf node resource will successfully perform the operation corresponding to the request after receiving the decomposed sub-request.
- an operation method for collective resources can be implemented.
- a batch processing (English: batch) request is received, the batch operation request is requested according to the number of linked collective resources (English: linked colletcion)
- the fourth request calls the target interface, the target interface is used to obtain the link information of the resource contained in the link collection resource;
- the link list (English: link list) returned by the link collection resource is received, it sends the link list to the non-collection resource
- a fifth request is sent, and the fifth request is used to instruct the aforementioned non-collective resource to perform a corresponding operation.
- the corresponding operation is an operation of changing a non-collective resource.
- the target interface is a link list processing interface (English: link list interface; abbreviation: oic.if.ll).
- link information is information describing link resources
- the link information includes interface information, resource identifiers, and resource types.
- the link information includes state attribute information.
- the state attribute information is information describing the state of the device, for example, the state attribute information can be the on state of the lamp or the off state of the lamp.
- the first set of resources can modify the state attribute to operate the device corresponding to the leaf node resource.
- the target interface is a batch link list processing interface (English: batch link list interface; abbreviation: oic.if.bll).
- oic.if.bll the role of the oic.if.bll interface is to obtain the link information of the leaf node.
- the interface included in the fifth request is the default interface (English: default interface) of the aforementioned non-aggregated resource.
- FIG. 1 is a schematic diagram of a link relationship between resources provided by an embodiment of the present application.
- the resources involved in the system for changing the resource state disclosed in the present application can be linked according to the link relationship shown in FIG. 1.
- FIG. 1 includes a first collective resource 120, a first middle-level resource 140, and a leaf node resource 160.
- the system for changing the state of resources in the embodiment of the present application includes a first set of resources, a first middle-level resource, m second middle-level resources, and n leaf node resources.
- m is 0, n is 3, and n1 is 0. That is, the first collective resource 120 directly links two first middle-level resources 140, and the first middle-level resource 140 links three leaf node resources.
- the meaning of link includes direct link and nested link. In Figure 1, the meaning of link refers to direct link.
- the first set of resources 120 includes a first middle-level resource 140.
- the first collective resource 120 when the first collective resource 120 includes the first intermediate-level resource 140, the first collective resource 120 is directly linked to the first intermediate-level resource 140.
- the first set of resources 120 may include at least one first middle-level resource 140.
- the first middle-level resource 140 includes a leaf node resource 160.
- the first intermediate level resource 140 directly links the leaf node resource 160.
- the first middle-level resource 140 may link at least one leaf node resource 160.
- the resources used by the system that changes the resource state form a three-level link relationship from the first collective resource 120 to the first middle-level resource 140 to the leaf node resource 160.
- the first collection resource 120 is nested to link the leaf node resource 160.
- FIG. 2 is a schematic diagram of another link relationship between resources provided by an embodiment of the present application.
- the resources involved in the system for changing the resource state disclosed in the present application can be linked according to the link relationship shown in FIG. 1.
- Figure 2 includes a first set of resources 120, a first middle-level resource 142, a first middle-level resource 144, a second middle-level resource 146, a second middle-level resource 148, a leaf node resource 162, a leaf node resource 164, and a leaf node resource 166 and leaf node resources 168.
- the system for changing the state of resources in the embodiment of the present application includes a first set of resources, a first middle-level resource, m second middle-level resources, and n leaf node resources.
- m is 2
- n is 4, and n1 is 0. That is, the first collective resource 120 directly links the two first middle-level resources 142 and the first middle-level resource 144, and the first middle-level resource 142 and the first middle-level resource 144 link a total of 4 leaf node resources.
- first middle-level resource 142 or the first middle-level resource 144 under the first middle-level resource 142 or the first middle-level resource 144, other second middle-level resources except the second middle-level resource 146 and the second middle-level resource 148 can be nested and linked. Hierarchical resources, and/or, nested links other leaf nodes to form a multi-level nested system with the first combined resource as the root node.
- the embodiment of the present application relates to the levels that the system may include and the leaf nodes included in each level There is no restriction on the number of resources and the second middle-level resources.
- the relationship of direct links is as follows.
- the first collective resource 120 directly links the first intermediate-level resource 142, and the first collective resource 120 directly links the first intermediate-level resource 144.
- the first middle-level resource 142 directly links to the second middle-level resource 146.
- the first middle-level resource 144 directly links the second middle-level resource 148.
- the second middle-level resource 146 directly links the leaf node resource 162 and directly links the leaf node resource 164.
- the second middle-level resource 148 directly links the leaf node resource 166 and directly links the leaf node resource 168.
- the relationship of nested links is as follows.
- the nested links of the first set of resources 120 include: second middle-level resource 146, second middle-level resource 148, leaf node resource 162, leaf node resource 164, leaf node Resources 166 and leaf node resources 168.
- the nested links of the first middle-level resources 142 include: leaf node resources 162 and leaf node resources 164.
- the nested links of the first middle-level resources 144 include: leaf node resources 166 and leaf node resources 168.
- FIG. 3 is a system architecture diagram for changing the resource state disclosed in an embodiment of the present application.
- the system for changing the state of resources includes a first set of resources 120, a first middle-level resource 140, and a leaf node resource 160.
- client an instruction from the client (English: client)
- it triggers the system to perform the operation of changing the resource state, as detailed below:
- Step 310 When the first request sent by the client is received, the first collection resource generates a second request according to the link information acquisition interface.
- the first collective resource may be a collective resource including multiple first intermediate-level resources.
- the first set of resources may be physical devices or things that link multiple subordinate resources. For example, for a family resource in a smart home system, the family resource as a whole is a first set of resources.
- the first set of resources can receive the first request sent by the client.
- the first request sent by the client may be a request generated by the client under the operation of the user, and the request may be a batch operation request.
- the first collection resource Upon receiving the first request sent by the client, the first collection resource generates a second request according to the link information acquisition interface.
- the client terminal may be an application program installed in a terminal, and the terminal includes but is not limited to any one of a mobile phone, a tablet computer, a smart gateway, a personal computer, a wearable device, and a vehicle-mounted terminal.
- the client and the first collection of resources are in the same local area network
- the client sends the first request to the smart gateway
- the smart gateway forwards the first request to the first collection of resources.
- the client is connected to the first set of resources through short-range wireless communication, and the client sends the first request directly to the first set of resources.
- the client is connected to the first collective resource through the server, the client sends the first request to the server, and the server forwards the first request to the first collective resource.
- the link information acquisition interface is the oic.if.ll interface
- the second request carries the identifier of the oic.if.ll interface.
- the interface can obtain the link information of all linked resources in the corresponding collection resource.
- the link information acquisition interface is the oic.if.ll interface
- the corresponding resource is called recursively until the link information of the leaf node resource in the collection resource corresponding to the oic.if.ll interface is obtained, and, Link information of all linked collection resources.
- the link information acquisition interface is the oic.if.bll interface newly defined according to the embodiment of this application, and the second request carries the identifier of the interface.
- the oic.if.bll interface is used to recursively call the corresponding collection resource until the link information of all linked leaf node resources in the collection resource and the link information of all linked collection resources are obtained.
- the oic.if.bll interface is the interface called by the first set of resources as shown in FIG. 2, the interface can obtain the first middle-level resource 142, the first middle-level resource 144, and the second middle-level resource at one time.
- Step 320 The first set of resources sends a second request to the first middle-level resource.
- the first set of resources after generating the second request, will send the second request to the first middle-level resource.
- the first set of resources may send the second request through the established communication link with the first middle-level resource.
- the first collective resource when the first collective resource is directly linked to the leaf node resource, the first collective resource will send a second request to the directly linked leaf node resource.
- the second request will directly instruct the leaf node resource to perform the operation of changing the state.
- Step 330 When receiving the second request, the first intermediate level resource obtains the link information of the leaf node resource.
- the first intermediate-level resource can parse the information carried in the second request after receiving the second request, and obtain the link information of the leaf node resource under the instruction of the second request .
- the leaf node resource is a resource directly linked to a first intermediate level resource.
- the leaf node resource is a resource of the first intermediate level resource nested link.
- the second request can also be used to obtain the direct link of the first intermediate level resource, or the link information of the nested link collection resource, which is not limited in this embodiment of the application. .
- Step 340 The first intermediate-level resource sends the link information of the leaf node resource to the first collection resource.
- the first middle-level resource when the first middle-level resource obtains the link information of the leaf node resource, the first middle-level resource sends the link information to the first set of resources.
- the operation of obtaining the link information of the leaf node resource by the first intermediate-level resource and returning the link information to the first set of resources may be completed under the instruction of the second request. That is, the second request is used to instruct the first middle-level resource to obtain and return the link information of the leaf node resource.
- Step 350 The first set of resources generates a third request according to the link information of the leaf node resources.
- the third request includes that the state change interface is the default interface of the leaf node resource, and the state change interface is used to change the state of the leaf node resource.
- the first set of resources can obtain the interface list from the link information of the leaf node resources.
- the interface list is a collection of interfaces that the leaf node resources can support.
- the third request includes a state change interface, and the state change interface is the default interface of the leaf node resource.
- the third request is used to change the state of the leaf node resources.
- Step 360 The first set of resources sends a third request to the leaf node resources.
- the first set of resources sends a third request to the leaf node resources.
- the leaf node resource when it receives the third request, it will call the corresponding interface according to the identifier of the state change interface (that is, the default interface of the leaf node resource) carried in the third request.
- the leaf node resource calls its own default interface to change the state of the leaf node resource.
- Scenario 1 When the current working state of the leaf node resource is different from the working state indicated by the third request, the current working state of the leaf node resource is changed to the working state indicated by the third request.
- the leaf node resource is a smart lamp resource
- the current working state of the smart lamp resource is the on state
- the state indicated by the third request is the off state.
- the leaf node resource changes the working state of the smart lamp resource to the off state according to the third request.
- Scenario 2 When the current working state of the leaf node resource is the same as the working state indicated by the third request, the current working state of the leaf node resource is kept unchanged.
- the leaf node resource may also return a message indicating that the change is successful to the first intermediate-level resource.
- the system for changing the state of resources includes a first set of resources, a first middle-level resource, and leaf node resources.
- the first set of resources can, when receiving the first request sent by the client, Generate a second request according to the link information acquisition interface, and send the second request to the first middle-level resource.
- the first middle-level resource obtains the link information of the leaf node resource according to the received second request, and sends the link information
- the first collection of resources determines the default interface of each leaf node resource according to the link information, and generates a third request through which the leaf node resource is instructed to change its state.
- the system disclosed in the present application can avoid the problem that the first set of resources directly issue a request for controlling the change state of the leaf node resource, and the interface called in the request is not the default interface of the leaf node.
- the interface called by the request generated by a collection of resources is the default interface of the leaf node resources, and finally enables the first collection of resources to successfully change the state of all leaf node resources in the system at one time.
- FIG. 4 is a flowchart of a method for changing a resource state according to an embodiment of the present application.
- the method shown in FIG. 4 can be applied to a first set of resources, the first set of resources includes a first intermediate-level resource, and the first intermediate-level resource includes a leaf node resource.
- the method includes:
- Step 410 When the first request sent by the client is received, a second request is generated according to the link information acquisition interface.
- the first request is used to instruct the leaf node resource to perform an operation to change the state, and the second request is used to obtain the leaf node resource.
- Link information the link information acquisition interface is used to acquire the link information of the corresponding resource.
- the first set of resources will generate the second request according to the link information acquisition interface when receiving the first request sent by the client.
- the first request sent by the client is used to instruct the leaf node resource to perform the operation of changing the state.
- the second request generated by the first set of resources is used to obtain link information of the leaf node resources.
- the link information obtaining interface is used to obtain link information of the corresponding resource.
- this embodiment includes but is not limited to the following two resource correspondence methods.
- the link information of the leaf node resource includes at least one of a resource identifier, an interface type, port information, and a resource type.
- the resource corresponding to the link information acquisition interface includes: the resource processed by the link information acquisition interface, and the leaf node resource directly linked to the resource.
- the resources corresponding to the link information acquisition interface may include the resources processed by the link information acquisition interface. That is, the middle-level inter-layer resource 140 shown in FIG. 1 and the leaf node resource directly linked to the first middle-level resource, that is, the leaf node resource 160 shown in FIG. 1.
- this linking method can solve the batch operation problem of the structure of the first set of resources-first intermediate level resources-leaf node resources in the architecture, in which the intermediate level resources and leaf node resources are directly linked. Since the above-mentioned link structure is widely used in the field of smart homes, the method of obtaining corresponding resources of the link information acquisition interface provided in this embodiment can solve the problem of failure in the batch processing of the first set of resources in the field.
- the link information acquisition interface can be designed as an oic.if.ll interface.
- the resource corresponding to the link information obtaining interface includes: the resource processed by the link information obtaining interface, and the leaf node resource to which the resource is nested and linked.
- the resources corresponding to the link information acquisition interface may include the resources processed by the link information acquisition interface. That is, the middle-level inter-level resources 142 and the middle-level inter-level resources 144 shown in FIG. 2 and the leaf node resources of the first middle-level resource nested link, that is, the leaf node resources 162 and the leaf node resources shown in FIG. 2 164.
- Step 420 Send a second request to the first middle-level resource.
- the first set of resources sends a second request to the first middle-level resource.
- Step 430 When receiving the link information of the leaf node resource sent by the first middle-level resource, generate a third request according to the link information of the leaf node resource.
- the first set of resources when it receives the link information of the leaf node resource sent by the first middle-level resource, it can generate a third request based on the link information.
- the third request includes a state change interface, and the state change interface It is the default interface of leaf node resources and is used to change the state of leaf node resources.
- Step 440 Send a third request to the leaf node resource.
- the first set of resources sends a third request to the leaf node resources.
- the leaf node resource when it receives the third request, it will call the corresponding interface according to the identifier of the state change interface (that is, the default interface of the leaf node resource) carried in the third request.
- the leaf node resource calls its own default interface to change the state of the leaf node resource.
- the first collective resource can also generate the second collective resource. Since then centralized management of leaf node resources. In the step of generating the second set of resources, the first set of resources can also correspondingly send a third request to the leaf node resources through the second set of resources.
- the first collective resource when the link information of the leaf node resource sent by the first middle-level resource is received, the first collective resource generates the second collective resource.
- the second collective resource may also be a pre-generated collective resource, and the second collective resource is directly linked to the leaf node resource.
- the first collective resource generates the third request according to the link information of the leaf node resource through the second collective resource, and the first collective resource sends the third request to the leaf node resource through the second collective resource.
- the method for changing the resource status enables the first collection of resources to obtain the linked leaves from the first intermediate-level resource after receiving the first request sent by the client.
- the link information of the node resource is based on the link information to generate a request sent to the leaf node resource, so that the interface identifier in the sent request is consistent with the default interface of the leaf node resource, which improves the processing of a batch of leaf nodes by the first set of resources
- the performance of resources improves the success rate of system control and is conducive to the correct execution of instructions by the system.
- FIG. 5 is a flowchart of another method for changing the state of a resource provided by an embodiment of the present application.
- the method shown in FIG. 5 can be applied to a first middle-level resource.
- the first set of resources includes a first middle-level resource, and the first middle-level resource includes a leaf node resource.
- the method includes:
- Step 510 When the second request is received, obtain the link information of the leaf node resource.
- the first intermediate-level resource can obtain the link information of the leaf node resource when receiving the second request.
- the second request is a request generated by the link information acquisition interface when the first collection resource receives the first request sent by the client.
- the link information obtaining interface is used to obtain link information of the resource corresponding to the link information obtaining interface.
- the first middle-level resource can parse out the instruction in the second request, so that the first middle-level resource obtains the link information of the leaf node resource according to the instruction of the second request.
- the first intermediate-level resource can determine how to obtain the link information of the leaf node resource according to the condition of the resource corresponding to the link information obtaining interface.
- the resource corresponding to the link information obtaining interface includes: the resource processed by the link information obtaining interface, and the leaf node resource directly linked to the resource.
- the first intermediate-level resource can obtain the link information of the leaf node resource directly linked to the first intermediate-level resource.
- the resource corresponding to the link information obtaining interface includes: the resource processed by the link information obtaining interface, and the leaf node resource to which the resource is nested and linked.
- the first intermediate-level resource when receiving the second request, can obtain first sub-link information, which is used to indicate the link information of the leaf node resource to which the first intermediate-level resource is directly linked. Subsequently, the first middle-level resource can obtain second sub-link information, which is used to indicate the link information of the leaf node resource of the nested link of the first middle-level resource.
- the first intermediate-level resource can obtain first sub-link information, which is used to indicate the leaf node resource to which the first intermediate-level resource 142 is directly linked. Since the first middle-level resource 142 in FIG. 2 is not directly linked to the leaf node resource, the first sub-link information is empty.
- the first middle-level resource 142 can also obtain second sub-link information, which is used to indicate the link information of the leaf node resource 162 of the nested link of the first middle-level resource 142 and the link information of the leaf node resource 164.
- Step 520 Send the link information of the leaf node resource to the first collection resource, and the link information of the leaf node resource is used to instruct the first collection resource to generate a third request.
- the first intermediate-level resource can send the link information of the leaf node resource to the first collective resource, and the link information of the leaf node resource is used to instruct the first collective resource to generate a third request, the third request It includes a state change interface, which is the default interface for leaf node resources and is used to change the state of leaf node resources.
- the method for changing the resource status enables the first intermediate-level resource to return the link information of the linked leaf node resource to the second request sent by the first set of resources.
- the first set of resources provides accurate link information of the leaf node resources to the first set of resources, so that the first set of resources can correctly control the change state of each leaf node resource at one time. Since the first middle-level resource provides accurate link information of the leaf node resources, the effect of accurately controlling the leaf node resources in batches by the first set of resources is improved.
- FIG. 6 is a schematic diagram of a model in a smart home system provided by an embodiment of the present application.
- the smart villa shown in Figure 6 includes the first set of resources my house (English: my house), the first middle-level resource room 1 (English: my room 1), and the first middle-level resource room 2 ( English: my room 2).
- Room 1 includes the leaf node resource No. 1 lamp (English: light 1) and No. 2 lamp (English: light 2).
- Room 2 includes the leaf node resource No. 3 lamps (English: light 3) and No. 4 lamps (English: light 4).
- code comments for the resource of Room 2 above please refer to the code comments of the resource of Room 1, which will not be repeated here.
- the detailed code representation of the resource of room 1 can refer to the following content.
- the detailed code representation of the resource of room 2 can be found in the following content.
- code representation of the resource of room No. 1 and the code representation of the resource of room 2 can refer to the comment of the code representation of the first set of resources, which will not be repeated here.
- FIG. 7 is an interaction diagram of an application scenario for changing the state of a resource provided by an embodiment of the present application.
- it includes a client 7A, a first aggregate resource 7B, a first middle-level resource 7C, and a first middle-level resource 7D.
- Step 710 The client sends the first batch (English: batch) operation request to the first set of resources.
- Step 720 When the first set of operation requests are received by the first set of resources, the first set of operation requests are decomposed according to the information of the link resources contained in the first set of resources to obtain n fourth requests.
- n is a positive integer, and n is the number of first intermediate-level resources directly linked to the first collection of resources.
- the first collection resource may be T-collection (Chinese: T collection resource).
- Step 730 When the first intermediate-level resource directly linked to the first collective resource is a collective resource, the first collective resource uses the link list interface (that is, oic.if.ll) of the first intermediate-level resource directly linked to the first collective resource. interface).
- Step 740 The first set of resources sends a fourth request to the first middle-level resource.
- Step 750 The first middle-level resource returns link list information to the first collection resource.
- the first collection resource will determine all the leaf node resources in the entire architecture according to the link list information, and combine all the leaf node resources into a D-collection (Chinese: D collection resource).
- step 760 for the first set of resources, the following steps may be performed.
- Step (1) According to the D-collection, the first collection of resources will decompose the first batch of operation requests into fifth requests again, and send the fifth requests to the respective leaf node resources included in the D-collection.
- the interface of the fifth request is the default interface corresponding to each leaf node resource included in the D-collection, and the fifth request is used to send to each leaf node resource included in the D-collection.
- the first collection resource may not generate the D-collection, but send the fifth request to all the leaf node resources in the entire architecture.
- Step (2) The first collection resource obtains response messages returned by each leaf node resource contained in the D-collection, and aggregates the response messages to obtain response messages for the first batch of operation requests.
- Step (3) The first set of resources returns a response message for the first batch of operation requests to the client.
- the client uses a batch operation to request operation of the T-collection.
- T-collction is a resource that contains other first intermediate level resources.
- T-collection After receiving the above batch of operation requests, T-collection generates a fourth request based on the information of other collection resources linked to it, and sends the fourth request to each of the other linked collection resources (that is, the first middle-level resource), and The link list (that is, oic.if.ll) interface is used as the interface type of each fourth request.
- T-collection that is, the first collection resource 7B in FIG. 7 directly links the first middle-level resource 7C and the first middle-level resource 7D.
- the first middle-level resource 7C and the first middle-level resource 7D respectively return the link information of the respective leaf node resources.
- the link information includes resource identification, interface type, port information, and resource type.
- the T-collection generates a new D-collection according to the leaf node resources returned by the first middle-level resource 7C and the first middle-level resource 7D. It should be noted that D-collection is a virtual temporary collection resource. After the first batch of operation requests are processed, the D-collection will be deleted. In a possible implementation manner, D-collection directly links all leaf node resources returned by the first intermediate-level resource 7C and all leaf node resources returned by the first intermediate-level resource 7D.
- the above solution provided by this embodiment can solve the problem that the state of the leaf node resource cannot be changed correctly in the batch operation of the resource structure of the first set of resources-the first middle level resource-the leaf node resource.
- the nesting method such as the first collection resource-first middle-level resource-leaf node resource is the most common application, so there is no need to define a new interface in this solution, which is less difficult to implement.
- a new interface oic.if.bll can be designed in the system for changing the resource state, and the function of the interface is similar to the oic.if.b interface.
- the interface oic.if.bll designed in this application can support all resources in the system that needs to change the resource state, and each resource includes the first set of resources, the first middle-level resources, and the leaf node resources.
- the oic.if.bll interface is used to obtain the first intermediate level resources and leaf node resources of all nested first collection resources at one time.
- FIG. 8 is another application scenario interaction diagram for changing the resource state provided by an embodiment of the present application.
- a client 8A a first set of resources 8B, a first middle-level resource 8C, and a first middle-level resource 8D are included.
- Step 810 The client sends the first batch (English: batch) operation request to the first set of resources.
- Step 820 When the first set of resources receives the first batch of operation requests, it decomposes the first batch of operation requests according to the information of the link resources contained in the first set of resources to obtain m sixth requests.
- n is a positive integer
- m is the number of first intermediate-level resources directly linked to the first collection of resources.
- the first collection resource may be a T-collection.
- T-collection receives the first batch of operation requests, it decomposes the first batch of operation requests according to the number of first intermediate-level resources directly linked by T-collection to obtain m sixth requests.
- Step 830 When the first intermediate-level resource directly linked by the first collective resource is a collective resource, the first collective resource uses oic.if.bll of the first intermediate-level resource directly linked by the first collective resource.
- Step 840 The first set of resources sends a sixth request to the first middle-level resource.
- the interface called in the sixth request is oic.if.bll.
- the first intermediate-level resource will continue to generate a request to call oic.if.bll when it directly links to other first-intermediate-level resources.
- the request is sent to other first-level middle-level resources directly linked.
- Step 850 When the first middle-level resource is no longer linked to other first middle-level resources, the first middle-level resource returns the link information of the directly linked leaf node resource to the first set of resources.
- Step 860 When receiving the link information of the leaf node resources returned by each first middle-level resource, the first set of resources decomposes the first batch of operation requests into seventh requests.
- the first collection resource can also generate a D-collection.
- the D-collection is a virtual temporary collection resource, and the D-collection will be deleted after the process of changing the resource state provided in this embodiment is executed. It should be noted that D-collection directly links all leaf node resources in this embodiment.
- Step 870 The first set of resources sends the seventh request to each leaf node resource.
- the interface carried is the default interface of the corresponding leaf node resource.
- Step 880 The first set of resources receives the response message returned by each leaf node resource.
- the first set of resources may also aggregate the response messages returned by each leaf node.
- the embodiment of the application can process the interface according to the newly defined batch link list.
- the first set of resources can obtain all the leaf nodes layer by layer according to the batch link list processing interface.
- the link information of the resource After obtaining the link information, the first set of resources can decompose the batch information sent by the client into information that calls the default interface of each leaf node resource, thus realizing a one-time change of the entire system. The effect of the state of the leaf node resource.
- FIG. 9 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application.
- the terminal shown in FIG. 9 can be recognized as the first set of resources in the system, or be recognized as the first middle-level resource.
- the terminal includes a processor 920 and a memory 940, and at least one instruction is stored in the memory 940, and the instruction is loaded and executed by the processor 920 to implement the method described in each method embodiment of the present application. The method of changing the state of the resource.
- the terminal 900 is an electronic device with a communication function.
- the processor 920 may include one or more processing cores.
- the processor 920 uses various interfaces and lines to connect various parts of the entire terminal 900, and executes the terminal by running or executing instructions, programs, code sets, or instruction sets stored in the memory 940, and calling data stored in the memory 940. 900's various functions and processing data.
- the processor 920 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). A kind of hardware form to realize.
- DSP Digital Signal Processing
- FPGA Field-Programmable Gate Array
- PLA Programmable Logic Array
- the processor 920 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
- the CPU mainly processes the operating system, user interface, and application programs;
- the GPU is used to render and draw the content that the display needs to display;
- the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 920, but may be implemented by a chip alone.
- the memory 940 may include random access memory (RAM) or read-only memory (Read-Only Memory).
- the memory 940 includes a non-transitory computer-readable storage medium.
- the memory 940 may be used to store instructions, programs, codes, code sets or instruction sets.
- the memory 940 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), Instructions used to implement the following method embodiments; the storage data area can store the data involved in the following method embodiments.
- FIG. 10 shows a structural block diagram of an apparatus for changing a resource state provided by an exemplary embodiment of the present application.
- the device for changing the resource state can be implemented as all or a part of the terminal through software, hardware or a combination of both, so as to realize the function of the first set of resources.
- the first set of resources includes the first intermediate-level resources, and the first intermediate-level resources include the leaf node resources.
- the device includes:
- the first generating module 1010 is configured to generate a second request according to the link information acquisition interface when the first request sent by the client is received, and the first request is used to instruct the leaf node resource to perform the operation of changing the state, so The second request is used to obtain link information of the leaf node resource, and the link information obtaining interface is used to obtain link information of the resource corresponding to the link information obtaining interface;
- the first sending module 1020 is configured to send the second request to the first middle-level resource
- the second generating module 1030 is configured to generate a third request according to the link information of the leaf node resource when receiving the link information of the leaf node resource sent by the first intermediate-level resource. Including a state change interface, where the state change interface is the default interface of the leaf node resource and is used to change the state of the leaf node resource;
- the second sending module 1040 is configured to send the third request to the leaf node resource.
- the resource corresponding to the link information acquisition interface involved in the device includes: the resource processed by the link information acquisition interface, and the leaf node resource to which the resource is directly linked.
- the resource corresponding to the link information acquisition interface involved in the device includes: the resource processed by the link information acquisition interface, and the leaf node of the resource nested link Resources.
- the second generating module 1030 is configured to generate a second set of resources when the link information of the leaf node resources sent by the first intermediate-level resource is received, and the first The second collection resource is directly linked to the leaf node resource.
- the second sending module 1040 is configured to send the third request to the leaf node resource through the second set of resources.
- the link information of the leaf node resources involved in the device includes at least one of a resource identifier, an interface type, port information, and a resource type.
- FIG. 11 shows a structural block diagram of an apparatus for changing a resource state provided by an exemplary embodiment of the present application.
- the device for changing the resource state can be implemented as all or a part of the terminal through software, hardware or a combination of the two, so as to realize the function of the first middle-level resource.
- the first set of resources includes the first intermediate-level resources, and the first intermediate-level resources include the leaf node resources.
- the device includes:
- the information obtaining module 1110 is configured to obtain link information of the leaf node resource when a second request is received.
- the second request is that the first collection of resources receives the first request sent by the client according to A request generated by a link information obtaining interface, where the link information obtaining interface is used to obtain link information of a resource corresponding to the link information obtaining interface;
- the third sending module 1120 is configured to send the link information of the leaf node resource to the first set of resources, and the link information of the leaf node resource is used to instruct the first set of resources to generate a third request.
- the third request includes a state change interface, and the state change interface is a default interface of the leaf node resource and is used to change the state of the leaf node resource.
- the resource corresponding to the link information acquisition interface involved in the device includes: the resource processed by the link information acquisition interface, and the leaf node resource to which the resource is directly linked.
- the resource corresponding to the link information acquisition interface involved in the device includes: the resource processed by the link information acquisition interface, and the leaf node of the resource nested link Resources. In an optional embodiment, said.
- the information obtaining module 1110 is configured to obtain link information of the leaf node resource directly linked to the first intermediate-level resource when the second request is received.
- the information obtaining module 1110 is configured to obtain first sub-link information when the second request is received, and the first sub-link information is used to indicate the first intermediate Link information of the leaf node resource directly linked to the hierarchical resource; acquiring second sub-link information, where the second sub-link information is used to indicate the link information of the leaf node resource to which the first intermediate-level resource is nested and linked .
- the embodiments of the present application also provide a computer-readable medium that stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the change of the resource state as described in each of the above embodiments Methods.
- the device for changing the state of a resource executes the method for changing the state of a resource
- the above-mentioned functional modules are used as an example for illustration. In practical applications, the above-mentioned function assignments can be divided into different groups according to needs.
- the function module is completed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above.
- the device for changing the state of a resource provided in the foregoing embodiment belongs to the same concept as the embodiment of the method for changing the state of a resource. For the specific implementation process, please refer to the method embodiment, which will not be repeated here.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Economics (AREA)
- General Business, Economics & Management (AREA)
- Computing Systems (AREA)
- Architecture (AREA)
- Civil Engineering (AREA)
- Structural Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例公开了一种更改资源状态的方法、装置、终端及存储介质,属于智能家居领域,本申请实施例能够建立一个包含第一集合资源、第一中间层级资源和叶子节点资源的更改资源状态的系统,通过令第一集合资源获取需要更改资源状态的叶子节点资源的链接信息,针对该叶子节点资源生成包含该叶子节点资源缺省接口的请求,从而使得叶子节点资源的状态能够正确被系统更改,避免了将第一集合资源的控制请求直接逐层下发至叶子节点资源,导致的控制请求中的接口不是叶子节点资源的缺省接口的问题。因此,本申请能使客户端下发的控制请求被每一个叶子节点资源所识别并执行,提高了控制系统的可靠性和稳定性。
Description
本申请涉及智能家居领域,特别涉及一种更改资源状态的方法、系统、终端及存储介质。
随着物联网(英文:Internet of Things,缩写:IoT)技术在智能家居领域的广泛应用,用户一键控制智能家居系统中所有设备的需求也日益增长。
相关技术中,智能家居系统中需要对系统中存在的所有设备进行控制。在一种组网方式中,被控制的设备都处于叶子节点的位置。当智能家居系统中的层级较高的设备接收到客户端的一键控制请求时,层级较高的设备通过已组建的网络逐层传递控制请求,直至所有的被控设备都接收到控制请求并响应该请求。
发明内容
本申请实施例提供了一种更改资源状态的方法、系统、终端及存储介质。所述技术方案如下:
一方面,提供了一种更改资源状态的系统,该系统包括第一集合资源、第一中间层级资源、m个第二中间层级资源和n个叶子节点资源,所述第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个所述叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或所述链接n-n1个叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数;在该更改资源状态的系统中:
所述第一集合资源,用于当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源的执行更改状态的操作,所述链接信息获取接口用于获取对应的资源的链接信息;
所述第一集合资源,用于向所述第一中间层级资源发送所述第二请求;
所述第一中间层级资源,用于当接收到所述第二请求时,获取所述叶子节点资源的链接信息;
所述第一中间层级资源,用于将所述叶子节点资源的链接信息发送至所述第一集合资源;
所述第一集合资源,用于根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口是所述叶子节点资源的缺省接口,且所述状态更改接口用于更改所述叶子节点资源的状态;
所述第一集合资源,用于向所述叶子节点资源发送所述第三请求。
另一方面,提供了一种更改资源状态的方法,应用于第一集合资源中,所述第一集合资源直接链接第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述方法包括:
当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源执行更改状态的操作,所述第二请求用于获取所述叶子节点资源的链接信息,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
向所述第一中间层级资源发送所述第二请求;
当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态;
向所述叶子节点资源发送所述第三请求。
另一方面,提供了一种更改资源状态的方法,应用于第一中间层级资源中,第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述方法包括:
当接收到第二请求时,获取所述叶子节点资源的链接信息,所述第二请求是所述第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
将所述叶子节点资源的链接信息发送至所述第一集合资源,所述叶子节点资源的链接信息用于指示所述第一集合资源生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态。
另一方面,提供了一种更改资源状态的装置,应用于第一集合资源中,所述第一集合资源直接链接第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,所述装置包括:
第一生成模块,用于当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源执行更改状态的操作,所述第二请求用于获取所述叶子节点资源的链接信息,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
第一发送模块,用于向所述第一中间层级资源发送所述第二请求;
第二生成模块,用于当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态;
第二发送模块,用于向所述叶子节点资源发送所述第三请求。
另一方面,提供了一种更改资源状态的装置,应用于第一中间层级资源中,第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述装置包括:
信息获取模块,用于当接收到第二请求时,获取所述叶子节点资源的链接信息,所述第二请求是所述第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
第三发送模块,用于将所述叶子节点资源的链接信息发送至所述第一集合资源,所述叶子节点资源的链接信息用于指示所述第一集合资源生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态。
另一方面,提供了一种终端,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现本申请实施例提供的应用在第一集合资源中的更改资源状态的方法。
另一方面,提供了一种终端,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现本申请实施例提供的应用在第一中间层级资源中的更改资源状态的方法。
另一方面,提供了一种计算机可读存储介质,该存储介质中存储有至少一条指令,该指令由处理器加载并执行以实现应用在第一集合资源中的更改资源状态的方法。
另一方面,提供了一种计算机可读存储介质,该存储介质中存储有至少一条指令,该指令由处理器加载并执行以实现应用在第一中间层级资源中的更改资源状态的方法。
本申请实施例提供的技术方案带来的有益效果至少包括:
本实施例能够建立一个包含第一集合资源、第一中间层级资源和叶子节点资源的更改资 源状态的系统。在该系统中,第一集合资源能够在客户端需要控制叶子节点资源时,从第一中间层级资源中获取叶子节点资源的链接信息,从而确定叶子节点资源的缺省接口。进一步的,第一集合资源能够生成第三请求,该第三请求中的状态更改接口是叶子节点资源的缺省接口。由于第一集合资源能够通过第一中间层级资源获知叶子节点资源的缺省接口,从而使得叶子节点资源接收到的第三请求均是该叶子节点资源能够调用的接口,避免了将第一集合资源的控制请求直接逐层下发至叶子节点资源,导致的控制请求中的接口不是叶子节点资源的缺省接口的问题。因此,本申请能使客户端下发的控制请求被每一个叶子节点资源所识别并执行,提高了控制系统的可靠性和稳定性。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种资源间的链接关系示意图;
图2是本申请实施例提供的另一种资源间的链接关系示意图;
图3是本申请实施例中所公开的更改资源状态的系统架构图;
图4是本申请实施例提供的一种更改资源状态的方法的流程图;
图5是本申请实施例提供的另一种更改资源状态的方法的流程图;
图6是本申请实施例提供的一种智能家居系统中的模型示意图;
图7是本申请实施例提供的一种更改资源状态的应用场景交互图;
图8是本申请实施例提供的另一种更改资源状态的应用场景交互图;
图9是是本申请一个示例性实施例提供的终端的结构框图;
图10示出了本申请一个示例性实施例提供的更改资源状态的装置的结构框图;
图11示出了本申请一个示例性实施例提供的更改资源状态的装置的结构框图。
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
随着物联网技术在智能家居领域中推广应用,智能家居系统在设计时选择兼容性好且易于维护的架构。在一些应用场景中,基于REST(英文:Representational State Transfer,中文:表征性状态转移)架构的智能家居系统,能够将网络中的事物或者设备以资源的方式描述。可见,在该架构中的事物或设备均较易控制,从而使得REST架构成为智能家居系统设计人员广泛选择的架构。作为一种可选的实施方式,本申请所公开的更改资源状态的系统、方法、装置、终端和存储介质,均可应用在REST架构中。
在基于REST架构的智能家居系统中,资源能够接收的操作方法包括但不限于CURDN。其中,CURDN具体可以是Create(中文:创建),Update(中文:修改),Retrieve(中文:获取),Delete(中文:删除),Notification(中文:通知)。需要说明的是,CURDN是REST架构的基本操作类型。
在该基于REST架构的智能家居系统中,资源在被描述过程中,定义了一种集合(英文:collection)资源。在一个集合资源中,可以包括多个链接资源(英文:linked resource)。需要说明的是,一个资源既可以同时是链接资源和集合资源,也可以仅是链接资源,还可以仅是集合资源。
在一种可能的实现方式中,资源可以是链接集合资源(英文:linked collection),该链接集合资源既是链接资源,也是集合资源。
在本申请的一种可能的实施方式中,资源在网络架构中需要根据接收到的请求执行相关的操作。在本申请实施例中,一条请求包括:操作方法+操作目标+操作手段。需要说明的是, 上述操作方法可以是CURDN操作中的至少一种。操作目标可以是资源在网络中的地址,比如URI(英文:Uniform Resource Identifier,中文:统一资源标识符)。操作手段可以是接口类型,该接口类型又可称之为接口属性(英文:interface)。
需要说明的是,在本申请中,每个资源在被设计组网时都有自身支持的接口列表。在接口列表中,存在资源对应支持的缺省接口。举例而言,针对资源R1,其在被组网设计时,支持的接口列表如下:
表一
资源标识 | R1 | R1 | R1 |
所支持接口 | A接口(缺省接口) | B接口 | C接口 |
由表一所示内容可知,资源R1能够支持的接口包括A接口、B接口和C接口。在实际应用中,当资源R1接收到的请求包括上述接口中的一个时,资源R 1能够正确调用相关接口并完成相应的操作。当资源R1接收到的请求不包括上述任意一个接口时,资源R1将调用缺省接口,来执行相应的操作。一些场景中,该资源R1会返回错误指示,使得发送相关请求的资源或者资源R1没能正确执行相关请求。
基于REST架构设计的一种智能家居系统中,第一集合资源能够在接收到包括batch interface(中文:批处理接口)的请求时,根据第一集合资源所链接的叶子节点资源的数目,将该请求分解为相应数目的子请求。向叶子节点资源发送分解后的子请求,并希望叶子节点资源在接收到分解后的子请求后,顺利执行请求对应的操作。
在本申请实施例提供的方法中,能够实现一种集合资源的操作方法,当接收到批处理(英文:batch)请求时,根据链接集合资源(英文:linked colletcion)的数目,将批操作请求分解为第四请求,第四请求调用目标接口,目标接口用于获取链接集合资源包含的资源的链接信息;当接收到链接集合资源返回的链接列表(英文:link list)时,向非集合资源发送第五请求,第五请求用于指示上述非集合资源执行相应的操作。可选地,该相应的操作是更改非集合资源的操作。
可选地,根据上述实施例提供的集合资源的操作方法,目标接口是链接列表处理接口(英文:link list interface;缩写:oic.if.ll)。作为一种能够实现的功能,oic.if.ll接口的作用是获取集合资源的链接资源的链接信息。其中,链接信息是描述链接资源的信息,该链接信息包括接口信息、资源标识、资源类型。可选地,链接信息包括状态属性信息。状态属性信息是描述设备状态的信息,例如,状态属性信息可以是灯具的开启状态,也可以是灯具的关闭状态。作为本申请的一种可能的实现方式,第一集合资源可以通过修改状态属性来操作叶子节点资源对应的设备。
可选地,根据上述实施例提供的集合资源的操作方法,目标接口是批链接列表处理接口(英文:batch link list interface;缩写:oic.if.bll)。作为一种能够实现的功能,oic.if.bll接口的作用是获取叶子节点的链接信息。
可选地,根据上述实施例提供的集合资源的操作方法,第五请求中包括的接口是上述非集合资源的缺省接口(英文:default interface)。
请参考图1,图1是本申请实施例提供的一种资源间的链接关系示意图。本申请公开的更改资源状态的系统中涉及的资源,能够按照图1所示的链接关系进行链接。图1包括第一集合资源120、第一中间层级资源140和叶子节点资源160。
需要说明的是,本申请实施例的更改资源状态的系统中,包括第一集合资源、第一中间层级资源、m个第二中间层级资源和n个叶子节点资源。其中,图1所示的场景中,m为0,n为3,n1为0。即第一集合资源120直接链接2个第一中间层级资源140,第一中间层级资源140链接3个叶子节点资源。在本系统中,链接的含义包括直接链接和嵌套链接。在图1中,链接的含义指直接链接。
第一集合资源120包括第一中间层级资源140。在一种可能的实现方式中,当第一集合 资源120包括第一中间层级资源140时,第一集合资源120直接链接第一中间层级资源140。第一集合资源120可以包含至少一个第一中间层级资源140。
第一中间层级资源140包括叶子节点资源160。在图1所示的链接关系中,第一中间层级资源140直接链接叶子节点资源160。第一中间层级资源140可以链接至少一个叶子节点资源160。
在图1所示的链接关系中,更改资源状态的系统所使用的资源,从第一集合资源120到第一中间层级资源140,再到叶子节点资源160,共形成三个层级的链接关系。其中,第一集合资源120嵌套链接叶子节点资源160。
请参考图2,图2是本申请实施例提供的另一种资源间的链接关系示意图。本申请公开的更改资源状态的系统中涉及的资源,能够按照图1所示的链接关系进行链接。图2包括第一集合资源120、第一中间层级资源142、第一中间层级资源144、第二中间层级资源146、第二中间层级资源148、叶子节点资源162、叶子节点资源164、叶子节点资源166和叶子节点资源168。
需要说明的是,本申请实施例的更改资源状态的系统中,包括第一集合资源、第一中间层级资源、m个第二中间层级资源和n个叶子节点资源。其中,图2所示的场景中,m为2,n为4,n1为0。即第一集合资源120直接链接2个第一中间层级资源142和第一中间层级资源144,第一中间层级资源142和第一中间层级资源144一共链接4个叶子节点资源。
在本申请的另一种实施方式中,第一中间层级资源142或第一中间层级资源144下,可以嵌套链接除第二中间层级资源146和第二中间层级资源148外的其它第二中间层级资源,和/或,嵌套链接其它叶子节点,以形成以第一结合资源为根节点的多层嵌套的系统,本申请实施例对系统可能包括的层级以及各层级中包括的叶子节点资源和第二中间层级资源的数目不做限制。
在图2中,直接链接的关系如下所述,第一集合资源120直接链接第一中间层级资源142,第一集合资源120直接链接第一中间层级资源144。
第一中间层级资源142直接链接第二中间层级资源146。第一中间层级资源144直接链接第二中间层级资源148。
第二中间层级资源146直接链接叶子节点资源162,且直接链接叶子节点资源164。第二中间层级资源148直接链接叶子节点资源166,且直接链接叶子节点资源168。
在图2中,嵌套链接的关系如下所述,第一集合资源120嵌套链接有:第二中间层级资源146、第二中间层级资源148、叶子节点资源162、叶子节点资源164、叶子节点资源166和叶子节点资源168。
第一中间层级资源142嵌套链接有:叶子节点资源162和叶子节点资源164。
第一中间层级资源144嵌套链接有:叶子节点资源166和叶子节点资源168。
请参考图3,图3是本申请实施例中所公开的更改资源状态的系统架构图。在图3中,更改资源状态的系统包括第一集合资源120,第一中间层级资源140和叶子节点资源160。当该更改资源状态的系统在接收到客户端(英文:client)发送的指令时,触发系统执行更改资源状态的操作,详述如下:
步骤310,当接收到客户端发送的第一请求时,第一集合资源根据链接信息获取接口生成第二请求。
在本申请实施例中,第一集合资源可以是一种集合资源,包含多个第一中间层级资源。在本申请实施例中,第一集合资源可以是链接多个下属资源的实体设备或事物。例如,智能家居系统中的家庭资源,该家庭资源整体上即为一个第一集合资源。
需要说明的是,第一集合资源能够接收到客户端发送的第一请求。在一种可能的实现方式中,客户端发送的第一请求可以是客户端在用户的操作下生成的请求,该请求可以是批操 作请求。在接收到客户端发送的第一请求时,第一集合资源根据链接信息获取接口生成第二请求。其中,客户端可以是安装在终端中的应用程序,该终端包括但不限于手机、平板电脑、智能网关、个人电脑、可穿戴设备和车载终端中任意一种。
在一种可能实现的方式中,客户端与第一集合资源处于同一局域网,客户端将第一请求发送至智能网关,智能网关将第一请求转发至第一集合资源。
在另一种可能实现的方式中,客户端与第一集合资源通过短距离无线通信的方式连接,客户端将第一请求直接发送至第一集合资源。
在另一种可能实现的方式中,客户端通过服务器与第一集合资源连接,客户端将第一请求发送至服务器,服务器将该第一请求转发至第一集合资源。
针对链接信息获取接口而言,本申请提供但不限于以下几种实现方式。
在一种可能实现的方式中,链接信息获取接口是oic.if.ll接口,第二请求中携带有该oic.if.ll接口的标识。当oic.if.ll接口被调用时,该接口能够获取所对应的集合资源内所有链接的资源的链接信息。可选地,当链接信息获取接口是oic.if.ll接口时,对相应的资源进行递归调用,直至获取该oic.if.ll接口对应的集合资源中的叶子节点资源的链接信息,以及,所有链接的集合资源的链接信息。
在一种可能的实现方式中,链接信息获取接口是按照本申请实施方式新定义的oic.if.bll接口,第二请求中携带有该接口的标识。可选地,该oic.if.bll接口用于对相应的集合资源进行递归调用,直至获取该集合资源中所有链接的叶子节点资源的链接信息,以及,所有链接的集合资源的链接信息。例如,若该oic.if.bll接口是如图2所示的第一集合资源调用的接口时,该接口能够一次性获取第一中间层级资源142、第一中间层级资源144、第二中间层级资源146、第二中间层级资源148、叶子节点资源162、叶子节点资源164、叶子节点资源166和叶子节点资源168各自的链接信息。
步骤320,第一集合资源向第一中间层级资源发送第二请求。
在本实施例中,第一集合资源在生成第二请求后,将向第一中间层级资源发送第二请求。第一集合资源可以通过与第一中间层级资源已经建立的通信链路发送第二请求。
在一种可能的实现方式中,当第一集合资源直接链接叶子节点资源时,第一集合资源将向直接链接的叶子节点资源发送第二请求。相应的,在该场景下,第二请求将直接指示该叶子节点资源执行改变状态的操作。
步骤330,当接收到第二请求时,第一中间层级资源获取叶子节点资源的链接信息。
在本实施例中,作为另一执行主体,第一中间层级资源在接收到第二请求后,能够解析第二请求中携带的信息,在第二请求的指示下,获取叶子节点资源的链接信息。
在一种可能的实现方式中,该叶子节点资源是第一中间层级资源直接链接的资源。
在另一种可能的实现方式中,该叶子节点资源是第一中间层级资源嵌套链接的资源。
需要说明的是,在本实施例执行的过程中,第二请求还能够用于获取第一中间层级资源直接链接,或者,嵌套链接的集合资源的链接信息,本申请实施例对此不作限定。
步骤340,第一中间层级资源将叶子节点资源的链接信息发送至第一集合资源。
在本实施例中,当第一中间层级资源得到叶子节点资源的链接信息时,第一中间层级资源将该链接信息发送至第一集合资源中。
在一种可能的实现方式中,第一中间层级资源获取叶子节点资源的链接信息,并将该链接信息返回到第一集合资源的操作,均可以是在第二请求的指示下完成。也即,第二请求用于指示第一中间层级资源获取并返回叶子节点资源的链接信息。
步骤350,第一集合资源根据叶子节点资源的链接信息生成第三请求。
在本申请实施例中,第三请求中包括状态更改接口是叶子节点资源的缺省接口,且状态更改接口用于更改叶子节点资源的状态。
在一种可能的实现方式中,第一集合资源能够从叶子节点资源的链接信息中获取接口列表。该接口列表是叶子节点资源能够支持的接口的集合,在该接口列表中,存在叶子节点资 源的缺省接口。也即,第一集合资源能够根据叶子节点资源的链接信息,获取叶子节点资源的缺省接口,并生成第三请求。该第三请求中包含状态更改接口,状态更改接口即为叶子节点资源的缺省接口。此外,第三请求用于更改叶子节点资源的状态。
步骤360,第一集合资源向叶子节点资源发送第三请求。
在本申请实施例中,第一集合资源向叶子节点资源发送第三请求。
相应的,叶子节点资源在接收到第三请求时,将按照第三请求中携带的状态更改接口(即叶子节点资源的缺省接口)的标识,调用对应的接口。在本申请实施例中,叶子节点资源调用自身的缺省接口,对叶子节点资源的状态进行更改。
需要说明的是,本申请实施例中的对叶子节点资源的状态进行更改的含义可以包括如下几种场景。
场景一:叶子节点资源在当前的工作状态与第三请求指示的工作状态不同时,将叶子节点资源当前的工作状态更改为第三请求指示的工作状态。
例如,叶子节点资源是智能灯具资源,且该智能灯具资源当前的工作状态是点亮状态,第三请求指示的状态是关闭状态。在此场景下,叶子节点资源根据第三请求将智能灯具资源的工作状态更改为关闭状态。
场景二:叶子节点资源在当前的工作状态与第三请求指示的工作状态相同时,保持叶子节点资源当前的工作状态不变。可选地,叶子节点资源还可以向第一中间层级资源返回更改成功的消息。
综上所述,本申请实施例提供的更改资源状态的系统,包括第一集合资源、第一中间层级资源和叶子节点资源,第一集合资源能够在接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,并将该第二请求发送至第一中间层级资源,该第一中间层级资源根据接收到的第二请求获取叶子节点资源的链接信息,并将该链接信息返回至第一集合资源,第一集合资源再根据该链接信息确定各个叶子节点资源的缺省接口,并生成第三请求,通过该第三请求指示叶子节点资源更改自身的状态。由此可见,本申请公开系统能够避免第一集合资源直接将用于控制叶子节点资源更改状态的请求下发,在请求中调用的接口不是叶子节点的缺省接口时无法使用的问题,使得第一集合资源生成的请求调用的接口是叶子节点资源的缺省接口,最终使得第一集合资源能够一次性成功地更改系统中所有叶子节点资源的状态。
请参考图4,图4是本申请实施例提供的一种更改资源状态的方法的流程图。图4所示的方法能够应用在第一集合资源中,第一集合资源包括第一中间层级资源,第一中间层级资源包括叶子节点资源,该方法包括:
步骤410,当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,第一请求用于指示叶子节点资源执行更改状态的操作,第二请求用于获取叶子节点资源的链接信息,链接信息获取接口用于获取对应的资源的链接信息。
本申请实施例中,第一集合资源将在接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求。需要说明的是,客户端发送的第一请求用于指示叶子节点资源执行更改状态的操作。第一集合资源生成的第二请求,是用于获取叶子节点资源的链接信息。其中,链接信息获取接口用于获取对应的资源的链接信息。针对链接信息获取接口对应的资源,本实施例包括但不限于一下两种资源的对应方式。
可选地,在一种能够实现的方式中,叶子节点资源的链接信息包括资源标识、接口类型、端口信息和资源类型中至少一种。
在一种可能的方式中,链接信息获取接口对应的资源包括:链接信息获取接口所处理的资源,和,该资源所直接链接的叶子节点资源。
例如,当第一集合资源与第一中间层级资源以及叶子节点资源之间的链接关系如图1所示的关系一致时,链接信息获取接口对应的资源可以包括链接信息获取接口所处理的资源,即图1中所示的中间层间资源140,和,该第一中间层级资源直接链接的叶子节点资源,即 图1中所示的叶子节点资源160。
需要说明的是,该链接方式能够解决架构中第一集合资源-第一中间层级资源-叶子节点资源这种结构的批处理操作问题,其中中介层级资源和叶子节点资源直接链接。由于上述链接结构在智能家居领域中应用较为广泛,因此,本实施例提供的该链接信息获取接口的对应资源的方式,能够解决本领域中第一集合资源批处理出现故障的问题。
可选地,在该处理方式中,链接信息获取接口可以被设计为oic.if.ll接口。
在另一种可能的方式中,链接信息获取接口对应的资源包括:链接信息获取接口所处理的资源,和,该资源所嵌套链接的叶子节点资源。
例如,当第一集合资源与第一中间层级资源以及叶子节点资源之间的链接关系如图2所示的关系一致时,链接信息获取接口对应的资源可以包括链接信息获取接口所处理的资源,即图2中所示的中间层间资源142、中间层间资源144,和,该第一中间层级资源嵌套链接的叶子节点资源,即图2中所示的叶子节点资源162、叶子节点资源164、叶子节点资源166和叶子节点资源168。
步骤420,向第一中间层级资源发送第二请求。
在本实施例中,第一集合资源向第一中间层级资源发送第二请求。
步骤430,当接收到第一中间层级资源发送的叶子节点资源的链接信息时,根据叶子节点资源的链接信息生成第三请求。
在本申请中,第一集合资源在接收到第一中间层级资源发送的叶子节点资源的链接信息时,能够根据该链接信息生成第三请求,第三请求中包括状态更改接口,该状态更改接口是叶子节点资源的缺省接口,且用于更改叶子节点资源的状态。
步骤440,向叶子节点资源发送第三请求。
在本申请中,第一集合资源向叶子节点资源发送第三请求。
相应的,叶子节点资源在接收到第三请求时,将按照第三请求中携带的状态更改接口(即叶子节点资源的缺省接口)的标识,调用对应的接口。在本申请实施例中,叶子节点资源调用自身的缺省接口,对叶子节点资源的状态进行更改。
在一种可能的实现方式中,第一集合资源还能够通过生成第二集合资源。以来集中管理叶子节点资源。在生成第二集合资源的步骤中,第一集合资源还能通过第二集合资源相应地向叶子节点资源发送第三请求。
在上述场景中,当接收到第一中间层级资源发送的叶子节点资源的链接信息时,第一集合资源生成第二集合资源。需要说明的是,第二集合资源也可以是预先生成的集合资源,该第二集合资源和叶子节点资源直接链接。第一集合资源通过第二集合资源,根据叶子节点资源的链接信息生成第三请求,第一集合资源通过第二集合资源向叶子节点资源发送第三请求。
综上所述,本申请实施例提供的一种更改资源状态的方法,能够令第一集合资源在接收到客户端发送的第一请求后,从第一中间层级资源中获取所链接的各个叶子节点资源的链接信息,在基于该链接信息生成发送至叶子节点资源的请求,使得该发送的请求中的接口标识和叶子节点资源的缺省接口一致,提高了第一集合资源处理一批叶子节点资源的性能,提高了系统控制的成功率,有利于系统正确执行指令。
请参考图5,图5是本申请实施例提供的另一种更改资源状态的方法的流程图。图5所示的方法能够应用在第一中间层级资源中,第一集合资源包括第一中间层级资源,第一中间层级资源包括叶子节点资源,该方法包括:
步骤510,当接收到第二请求时,获取叶子节点资源的链接信息。
在本实施例中,第一中间层级资源能够在接收到第二请求时,获取叶子节点资源的链接信息。需要说明的是,第二请求是第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求。其中,链接信息获取接口用于获取链接信息获取接口对应的资源的链接信息。
在本实施例中,第一中间层级资源能够解析出第二请求中的指令,以便第一中间层级资源按照第二请求的指示获取叶子节点资源的链接信息。
在本实施例的实现方式中,第一中间层级资源能够根据链接信息获取接口对应的资源的情况,来决定如何获取叶子节点资源的链接信息。
在一种可能的实现方式中,链接信息获取接口对应的资源包括:链接信息获取接口所处理的资源,和,该资源所直接链接的叶子节点资源。
在此场景中,当接收到第二请求时,第一中间层级资源能够获取第一中间层级资源直接链接的叶子节点资源的链接信息。
在另一种可能的方式中,链接信息获取接口对应的资源包括:链接信息获取接口所处理的资源,和,该资源所嵌套链接的叶子节点资源。
在此场景中,当接收到第二请求时,第一中间层级资源能够获取第一子链接信息,该第一子链接信息用于指示第一中间层级资源直接链接的叶子节点资源的链接信息。随后,第一中间层级资源能够获取第二子链接信息,该第二子链接信息用于指示第一中间层级资源嵌套链接的叶子节点资源的链接信息。
例如,以本实施例的图2所示架构为例,以第一中间层级资源142为例进行说明。当接收到第二请求时,第一中间层级资源能够获取第一子链接信息,该第一子链接信息用于指示第一中间层级资源142直接链接的叶子节点资源。由于在图2中第一中间层级资源142没有直接链接叶子节点资源,因此,第一子链接信息为空。第一中间层级资源142还能够获取第二子链接信息,该二子链接信息用于指示第一中间层级资源142嵌套链接的叶子节点资源162的链接信息,以及,叶子节点资源164的链接信息。
步骤520,将叶子节点资源的链接信息发送至第一集合资源,叶子节点资源的链接信息用于指示第一集合资源生成第三请求。
在本实施例中,第一中间层级资源能够将叶子节点资源你的链接信息发送至第一集合资源,该叶子节点资源的链接信息用于指示第一集合资源生成第三请求,该第三请求中包括状态更改接口,状态更改接口是叶子节点资源的缺省接口,且用于更改叶子节点资源的状态。
综上所述,本实施例提供的一种更改资源状态的方法,能够令第一中间层级资源在接收到第一集合资源发送的第二请求时,将链接的叶子节点资源的链接信息返回至第一集合资源,向第一集合资源提供叶子节点资源准确的链接信息,使得第一集合资源能够一次性正确控制各个叶子节点资源改变状态。由于第一中间层级资源提供了叶子节点资源准确的链接信息,因此提高了第一集合资源准确批量控制叶子节点资源的效果。
请参考图6,图6是本申请实施例提供的一种智能家居系统中的模型示意图。在图6所示的智能别墅中,包括第一集合资源我的别墅(英文:my house),第一中间层级资源1号房间(英文:my room 1),第一中间层级资源2号房间(英文:my room 2)。其中,1号房间中包括叶子节点资源1号灯具(英文:light 1)和2号灯具(英文:light 2)。2号房间中包括叶子节点资源3号灯具(英文:light 3)和4号灯具(英文:light 4)。
在本实施例中,第一集合资源我的别墅所涉及的示意性代码如下:
/myhouse{//表示第一集合资源myhouse
“rt”:[“x.org.example.house”,“oic.wk.col],//rt(英文:resource type,中文:资源类型),对第一集合资源myhouse进行类型上的描述
“if”:[“oic.if.ll”,“oic.if.baseline”,“oic.if.b”,“oic.if.lrw”]//if(英文:interface,中文:接口类型),描述该资源支持的接口类型,其中第一个是缺省接口
“links”://用于描述该第一集合资源链接的资源的内容
[
{“”
“href”:“/myroom1”,//用于描述第一集合资源链接的1号房间资源的路径信息
“rt”:“x.org.example.room,oic.wk.col”,//用于描述1号房间资源的资源类型
“if”:[“oic.if.b”,“oic.if.baseline”,“oic.if.ll”],//用于描述1号房间资源的接口类型
“bm”:2}
{
“href”:“/myroom2”,
“rt”:“x.org.example.room,oic.if.ll.baseline”,
“if”:[“oic.if.ll”,“oic.if.baseline”,“oic.if.b”],
“bm”:2}
]
}
需要说明的是,上述针对2号房间资源的代码注释,请参见1号房间资源的代码注释,此处不再赘述。
在本实施例中,1号房间资源的详细代码表示可参见下述内容。
/myroom1{
“rt”:[“x.org.example.room”,“oic.wk.col”,
“if”:[“oic.if.b”,“oic.if.baseline”,“oic,if,ll”],
“links”:
[
{
“href”:“/light1”,
“rel”:[“item”],
“rt”:“oic.r.switch.binary”,
“if”:[“oic.if.a”,“oic.if.baseline”],
“bm”:2}
{
“href”:“/light2”,
“rel”:[“item”],
“rt”:“oic.r.switch.binary”,
“if”:[“oic.if.a”,“oic.if.baseline”],
“bm”:2}
]
}
在本实施例中,2号房间资源的详细代码表示可参见下述内容。
/myroom1{
“rt”:[“x.org.example.room”,“oic.wk.col”,
“if”:[“oic.if.ll”,“oic.if.baseline”,“oic,if,b”],
“links”:
[
{
“href”:“/light3”,
“rel”:[“item”],
“rt”:“oic.r.switch.binary”,
“if”:[“oic.if.a”,“oic.if.baseline”],
“bm”:2}
{
“href”:“/light4”,
“rel”:[“item”],
“rt”:“oic.r.switch.binary”,
“if”:[“oic.if.a”,“oic.if.baseline”],
“bm”:2}
]
}
需要说明的是,上述针对1号房间资源的代码表示和2号房间资源的代码表示均可参照第一集合资源的代码表示的注释,此处不再赘述。
请参见图7,图7是本申请实施例提供的一种更改资源状态的应用场景交互图。在图7中,包括客户端7A、第一集合资源7B、第一中间层级资源7C和第一中间层级资源7D。
步骤710,客户端向第一集合资源发送第一批(英文:batch)操作请求。
步骤720,第一集合资源在接收到第一批操作请求时,根据第一集合资源包含的链接资源的信息分解第一批操作请求,得到n个第四请求。
需要说明的是,n为正整数,n是第一集合资源直接链接的第一中间层级资源的数量。
在本实施例中,第一集合资源可以是T-collection(中文:T集合资源)。
步骤730,当第一集合资源直接链接的第一中间层级资源是集合资源时,第一集合资源使用第一集合资源直接链接的第一中间层级资源的link list接口(也即oic.if.ll接口)。
步骤740,第一集合资源向第一中间层级资源发送第四请求。
步骤750,第一中间层级资源向第一集合资源返回link list信息。
步骤760,第一集合资源将根据link list信息确定整个架构中全部的叶子节点资源,并将全部的叶子节点资源组合为一个D-collection(中文:D集合资源)。
可选地,在第一集合资源执行完成步骤760后,可以执行以下步骤。
步骤(1),第一集合资源将根据D-collection,将第一批操作请求再次分解为第五请求,将第五请求分别发送至D-collection中包含的各个叶子节点资源。
需要说明的是,第五请求的接口是D-collection中包含的各个叶子节点资源各自对应的缺省接口,第五请求用于发送至D-collection中包含的各个叶子节点资源。
作为一种可替代的实现方式,第一集合资源可以不生成D-collection,而是分别向整个架构中全部的叶子节点资源发送第五请求。
步骤(2),第一集合资源获取D-collection中包含的各个叶子节点资源返回的应答消息,并将应答消息进行聚合,获得针对第一批操作请求的应答消息。
步骤(3),第一集合资源向客户端返回针对第一批操作请求的应答消息。
在本申请实施例中,客户端使用批操作请求操作T-collection。T-collction是一个包含其他第一中间层级资源的资源。T-collection收到上述批操作请求后,根据自身链接的其他集合资源的信息,生成第四请求,将第四请求分别发往链接的各个其他集合资源(也即第一中间层级资源),并以link list(也即oic.if.ll)接口作为各第四请求的接口类型。其中,T-collection(即图7中的第一集合资源7B)直接链接了第一中间层级资源7C和第一中间层级资源7D。
在上述操作中,第一中间层级资源7C和第一中间层级资源7D在收到第四请求后,分别返回各自的叶子节点资源的链接信息。其中,该链接信息包括资源标识、接口类型、端口信息、资源类型。
在上述操作中,T-collection根据第一中间层级资源7C和第一中间层级资源7D各自返回的叶子节点资源,生成新的D-collection。需要说明的是,D-collection是虚拟的临时集合资源,当第一批操作请求处理完成后,该D-collection将会被删除。在一种可能的实现方式中,D-collection直接链接了第一中间层级资源7C返回的所有叶子节点资源,以及,第一中间层级资源7D返回的所有叶子节点资源。
综上可知,本实施例提供的上述方案能够解决第一集合资源-第一中间层级资源-叶子节点资源这种资源结构的批操作中,可能出现的无法正确更改叶子节点资源的状态的问题。由于在智能家居领域中,如上述第一集合资源-第一中间层级资源-叶子节点资源这种嵌套方式的应用最为普遍,因此本方案中无需定义新的接口,实现难度较低。
在本实施例的另一种实现方式中,更改资源状态的系统中可以设计一个新的接口 oic.if.bll,该接口的功能类似于oic.if.b接口。本申请设计的接口oic.if.bll需要更改资源状态的系统中的各个资源都能够支持,各个资源包括第一集合资源、第一中间层级资源和叶子节点资源。该oic.if.bll接口用于一次性获取所有嵌套第一集合资源的第一中间层级资源以及叶子节点资源。
请参考图8,图8是本申请实施例提供的另一种更改资源状态的应用场景交互图。在图8中,包括客户端8A、第一集合资源8B、第一中间层级资源8C和第一中间层级资源8D。
步骤810,客户端向第一集合资源发送第一批(英文:batch)操作请求。
步骤820,第一集合资源在接收到第一批操作请求时,根据第一集合资源包含的链接资源的信息分解第一批操作请求,得到m个第六请求。
需要说明的是,m为正整数,m是第一集合资源直接链接的第一中间层级资源的数量。
在一种可能实现的方式中,第一集合资源可以是T-collection。T-collection在接收到第一批操作请求时,根据T-collection所直接链接的第一中间层级资源的数量,分解第一批操作请求,得到m个第六请求。
步骤830,当第一集合资源直接链接的第一中间层级资源是集合资源时,第一集合资源使用第一集合资源直接链接的第一中间层级资源的oic.if.bll。
步骤840,第一集合资源向第一中间层级资源发送第六请求。
在本申请实施例中,第六请求中调用的接口是oic.if.bll。
需要说明的是,在第一中间层级资源接收到第六请求后,第一中间层级资源会在其直接链接其它第一中间层级资源时,继续生成调用oic.if.bll的请求,并把该请求发送至直接链接的其它第一中间层级资源。
步骤850,当第一中间层级资源不再链接其它第一中间层级资源时,第一中间层级资源向第一集合资源返回所直接链接的叶子节点资源的链接信息。
步骤860,当接收到各个第一中间层级资源返回的叶子节点资源的链接信息时,第一集合资源将第一批操作请求分解为第七请求。
可选地,第一集合资源还能够生成D-collection。该D-collection是虚拟的临时集合资源,当本实施例提供的更改资源状态的流程执行完成后,该D-collection会被删除。需要说明的是,D-collection直接链接了本实施例中所有叶子节点资源。
步骤870,第一集合资源将第七请求发送至各个叶子节点资源。
需要说明的是,第七请求在被发送至各个叶子节点资源时,所携带的接口是所对应的叶子节点资源的缺省接口。
步骤880,第一集合资源接收各个叶子节点资源返回的应答消息。
可选地,第一集合资源还可以将各个叶子节点返回的应答消息聚合在一起。
综上所述,本申请实施例能够根据新定义的批链接列表处理接口,在系统中存在多层嵌套关系时,第一集合资源能够根据批链接列表处理接口,逐层获取全部的叶子节点资源的链接信息,在获取到该链接信息后,第一集合资源能够将客户端发送的批处理信息分解为调用各个叶子节点资源的缺省接口的信息,从而实现了一次性更改整个系统中的叶子节点资源的状态的效果。
请参见图9,图9是是本申请一个示例性实施例提供的终端的结构框图。图9所示的终端能够在在系统中被识别为第一集合资源,或者,被识别为第一中间层级资源。如图9所示,该终端包括处理器920和存储器940,所述存储器940中存储有至少一条指令,所述指令由所述处理器920加载并执行以实现如本申请各个方法实施例所述的更改资源状态的方法。
在本申请中,终端900是具备通信功能的电子设备。
处理器920可以包括一个或者多个处理核心。处理器920利用各种接口和线路连接整个终端900内的各个部分,通过运行或执行存储在存储器940内的指令、程序、代码集或指令集,以及调用存储在存储器940内的数据,执行终端900的各种功能和处理数据。可选的, 处理器920可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器920可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器920中,单独通过一块芯片进行实现。
存储器940可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选的,该存储器940包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器940可用于存储指令、程序、代码、代码集或指令集。存储器940可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储下面各个方法实施例中涉及到的数据等。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图10,图10示出了本申请一个示例性实施例提供的更改资源状态的装置的结构框图。该更改资源状态的装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分,以实现第一集合资源的功能。在本装置中,第一集合资源包括所述第一中间层级资源,所述第一中间层级资源包括所述叶子节点资源。该装置包括:
第一生成模块1010,用于当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源执行更改状态的操作,所述第二请求用于获取所述叶子节点资源的链接信息,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
第一发送模块1020,用于向所述第一中间层级资源发送所述第二请求;
第二生成模块1030,用于当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态;
第二发送模块1040,用于向所述叶子节点资源发送所述第三请求。
在一个可选的实施例中,所述装置中涉及的链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源直接链接的所述叶子节点资源。
在一个可选的实施例中,所述装置中涉及的所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源嵌套链接的所述叶子节点资源。
在一个可选的实施例中,所述第二生成模块1030,用于当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,生成第二集合资源,所述第二集合资源与所述叶子节点资源直接链接。
在一个可选的实施例中,所述第二发送模块1040,用于通过所述第二集合资源向所述叶子节点资源发送所述第三请求。
在一个可选的实施例中,所述装置中涉及的叶子节点资源的链接信息包括资源标识、接口类型、端口信息和资源类型中至少一种。
请参考图11,图11示出了本申请一个示例性实施例提供的更改资源状态的装置的结构框图。该更改资源状态的装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分,以实现第一中间层级资源的功能。在本装置中,第一集合资源包括所述第一中间层级 资源,所述第一中间层级资源包括所述叶子节点资源。该装置包括:
信息获取模块1110,用于当接收到第二请求时,获取所述叶子节点资源的链接信息,所述第二请求是所述第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;
第三发送模块1120,用于将所述叶子节点资源的链接信息发送至所述第一集合资源,所述叶子节点资源的链接信息用于指示所述第一集合资源生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态。
在一个可选的实施例中,所述装置中涉及的链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源直接链接的所述叶子节点资源。
在一个可选的实施例中,所述装置中涉及的所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源嵌套链接的所述叶子节点资源。在一个可选的实施例中,所述。
在一个可选的实施例中,所述信息获取模块1110,用于当接收到所述第二请求时,获取所述第一中间层级资源直接链接的所述叶子节点资源的链接信息。
在一个可选的实施例中,所述信息获取模块1110,用于当接收到所述第二请求时,获取第一子链接信息,所述第一子链接信息用于指示所述第一中间层级资源直接链接的所述叶子节点资源的链接信息;获取第二子链接信息,所述第二子链接信息用于指示所述第一中间层级资源嵌套链接的所述叶子节点资源的链接信息。
本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的更改资源状态的方法。
需要说明的是:上述实施例提供的更改资源状态的装置在执行更改资源状态的方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的更改资源状态的装置与更改资源状态的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。
Claims (17)
- 一种更改资源状态的系统,其特征在于,所述系统包括:第一集合资源、第一中间层级资源、m个第二中间层级资源和n个叶子节点资源,所述第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个所述叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数;所述第一集合资源,用于当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源的执行更改状态的操作,所述链接信息获取接口用于获取对应的资源的链接信息;所述第一集合资源,用于向所述第一中间层级资源发送所述第二请求;所述第一中间层级资源,用于当接收到所述第二请求时,获取所述叶子节点资源的链接信息;所述第一中间层级资源,用于将所述叶子节点资源的链接信息发送至所述第一集合资源;所述第一集合资源,用于根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口是所述叶子节点资源的缺省接口,且所述状态更改接口用于更改所述叶子节点资源的状态;所述第一集合资源,用于向所述叶子节点资源发送所述第三请求。
- 一种更改资源状态的方法,其特征在于,应用于第一集合资源中,所述第一集合资源直接链接第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述方法包括:当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源执行更改状态的操作,所述第二请求用于获取所述叶子节点资源的链接信息,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;向所述第一中间层级资源发送所述第二请求;当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态;向所述叶子节点资源发送所述第三请求。
- 根据权利要求2所述的方法,其特征在于,所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源直接链接的所述叶子节点资源。
- 根据权利要求2所述的方法,其特征在于,所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源嵌套链接的所述叶子节点资源。
- 根据权利要求3或4所述的方法,其特征在于,当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,包括:当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,生成第二集合资源,所述第二集合资源与所述叶子节点资源直接链接;通过所述第二集合资源根据所述叶子节点资源的链接信息生成所述第三请求;所述向所述叶子节点资源发送所述第三请求,包括:通过所述第二集合资源向所述叶子节点资源发送所述第三请求。
- 根据权利要求3或4所述的方法,其特征在于,所述叶子节点资源的链接信息包括资源标识、接口类型、端口信息和资源类型中至少一种。
- 一种更改资源状态的方法,其特征在于,应用于第一中间层级资源中,第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述方法包括:当接收到第二请求时,获取所述叶子节点资源的链接信息,所述第二请求是所述第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;将所述叶子节点资源的链接信息发送至所述第一集合资源,所述叶子节点资源的链接信息用于指示所述第一集合资源生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态。
- 根据权利要求7所述的方法,其特征在于,所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源直接链接的所述叶子节点资源。
- 根据权利要求7所述的方法,其特征在于,所述链接信息获取接口对应的资源包括:所述链接信息获取接口所处理的资源,和,所述资源嵌套链接的所述叶子节点资源。
- 根据权利要求8所述的方法,其特征在于,所述当接收到第二请求时,获取所述叶子节点资源的链接信息,包括:当接收到所述第二请求时,获取所述第一中间层级资源直接链接的所述叶子节点资源的链接信息。
- 根据权利要求9所述的方法,其特征在于,所述当接收到第二请求时,获取所述叶子节点资源的链接信息,包括:当接收到所述第二请求时,获取第一子链接信息,所述第一子链接信息用于指示所述第一中间层级资源直接链接的所述叶子节点资源的链接信息;获取第二子链接信息,所述第二子链接信息用于指示所述第一中间层级资源嵌套链接的所述叶子节点资源的链接信息。
- 一种更改资源状态的装置,其特征在于,应用于第一集合资源中,所述第一集合资源直接链接第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,所述装置包括:第一生成模块,用于当接收到客户端发送的第一请求时,根据链接信息获取接口生成第二请求,所述第一请求用于指示所述叶子节点资源执行更改状态的操作,所述第二请求用于获取所述叶子节点资源的链接信息,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;第一发送模块,用于向所述第一中间层级资源发送所述第二请求;第二生成模块,用于当接收到所述第一中间层级资源发送的所述叶子节点资源的链接信息时,根据所述叶子节点资源的链接信息生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态;第二发送模块,用于向所述叶子节点资源发送所述第三请求。
- 一种更改资源状态的装置,其特征在于,应用于第一中间层级资源中,第一集合资源直接链接所述第一中间层级资源和/或直接链接n1个叶子节点资源,所述第一中间层级资源链接m个第二中间层级资源和/或链接n-n1个所述叶子节点资源,m是自然数,n是正整数,n1是不大于n的自然数,所述装置包括:信息获取模块,用于当接收到第二请求时,获取所述叶子节点资源的链接信息,所述第二请求是所述第一集合资源在接收到客户端发送的第一请求时,根据链接信息获取接口生成的请求,所述链接信息获取接口用于获取所述链接信息获取接口对应的资源的链接信息;第三发送模块,用于将所述叶子节点资源的链接信息发送至所述第一集合资源,所述叶子节点资源的链接信息用于指示所述第一集合资源生成第三请求,所述第三请求中包括状态更改接口,所述状态更改接口是所述叶子节点资源的缺省接口,且用于更改所述叶子节点资源的状态。
- 一种终端,其特征在于,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求2至6任一所述的更改资源状态的方法。
- 一种终端,其特征在于,所述终端包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求7至11任一所述的更改资源状态的方法。
- 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求2至6任一所述的更改资源状态的方法。
- 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求7至11任一所述的更改资源状态的方法。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/085216 WO2020220272A1 (zh) | 2019-04-30 | 2019-04-30 | 更改资源状态的方法、系统、终端及存储介质 |
CN201980091942.6A CN113439418A (zh) | 2019-04-30 | 2019-04-30 | 更改资源状态的方法、系统、终端及存储介质 |
US17/511,232 US11706156B2 (en) | 2019-04-30 | 2021-10-26 | Method and system for changing resource state, terminal, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/085216 WO2020220272A1 (zh) | 2019-04-30 | 2019-04-30 | 更改资源状态的方法、系统、终端及存储介质 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/511,232 Continuation US11706156B2 (en) | 2019-04-30 | 2021-10-26 | Method and system for changing resource state, terminal, and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020220272A1 true WO2020220272A1 (zh) | 2020-11-05 |
Family
ID=73029547
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/085216 WO2020220272A1 (zh) | 2019-04-30 | 2019-04-30 | 更改资源状态的方法、系统、终端及存储介质 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11706156B2 (zh) |
CN (1) | CN113439418A (zh) |
WO (1) | WO2020220272A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112286621A (zh) * | 2020-12-30 | 2021-01-29 | 智道网联科技(北京)有限公司 | 一种远程界面生成方法、装置、电子设备及介质 |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20240232203A9 (en) * | 2022-10-19 | 2024-07-11 | Dell Products L.P. | Increased efficiency of query types of representational state transfer programming interfaces |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1753374A (zh) * | 2004-09-23 | 2006-03-29 | 华为技术有限公司 | 系统资源管理的实现方法 |
CN102263776A (zh) * | 2010-05-26 | 2011-11-30 | 魏星 | 一种智能家居远程控制系统及智能家居服务器 |
CN102394826A (zh) * | 2011-11-04 | 2012-03-28 | 北京邮电大学 | 集中式频谱灵活光网络信息同步方法及系统 |
CN107979871A (zh) * | 2017-10-27 | 2018-05-01 | 上海感悟通信科技有限公司 | 用于无线自组织网络的通信系统、装置、方法及存储介质 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8234650B1 (en) * | 1999-08-23 | 2012-07-31 | Oracle America, Inc. | Approach for allocating resources to an apparatus |
US8640137B1 (en) * | 2010-08-30 | 2014-01-28 | Adobe Systems Incorporated | Methods and apparatus for resource management in cluster computing |
US9578028B2 (en) | 2014-06-27 | 2017-02-21 | Juniper Networks, Inc. | Subscriber management using a restful interface |
-
2019
- 2019-04-30 WO PCT/CN2019/085216 patent/WO2020220272A1/zh active Application Filing
- 2019-04-30 CN CN201980091942.6A patent/CN113439418A/zh active Pending
-
2021
- 2021-10-26 US US17/511,232 patent/US11706156B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1753374A (zh) * | 2004-09-23 | 2006-03-29 | 华为技术有限公司 | 系统资源管理的实现方法 |
CN102263776A (zh) * | 2010-05-26 | 2011-11-30 | 魏星 | 一种智能家居远程控制系统及智能家居服务器 |
CN102394826A (zh) * | 2011-11-04 | 2012-03-28 | 北京邮电大学 | 集中式频谱灵活光网络信息同步方法及系统 |
CN107979871A (zh) * | 2017-10-27 | 2018-05-01 | 上海感悟通信科技有限公司 | 用于无线自组织网络的通信系统、装置、方法及存储介质 |
Non-Patent Citations (1)
Title |
---|
3GPP. ''TS 29.201'' REPRESENTATIONAL STATE TRANSFER (REST) REFERENCE POINT BETWEEN APPLICATION FUNCTION (AF) AND PROTOCOL CONVERTER (PC) (RELEASE 13, 31 December 2016 (2016-12-31) * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112286621A (zh) * | 2020-12-30 | 2021-01-29 | 智道网联科技(北京)有限公司 | 一种远程界面生成方法、装置、电子设备及介质 |
Also Published As
Publication number | Publication date |
---|---|
CN113439418A (zh) | 2021-09-24 |
US20220052962A1 (en) | 2022-02-17 |
US11706156B2 (en) | 2023-07-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9110884B2 (en) | Message publishing and subscribing method and apparatus | |
KR101871383B1 (ko) | 계층적 데이터 구조의 노드 상에서 재귀적 이벤트 리스너를 사용하기 위한 방법 및 시스템 | |
US11210277B2 (en) | Distributing and processing streams over one or more networks for on-the-fly schema evolution | |
CN110677462B (zh) | 多区块链网络的访问处理方法、系统、装置及存储介质 | |
WO2019109923A1 (zh) | 消息处理方法及系统、存储介质、电子设备 | |
US11706156B2 (en) | Method and system for changing resource state, terminal, and storage medium | |
US20190324930A1 (en) | Method, device and computer program product for enabling sr-iov functions in endpoint device | |
WO2024113996A1 (zh) | 一种对主机io处理的优化方法、装置、设备及非易失性可读存储介质 | |
CN114090388A (zh) | 信息获取方法、服务器集群、服务器及设备 | |
CN109614271A (zh) | 多个集群数据一致性的控制方法、装置、设备及存储介质 | |
US11228537B2 (en) | Resource processing method and system, storage medium and electronic device | |
CN110933188A (zh) | 远程服务的调用方法、系统、服务器及存储介质 | |
WO2023208132A1 (zh) | Api转换系统及其访问请求处理方法、电子设备及介质 | |
WO2019062156A1 (zh) | 存储过程的执行方法、装置及存储介质 | |
WO2023186154A1 (zh) | 数据传输系统以及方法 | |
CN110855562A (zh) | 一种物联网数据分发管理方法及系统、存储介质及管理终端 | |
WO2021078176A1 (zh) | 存储过程的运行方法、装置、数据库系统及存储介质 | |
WO2024041081A1 (zh) | 数据处理方法、装置、设备及可读存储介质 | |
WO2023143061A1 (zh) | 一种数据访问方法及其数据访问系统 | |
JP4283595B2 (ja) | 情報処理装置、オブジェクト管理方法、オブジェクト管理プログラム及び記録媒体 | |
WO2022116191A1 (zh) | 连接建立方法、装置、设备及存储介质 | |
US11456889B2 (en) | Information notification method, apparatus, and system | |
WO2021134757A1 (zh) | 与用户进行信息交互的方法和装置 | |
CN116701328A (zh) | 数据处理方法、装置、设备、存储介质及程序产品 | |
WO2019227702A1 (zh) | 数据处理方法、装置、计算机设备以及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19927552 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19927552 Country of ref document: EP Kind code of ref document: A1 |