Nothing Special   »   [go: up one dir, main page]

CN110741361B - Resource query processing method, device, computer equipment and storage medium - Google Patents

Resource query processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110741361B
CN110741361B CN201880037186.4A CN201880037186A CN110741361B CN 110741361 B CN110741361 B CN 110741361B CN 201880037186 A CN201880037186 A CN 201880037186A CN 110741361 B CN110741361 B CN 110741361B
Authority
CN
China
Prior art keywords
resource
query
rcd
response message
request message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201880037186.4A
Other languages
Chinese (zh)
Other versions
CN110741361A (en
Inventor
唐海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN110741361A publication Critical patent/CN110741361A/en
Application granted granted Critical
Publication of CN110741361B publication Critical patent/CN110741361B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • G06F16/24566Recursive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a resource query processing method, a device, computer equipment and a storage medium, wherein the RD searches resource information meeting query conditions in a resource file according to a query mode in a first resource query request message, and if the query mode is recursive query and the queried resource information comprises resource links of resource limited equipment, a preset processing mechanism is adopted to process the first resource query request message.

Description

Resource query processing method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of internet of things, and in particular, to a method and apparatus for processing resource query, a computer device, and a storage medium.
Background
With the development of the internet of things and smart home technologies and industries, intelligent home appliances are beginning to enter into the life of general residents, and intelligent home appliances can be classified into general devices (ND) and resource-constrained devices (Resource Constrained Device, RCD). The common device refers to a device with stronger capability in the aspects of processing speed, continuous work, networking and the like, and the resource-limited device is relatively deficient in hardware resources compared with the common device, so that the service processing capability and the cruising capability of the common device are poor, and the resource-limited device may periodically enter a sleep state (save power) in a network or cannot process a large amount of service requests in real time and the like.
Currently, there is a solution in the industry for proxy devices, mainly to help resource-constrained devices to handle resource query requests, proxy devices (Resource Directory, RD) are typically more powerful and real-time networked devices. Typically, after the RCD selects the RD and issues its own Resource Links (Resource Links) to the RD, after the RCD receives the Resource query request again, the RCD may not respond to the Resource query request any more, but the RD responds to the Resource query request. For example, a common method for querying an RD resource is that a client (client) sends a resource query request to the RD in a multicast or unicast manner, where a query method (interface) may be set in the query request, and the RD queries resource information required by the client according to the set query method.
However, when encountering a resource link in which RCD device resources exist in the RD, and the query method is set to a recursive query, how the RD should handle is a problem to be solved.
Disclosure of Invention
Based on this, it is necessary to provide a resource query processing method, apparatus, computer device and storage medium for the above-mentioned technical problem how the RD should process when encountering a resource link in which the resource of the RCD device exists in the RD, and the query method is set as a recursive query.
In a first aspect, an embodiment of the present invention provides a resource query processing method, where the method includes:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
inquiring a resource file according to the resource inquiry request, and acquiring resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and if the query mode is recursive query and the resource information comprises the resource link of the RCD, processing the first resource query request message by adopting a preset processing mechanism.
In one embodiment, the processing the first resource query request message by using a preset processing mechanism includes:
Acquiring a first response message according to the resource information;
and sending the first response message to a query end.
In one embodiment, the obtaining the first response message according to the resource information includes:
changing the query mode into a link query mode;
acquiring the resource link of the RCD according to the resource information by adopting the link inquiry mode;
and carrying the resource link of the RCD in the first response message.
In one embodiment, the first response message is a redirect message, where the redirect message is used to instruct the querying end to acquire the resources required for the RCD.
In one embodiment, the obtaining the first response message according to the resource information includes:
determining a target RCD according to the resource information;
sending a second resource query request message to the target RCD; the second resource query request message is used for indicating the target RCD to query the resources required by the query end;
receiving a second response message sent by the target RCD; the second response message comprises resources required by the query end;
and generating the first response message according to the second response message.
In one embodiment, if there are a plurality of target RCDs, the generating the first response message according to the second response message includes:
and generating the first response message according to the second response message sent by each target RCD.
In one embodiment, the processing the first resource query request message by using a preset processing mechanism includes:
discarding the first resource query request message.
In one embodiment, if the query mode is a recursive query and the resource information includes the published resource information of the RD, the resource meeting the query condition is obtained by adopting the recursive query mode.
In one embodiment, the method further comprises:
receiving a resource release request sent by an RCD of a resource to be released; the resource release request comprises the equipment identification and attribute information of the RCD of the resource to be released;
authenticating the RCD of the resource to be issued according to the resource issuing request;
and if the authentication is passed, storing the release resource information of the RCD of the resource to be released into the resource file according to the resource release request.
In a second aspect, an embodiment of the present invention provides a resource query processing apparatus, including:
the first receiving module is used for receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
the acquisition module is used for inquiring the resource file according to the resource inquiry request and acquiring the resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and the processing module is used for processing the first resource query request message by adopting a preset processing mechanism if the query mode is recursive query and the resource information comprises the resource link of the RCD.
In a third aspect, an embodiment of the present invention provides a computer device comprising a memory storing a computer program and a processor implementing the following steps when executing the computer program:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
inquiring a resource file according to the resource inquiry request, and acquiring resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
And if the query mode is recursive query and the resource information comprises the resource link of the RCD, processing the first resource query request message by adopting a preset processing mechanism.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
inquiring a resource file according to the resource inquiry request, and acquiring resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and if the query mode is recursive query and the resource information comprises the resource link of the RCD, processing the first resource query request message by adopting a preset processing mechanism.
According to the resource query processing method, the device, the computer equipment and the storage medium, the RD queries in a resource file comprising the published resource information of the RD and the published resource information of the RCD according to the received first resource query request message comprising the query mode and the query condition, acquires the resource information corresponding to the first resource query request message, and processes the first resource query request message by adopting a preset processing mechanism when the query mode is recursive query and the queried corresponding resource information comprises the resource link of the RCD.
Drawings
FIG. 1 is an application environment diagram of a resource query processing method according to an embodiment;
FIG. 2 is a flowchart of a method for processing a resource query according to an embodiment;
FIG. 3 is a flowchart of a method for processing a resource query according to an embodiment;
FIG. 4 is a flowchart of a method for processing a resource query according to an embodiment;
FIG. 5 is a flowchart of a method for processing a resource query according to an embodiment;
FIG. 6 is a block diagram illustrating a resource query processing apparatus according to one embodiment;
FIG. 7 is a block diagram illustrating a resource query processing apparatus according to one embodiment;
FIG. 8 is a block diagram of a resource query processing device according to one embodiment;
FIG. 9 is a block diagram of a resource query processing device according to one embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The resource query processing method provided by the application can be applied to an application environment shown in fig. 1. Wherein, the device a and the device D are resource-constrained devices (Resource Constrained Device, abbreviated as RCD), the device B is a proxy device (Resource Directory, abbreviated as RD), and the device C is a query end, where the communication manner between the query end and the RD and between each RCD and RD may be wireless communication, for example: the modes of infrared communication, bluetooth communication, 2G, 3G, 4G, 5G, and the like may be wired communication, for example: communication cables, etc., this embodiment is not limited thereto. Wherein, device a and device D (i.e., RCD) may publish their own resources to device B (i.e., RD), and device C (querying side) may query the resources on device a and device D (i.e., RCD) through device B (i.e., RD). The query end may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
The embodiment of the application provides a resource query processing method, a device, a computer device and a storage medium, which aim to solve the technical problem of how to process a RD when encountering resource links of RCD device resources in the RD and the query method is set as a recursive query. The following will specifically describe the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems by means of examples and with reference to the accompanying drawings. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. It should be noted that, in the resource query processing method provided by the present invention, the execution body is an RD, where the RD may be a computer device, or a resource query processing apparatus, where the apparatus may be implemented in a manner of software, hardware, or a combination of software and hardware to be part or all of resource query processing.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In one embodiment, fig. 2 provides a method for processing a resource query, and this embodiment relates to a specific process of processing, by an RD, a first resource query request message when a query manner in the first resource request is a recursive query. As shown in fig. 2, the method includes:
s101, receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition.
In this embodiment, the first resource query request message is a request sent by the querying end to the RD, and is used for querying the device resource required by the user. For example, assuming that the certain RCD is a luminaire, the first resource query request message may be to obtain attribute information of the luminaire, for example: the color rendering index, color rendering temperature, stroboscopic information of the lamp and the like. Wherein the first resource query request message can comprise a query mode and a query condition, and the query mode represents a characteristic attribute query, a recursion query, a link query and the like; the characteristic attribute query only obtains the value of the characteristic value attribute in the resource, for example, when the thermometer resource is queried, only obtains the value of the temperature attribute, and other common attributes do not query. The query conditions represent query conditions that the RD needs to follow when querying using a specified query format, for example: the query condition may be a type, a query range, a query time period, etc., and in this embodiment, the query mode and the query condition of the first resource query request message are not limited.
For example, the format of the first resource query request message may be a format of a constrained application protocol (The Constrained Application Protocol, coAP) request message, and the query mode and the query condition may be set in a query portion of the first resource query request message.
S102, inquiring a resource file according to the first resource inquiry request message, and acquiring resource information corresponding to the first resource inquiry request message; the resource file includes the release resource information of the RD and the release resource information of the RCD.
The resource file is stored in the RD, and includes a file of release resource information of the RD and release resource information of the RCD, where the release resource information of the RD and the release resource information of the RCD may be resource information that can be queried by each device, and the release resource information may include a resource type, an address, and the like of the device, which is not limited in this embodiment. The resource file may be in an oic/res format, the resource type of the published resource information of the RD may be oic.wk.rd, and the resource type of the published resource information of the RCD may be oic.wk.res.
In this embodiment, the RD searches the resource file for the resource information meeting the query condition according to the query mode in the first resource query request message, for example, the query mode in the first resource query request message is a recursive query, and if the query condition is a lamp, the RD searches the resource file for the resource information with all the resource types being the lamp in the recursive query mode.
S103, if the query mode is recursive query and the resource information comprises the resource link of the RCD, a preset processing mechanism is adopted to process the first resource query request message.
In this embodiment, if the query manner carried in the first resource query request message is recursive query and the obtained resource information corresponding to the first resource query request message includes the resource link of the RCD, a preset processing mechanism is adopted to process the first resource query request message. Wherein the resource link of the RCD represents an acquisition path of resource information issued by the RCD, for example: the resource links of the RCD may include resource addresses, types, interfaces available for use, IP addresses, etc., which are not limited in this embodiment. The preset processing mechanism represents a processing rule of the RD to the first resource query request message, which is preset according to the requirement, namely: and the RD processes each request when receiving different first resource inquiry request messages.
In this embodiment, a corresponding processing mechanism may be specified in advance, and when a query manner is a recursive query and the resource information includes a resource link of an RCD, processing may be performed according to the processing mechanism, for example, the processing mechanism may be that the query manner is a recursive query and when the resource information includes a resource link of an RCD, the first resource query request message is directly ignored, or the resource link of the RCD is fed back to the query end, or the corresponding RCD is directly accessed to obtain a query resource, or the like.
According to the resource query processing method provided by the embodiment, the RD searches the resource information meeting the query condition in the resource file according to the query mode in the first resource query request message, and if the query mode is recursive query and the queried resource information comprises the resource link of the RCD, the first resource query request message is processed by adopting a preset processing mechanism.
Optionally, in one embodiment, step S103 "the processing the first resource query request message by using a preset processing mechanism" includes: discarding the first resource query request message.
In this embodiment, if the RD processes the first resource query request message according to the preset processing mechanism, and if the query mode is recursive query and the queried resource information includes the resource link of the RCD, the RD discards the first resource query request message, i.e. directly ignores the first resource query request message. Thus, after the inquiring end can not receive the response information returned by the RD for a long time, the inquiring end considers that the network does not have the needed resources.
In one embodiment, fig. 3 provides a method for processing a resource query, which relates to a processing mechanism of RD if the query mode is a recursive query and the queried resource information includes a resource link of RCD. As shown in fig. 3, the "processing the first resource query request message by using a preset processing mechanism" includes:
s201, according to the resource information, a first response message is acquired.
The first response message is used for representing a resource query result.
In this embodiment, if the resource information includes resource connection of the RCD, the resource connection of the RCD may be used as a query result to generate the first response message, or if the resource information includes specific information of the query resource, the specific information of the query resource is used as a resource query result to generate the first response message. For example: the first resource query request message is: the color rendering index and color rendering temperature of the lamp are obtained, and the first response message may include a specific color rendering index and color rendering temperature of the lamp, or the first response message may include an identifier, an address, an inquiry interface, and the like of the lamp, which is not limited in this embodiment.
Optionally, one implementation of the step S201 includes: changing the query mode into a link query mode; acquiring the resource link of the RCD according to the resource information by adopting the link inquiry mode; and carrying the resource link of the RCD in the first response message.
In this embodiment, since the resource link cannot be obtained by the recursive query method, the query method needs to be changed to the link query method, for example, the recursive query method (oic.if.b) may be changed to the link query method (oic.if.ll), the resource link of the RCD may be obtained by the link query method, and the resource link of the RCD may be carried in the first response message. The resource link of the RCD represents a link path of the RCD for issuing resource information, for example, if the RCD is a luminaire a, the resource link of the RCD may be a luminaire a device identifier, a resource address, a type, an available interface, an IP address, etc., and the RD may generate the first response message according to the luminaire a device identifier, the resource address, the type, the available interface, the IP address, etc.
Optionally, the first response message is a redirection message, where the redirection message is used to instruct the querying end to acquire the required resources from the RCD. After the query terminal receives the first response message, the query terminal obtains the required resources from the corresponding RCD according to the first response message.
S202, the first response message is sent to a query end.
In this embodiment, the RD sends the first response message to the query end, where the query end may perform corresponding processing according to the content and type of the first response message. For example, if the first response message includes a resource link of the resource-constrained device a, and the first response message is a common response message, the querying end may continue to query the resource-constrained device a for the required resource, or may not query the resource-constrained device a for the required resource. If the first response message includes a resource link of the resource-constrained device a and the first response message is a redirection message, the querying end must query the resource-constrained device a for the required resource.
According to the resource query processing method provided by the embodiment, the RD acquires the first response message according to the resource information corresponding to the first resource query request message, sends the first response message to the query terminal, and informs the query terminal of the query result, so that the technical problem of how the RD processes when encountering resource links of the RCD equipment resources in the RD and the query method is set as recursive query is solved.
In one embodiment, fig. 4 provides a method for processing a resource query, and this embodiment relates to a specific process of obtaining, by an RD, a first response message according to resource information. As shown in fig. 4, S201 includes:
S301, determining a target RCD according to the resource information.
In this embodiment, since the resource information includes the resource link of the RCD, the RD may determine the target RCD according to the resource link of the RCD, for example, if the resource link of the RCD includes information such as an identifier, an address, an interface, etc. of the RCD, the target RCD may be determined according to the identifier, the address, the interface, etc. of the RCD.
It should be noted that, the resource information may include resource links of one RCD or resource links of a plurality of RCDs, and the determined target RCD may include one RCD or a plurality of RCDs.
S302, a second resource query request message is sent to the target RCD; the second resource query request message is used for indicating the target RCD to query the resources required by the query end.
Based on the target RCD determined in step S301, the RD sends a second resource query request message to the target RCD, where the second resource request is used to instruct the target RCD to query the resource required by the querying end, that is, to query the resource requested by the first resource query request message.
For example: assuming that the target RCD is the lamp A, the RD sends a second resource query request message to the lamp A to acquire the color rendering index of the lamp A, and the lamp A returns the display index of the lamp A to the RD when receiving the request.
If the target RCD includes a plurality of RCDs, the RD sends a second resource query request message to each RCD, respectively.
S303, receiving a second response message sent by the target RCD; the second response message includes the resources required by the querying end.
In this step, after receiving the second resource query request message, the target RCD feeds back, according to the second resource query request message, the second response message carried by the required resource information to the RD. For example, if the target RCD is a refrigerator and the second resource query request message is used for querying the temperature of the refrigerator, the refrigerator carries the current temperature of the refrigerator in the second response message and feeds the second response message back to the RD.
S304, generating the first response message according to the second response message.
Based on the second response message sent by the target RCD and received by the RD in step S302, the first response message is generated according to the second response message, and since the second response message is the result of the query of the target RCD according to the second resource query request message sent by the RD, the first response message generated according to the second response message includes the resources required by the query end. The manner of generating the first response message according to the second response message may be, for example, a format required for converting the second response message into the first response message, or other manners, which are not limited in this embodiment.
Considering that the resource query request sent by the query end is more than asking for resources from one RCD in some cases, optionally, if there are multiple target RCDs, the generating the first response message according to the second response message includes: and generating the first response message according to the second response message sent by each target RCD. When a plurality of target RCDs exist, the RD sends corresponding second resource query request messages to the plurality of target RCDs, each target RCD returns the result queried according to the second resource query request message to the RD as a second response message after receiving the second resource query request message, and the RD integrates the second response messages sent by all the target RCDs to generate the first response message. Thus, the RD can query the resources required by the querying side regardless of whether the source of resources required by the querying side is a target RCD or a plurality of RCDs.
According to the resource query request method provided by the embodiment, the RD determines the target RCD firstly according to the resource information, then sends the second resource query request message for indicating the target RCD to query the resources required by the query end to the target RCD, and generates the first response message according to the second response message which is fed back by the target RCD and comprises the resources required by the query end, so that the RD can still acquire the resources required by the query end when the query mode is recursive query and the resource information comprises the resource links of the RCD, and the query efficiency is improved.
The embodiment of the application also provides a method for processing the published resource information of the RD, optionally, if the query mode is a recursive query and the published resource information of the RD is included in the resource information, acquiring the resource meeting the query condition by adopting the recursive query mode.
In this embodiment, if the query portion of the first resource query request message is if=oic.if.b and oic.wk.rd, the query mode is a recursive query, and the corresponding resource information includes the published resource information of RD, and then a recursive query mode is adopted to obtain the resource meeting the query condition.
In one embodiment, fig. 5 provides a resource query processing method, and this embodiment relates to a specific process of the RCD publishing its queriable resource to the RD. As shown in fig. 5, the method further includes:
s401, receiving a resource release request sent by an RCD of a resource to be released; the resource release request comprises the equipment identification and attribute information of the RCD of the resource to be released.
In this embodiment, when the RCD that is to issue a resource needs to issue the resource, the RD may be selected first, and then a resource issue request is sent to the RD. The resource release request sent by the RCD of the resource to be released includes its own device identifier and attribute information, where the device attribute information includes a resource address, a type, an available interface, an IP address, and the like, which is not limited in this embodiment.
Alternatively, when the RCD that is to issue the resource selects the RD, a broadcast request may be sent first, where the broadcast request is used to indicate that the RCD needs the resource to issue, and a response message of the received RDs, and one or more RDs are selected from the RDs that are to issue. It should be noted that one RCD may determine one or more RDs, and one RD may also correspond to one or more RCDs.
And S402, authenticating the RCD of the resource to be issued according to the resource issuing request.
In this embodiment, the RD authenticates the RCD of the resource to be issued that sends the request according to the resource issuing request, where authentication indicates whether the RCD of the resource to be issued that sends the request has authority to issue the resource on the RD, and the manner in which the RD authenticates the RCD of the resource to be issued may be, for example, by identifying whether the RCD of the resource to be issued is a device that has already been bound to the RD, or may be other authentication manners, which is not limited in this embodiment.
And S403, if the authentication is passed, storing the release resource information of the RCD of the resource to be released into the resource file according to the resource release request.
Based on the result of authenticating the RCD of the resource to be issued in the step S402, if the authentication result is passed, the RD saves the resource information issued by the RCD of the resource to be issued in the own resource file, where the resource information issued by the RCD of the resource to be issued may be any information of the RCD of the resource to be issued, for example: parameter information, usage detail information, and the like, which is not limited in this embodiment.
According to the resource query processing method provided by the embodiment, the RD authenticates the corresponding RCD of the resource to be issued according to the resource issuing request by receiving the equipment identifier and the attribute information resource issuing request of the RCD of the resource to be issued, if the authentication is passed, the issued resource information of the RCD of the resource to be issued is stored in the resource file, and in the method, the RD authenticates the RCD of the resource to be issued first, and if the authentication is passed, the issued resource information is stored, so that the RD does not process the resource request of the RCD without authority when helping the RCD to process the resource discovery request, and the security of the RD processing process when the RCD equipment resource is linked in the RD is met, and the query method is set as the security of the RD during recursive query.
It should be understood that, although the steps in the flowcharts of fig. 2-5 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-5 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or steps.
In one embodiment, as shown in fig. 6, there is provided a resource query processing apparatus, including: a first receiving module 10, an acquiring module 11 and a processing module 12, wherein:
a first receiving module 10, configured to receive a first resource query request message; the first resource query request message comprises a query mode and a query condition;
the obtaining module 11 is configured to query a resource file according to the resource query request, and obtain resource information corresponding to the resource query request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and the processing module 12 is configured to process the first resource query request message by adopting a preset processing mechanism if the query mode is a recursive query and the resource information includes the resource link of the RCD.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, as shown in fig. 7, there is provided a resource query processing apparatus, where the processing module 12 includes: an acquisition unit 121 and a transmission unit 122, wherein:
An obtaining unit 121, configured to obtain a first response message according to the resource information;
the sending unit 122 is configured to send the first response message to a querying end.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, the obtaining unit 121 is specifically configured to change the query mode to a link query; acquiring the resource link of the RCD according to the resource information by adopting the link inquiry mode; and carrying the resource link of the RCD in the first response message.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, if the first response message is a redirect message, the redirect message is used to instruct the querying end to acquire the required resource from the RCD.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, as shown in fig. 8, there is provided a resource query processing apparatus, the acquiring unit 121 includes: a determination subunit 1211, a transmission subunit 1212, a reception subunit 1213, and a generation subunit 1214, wherein:
A determining subunit 1211, configured to determine a target RCD according to the resource information.
A sending subunit 1212 configured to send a second resource query request message to the target RCD; the second resource query request message is used for indicating the target RCD to query the resources required by the query end.
A receiving subunit 1213, configured to receive a second response message sent by the target RCD; the second response message includes the resources required by the querying end.
A generating subunit 1214, configured to generate the first response message according to the second response message.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, the generating subunit 1214 is specifically configured to generate, if there are multiple target RCDs, the first response message according to the second response message sent by each of the target RCDs.
In one embodiment, the processing module 12 is specifically further configured to discard the first resource query request message.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
In one embodiment, the processing module 12 is further configured to acquire, if the query manner is a recursive query and the resource information includes the published resource information of the RD, a resource meeting the query condition by adopting the recursive query manner.
In one embodiment, as shown in fig. 9, there is provided a resource query processing apparatus, the method further including: a second receiving module 13, an authentication module 14 and a saving module 15, wherein:
a second receiving module 13, configured to receive a resource release request sent by an RCD of a resource to be released; the resource release request comprises the equipment identification and attribute information of the RCD of the resource to be released;
an authentication module 14, configured to authenticate the RCD of the resource to be issued according to the resource issue request;
and the storage module 15 is configured to store the resource release information of the RCD of the resource to be released into the resource file according to the resource release request if the authentication passes.
The implementation principle and technical effects of the resource query processing device provided in the above embodiment are similar to those of the above method embodiment, and are not described herein again.
The specific limitation of the resource query processing device can be referred to the limitation of the resource query processing method hereinabove, and will not be described herein. The above-described respective modules in the resource query processing apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing resource query processing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a resource query processing method.
It will be appreciated by those skilled in the art that the structure shown in fig. 10 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
inquiring a resource file according to the resource inquiry request, and acquiring resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and if the query mode is recursive query and the resource information comprises the resource link of the RCD, processing the first resource query request message by adopting a preset processing mechanism.
The computer device provided in the foregoing embodiments has similar implementation principles and technical effects to those of the foregoing method embodiments, and will not be described herein in detail.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition;
Inquiring a resource file according to the resource inquiry request, and acquiring resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of RCD;
and if the query mode is recursive query and the resource information comprises the resource link of the RCD, processing the first resource query request message by adopting a preset processing mechanism.
The foregoing embodiment provides a computer readable storage medium, which has similar principles and technical effects to those of the foregoing method embodiment, and will not be described herein.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description. The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for processing a resource query, the method comprising:
receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition; the format of the first resource query request message is the format of a constrained application protocol CoAP request message, and the query mode and the query condition are set in a query part of the first resource query request message; the query mode comprises characteristic attribute query, recursion query and link query; the query conditions are used for representing query conditions which are followed by the proxy device RD when querying by using a designated query mode;
Inquiring a resource file according to the first resource inquiry request message, and acquiring resource information corresponding to the first resource inquiry request message; the resource file comprises release resource information of proxy equipment RD and release resource information of resource restricted equipment RCD; the generation process of the resource file comprises the following steps: receiving a resource release request sent by an RCD of a resource to be released; the resource release request comprises equipment identification and attribute information of the RCD of the resource to be released, the RCD of the resource to be released is authenticated according to the resource release request, and if the authentication is passed, the release resource information of the RCD of the resource to be released is stored in the resource file according to the resource release request;
if the query mode is recursive query and the resource information includes the resource link of the RCD, a first response message is acquired according to the resource information, and the first response message is sent to a query end, or the first resource query request message is discarded.
2. The method of claim 1, wherein the obtaining a first response message according to the resource information comprises:
changing the query mode into a link query mode;
Acquiring the resource link of the RCD according to the resource information by adopting the link inquiry mode;
and carrying the resource link of the RCD in the first response message.
3. The method of claim 2, wherein the first reply message is a redirect message that indicates that the querying end obtains the required resources from the RCD.
4. The method of claim 1, wherein the obtaining a first response message according to the resource information comprises:
determining a target RCD according to the resource information;
sending a second resource query request message to the target RCD; the second resource query request message is used for indicating the target RCD to query the resources required by the query end;
receiving a second response message sent by the target RCD; the second response message comprises resources required by the query end;
and generating the first response message according to the second response message.
5. The method of claim 4, wherein if there are a plurality of the target RCDs, the generating the first reply message from the second reply message comprises:
And generating the first response message according to the second response message sent by each target RCD.
6. The method of claim 4, wherein generating the first reply message from the second reply message comprises:
and converting the second response message into a format corresponding to the first response message to obtain the first response message.
7. The method of claim 1, wherein if the query mode is a recursive query and the resource information includes the published resource information of the RD, acquiring the resource meeting the query condition by adopting the recursive query mode.
8. A resource query processing apparatus, the apparatus comprising:
the first receiving module is used for receiving a first resource query request message; the first resource query request message comprises a query mode and a query condition; the format of the first resource query request message is the format of a constrained application protocol CoAP request message, and the query mode and the query condition are set in a query part of the first resource query request message; the query mode comprises characteristic attribute query, recursion query and link query; the query conditions are used for representing query conditions which are followed by the proxy device RD when querying by using a designated query mode;
The acquisition module is used for inquiring the resource file according to the resource inquiry request and acquiring the resource information corresponding to the resource inquiry request; the resource file comprises release resource information of proxy equipment RD and release resource information of resource restricted equipment RCD; the generation process of the resource file comprises the following steps: receiving a resource release request sent by an RCD of a resource to be released; the resource release request comprises equipment identification and attribute information of the RCD of the resource to be released, the RCD of the resource to be released is authenticated according to the resource release request, and if the authentication is passed, the release resource information of the RCD of the resource to be released is stored in the resource file according to the resource release request;
and the processing module is used for acquiring a first response message according to the resource information if the query mode is recursive query and the resource information comprises the resource link of the RCD, and sending the first response message to a query end or discarding the first resource query request message.
9. A resource query processing device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN201880037186.4A 2018-11-08 2018-11-08 Resource query processing method, device, computer equipment and storage medium Active CN110741361B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/114601 WO2020093318A1 (en) 2018-11-08 2018-11-08 Resource query processing method and apparatus, and computer device and storage medium

Publications (2)

Publication Number Publication Date
CN110741361A CN110741361A (en) 2020-01-31
CN110741361B true CN110741361B (en) 2024-02-06

Family

ID=69236616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880037186.4A Active CN110741361B (en) 2018-11-08 2018-11-08 Resource query processing method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110741361B (en)
WO (1) WO2020093318A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115004671A (en) * 2020-06-16 2022-09-02 Oppo广东移动通信有限公司 Resource publishing method, device, gateway, cloud platform and computer storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016082274A1 (en) * 2014-11-27 2016-06-02 中国科学院计算机网络信息中心 Dane extended query method and system supporting carrying of service address information
CN106134159A (en) * 2014-03-11 2016-11-16 康维达无线有限责任公司 Strengthen distributive resources list
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2639688C2 (en) * 2012-02-16 2017-12-21 Филипс Лайтинг Холдинг Б.В. Control method of mediators table in the wireless network, using the device-mediators
CN102694849B (en) * 2012-05-14 2015-07-08 中国科学院计算机网络信息中心 IOT (Internet of Things) resource information acquiring method, terminal equipment and system
CN103561083B (en) * 2013-10-31 2017-01-18 广州视源电子科技股份有限公司 Internet of things data processing method
US10374758B2 (en) * 2014-04-15 2019-08-06 Signify Holding B.V. Method and apparatus for controlling handshake in a packet transmission network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106134159A (en) * 2014-03-11 2016-11-16 康维达无线有限责任公司 Strengthen distributive resources list
WO2016082274A1 (en) * 2014-11-27 2016-06-02 中国科学院计算机网络信息中心 Dane extended query method and system supporting carrying of service address information
CN108664613A (en) * 2018-05-11 2018-10-16 中国平安人寿保险股份有限公司 Data query method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110741361A (en) 2020-01-31
WO2020093318A1 (en) 2020-05-14

Similar Documents

Publication Publication Date Title
US11461402B2 (en) Routing based request correlation
CN108256114B (en) Document online preview method and device, computer equipment and storage medium
CN110830575B (en) Data transmission method and control system of intelligent household equipment and intelligent gateway equipment
US9438601B2 (en) Operating group resources in sub-groups and nested groups
CN110731074B (en) Subscription message processing method and device, computer equipment and storage medium
US10637794B2 (en) Resource subscription method, resource subscription apparatus, and resource subscription system
CN110493321B (en) Resource acquisition method, edge scheduling system and server
CN102523299B (en) Cache method for content identification based on message digests
US20160241635A1 (en) M2m data querying and invoking methods, querying and invoking devices, and system
KR20150018302A (en) Group Owner Centric Service Discovery method and apparatus
CN113542420A (en) Hotspot file processing method and device, electronic equipment and medium
CN110741361B (en) Resource query processing method, device, computer equipment and storage medium
US11916970B2 (en) Security information exchange between a client and a server
US20160316395A1 (en) Service query method, apparatus and system, and station
CN110933121A (en) Connection establishing method, communication processing method and device and communication equipment
CN110753921B (en) Query request processing method, device, computer equipment and storage medium
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN109600452B (en) Server cluster, message pushing method and related server
CN104486252A (en) Method and device for thin clients to have access to standard clients
CN116962108A (en) Control method of household equipment, gateway, server and electronic equipment
CN116743568A (en) Equipment network distribution method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant