WO2017206634A1 - 一种语义查询的方法及装置 - Google Patents

一种语义查询的方法及装置 Download PDF

Info

Publication number
WO2017206634A1
WO2017206634A1 PCT/CN2017/082233 CN2017082233W WO2017206634A1 WO 2017206634 A1 WO2017206634 A1 WO 2017206634A1 CN 2017082233 W CN2017082233 W CN 2017082233W WO 2017206634 A1 WO2017206634 A1 WO 2017206634A1
Authority
WO
WIPO (PCT)
Prior art keywords
query
triplet
semantic
resource
attribute
Prior art date
Application number
PCT/CN2017/082233
Other languages
English (en)
French (fr)
Inventor
高莹
张永靖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017206634A1 publication Critical patent/WO2017206634A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/903Querying
    • G06F16/9032Query formulation
    • G06F16/90332Natural language query formulation or dialogue systems

Definitions

  • the present invention relates to the field of Machine-to-Machine Communications (M2M) technology, and in particular, to a method and apparatus for semantic query.
  • M2M Machine-to-Machine Communications
  • Machine-to-Machine Communications is a networked application and service centered on machine intelligence interaction.
  • M2M technology realizes data communication without manual intervention by embedding wireless or wired communication modules and application processing logic inside the machine to meet the information needs of users for monitoring, command and dispatch, data acquisition and measurement.
  • M2M technology has been applied in more and more industries and fields, such as intelligent transportation, agricultural irrigation, smart home, power grid, meter reading and other industries.
  • M2M system operators develop a unified M2M platform to implement some common capabilities, such as data access and storage, data sharing and transmission, group communication, subscription notification of data, security, and billing. , resource discovery, etc.
  • the M2M platform can access different types of devices and sensors, and can provide application access interfaces, allowing applications from different industries to invoke the common capabilities provided by the M2M platform through the access interface.
  • the public service entity (such as CSE, Common service Entity) included in the M2M system provides a unified interface for data transmission to shield the difference between the communication modes of the devices, and realizes the shared data transmission capability between industries and applications that access the M2M system.
  • industries and applications are still closed to each other.
  • other applications cannot know the functions and functions of the device.
  • the operations performed, as well as other applications cannot know the meaning of the data even if they can obtain the data, and cannot reuse and share the data between different applications, which is not conducive to the formation of an open data market.
  • M2M system has added semantic description resources, which can describe data and operations in a way that machines can understand so that other applications can describe resources through semantics.
  • Semantic description information to determine the functions and executable operations provided by the parent resource, and also to determine the meaning of the data provided by the parent resource, such as data types, units, etc., to achieve data sharing between different applications, and to facilitate the formation of open data The market, and also use the semantic description information in the semantic description resource to further provide semantic functions such as semantic query and semantic reasoning.
  • the existing semantic query method is: after the semantic description resource device receives the semantic query request, it needs to determine whether all the semantic description resources stored locally are linked to the remote semantic description resource, and if the link is linked to the remote semantic description resource, According to the local semantic description, the remote semantic description resource of the resource link describes the URI of the resource, and obtains the remote semantic description resource of all the local semantic description resource links, and then performs semantic query in all the obtained remote semantic description resources and local semantic description resources.
  • the linked remote semantic resources are not all related to this semantic query, the remote semantic description resources unrelated to this semantic query are obtained, thereby increasing unnecessary network overhead.
  • the invention provides a method and a device for semantic query, in order to solve the problem of the prior art semantic query, the remote semantic description resource unrelated to the semantic query is obtained, thereby increasing the unnecessary network overhead.
  • the M2M gateway, the M2M platform, and the M2M device in the M2M system can be used as a device for storing a semantic description resource, and the device storing the semantic description resource receives the semantic query request sent by the application server, and uses a partial query in the semantic query request.
  • the triplet and resource link query triples query part query the attributes indicated by the triplet link to the remote semantic description resource query object, and then only need to query the remote semantic description resource of the attribute link indicated by the partial triplet Perform remote semantic query operations.
  • the device for storing the semantic description resource does not need to perform the semantic query process in all the remote semantic description resources of the link, and can avoid obtaining too much remote semantic information and reducing the network overhead.
  • an embodiment of the present invention provides a method for semantic query, which is applied to a machine communication M2M system, where a first device (a device that stores a semantic description resource, such as an M2M device, an M2M platform, or an M2M gateway) receives a first semantic Querying the request, the first semantic query request includes a query object variable and a first query condition, the query object variable indicating an attribute or resource of the requested query by the first semantic query request, the first query condition including at least two A query triplet, the at least two query triplets respectively indicating attributes and/or resources associated with the query object.
  • a first device a device that stores a semantic description resource, such as an M2M device, an M2M platform, or an M2M gateway
  • receives a first semantic Querying the request the first semantic query request includes a query object variable and a first query condition, the query object variable indicating an attribute or resource of the requested query by the first semantic query request, the first query condition including at least two A query triplet, the at
  • the first device queries the first query object that satisfies the first query condition by using the at least two query triplets; and then queries the partial query ternary using the partial query triplet and the resource link query triplet
  • the attribute indicated by the group is linked to the second query object of the remote semantic description resource, and the attribute or resource indicated by the partial query triplet is queried, and the partial query triplet is deleted in the at least two query triples At least one query triplet after querying the triplet, wherein at least one query triplet containing the query object variable exists in the partial query triplet.
  • the second semantic query request includes a query triplet other than the partial query triplet in the first query condition.
  • the first device may further receive the part. Querying a second semantic query success response returned by the device of the remote semantic description resource of the attribute link indicated by the triplet; and then sending a first semantic query response, wherein the first semantic query response includes the first query object and the The second query object.
  • the first device only needs to receive the second semantic query response sent by the device where the remote semantic description resource of the attribute link indicated by the partial query triplet is located, thereby reducing network overhead.
  • the first device may further receive the The remote semantic description of the attribute link indicated by the partial query triplet describes the second semantic query failure response returned by the device where the resource is located; And then sending a first semantic query response, where the first semantic query response includes the first query object, and does not include the second query object.
  • the first device only needs to receive the second semantic query response sent by the device where the remote semantic description resource of the attribute link indicated by the partial query triplet is located, thereby reducing network overhead.
  • the at least two query triples respectively indicate attributes and/or are included by the query object.
  • the first device uses a partial query triplet and a resource link query triple query to query the attribute of the partial query triplet to link to a second query object of the remote semantic description resource, and Querying the attribute or the resource indicated by the partial query triplet; and then sending the second semantic query request to the device where the remote semantic description resource of the attribute link indicated by the triplet is sent by the partial query, which may be implemented as:
  • the first device deletes at least one query triplet in the first query condition, where the remaining query triplet is the partial query triplet, and the partial query triplet exists at least a query triplet containing the query object variable;
  • the first device constructs a resource link query triplet.
  • the number of the resource link query triplet is the same as the number of the deleted query triplet, and the subject of the resource link query triplet is deleted.
  • Querying the object of the triplet, the predicate is indicated as a resource link relationship, and the object is any query variable, and the any query variable is different from the query variable in the first query condition;
  • the first device uses the partial query triplet and the resource link query triplet to query the attribute of the partial query triplet to link to the second query object of the remote semantic description resource and the partial query three The attribute indicated by the tuple;
  • the first device sends a second semantic query request to the device where the remote semantic description resource of the attribute link indicated by the third query group is located, when the second query object is different from the first query object.
  • the first device can accurately determine the device where the remote semantic description resource that needs to perform remote semantic query is located, and then send the second semantic query request only to the device where the remote semantic description resource that needs to perform the remote semantic query is located. , can avoid the first device to obtain too much irrelevant remote semantic information.
  • the first device when the first device deletes at least one query triplet in the first query condition, the first device determines a level between the query triplets in the first query condition. Whether they are the same; when the levels between the query triples in the first query condition are different, the query level in the first query condition is deleted each time in descending order of the level of the query triplet At least one query triplet that is low; at least the query triplet containing the query object variable exists in the remaining query triples after deletion; when between the query triplets in the first query condition When the levels are the same, at least one query triplet in the first query condition is deleted in a traversal manner, wherein at least the query three containing the query object variable exists in the remaining query triples after the deletion. Tuple.
  • the query triplet When determining the partial query triplet, the query triplet is deleted according to the level between the query triplets in the first query condition, and then the partial query triplet can accurately determine the remote related to the semantic query. Semantic description The source, and thus the semantic query without unrelated remote semantic description resources, can achieve the effect of efficient remote semantic query.
  • the first semantic query request includes a remote semantic query parameter
  • the remote semantic query parameter is used to indicate whether a remote query is required
  • the device that receives the first semantic query request includes The remote query indicates a policy
  • the remote query indicating policy is used to indicate whether a remote query is required.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions for a device for storing a semantic description resource, which includes a program designed to execute the above aspects.
  • an embodiment of the present invention provides an apparatus for storing a semantic description resource, where the apparatus for storing a semantic description resource has a function of implementing a device behavior of the foregoing method to store a semantic description resource.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more units corresponding to the functions described above.
  • the structure of the apparatus for storing semantic description resources includes a memory, a transceiver, and a processor.
  • the memory is for storing computer executable program code and is coupled to the transceiver.
  • the program code includes instructions that, when executed by the processor, cause the apparatus to perform the information or instructions involved in the above method.
  • the partial query triplet and the resource link relationship query triple query part are used to query the attributes indicated by the triplet to link to the second query object of the remote semantic description resource. And the part querying the attributes indicated by the triplet, and then only sending the second semantic query request to the device where the remote semantic description resource of the attribute link indicated by the partial query triplet is located, querying the attribute of the partial query triplet or Whether the resource satisfies the second query condition, and does not need to perform the semantic query process in all the remote semantic description resources of the link, thereby avoiding obtaining too much remote semantic information and reducing network overhead.
  • FIG. 1 is a network architecture diagram of an M2M system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a logical structure of an apparatus for storing a semantic description resource according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a semantic description resource according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of a triplet of semantic information in a semantic description resource according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a semantic query method according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a logical structure of an apparatus for storing a semantic description resource according to an embodiment of the present invention.
  • the network architecture and the service scenario described in the embodiments of the present invention are used to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation of the technical solutions provided by the embodiments of the present invention.
  • the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
  • FIG. 1 is a schematic structural diagram of an M2M system 200 for querying semantic information in an M2M system according to an embodiment of the present invention.
  • the embodiment of the present invention is based on the existing M2M architecture, and stores each semantic description resource in the M2M platform, and each semantic description resource stored in the M2M platform 102 is used for semantic query of the semantic information of the semantic description resource. Further, the semantic description resource may be stored on the M2M platform 102 or may be stored on each M2M gateway 103 or each M2M device 104.
  • the semantic description resource is stored on the device where the resource is located. All local semantics describe the semantic information in the description attribute of the resource and the link relationship with the remote semantic description resource.
  • the semantic information of the embodiment of the present invention may exist in the form of a triplet for describing information of a resource described by the semantic description resource.
  • the device for storing the semantic description resource may be the M2M gateway 103 or the M2M platform 102 or the M2M device 104 in the M2M system.
  • the embodiment of the present invention may also be applied to other systems.
  • first, second, and third in the embodiments of the present invention have no technical significance, but are used to distinguish the differences of terms.
  • the M2M system includes an M2M platform 102, an M2M gateway 103, an M2M device 104, and an application server 101.
  • the M2M platform 102 may be an In (Infrastructure Node)
  • the M2M gateway 102 is an MN (Middle Node)
  • the M2M device 104 may be an ASN (Application Service Node).
  • AND ((Application Dedicated Node) is not shown in the figure).
  • CSE Common Service Entity
  • CSE Common Service Entity
  • the CSE may be included in the M2M platform 102, the M2M gateway 103, or the ASN of the M2M device 104 to implement the corresponding functions.
  • the CSE allows the AE (Application Entity) to access the public capabilities of the CSE through the Mca reference point, implements communication between the CSEs through the Mcc reference point, and invokes the underlying network capabilities through the Mcn reference point.
  • AE Application Entity
  • the M2M platform 102, the M2M gateway 103, and the M2M device 104 may each store a semantic description resource of each resource, and receive an operation request related to the semantic description resource sent by each application server.
  • the operation request related to the semantic description resource may be a semantic query request for describing the semantic information in the resource for the query semantics.
  • the process of the semantic query may be introduced in the following detailed description with reference to the embodiments of the present invention.
  • the semantic description resources stored by the M2M gateway 103, the M2M device 104, and the M2M platform 102 may be in the form of sub-resources of existing resources or as independent resources.
  • the semantic description resource is used to describe the semantic information of the related resource, and the data and operations of the related resource are described in a machine understandable manner so that other applications can determine the function and executable operation of the resource described by the semantic description resource through the semantic description resource.
  • the meaning of the data provided such as data types, units, etc., to achieve data sharing between different applications, and to help form an open data market.
  • FIG. 2 is a schematic structural diagram of an apparatus for storing a semantic description resource according to an embodiment of the present invention, for accepting an operation request related to a semantic description resource in the M2M system shown in FIG. 1 and triggering a query for a semantic description resource Process.
  • Apparatus 200 storing semantic description resources may include one or more ports 208 coupled to a transceiver 206.
  • Transceiver 206 can be a transmitter, a receiver, or a combination thereof that transmits or receives data packets from other network nodes through port 208.
  • Processor 202 is coupled to transceiver 206 for processing data packets.
  • Processor 202 can include one or more multi-core processors and/or memory 204.
  • the processor 202 can be a general purpose processor, an application specific integrated circuit (ASIC), or a digital signal processor (DSP).
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • the memory 204 can be a non-transitory storage medium coupled to the processor 202 for storing different types of data, such as semantic description resources, resources described by semantically describing resources, and the like.
  • the memory 204 may include a read only memory (ROM), a random access memory (RAM), or other types of dynamic storage devices that can store information and instructions, and may also be a disk storage.
  • the memory 204 can be used to store instructions that implement a semantic query related method. It will be appreciated that at least one of the cache and long term storage is programmed or loaded by the processor 202 to the processor 202 of the device 200.
  • Apparatus 200 storing semantic description resources may implement one or more instructions to trigger a semantic query in accordance with an embodiment of the present invention. These instructions may be stored in memory 204 or integrated into a kernel or kernel plug-in of an operating system that stores a device that semantically describes the resource.
  • device 200 acts as a means of storing semantic description resources, including memory 204, processor 202 and transceiver 206, and one or more ports 208 coupled to the transceiver.
  • a memory 204 for storing computer executable program code;
  • a processor 202 coupled to the memory 204 and the transceiver 206;
  • program code includes instructions that, when executed by the processor, cause the apparatus storing the semantic description resource to perform the relevant steps performed by the first device of FIG.
  • FIG. 2 is also a schematic structural diagram of a CSE provided by an embodiment of the present invention, including a memory 204, a processor 202 and a transceiver 206, and one or more ports 208 coupled to the transceiver.
  • a memory 204 for storing computer executable program code;
  • a processor 202 coupled to the memory 204 and the transceiver 206;
  • program code includes instructions that, when executed by the processor, cause the apparatus storing the semantic description resource to perform the relevant steps performed by the first device of FIG.
  • the semantic description resource stored in the device storing the semantic description resource in FIG. 1-5 may be as shown in FIG. 3.
  • the semantic description resource semanticDescriptor includes a parameter describing the attribute descriptor and a semantic description resource reference (ontologyRef). parameter.
  • the parameter describing the descriptor includes the semantic information of the semantic description resource and the association relationship between the semantic description resource and the other semantic description resource;
  • the parameter of the reference ontology includes the uniform resource identifier of the ontology of the semantic description resource reference. (Uniform Resource Identifier, URI).
  • RoomA (Room A) includes two devices, respectively, sensor12 ( Sensor 12) and sensor 22 (sensor 22). Sensor12 and sensor22 specifically include the following triplet information:
  • sensor12hasFunctionality measuringTemperature indicates that sensor12 has the function of measuring temperature
  • TemperatureAspect indicates that measuringTemperature has a temperature value
  • sensor12hasFunctionality measuringHumidity indicates that sensor12 has the function of measuring humidity
  • measuringHumidity hasQuantities HumidityAspect indicates that measuringHumidity has a value in terms of humidity
  • HumidityAspect hasResLink http://www.onem2m.example3.org/***/ indicates that HumidityAspect is linked to a semantic description resource with a URI of http://www.onem2m.example3.org/***/;
  • sensor22 hasFunctionality lightMeasuring indicates that sensor12 provides the function of illumination measurement
  • lightMeasuring hasResLink http://www.onem2m.example2.org/***/ indicates that lightMeasuring links to a semantic description resource with a URI of http://www.onem2m.example2.org/***/;
  • FIG. 4 is only an exemplary schematic diagram, and other triplet information stored in the device where the CSE is located is not shown here.
  • the semantic query request contains a query statement. Further, the query statement includes a query object variable and a semantic query condition. It should be noted that the query statement included in the semantic query request may be a SPARQL query statement, but is not limited to the SPARQL query statement, and may also be any other query statement that can be converted into a SPARQL semantic query statement.
  • the query object variable indicates the attribute or resource of the query requested by the semantic query request
  • the semantic query condition is a condition that the attribute or resource of the requested query should satisfy.
  • the semantic query condition includes at least two query triples. At least two query triples respectively indicate attributes and/or resources associated with the query object.
  • the query object variable is a subject of a query triple
  • at least two query triples respectively indicate attributes associated with the query object.
  • the attribute associated with the query object is specifically: at least two query triples respectively indicate an attribute included in the query object and/or an attribute included in the attribute included in the query object.
  • the query statement contained in the semantic query request is as follows:
  • the query object variable is the resource requested by the semantic query request? Device (that is, the object to be queried is the resource corresponding to ?device).
  • the semantic query condition contains three query triples, respectively? Device hasFunctionality? Function,? Function hasQuantities? Quantities, and? Quantities hasUnit? Unit, the semantic query request needs to query the resource that satisfies the above semantic query condition. Need to query specifically? Device, what? Device is associated by hasFunctionality? Function corresponding to Function; further,? Device contains? The attribute corresponding to Function is also included by hasQuantities? Attributes corresponding to Quantities, as well as through? What does the Quantities property contain? Unit property. In other words, query the triples? Device hasFunctionality? Function indication?
  • a query triple consists of a subject, a predicate, and an object.
  • the predicate indicates the relationship between the subject and the object, the attribute pointed to by the object as the subject, or the resource to which the object is the subject.
  • a query statement? Device hasFunctionality? What is the subject contained in Function? Device the predicate is hasFunctionality and the object is? Function.
  • object? Function is the main language? The attributes contained in device.
  • the association in the query triplet indicates that the subject is associated with the object.
  • the query object variable may also be an object of a query triple, and at least two query triples respectively indicate attributes or resources associated with the query object.
  • the attributes or resources associated with the query object are: the attribute or resource to which the query object belongs, and the attribute or resource to which the attribute to which the query object belongs.
  • the association in the query triple represents that the object is associated with the subject.
  • the query statement included in the semantic query request may also be as follows: the query object variable may also be an object of the query triplet. Code 2 is specifically:
  • query the object variable? Quantities is a query triple? Function hasQuantities? The object of Quantities.
  • the query condition contained in the semantic query request has two query triples, which are: Device hasFunctionality? Function and? Function hasQuantities? Quantities. among them,? Function hasQuantities? Quantities shows that the Function has a Quantities value, and? Device hasFunctionality? Function indicates that Function is the function function of the device device.
  • the query object variable can be a subject in a query triple, and the query object variable can also be an object of the query triple.
  • the query triplet respectively indicates the attribute included in the query object corresponding to the query object variable and/or the attribute contained in the attribute included in the query object.
  • the query triple indicates the attribute and/or resource to which the query object corresponding to the query object variable belongs. The association can not only indicate that the subject is associated with the object, but also that the object is associated with the subject.
  • the query triples included in the semantic query condition may be a progressive relationship or a parallel relationship.
  • the first query triplet The object is the subject of the second query triple, indicating that the two query triples are progressive.
  • the query triples in Code 1 and Code 2 above are the query triples of the progressive relationship.
  • the two query triples contained in the semantic query condition are? Device hasFunctionality? Function and? Device hasService? Service. Indicates two queries three The subjects of the tuple are the same (both? device), then the two query triples are in a side-by-side relationship.
  • the semantic description resource shown in FIG. 4 is combined with the description of the semantic query request corresponding to the above code one and code two.
  • a flowchart of a method for semantic query provided by an embodiment of the present invention is shown in FIG. 5.
  • the code 1 is used as the first semantic query request
  • the query object variable is the subject of a query triplet, that is, the query object variable is used as the resource requested by the first semantic query request as an example, and the description is performed.
  • the process specifically includes the following steps:
  • the first device receives a first semantic query request sent by an application server.
  • the semantic query request includes a query object variable and a first query condition, where the query object variable is an attribute or resource requested by the first semantic query request, and the first query condition includes at least two query triples.
  • the at least two query triples respectively indicate the attributes associated with the query object.
  • the attribute associated with the query object is specifically: at least two query triples respectively indicate an attribute included in the query object and/or an attribute included in the attribute included in the query object.
  • the query statement included in the first semantic query request refers to the above code one, then the query object variable of the first semantic query request is? Device. Assumption? Device is the resource that requests the query. Query triples separately? What is the device resource included? The attribute corresponding to Function,? What is the attribute corresponding to Function? Attributes corresponding to Quantities, as well as? What are the attributes of Quantities? Unit attribute.
  • the first device determines that the three query triples belong to the The query triples into the relationship.
  • the semantic query request also includes an operation method of the semantic query, such as RETRIEVE, and a URI of the destination address of the semantic query request.
  • an operation method of the semantic query such as RETRIEVE
  • a URI of the destination address of the semantic query request.
  • the first device is the M2M platform where the CSE1 is located, the M2M gateway, or M2M device.
  • the first semantic query request needs to query the first query condition in the first device (including the attribute corresponding to the Function through the hasFunctionality relationship, and the attribute corresponding to the Function is included by the hasQuantities relationship)
  • the query object corresponding to the attribute of Quantities, and the attribute corresponding to ?Quantities has the attribute corresponding to ?unit by hasUnit relationship.
  • the first semantic query request further includes a remote semantic query parameter, where the remote semantic query parameter is used to indicate whether a remote query is required, and when the remote semantic query parameter is true, the remote query is required, and the remote semantic query is required.
  • the remote semantic query parameter is used to indicate whether a remote query is required, and when the remote semantic query parameter is true, the remote query is required, and the remote semantic query is required.
  • the parameter is flase, it means that remote query is not required.
  • the remote semantic query parameter is assumed to be true.
  • the first device determines a remote semantic description resource that needs to query the link.
  • the first device determines, according to the remote semantic query parameter in the first semantic query request, the remote semantic description resource that needs to query the link is determined.
  • the first device may further determine, according to the local policy stored in the first device whether to perform the remote query, the remote semantic description resource that needs to query the link.
  • the first device queries, by using a query statement in the first semantic query request, the first query object that satisfies the first query condition.
  • the third unit shown in FIG. 4 is stored in the first device as an example.
  • the query sentence included in the first semantic query request refers to the above code one.
  • the query object variable of the first semantic query request is? Device, that is, the first query object is? The resource corresponding to the device.
  • the first device uses the three query triplets in the first semantic query condition to query the triples shown in FIG. 4 to satisfy the three query triples. Device.
  • the query process of this step can be:
  • sensor12 hasFunctionality measuringTemperature, indicating that sensor12 meets the first query triplet? Device hasFunctionality? Function. among them,? The attribute corresponding to Function is measuringTemperature, so you need to further query whether the measuringTemperature satisfies the second query triple.
  • the measuringTemperature hasQuantities TemperatureAspect
  • the measuringTemperature satisfies the second query triplet?
  • Function hasQuantities? Quantities. among them,?
  • the attribute corresponding to Quantities is TemperatureAspect, so it is necessary to further query whether TemperatureAspect satisfies the third query triple.
  • the triple information of FIG. 4 also includes a TemperatureAspect hasUnit "Celsius”, indicating that the TemperatureAspect satisfies the third query triplet? Quantities hasUnit? Unit. among them,? The attribute corresponding to Unit is "Celsius”.
  • sensor12 is associated by hasFunctionality?
  • the function corresponding to the function measuringTemperature is the sensor12 included?
  • the attribute correspondingTemperature corresponding to Function is also included by hasQuantities? Quantities corresponding to the attribute TemperatureAspect, and through? Attributes corresponding to QuantitiesTemperatureAspect?
  • the Unit attribute "Celsius" therefore, sensor12 satisfies the three query triples of the above code, and the first query object that satisfies the first query condition in this step is? Device12 corresponding to device.
  • sensor22 hasFunctionality lightMeasuring, indicating that sensor22 satisfies the first query triplet? Device hasFunctionality? Function. among them,?
  • the attribute corresponding to Function is lightMeasuring, but is not queried from Figure 4 to lightMeasuring and is also included by hasQuantities? Quantities correspond to the properties, so,?
  • the sensor22 corresponding to the device does not satisfy the second query triplet and the third query triplet of the code, that is, the sensor 22 is not the first query object.
  • the SPARQL semantic query tool may be used for semantic query.
  • the embodiment of the present invention does not limit the specific query mode.
  • the first query object may be one or more, and the first query object may be stored in a form of a table.
  • the first query object list determined by the above query process is:
  • mapping relationship between the first query object list and the first semantic query request may also be stored in the first device.
  • the first device uses the partial query triplet and the resource link to query the triplet query part to query the triplet indication.
  • the attribute is linked to the second query object of the remote semantic description resource, and the attribute or resource indicated by the partial query triplet is queried.
  • the first device first needs to delete at least one query triplet in the first query condition, and the remaining query triplet is a partial query triplet, and at least one of the partial query triples exists.
  • the query triplet containing the query object variable, the attribute or resource indicated by the partial query triplet is the attribute and/or resource associated with the second query object.
  • At least one query triplet in the first query condition When deleting at least one query triplet in the first query condition, first determining whether the levels between the query triplets in the first query condition are the same, and if different, according to the level of the query triplet from low to high The order of deleting at least one query triplet with a low query level in the first query condition each time; when the levels between query triplets other than the query triplet containing the query object variable are the same, At least one query triplet in the first query condition is deleted each time in a traversal manner. Wherein, at least the query triplet remaining after the deletion has a query triplet containing the query object variable.
  • the query triplet including the query object in the first query condition is? Device hasFunctionality? Function, the other two queries in the triple,? Function hasQuantities? What is the object of Quantities? Quantities hasUnit? The subject of the unit, then, query the triples? Function hasQuantities? Is Quantities higher than Quantities hasUnit? Unit. Therefore, you should delete the low-level query triples first, should you delete them first? Quantities hasUnit? Unit. It can be understood that when the levels of the other two query triples are the same, at least one of the two query triples can be deleted each time by traversing.
  • the first device After deleting at least one query triplet, the first device also needs to construct a resource link relationship query triplet, and the subject of the resource link relationship query triple is the subject of the deleted query statement, and the predicate is indicated as a resource link relationship, and the object is Any query variable, further, any of the query variables is different from the query variable in the first query condition.
  • the subject of the resource link query triple is? Quantities
  • the predicate is the resource link relationship hasResLink
  • the object can be set to a different query variable than the query variable in the first query condition. For example, can it be? URI, then the resource link relationship query triples? Quantities hasResLink? URI, part of the query triples? Device hasFunctionality? Function and? Function hasQuantities? Quantities.
  • the query triplet of the second query object further includes an auxiliary query variable, and the auxiliary query variable queries the subject and the object of the triplet for the resource link relationship.
  • the subject of the resource link relationship query triple is an attribute indicated by the partial query triplet, and the object of the resource link relationship is used to indicate a remote semantic description resource of the attribute link indicated by the partial query triplet.
  • the query statement used to query the second query object is:
  • HumidityAspect hasResLink http://www.onem2m.example3.org/***/).
  • the second query object linked to the remote semantic description resource is sensor12 using the above query query query attribute of the partial query triplet (ie, the attribute HumidityAspect indicated by the subject in the resource link query triple). And using the above query statement query?
  • the attributes indicated by Quantities are HumidityAspect; and?
  • the attribute indicated by the URI is http://www.onem2m.example3.org/***/, and the second query object list can be obtained by querying the second query object query statement as described above, as shown in the following table:
  • the second query object sensor 12 Since the second query object sensor 12 is the same as the first query object, the sensor 12 has been determined as the query object satisfying the first query condition, and the second semantic query of the sensor 12 is not required. Therefore, the sensor 12 is deleted from the second query object list, and the second query object list is still empty.
  • the query triplet of the second query object further includes an auxiliary query variable in addition to the query object variable, and the auxiliary query variable queries the subject and the object of the triplet for the resource link relationship.
  • the query statement used to query the second query object is:
  • the second query object list is shown in the following table:
  • step 504 ends and the final determined second query object is sensor22.
  • the embodiment of the present invention does not limit a method for constructing a query statement for querying a second query object, and any query that can be used to query a partial query triplet in the first query condition and linked to a remote semantic description resource may be implemented.
  • the statement construction method is applicable to the present invention.
  • the first device sends a second semantic query request to the second device, where the second semantic query request includes a query triplet other than the partial query triplet in the first query condition.
  • the example in the above step 504 is still continued.
  • the second query object is sensor22. What is the partial query triplet used when querying the second query object sensor22? Device hasFunctionality? Function. Therefore, in addition to the partial query triples, the query triples are: Function hasQuantities? Quantities and? Quantities hasUnit? Unit. Therefore, the query condition in the second semantic query request sent by the first device to the second device includes the above two query triples.
  • the destination address of the second semantic query request is the URI of the semantic description resource of the attribute link indicated by the partial query triplet.
  • the first device may also determine the partial query triple used when querying the second query object sensor22.
  • the query statement in the second semantic query request is:
  • the first device sends the second semantic query request to the second device to determine whether the attribute or resource indicated by the partial query triplet satisfies the second query condition, and the second query condition includes the first query condition.
  • the second device performs a second semantic query according to the second semantic query request.
  • semantic information stored in the second device includes the following triplet information:
  • the second query object satisfies the second query condition as an example, and the query result of the second semantic query is assumed to be yes.
  • the second device sends a second semantic query response to the first device.
  • the second semantic query response carries the URI of the second device, and the second semantic query response is a second semantic query success response or a second semantic query failure response.
  • each second device needs to send a second semantic query response to the first device after completing the second semantic query process.
  • the first device receives a second semantic query response sent by the second device, and sends a first semantic query response to the application server.
  • the first device queries the URI in the success response according to the second semantic query (http://www.onem2m.example2.org/***/) from the second Querying the second query object corresponding to the URI (sensor22) in the query object list, because the semantic query process has determined that the second query object (sensor22) satisfies the partial query triplet in the first query condition, and the partial query ternary The attribute indicated by the group satisfies the second query condition.
  • the second semantic query http://www.onem2m.example2.org/***/
  • the second query object (sensor22) satisfies the first query condition, and the second query object sensor22 can be determined as the first query object, so the sensor22 is from the first
  • the second query object list is deleted and added to the first query object list.
  • the second query object list is empty, and the first query object list is:
  • the first device searches for the second query object corresponding to the URI from the second query object list according to the URI in the second semantic query failure response, because the semantics is The query process has determined that the second query object satisfies the partial query triplet in the first query condition, but the attribute indicated by the partial query triplet does not satisfy the second query condition, so the second semantic query process can be considered as the second The query object does not satisfy the first query condition, so the second query object corresponding to the URI is deleted from the second query object list, and the first query object list remains unchanged.
  • the first device may determine that the first semantic query needs to be returned to the application server after receiving the second semantic query response sent by all the second devices or according to other conditions (for example, when the second query object list is empty).
  • the first semantic query response is sent to the application server, where the first semantic query response includes a first query object (sensor12) and a second query object corresponding to the second semantic query success response (sensor22).
  • the semantic query method provided by the embodiment of the present invention carries a remote query parameter in the semantic query request, and can indicate whether the linked remote semantic description resource needs to be queried.
  • the partial query triplet is used.
  • the resource link relationship query triple query part searches the attribute indicated by the triplet to link to the second query object of the remote semantic description resource and the attribute indicated by the partial query triplet, and then only needs to query the partial query triplet.
  • the remote semantic description of the attribute link describes the device where the resource is located to send the second semantic query request, and the query part queries the attribute or resource indicated by the triplet to satisfy the second query condition, and does not need to describe the resource in all remote semantics of the link.
  • the semantic query process is performed to avoid obtaining too much remote semantic information and reducing network overhead.
  • the above embodiment takes the query object variable as the resource of the first query request by the first semantic query request.
  • the query object variable may also be the requested query of the first semantic query request.
  • the attribute is still described in conjunction with the method flow shown in FIG. 5, taking code 2 as the first semantic query request as an example.
  • step 501 the application server sends the first semantic query request to the first device, and the query statement included in the first semantic query request refers to the code 2 above:
  • the query object variable of the first semantic query request is? Quantities,? Quantities is the attribute of the request query, query triplet indication separately? What is the corresponding attribute of Function?
  • the resource or attribute corresponding to the device contains the attributes? What is the property of Quantities? The attribute contained in the attribute corresponding to Function.
  • the first semantic query request needs to query the first query condition in the first device (the attribute corresponding to the Function corresponding to the HasQuantities relationship is included, and the attribute corresponding to the Function is the resource or attribute corresponding to the device by the hasFunctionality relationship; The included query object.
  • the triplet information shown in FIG. 4 further includes sensor12hasFunctionality measuringHumidity (satisfying the first query statement in the code 2) and measuringHumidity hasQuantities HumidityAspect (satisfying the second query statement in the code 2), it can be determined that the satisfaction is satisfied.
  • the query object of the first query condition also includes: The property HumidityAspect corresponding to Quantities.
  • the first query object list is:
  • the first device uses the partial query triplet and the resource link query triple query part to query the attribute indicated by the triplet to link to the second query object of the remote semantic description resource, and query the part Query the attributes or resources indicated by the triplet.
  • the object of Function is the second query triple? Function hasQuantities? Quantities object, so you can determine that the first query triple is higher than the second query triple, so the second query triple should be deleted in order of lowest to highest level, but due to the second
  • the query triplet is a query triple containing the query object variable, so the second query triple cannot be deleted, so there is no query triple in the code 2, that is, there is no remote semantic description resource that can be queried.
  • the second query object list is empty, and there is no need to perform the process of the second semantic query.
  • the first device may directly send the first semantic query response to the application server, where the first semantic query response includes the first query object TemperatureAspect and the measuringHumidity.
  • the semantic query method provided by the embodiment of the present invention carries a remote query parameter in the semantic query request, and can indicate whether the linked remote semantic description resource needs to be queried.
  • the partial query triplet is used.
  • the resource link relationship query triple query part searches the attribute indicated by the triplet to link to the second query object of the remote semantic description resource and the attribute indicated by the partial query triplet, and then only needs to query the partial query triplet
  • the device where the CSE associated with the attribute is sent sends a second semantic query request, and the query part queries the attribute or resource indicated by the triplet to satisfy the second query condition, and does not need to perform the semantic query process in all the remote semantic description resources of the link, thereby avoiding obtaining Excessive remote semantic information reduces network overhead.
  • the embodiment of the present invention further provides a device for semantic query, where the device for semantic query is specifically a device for storing a semantic description resource, and the device is applied to an M2M gateway, an M2M platform or an M2M device, and the device is
  • the method includes a receiving unit 601, a query unit 603, and a sending unit 604.
  • the receiving unit 601 is configured to receive a first semantic query request, where the first semantic query request includes a query object variable and a first query condition, where the query object variable indicates an attribute or resource of the query requested by the first semantic query request
  • the first query condition includes at least two query triplets, and the at least two query triplets respectively indicate attributes and/or resources associated with the query object;
  • the query unit 602 is configured to query, by using the at least two query triplets, the first query object that satisfies the first query condition; and use the partial query triplet and the resource link query triplet to query the partial query ternary
  • the attribute indicated by the group is linked to the second query object of the remote semantic description resource, and the attribute or resource indicated by the partial query triplet is queried, and the partial query triplet is deleted in the at least two query triples At least one query triplet after querying the triplet, wherein at least one query triplet containing the query object variable exists in the partial query triplet;
  • the receiving unit 601 is further configured to perform steps 501, 508 performed by the first device in FIG. 5.
  • the querying unit 602 is further configured to perform the steps 502, 503, 504 and the like performed by the first device in FIG. 5, and the sending unit 603 is further configured to perform the step 505 performed by the first device in FIG. 5.
  • the invention is not described in detail herein.
  • the apparatus in FIG. 6 may be used to execute any of the processes performed by the device storing the semantic description resource in the above method flow, and store the semantic description resources of FIG. 3 and FIG.
  • FIG. 8 the device in Figure 8 is presented in the form of a functional unit.
  • a "unit” herein may refer to an application-specific integrated circuit (ASIC), circuitry, a processor and memory that executes one or more software or firmware programs, integrated logic circuitry, and/or other functions that provide the functionality described above.
  • ASIC application-specific integrated circuit
  • FIG. 8 the apparatus of Figure 6 can take the form shown in Figure 2.
  • Each unit can be implemented by the processor, transceiver, and memory of FIG.
  • Example computer readable media suitable for implementing the subject matter described herein include non-transitory computer readable media, such as disk storage devices, chip memory devices, programmable logic devices, and application specific integrated circuits.
  • a computer readable medium embodying the subject matter described herein can be located on a single device or computing platform or can be distributed across multiple devices or computing platforms.

Abstract

本发明提供一种语义查询的方法,应用于M2M系统,可以解决语义查询的过程中,会获取与本次语义查询无关的远程语义描述资源,从而会增加不必要的网络开销的问题。本发明实施例通过接收第一语义查询请求,使用第一语义查询请求中至少两条查询三元组查询满足第一查询条件的第一查询对象,使用部分查询三元组以及资源链接查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询部分查询三元组指示的属性或资源,向部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定部分查询三元组指示的属性是否满足第二查询条件。本发明实施例适用于语义查询的过程中。

Description

一种语义查询的方法及装置
本申请要求于2016年6月1日提交中国专利局、申请号为201610387225.6、发明名称为“一种语义查询的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及机器通信(Machine-to-Machine Communications,M2M)技术领域,尤其涉及一种语义查询的方法及装置。
背景技术
机器通信(Machine-to-Machine Communications,M2M)是一种以机器智能交互为核心的、网络化的应用与服务。M2M技术通过在机器内部嵌入无线或有线通信模块以及应用处理逻辑,实现无需人工干预的数据通信,以满足用户对监控、指挥调度、数据采集和测量等方面的信息化需求。目前M2M技术已经在越来越多的行业和领域得到应用,例如智能交通、农业灌溉、智能家居、电网、抄表等行业。M2M系统运营商为了满足对不同行业应用服务的需要,开发统一的M2M平台实现部分公共能力,例如数据访问和存储、数据的共享和传输、群组通信、对数据的订阅通知、安全、计费、资源发现等。该M2M平台可以接入不同种类的设备和传感器,以及可以提供应用访问接口,允许不同行业的应用通过访问接口调用M2M平台提供的公共能力。
目前,M2M系统包含的公共服务实体(如CSE,Common service Entity)提供统一接口进行数据传输以屏蔽设备通信方式间的差异,实现接入M2M系统的各行业和应用之间共享数据传输能力。但是在数据使用上,各行业和应用之间仍然是相互封闭的,例如:对属于不同应用的设备来说,在没有先验知识的情况下,其他应用无法知道该设备所具有的功能和可执行的操作,以及其他应用即使能够获得数据也无法知晓数据的含义,无法实现不同应用之间对数据的重用和共享,不利于形成开放的数据市场。
为了实现各个行业和应用之间可以在没有先验知识的情况下共享资源和数据,M2M系统新增了语义描述资源,可以使用机器能够理解的方式描述数据和操作使得其他应用可以通过语义描述资源的语义描述信息来确定父资源提供的功能和可执行的操作,也可以确定父资源提供的数据含义,如数据类型,单位等,实现不同应用之间的数据共享,并有利于形成开放的数据市场,并且还要利用语义描述资源中的语义描述信息进一步提供语义查询、语义推理等语义功能。
其中,现有的语义查询方法为:语义描述资源所在的设备接收到语义查询请求后,需要判断本地存储的所有的语义描述资源是否链接到远程语义描述资源,如果链接到远程语义描述资源,需根据本地的语义描述资源链接的远程语义描述资源的URI,去获取所有本地的语义描述资源链接的远程语义描述资源,进而在获取的所有远程语义描述资源和本地语义描述资源中进行语义查询。然而,由于链接的远程语义资源并不是都与本次的语义查询相关,因而会获取与本次语义查询无关的远程语义描述资源,从而增加不必要的网络开销。
发明内容
本发明提供一种语义查询的方法及装置,以解决现有技术语义查询的过程中,会获取与本次语义查询无关的远程语义描述资源,从而会增加不必要的网络开销的问题。
在具体实现中M2M系统中的M2M网关、M2M平台以及M2M设备均可以作为存储语义描述资源的装置,由存储语义描述资源的装置接收应用服务器发送的语义查询请求,使用语义查询请求中的部分查询三元组以及资源链接查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的查询对象,进而只需向部分查询三元组指示的属性链接的远程语义描述资源所在的设备进行远程语义查询的操作。通过本发明,存储语义描述资源的装置无需在链接的所有远程语义描述资源中进行语义查询过程,可以避免获取过多的远程语义信息,减少了网络开销。
第一方面,本发明实施例提供一种语义查询的方法,应用于机器通信M2M系统,其中,第一设备(存储语义描述资源的装置,比如M2M设备、M2M平台或M2M网关)接收第一语义查询请求,所述第一语义查询请求包括查询对象变量以及第一查询条件,所述查询对象变量指示所述第一语义查询请求所请求查询的属性或资源,所述第一查询条件包括至少两条查询三元组,所述至少两条查询三元组分别指示所述查询对象关联的属性和/或资源。然后,第一设备使用所述至少两条查询三元组查询满足所述第一查询条件的第一查询对象;然后使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源,所述部分查询三元组为所述至少两条查询三元组中删除了至少一条查询三元组后的查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组。然后向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定所述部分查询三元组指示的属性是否满足第二查询条件,所述第二查询条件包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。通过本发明的实施例,当需要查询链接的远程语义描述资源时,使用部分查询三元组以及资源链接关系查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性,进而只需向部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求,查询部分查询三元组指示的属性或资源是否满足第二查询条件,无需在链接的所有远程语义描述资源中进行语义查询过程,避免了获取过多的远程语义信息,减少了网络开销。
在一个可能的设计中,在所述第一设备向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求之后,第一设备还可以接收所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备返回的第二语义查询成功响应;然后发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象和所述第二查询对象。第一设备只需接收部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送的第二语义查询响应,减少了网络开销。
在另一个可能的设计中,在所述第一设备向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求之后,第一设备还可以接收所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备返回的第二语义查询失败响应; 然后发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象,不包括所述第二查询对象。第一设备只需接收部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送的第二语义查询响应,减少了网络开销。
在另一个可能的设计中,当所述查询对象变量为一条查询三元组的主语时,所述至少两条查询三元组分别指示所述查询对象包含的属性和/或被所述查询对象包含的属性所包含的属性;当所述查询对象变量为一条查询三元组的宾语时,所述至少两条查询三元组分别指示所述查询对象所属的属性或资源,以及所述查询对象所属的属性所属的属性或资源。从而,使得本发明的方案既可以实现对主语作为查询对象的查询,也可以实现对宾语作为查询对象的查询。从而,扩大了分布式查询的使用范围,进一步满足应用不同的查询需求。
在另一个可能的设计中,所述第一设备使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源;然后向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求,具体可以实现为:
S1、第一设备删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组为所述部分查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
S2、第一设备构造资源链接查询三元组,所述资源链接查询三元组的数量与被删除的查询三元组的数量相同,所述资源链接查询三元组的主语为所述被删除的查询三元组的宾语,谓语指示为资源链接关系,宾语为任一查询变量,所述任一查询变量与第一查询条件中的查询变量不同;
S3、第一设备使用所述部分查询三元组以及所述资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性;
S4、第一设备当所述第二查询对象与所述第一查询对象不同时,向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求;
循环执行上述步骤S1至S4,直至所述第一查询条件中除包含所述查询对象变量的查询三元组之外的查询三元组都被删除过一次。
通过这种设计,可以使得第一设备准确地确定出需要进行远程语义查询的远程语义描述资源所在的设备,进而只对需要进行远程语义查询的远程语义描述资源所在的设备发送第二语义查询请求,可以避免第一设备获取过多无关的远程语义信息。
在另一个可能的设计中,所述第一设备删除所述第一查询条件中的至少一条查询三元组时,第一设备判断所述第一查询条件中的查询三元组之间的级别是否相同;当所述第一查询条件中的查询三元组之间的级别不同时,按照查询三元组的级别从低到高的顺序,每次删除所述第一查询条件中的查询级别低的至少一条查询三元组;删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组;当所述第一查询条件中的查询三元组之间的级别相同时,采用遍历的方式每次删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组。确定部分查询三元组时,根据第一查询条件中的查询三元组之间的级别来删除查询三元组,然后通过部分查询三元组可以准确地确定出与本次语义查询相关的远程语义描述资 源,进而无需向不相关的远程语义描述资源进行语义查询,可以达到高效地进行远程语义查询的效果。
在另一个可能的设计中,所述第一语义查询请求中包括远程语义查询参数,所述远程语义查询参数用于指示是否需要进行远程查询;或接收所述第一语义查询请求的设备中包含远程查询指示策略,所述远程查询指示策略用于指示是否需要进行远程查询。通过远程语义查询参数或者远程查询指示策略,可以确定是否需要查询连接的远程语义描述资源,增加了语义查询方法的灵活性。
第二方面,本发明实施例提供了一种计算机存储介质,用于储存为上述存储语义描述资源的装置所用的计算机软件指令,其包含用于执行上述方面所设计的程序。
第三方面,本发明实施例提供了存储语义描述资源的装置,该存储语义描述资源的装置具有实现上述方法实际中存储语义描述资源的装置行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的单元。
第四方面,存储语义描述资源的装置的结构中包括存储器,收发器和处理器。其中存储器用于存储计算机可执行程序代码,并与收发器耦合。所述程序代码包括指令,当所述处理器执行所述指令时,所述指令使所述装置执行上述方法中所涉及的信息或者指令。
由上述方案可知,当需要查询链接的远程语义描述资源时,使用部分查询三元组以及资源链接关系查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性,进而只需向部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求,查询部分查询三元组指示的属性或资源是否满足第二查询条件,无需在链接的所有远程语义描述资源中进行语义查询过程,避免了获取过多的远程语义信息,减少了网络开销。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。显而易见地,下面附图中反映的仅仅是本发明的一部分实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得本发明的其他实施方式。而所有这些实施例或实施方式都在本发明的保护范围之内。
图1为本发明实施例提供的基于M2M系统的网络架构图;
图2为本发明实施例提供的存储语义描述资源的装置的逻辑结构示意图;
图3为本发明实施例提供的语义描述资源的结构示意图;
图4为本发明实施例提供的语义描述资源中的语义信息的三元组示意图;
图5为本发明实施例提供的语义查询方法的流程图;
图6为本发明实施例提供的存储语义描述资源的装置的逻辑结构示意图。
具体实施方式
下面将结合附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有付出创造性劳动前提下所获得的所有其他实施例,都属于本发 明保护的范围。
本发明实施例描述的网络架构以及业务场景是为了更加清楚的说明本发明实施例的技术方案,并不构成对于本发明实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本发明实施例提供的技术方案对于类似的技术问题,同样适用。
图1提供了本发明实施例的一种M2M系统200的架构示意图,用于在M2M系统中查询语义信息。本发明实施例基于现有的M2M架构,并在M2M平台存储各语义描述资源,存储在M2M平台102的各语义描述资源用于对语义描述资源的语义信息进行语义查询。进一步的,语义描述资源可以存储在M2M平台102上,也可以存储在各M2M网关103或者各M2M设备104上。为了更好地利用现有的语义查询工具(如,SPARQL(Simple Protocol and RDF Query Language)查询)对语义描述资源的描述属性中的语义信息实现语义查询功能,语义描述资源所在的设备上集中存储本地所有语义描述资源的描述属性中的语义信息以及与远程语义描述资源的链接关系。本发明实施例的语义信息可以以三元组的形式存在,用于描述被语义描述资源所描述的资源的信息。
在本发明实施例中,存储语义描述资源的装置可以为M2M系统中的各M2M网关103或M2M平台102或M2M设备104,相应的,本发明实施例还可以应用在其他的系统。
此外,本发明实施例中的第一、第二和第三没有任何技术上的意义,只是用来区别术语的不同。
具体的,本发明实施例提供的M2M系统包括M2M平台102、M2M网关103、M2M设备104以及应用服务器101。如图1所示,M2M平台102是可以是IN(Infrastructure Node,基础设施节点),M2M网关102是MN(Middle Node,中间节点),M2M设备104可以是ASN(Application Service Node,应用服务节点)或AND((Application Dedicated Node,应用专用节点)图中未示出)。另外,CSE(Common Service Entity,公共服务实体)是作为M2M系统的公共能力部件,可以实现对公共能力的承载。CSE可以包含在M2M平台102、M2M网关103,或作为M2M设备104的ASN中,以实现相应的功能。CSE通过Mca参考点让AE(Application Entity,应用实体)访问CSE开放的公共能力,通过Mcc参考点实现CSE之间的通信以及通过Mcn参考点实现对底层网络能力的调用。
在图1所示的架构中,M2M平台102、M2M网关103以及M2M设备104均可存储各资源的语义描述资源,接收各应用服务器发送的与语义描述资源相关的操作请求。其中与语义描述资源相关的操作请求可以为查询语义描述资源中的语义信息的语义查询请求。具体的,语义查询的流程可参考本发明实施例在后面的详述介绍。
M2M网关103、M2M设备104和M2M平台102存储的语义描述资源可以作为现有资源的子资源的形式,也可以作为独立的资源。语义描述资源用于描述相关资源的语义信息,用机器能够理解的方式描述相关资源的数据和操作使得其他应用可以通过语义描述资源来确定被语义描述资源描述的资源提供的功能和可执行的操作以及提供的数据含义,如数据类型,单位等,实现不同应用之间的数据共享,并有利于形成开放的数据市场。
图2显示了本发明实施例提供的作为存储语义描述资源的装置的结构示意图,用于在图1所示的M2M系统中接受与语义描述资源相关的操作请求,以及触发对语义描述资源的查询 流程。存储语义描述资源的装置200可包含一个或多个端口208,与收发器(transceiver)206相耦合。收发器206可以是发射器,接收器或其组合,从其他网络节点通过端口208发送或接收数据包。处理器202耦合到收发器206,用于处理数据包。处理器202可包含一个或多个多核处理器和/或存储器204。处理器202可以是一个通用处理器,专用集成电路(application specific integrated circuit,ASIC),或数字信号处理器(DSP)。
存储器204可为非瞬时性的存储介质,与处理器202相耦合,用于保存不同类型的数据,如语义描述资源,被语义描述资源描述的资源等。存储器204可包含只读存储器(read only memory,ROM),随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是磁盘存储器。存储器204可用于保存实现语义查询相关方法的指令。可以理解,通过编程或装载可执行指令到设备200的处理器202,缓存和长期存储中的至少一个。
存储语义描述资源的装置200可实现根据本发明的实施例执行一个或多个指令以触发进行语义查询。这些指令可存储在存储器204中,也可集成在存储语义描述资源的装置的操作系统的内核或内核的插件中。
另一个实施例中,设备200作为存储语义描述资源的装置,包括存储器204,处理器202和收发器206以及与收发器耦合的一个或多个端口208。存储器204,用于存储计算机可执行程序代码;处理器202与所述存储器204和所述收发器206耦合;
其中所述程序代码包括指令,当所述处理器执行所述指令时,所述指令使所述存储语义描述资源的装置执行图5中第一设备执行的相关步骤。
此外,图2还可以作为本发明实施例提供的CSE的结构示意图,包括存储器204,处理器202和收发器206以及与收发器耦合的一个或多个端口208。存储器204,用于存储计算机可执行程序代码;处理器202与所述存储器204和所述收发器206耦合;
其中所述程序代码包括指令,当所述处理器执行所述指令时,所述指令使所述存储语义描述资源的装置执行图5中第一设备执行的相关步骤。
作为一个例子,图1-5中存储语义描述资源的装置存储的语义描述资源semanticDescriptor结构可以如图3所示,语义描述资源semanticDescriptor包含描述属性descriptor的参数和语义描述资源引用的本体(ontologyRef)的参数。其中,描述属性(descriptor)的参数包括语义描述资源的语义信息和语义描述资源关联其它语语义描述资源的关联关系;引用的本体(ontologyRef)的参数包括语义描述资源引用的本体的统一资源标识符(Uniform Resource Identifier,URI)。
图4为本发明实施例提供的CSE所在的设备中存储的语义描述资源包含的部分语义信息的三元组示意图,如图4所示,RoomA(房间A)包含两个设备,分别为sensor12(传感器12)和sensor22(传感器22)。sensor12和sensor22具体包括以下三元组信息:
sensor12hasFunctionality measuringTemperature表示sensor12具有测量温度的功能;
measuringTemperature hasQuantities TemperatureAspect表示measuringTemperature具有温度方面的数值;
TemperatureAspect hasUnit“Celsius”表示温度的单位是摄氏度;
sensor12hasFunctionality measuringHumidity表示sensor12具有测量湿度的功能;
measuringHumidity hasQuantities HumidityAspect表示measuringHumidity具有湿度方面的数值;
HumidityAspect hasResLink http://www.onem2m.example3.org/***/表示HumidityAspect链接到一个URI为http://www.onem2m.example3.org/***/的语义描述资源;
sensor22hasFunctionality lightMeasuring表示sensor12提供光照测量的功能;
lightMeasuring hasResLink http://www.onem2m.example2.org/***/表示lightMeasuring链接到一个URI为http://www.onem2m.example2.org/***/的语义描述资源;
需要说明的是,图4仅为示例性示意图,CSE所在的设备中存储的其他三元组信息在此不再一一示出。
为了方便以下实施例中的描述,首先对本发明实施例涉及到的相关内容进行解释说明。
语义查询请求包含查询语句,进一步地,查询语句包含查询对象变量以及语义查询条件。需要说明的是,语义查询请求中包含的查询语句可以为SPARQL查询语句,但不限制于SPARQL查询语句,也可以为其他任意可转化为SPARQL语义查询语句的查询语句。
其中,查询对象变量指示了语义查询请求所请求查询的属性或资源,语义查询条件为所请求查询的属性或资源应该满足的条件。语义查询条件包括至少两条查询三元组。至少两条查询三元组分别指示查询对象关联的属性和/或资源。
进一步的,当查询对象变量为一条查询三元组的主语时,至少两条查询三元组分别指示查询对象关联的属性。且查询对象关联的属性具体为:至少两条查询三元组分别指示查询对象包含的属性和/或被查询对象包含的属性所包含的属性。
例如,语义查询请求中包含的查询语句为如下代码一:
Figure PCTCN2017082233-appb-000001
其中,查询对象变量为该语义查询请求所请求查询的资源?device(即要查询的对象为?device对应的资源)。该语义查询条件包含三条查询三元组,分别为?device hasFunctionality?Function、?Function hasQuantities?Quantities,和?Quantities hasUnit?unit,则该语义查询请求需要查询满足上述语义查询条件的资源。具体需要查询?device,该?device通过hasFunctionality关联?Function对应的属性;进一步,?device包含?Function对应的属性还通过hasQuantities包含?Quantities对应的属性,以及通过?Quantities属性包含?Unit属性。也就是说,查询三元组?device  hasFunctionality?Function指示?device对应的资源包含的?Function对应的属性,查询三元组?Function hasQuantities?Quantities指示被?device对应的资源包含的?Function对应的属性包含的?Quantities对应的属性,查询三元组?Quantities hasUnit?unit指示?Quantities对应的属性所包含的?unit属性。
一条查询三元组包含主语、谓语、宾语。其中,谓语表示主语和宾语之间的关系,宾语为主语指向的属性,或者宾语为主语归属的资源。例如查询语句?device hasFunctionality?Function中包含的主语为?device,谓语为hasFunctionality以及宾语为?Function。其中,由于主语?device为查询对象变量,宾语?Function为主语?device包含的属性。查询三元组中的关联关系表示主语关联到宾语。
作为另一种可选方式,查询对象变量还可以为一条查询三元组的宾语,则至少两条查询三元组分别指示查询对象关联的属性或资源。且查询对象关联的属性或资源具体为:查询对象所属的属性或资源,以及查询对象所属的属性所属的属性或资源。查询三元组中的关联关系表示宾语关联到主语。
作为一个例子再例如,语义查询请求中包含的查询语句还可以如下代码二,查询对象变量还可以为一条查询三元组的宾语。代码二具体为:
Figure PCTCN2017082233-appb-000002
此时,查询对象变量?Quantities为查询三元组?Function hasQuantities?Quantities的宾语。则该语义查询请求中包含的查询条件具有两条查询三元组,分别为:?device hasFunctionality?Function和?Function hasQuantities?Quantities。其中,?Function hasQuantities?Quantities表明Function具有的Quantities数值,而?device hasFunctionality?Function表明Function为设备device具有的function功能。也就是说,查询三元组?Function hasQuantities?Quantities指示?Quantities对应的属性为?Function对应的属性所包含的属性,查询三元组?device hasFunctionality?Function指示?Function对应的属性为?device对应的资源或属性包含的属性。
可见,查询对象变量可以为一条查询三元组中的主语,查询对象变量还可以为查询三元组的宾语。当查询对象变量为一条查询三元组中主语时,查询三元组分别指示查询对象变量对应的查询对象包含的属性和/或查询对象包含的属性所包含的属性。当查询对象变为为一条查询三元组中的宾语时,查询三元组指示查询对象变量对应的查询对象所属的属性和/或资源。关联关系不仅可以表示主语关联到宾语,也可以表示宾语关联到主语。
还需说明的是,语义查询条件包含的各查询三元组之间可以为递进关系也可以为并列关系,上述两个举例中的两条查询三元组中,第一个查询三元组的宾语为第二个查询三元组的主语,则说明这两条查询三元组为递进关系。如上述代码一和代码二中的查询三元组则为递进关系的查询三元组。假设语义查询条件中包含的两条查询三元组分别为?device hasFunctionality?Function和?device hasService?Service。表明两条查询三 元组的主语相同(都是?device)则这两条查询三元组为并列关系。
结合图4所示的语义描述资源,以及上述代码一和代码二对应的语义查询请求的描述。本发明实施例提供的语义查询的方法流程图如图5所示。在该流程中,以代码一作为第一语义查询请求,以查询对象变量为一条查询三元组的主语,即以查询对象变量为第一语义查询请求所请求查询的资源为例进行说明,该流程具体包括如下步骤:
501、第一设备接收应用服务器发送的第一语义查询请求。
其中,语义查询请求中包括查询对象变量以及第一查询条件,查询对象变量为第一语义查询请求所请求查询的属性或资源,第一查询条件包括至少两条查询三元组。其中,至少两条查询三元组分别指示查询对象关联的属性。进一步的,查询对象关联的属性具体为:至少两条查询三元组分别指示查询对象包含的属性和/或被查询对象包含的属性所包含的属性。
第一语义查询请求中包含的查询语句参考如上代码一,则第一语义查询请求的查询对象变量为?device。假设?device为请求查询的资源。查询三元组分别指示?device资源包含的?Function对应的属性,?Function对应的属性包含的?Quantities对应的属性,以及?Quantities对应的属性所包含的?unit属性。
进一步的,如上述所,上述代码一中的三条查询三元组中,由于一条查询三元组的主语为另一条查询三元组的宾语,因此第一设备确定这三条查询三元组属于递进关系的查询三元组。
此外,语义查询请求中还包括语义查询的操作方法,例如RETRIEVE(检索),以及语义查询请求的目的地址的URI,例如该URI指向CSE1,则第一设备为CSE1所在的M2M平台、M2M网关或者M2M设备。
通过第一语义查询请求中包括的上述内容可知,第一语义查询请求需要查询第一设备中满足第一查询条件(通过hasFunctionality关系包括?Function对应的属性,且?Function对应的属性通过hasQuantities关系包括?Quantities对应的属性,且?Quantities对应的属性通过hasUnit关系具有?unit对应的属性)的查询对象。
进一步的,第一语义查询请求中还包括远程语义查询参数,所述远程语义查询参数用于指示是否需要进行远程查询,当远程语义查询参数为true时,代表需要进行远程查询,当远程语义查询参数为flase时,代表不需要进行远程查询。
本例中,假设远程语义查询参数为true。
502、第一设备确定需要查询链接的远程语义描述资源。
具体的,当第一设备根据定第一语义查询请求中的远程语义查询参数确定需要查询链接的远程语义描述资源。作为一种可选方式,当第一语义查询请求不包含远程语义查询参数时,第一设备还可以根据存储在第一设备的是否进行远程查询的本地策略确定需要查询链接的远程语义描述资源。
如上所述,本例中假设远程语义查询参数为true,则确定需要查询链接的远程语义描述资源。
503、第一设备使用第一语义查询请求中的查询语句查询满足第一查询条件的第一查询对象。
以第一设备中存储图4所示的三元组为例进行说明,如上所述,第一语义查询请求中包含的查询语句参考上述代码一。
结合上述描述,第一语义查询请求的查询对象变量为?device,即第一查询对象为?device对应的资源,本步骤中,第一设备采用第一语义查询条件中的三条查询三元组查询图4所示的三元组中满足这三条查询三元组的?device。
作为一个例子,本步骤的查询过程可以为:
由于第一语义查询请求的查询对象变量为?device,所以,首先确定图4中包含两个device,分别为sensor12和sensor22。
然后根据图4所示的三元组信息可知,sensor12hasFunctionality measuringTemperature,说明sensor12满足第一条查询三元组?device hasFunctionality?Function。其中,?Function对应的属性为measuringTemperature,所以需进一步查询measuringTemperature是否满足第二条查询三元组。
进而,由于measuringTemperature hasQuantities TemperatureAspect,说明measuringTemperature满足第二条查询三元组?Function hasQuantities?Quantities。其中,?Quantities对应的属性为TemperatureAspect,所以需进一步查询TemperatureAspect是否满足第三条查询三元组。
进一步的,图4的三元组信息中还包括TemperatureAspect hasUnit“Celsius”,说明TemperatureAspect满足第三条查询三元组?Quantities hasUnit?unit。其中,?Unit对应的属性为“Celsius”。
通过上述查询过程可知,sensor12通过hasFunctionality关联?Function对应的属性measuringTemperature,进一步,sensor12包含的?Function对应的属性measuringTemperature还通过hasQuantities包含?Quantities对应的属性TemperatureAspect,以及通过?Quantities对应的属性TemperatureAspect包含?Unit属性“Celsius”,所以,sensor12满足上述代码一种的三条查询三元组,本步骤中查询到的满足第一查询条件的第一查询对象为?device对应的sensor12。
另外,由图4可知,sensor22hasFunctionality lightMeasuring,说明sensor22满足第一条查询三元组?device hasFunctionality?Function。其中,?Function对应的属性为lightMeasuring,但是从图4中未查询到lightMeasuring还通过hasQuantities包含?Quantities对应的属性,所以,?device对应的sensor22不满足代码一种的第二条查询三元组和第三条查询三元组,即sensor22不是第一查询对象。
需要说明的是,上述查询过程仅为一个示例性的解释说明,具体实现的过程中,可以利用SPARQL语义查询工具进行语义查询,本发明实施例不限制具体的查询方式。第一查询对象可以为一个或者是多个,可以以表格的形式存储第一查询对象,例如通过上述的查询过程确定的第一查询对象列表为:
?device
sensor12
进而,还可以在第一设备中存储第一查询对象列表与第一语义查询请求的映射关系。
504、第一设备使用部分查询三元组以及资源链接查询三元组查询部分查询三元组指示 的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源。
进一步的,在查询之前,第一设备首先需删除第一查询条件中的至少一条查询三元组,删除后剩余的查询三元组为部分查询三元组,部分查询三元组中至少存在一条包含查询对象变量的查询三元组,部分查询三元组指示的属性或资源为第二查询对象关联的属性和/或资源。
在删除第一查询条件中的至少一条查询三元组时,首先需判断第一查询条件中的查询三元组之间的级别是否相同,如果不同,按照查询三元组的级别从低到高的顺序,每次删除所述第一查询条件中的查询级别低的至少一条查询三元组;当除包含查询对象变量的查询三元组之外的查询三元组之间的级别相同时,采用遍历的方式每次删除第一查询条件中的至少一条查询三元组。其中,删除后剩余的查询三元组中至少存在包含查询对象变量的查询三元组。
判断第一查询条件中的查询三元组之间的级别是否相同具体为:任一查询三元组的宾语是否为其它查询三元组的主语,如果是,则第一查询条件中查询三元组之间级别不相同,否则相同。进一步的,任一查询三元组的宾语为其它查询三元组的主语时,其宾语为其它查询三元组的主语的查询三元组的级别高于所述其它查询三元组。
仍以步骤501中的第一语义查询请求为例,第一查询条件中包含查询对象的查询三元组为?device hasFunctionality?Function,另外两条查询三元组中,?Function hasQuantities?Quantities的宾语为?Quantities hasUnit?unit的主语,则,查询三元组?Function hasQuantities?Quantities的级别高于Quantities hasUnit?unit。因此,应该先删除低级别的查询三元组,则应先删除?Quantities hasUnit?unit。可以理解的是,当上述另外两条查询三元组之间级别相同时,则可采用遍历的方式每次分别删除这两条查询三元组中的至少一条。
在删除至少一条查询三元组之后,第一设备还需构造资源链接关系查询三元组,资源链接关系查询三元组的主语为被删除查询语句的主语,谓语指示为资源链接关系,宾语为任一查询变量,进一步的,所述任一查询变量与第一查询条件中的查询变量不同。
作为一个例子,被删除的查询三元组为?Quantities hasUnit?unit,则资源链接查询三元组的主语为?Quantities,谓语为表示资源链接关系hasResLink,宾语可以设置为与第一查询条件中的查询变量不同的查询变量。例如可以为?URI,则资源链接关系查询三元组为?Quantities hasResLink?URI,部分查询三元组为?device hasFunctionality?Function以及?Function hasQuantities?Quantities。进一步的,第二查询对象的查询三元组中除了包含查询对象变量以外,还进一步包括辅助查询变量,辅助查询变量为资源链接关系查询三元组的主语和宾语。其中,资源链接关系查询三元组的主语为部分查询三元组指示的属性,资源链接关系的宾语用于指示部分查询三元组指示的属性链接的远程语义描述资源。
用于查询第二查询对象的查询语句为:
Figure PCTCN2017082233-appb-000003
Figure PCTCN2017082233-appb-000004
根据图4可知,(sensor12hasFunctionality measuringHumidity,且
measuringHumidity hasQuantities HumidityAspect,且
HumidityAspect hasResLink http://www.onem2m.example3.org/***/)。
因此,使用上述查询语句查询部分查询三元组指示的属性(即资源链接查询三元组中的主语所指示的属性HumidityAspect)链接到远程语义描述资源的第二查询对象为sensor12。以及使用上述查询语句查询?Quantities指示的属性为HumidityAspect;以及?URI指示的属性为http://www.onem2m.example3.org/***/,用上述用于查询第二查询对象查询语句进行查询可以得到第二查询对象列表,如下表所示:
?device ?Quantities ?URI
sensor12 HumidityAspect http://www.onem2m.example3.org/***/
由于第二查询对象sensor12与第一查询对象相同,所以sensor12已经被确定为满足第一查询条件的查询对象,无需对sensor12进行第二语义查询。因此将sensor12从第二查询对象列表中删除,此时第二查询对象列表仍然为空。
进一步的,由于删除第一查询条件中的一条查询三元组(?Quantities hasUnit?unit)后仍然剩余两条查询三元组(?device hasFunctionality?Function和?Function hasQuantities?Quantities),所以还需循环执行上述删除与查询的过程,直至第一查询条件中除包含查询对象变量的查询三元组(?device hasFunctionality?Function)之外的查询三元组都被删除过一次。
此时,第一查询条件中剩余的两条查询三元组中?Function hasQuantities?Quantities不包含查询对象变量?device,所以将这条不包含查询对象变量的查询三元组删除,然后构造资源链接关系查询三元组。其中,构造的资源链接关系查询三元组为:?Function hasResLink?URI,部分查询三元组为?device hasFunctionality?Function。同样地,第二查询对象的查询三元组中除了包含查询对象变量以外,还进一步包括辅助查询变量,辅助查询变量为资源链接关系查询三元组的主语和宾语。则用于查询第二查询对象的查询语句为:
Figure PCTCN2017082233-appb-000005
结合图4可知,(sensor22hasFunctionality lightMeasuring,且
lightMeasuring hasResLink http://www.onem2m.example2.org/***/)。
因此,使用上述查询语句查询部分查询三元组指示的属性(即资源链接查询三元组中的 主语所指示的属性lightMeasuring)链接到远程语义描述资源的第二查询对象为sensor22。以及使用上述查询语句查询?Function指示的属性为lightMeasuring,以及使用上述查询语句查询?URI指示的属性为http://www.onem2m.example2.org/***/。用第二次构造的用于查询第二查询对象查询语句进行查询之后,第二查询对象列表如下表所示:
?device ?Function ?URI
sensor22 lightMeasuring http://www.onem2m.example2.org/***/
由于第二查询对象sensor22不包含在第一查询对象列表中,所以需对sensor12进行第二语义查询。
可以理解的是,此时第一查询条件中只剩包含查询对象变量的查询三元组?device hasFunctionality?Function没被删除过,所以步骤504结束,最终确定的第二查询对象为sensor22。
值得说明的是,上述举例以每次删除一条查询三元组为例,但是并不限制于每次只删除一条,且确定的第二查询对象可能为一个也可能为多个或者可能为空。
另外,本发明实施例不限定构造用于查询第二查询对象的查询语句的方法,任何可以实现用于查询满足第一查询条件中的部分查询三元组,且链接到远程语义描述资源的查询语句构造方法都适用于本发明。
505、第一设备向第二设备发送第二语义查询请求,所述第二语义查询请求包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。
其中,第二设备为该部分查询三元组指示的属性链接的语义描述资源所在的M2M平台、M2M网关或者M2M设备。
作为一个例子,仍继续上述步骤504中的举例,第二查询对象为sensor22,确定查询第二查询对象sensor22时所使用的部分查询三元组为?device hasFunctionality?Function。因此,除了部分查询三元组之外的查询三元组为:?Function hasQuantities?Quantities和?Quantities hasUnit?unit。因此,第一设备向第二设备发送的第二语义查询请求中的查询条件包含上述两条查询三元组。第二语义查询请求的目的地址为该部分查询三元组指示的属性链接的语义描述资源的URI。
作为另一种可选方式,第一设备还可以在确定查询第二查询对象sensor22时所使用的部分查询三元组为?device hasFunctionality?Function后,使用部分查询三元组指示的属性作为除了部分查询三元组之外的查询三元组生成第二语义查询请求。
作为一个例子,第二语义查询请求中的查询语句为:
Figure PCTCN2017082233-appb-000006
该第二语义查询请求用于查询在第二设备存储的语义描述资源中lightMeasuring是否通过hasQuantities关系包含?Quantities对应的属性,且lightMeasuring包含的? Quantities对应的属性是否通过hasUnit关系包含?unit对应的属性。
步骤504中确定了该部分查询三元组指示的属性为lightMeasuring,lightMeasuring链接的语义描述资源的URI为http://www.onem2m.example2.org/***/,假设CSE2对应 的URI为http://www.onem2m.example2.org/,则可确定部分查询三元组指示的属性链 接的语义描述资源的URI指示所述链接的语义描述资源为CSE2上的资源,所以第二设备为CSE2所在的M2M平台、M2M网关或者M2M设备。
需要说明的是,第一设备向第二设备发送第二语义查询请求是为了确定部分查询三元组指示的属性或资源是否满足第二查询条件,第二查询条件包含第一查询条件中除所述部分查询三元组之外的查询三元组。因此,本发明实施例并不局限于本实施例中第二查询请求包含的查询语句的构造方式,任何可以实现该目的的查询语句都认为是可行的。
506、第二设备根据第二语义查询请求进行第二语义查询。
以步骤505中的第二语义查询请求中的查询语句为例,可以理解的是,在第一语义查询过程中,已经确定sensor22满足部分查询三元组?device hasFunctionality?Function,第二语义查询是为了进一步确定部分查询三元组?device hasFunctionality?Function指示的属性lightMeasuring是否进一步满足第一查询条件中除部分查询三元组之外的查询三元组。
假设第二设备中存储的语义信息包括以下三元组信息:
lightMeasuring hasQuantities lightAspect
lightAspect hasUnit“Lux”
此时,采用第二语义查询请求中包含的两条查询三元组(lightMeasuring hasQuantities?Quantities和?Quantities hasUnit?unit)在第二设备的语义描述资源中进行查询,由于第二设备中存储的语义信息中包括三元组lightMeasuring hasQuantities lightAspect,则说明lightMeasuring满足第一条查询三元组lightMeasuring hasQuantities?Quantities。其中,?Quantities对应的属性为lightAspect,则进一步查询lightAspect是否满足第二条查询三元组?Quantities hasUnit?unit。
由于第二设备中存储的语义信息中包括三元组lightAspect hasUnit“Lux”,则说明lightAspect满足第二条查询三元组?Quantities hasUnit?unit,其中,?unit对应的属性为“Lux”。
通过查询,确定了部分查询三元组指示的属性lightMeasuring在第二设备的语义描述资源中通过hasQuantities关系包含?Quantities对应的属性lightAspect,且lightMeasuring包含的?Quantities对应的属性lightAspect进一步通过hasUnit关系包含?unit对应的属性“Lux”,从而可以确定第二查询对象满足第二查询条件。还需说明的是,如果第二设备中未存储相关三元组信息,则说明第二查询对象不满足第二查询条件。
在本发明实施例中,以第二查询对象满足第二查询条件为例,则假设第二语义查询的查询结果为yes。
需要说明的是,第二查询对象可能为多个,第一设备需分别向每个第二查询对象对应的第二设备发送第二语义查询请求。
507、第二设备向第一设备发送第二语义查询响应。
其中,第二语义查询响应中携带第二设备的URI,第二语义查询响应为第二语义查询成功响应或者第二语义查询失败响应。
需要说明的是,每个第二设备完成第二语义查询过程后都需向第一设备发送第二语义查询响应。
由于步骤506中的查询结果为yes,所以本例中第二设备向第一设备发送的是第二语义查询成功响应,该第二语义查询成功响应中具体可以携带第二语义查询结果yes,以及上述部分三元组链接的语义描述资源的URI http://www.onem2m.example2.org/***/
508、第一设备接收第二设备发送的第二语义查询响应,并向应用服务器发送第一语义查询响应。
当第二语义查询响应为第二语义查询成功响应时,第一设备根据第二语义查询成功响应中的URI(http://www.onem2m.example2.org/***/),从第二查询对象列表中查找该URI对应的第二查询对象(sensor22),由于经过上述语义查询过程已经确定第二查询对象(sensor22)满足第一查询条件中的部分查询三元组,且部分查询三元组指示的属性满足第二查询条件,因此经过远程语义查询过程可以认为第二查询对象(sensor22)满足第一查询条件,可以将第二查询对象sensor22确定为第一查询对象,故将sensor22从第二查询对象列表中删除,同时加入到第一查询对象列表中,此时,第二查询对象列表为空,第一查询对象列表为:
?device
sensor12
sensor22
当第二语义查询响应为第二语义查询失败响应时,第一设备根据第二语义查询失败响应中的URI,从第二查询对象列表中查找该URI对应的第二查询对象,由于经过上述语义查询过程已经确定该第二查询对象虽然满足第一查询条件中的部分查询三元组,但是部分查询三元组指示的属性不满足第二查询条件,因此经过远程语义查询过程可以认为该第二查询对象不满足第一查询条件,故将该URI对应的第二查询对象从第二查询对象列表中删除,第一查询对象列表保持不变。
需要说明的是,第一设备可以在接收到所有的第二设备发送的第二语义查询响应之后或者根据其他条件(例如第二查询对象列表为空时)判断需要向应用服务器返回第一语义查询响应时,才会向应用服务器发送第一语义查询响应,第一语义查询响应中包括第一查询对象(sensor12)以及第二语义查询成功响应对应的第二查询对象(sensor22)。
本发明实施例提供的语义查询的方法,语义查询请求中携带远程查询参数,可以指示是否需要查询链接的远程语义描述资源,当需要查询链接的远程语义描述资源时,使用部分查询三元组以及资源链接关系查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性,进而只需向部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求,查询部分查询三元组指示的属性或资源是否满足第二查询条件,无需在链接的所有远程语义描述资源 中进行语义查询过程,避免了获取过多的远程语义信息,减少了网络开销。
上述实施例以查询对象变量为第一语义查询请求所请求查询的资源为例,在本发明实施例提供的另一种实现方式中,查询对象变量还可以为第一语义查询请求所请求查询的属性,仍结合图5所示的方法流程,以代码二作为第一语义查询请求为例进行说明。
在步骤501、应用服务器向第一设备发送第一语义查询请求中,第一语义查询请求中包含的查询语句参考如上代码二:
Figure PCTCN2017082233-appb-000007
则第一语义查询请求的查询对象变量为?Quantities,?Quantities为请求查询的属性,查询三元组分别指示?Function对应的属性为?device对应的资源或属性包含的属性,?Quantities对应的属性为?Function对应的属性所包含的属性。
由此可知,第一语义查询请求需要查询第一设备中满足第一查询条件(通过hasQuantities关系被?Function对应的属性所包含,且?Function对应的属性通过hasFunctionality关系被?device对应的资源或属性所包含)的查询对象。
进一步的,上述代码二中的两条查询三元组中,由于第二条查询三元组的主语为第一条查询三元组的宾语,因此第一设备确定这三条查询三元组属于递进关系的查询三元组。
本例中,仍假设远程语义查询参数为true,第一设备需要查询链接的远程语义描述资源。
进一步的,在步骤503、第一设备使用第一语义查询请求中的查询语句查询满足第一查询条件的第一查询对象中,采用代码二中的两条查询语句从图4所示的三元组信息中查询第一查询对象?Quantities,通过查询可知,sensor12hasFunctionality measuringTemperature满足代码二中的第一条查询语句,measuringTemperature hasQuantities TemperatureAspect满足代码二中的第二条查询语句。
即?Quantities对应的属性TemperatureAspect为?Function对应的属性measuringTemperature所包含,?Function对应的属性measuringTemperature为?device对应的资源sensor12所包含的属性,所以可以确定满足第一查询条件的第一查询对象为?Quantities对应的属性TemperatureAspect。
此外,由于图4所示的三元组信息中还包含sensor12hasFunctionality measuringHumidity(满足代码二中的第一条查询语句)以及measuringHumidity hasQuantities HumidityAspect(满足代码二中的第二条查询语句),所以可以确定满足第一查询条件的查询对象还包括:?Quantities对应的属性HumidityAspect。
经过查询确定第一查询对象列表为:
?Quantities
TemperatureAspect
measuringHumidity
然后,对应于上述步骤504,第一设备使用部分查询三元组以及资源链接查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部 分查询三元组指示的属性或资源。
由于代码二中,第一条查询三元组?device hasFunctionality?Function的宾语为第二条查询三元组?Function hasQuantities?Quantities的宾语,所以可以确定第一条查询三元组的级别高于第二条查询三元组,所以按照级别从低到高的顺序,应该删除第二条查询三元组,但是由于第二条查询三元组为包含查询对象变量的查询三元组,所以不能删除第二条查询三元组,所以代码二中没有能够删除的查询三元组,即没有能够查询的远程语义描述资源,此时,第二查询对象列表为空,无需执行第二语义查询的过程。
所以第一设备可以直接向应用服务器发送第一语义查询响应,第一语义查询响应中包含第一查询对象TemperatureAspect以及measuringHumidity。
本发明实施例提供的语义查询的方法,语义查询请求中携带远程查询参数,可以指示是否需要查询链接的远程语义描述资源,当需要查询链接的远程语义描述资源时,使用部分查询三元组以及资源链接关系查询三元组查询部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性,进而只需向部分查询三元组指示的属性关联的CSE所在的设备发送第二语义查询请求,查询部分查询三元组指示的属性或资源是否满足第二查询条件,无需在链接的所有远程语义描述资源中进行语义查询过程,避免了获取过多的远程语义信息,减少了网络开销。
如图6所示,本发明实施例还提供了一种语义查询的装置,该语义查询的装置具体为存储语义描述资源的装置,该装置应用于M2M网关、M2M平台或M2M设备中,该装置包括:接收单元601,查询单元603和发送单元604。
接收单元601,用于接收第一语义查询请求,所述第一语义查询请求包括查询对象变量以及第一查询条件,所述查询对象变量指示所述第一语义查询请求所请求查询的属性或资源,所述第一查询条件包括至少两条查询三元组,所述至少两条查询三元组分别指示所述查询对象关联的属性和/或资源;
查询单元602,用于使用所述至少两条查询三元组查询满足所述第一查询条件的第一查询对象;使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源,所述部分查询三元组为所述至少两条查询三元组中删除了至少一条查询三元组后的查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
发送单元603,用于向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定所述部分查询三元组指示的属性是否满足第二查询条件,所述第二查询条件包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。
进一步的,接收单元601还用于执行图5中第一设备执行的步骤501,508。查询单元602还可以用于执行图5中第一设备执行的步骤502,503,504等步骤,发送单元603还可以用于执行图5中第一设备执行的步骤505。本发明在此不再详述。此外,图6中的装置可以用于执行上述方法流程中存储语义描述资源的设备执行的任一流程,存储图3和图4的语义描述资源。
进一步的,图8中的装置是以功能单元的形式来呈现。这里的“单元”可以指特定应用集成电路(application-specific integrated circuit,ASIC),电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在 一个简单的实施例中,本领域的技术人员可以想到图6中的装置可以采用图2所示的形式。各单元可以通过图2的处理器、收发器和存储器来实现。
本发明实施例还提供了一种计算机存储介质,用于储存为上述图6所示的存储语义描述资源的装置6所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序。通过执行存储的程序,可以实现对语义描述资源进行语义查询。本领域普通技术人员应该了解本申请的所有或部分标的物可在结合硬件和/或固件的软件中实施。例如,本文描述的标的物可在一个或多个处理器执行的软件中实施。在一项示例性实施方式中,本文描述的标的物可使用存储有计算机可执行指令的非瞬时计算机可读介质实施,当计算机处理器执行该计算机可执行指令时,该指令控制计算机执行步骤。适于实施本文描述的标的物的示例计算机可读介质包括非瞬时计算机可读介质,例如磁盘存储器设备、芯片存储器设备、可编程逻辑设备和专用集成电路。另外,实施本文描述的标的物的计算机可读介质可位于单个设备或计算平台上,或可在多个设备或计算平台上分发。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (15)

  1. 一种语义查询的方法,应用于机器通信M2M系统,其特征在于,所述方法包括:
    接收第一语义查询请求,所述第一语义查询请求包括查询对象变量以及第一查询条件,所述查询对象变量指示所述第一语义查询请求所请求查询的属性或资源,所述第一查询条件包括至少两条查询三元组,所述至少两条查询三元组分别指示所述查询对象关联的属性和/或资源;
    使用所述至少两条查询三元组查询满足所述第一查询条件的第一查询对象;
    使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源,所述部分查询三元组为所述至少两条查询三元组中删除了至少一条查询三元组后的查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
    向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定所述部分查询三元组指示的属性是否满足第二查询条件,所述第二查询条件包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。
  2. 根据权利要求1所述的语义查询的方法,其特征在于,在所述向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求之后,所述方法还包括:
    接收所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备返回的第二语义查询成功响应;
    发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象和所述第二查询对象。
  3. 根据权利要求1所述的语义查询的方法,其特征在于,在所述向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求之后,所述方法还包括:
    接收所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备返回的第二语义查询失败响应;
    发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象,不包括所述第二查询对象。
  4. 根据权利要求2或3所述的语义查询的方法,其特征在于,当所述查询对象变量为一条查询三元组的主语时,所述至少两条查询三元组分别指示所述查询对象包含的属性和/或被所述查询对象包含的属性所包含的属性;
    当所述查询对象变量为一条查询三元组的宾语时,所述至少两条查询三元组分别指示所述查询对象所属的属性或资源,以及所述查询对象所属的属性所属的属性或资源。
  5. 根据权利要求4所述的语义查询的方法,其特征在于,所述使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源;向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求,包括:
    S1、删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组 为所述部分查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
    S2、构造资源链接查询三元组,所述资源链接查询三元组的数量与被删除的查询三元组的数量相同,所述资源链接查询三元组的主语为所述被删除的查询三元组的主语,谓语指示为资源链接关系,宾语为任一查询变量,所述任一查询变量与第一查询条件中的查询变量不同;
    S3、使用所述部分查询三元组以及所述资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性;
    S4、当所述第二查询对象与所述第一查询对象不同时,向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求;
    循环执行上述步骤S1至S4,直至所述第一查询条件中除包含所述查询对象变量的查询三元组之外的查询三元组都被删除过一次。
  6. 根据权利要求5所述的语义查询的方法,其特征在于,所述删除所述第一查询条件中的至少一条查询三元组,包括:
    判断所述第一查询条件中的查询三元组之间的级别是否相同;
    当所述第一查询条件中的查询三元组之间的级别不同时,按照查询三元组的级别从低到高的顺序,每次删除所述第一查询条件中的查询级别低的至少一条查询三元组;删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组;
    当所述第一查询条件中的查询三元组之间的级别相同时,采用遍历的方式每次删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组。
  7. 根据权利要求5或6所述的语义查询的方法,其特征在于,所述第一语义查询请求中包括远程语义查询参数,所述远程语义查询参数用于指示是否需要进行远程查询;或
    接收所述第一语义查询请求的设备中包含远程查询指示策略,所述远程查询指示策略用于指示是否需要进行远程查询。
  8. 一种语义查询的装置,应用于机器通信M2M系统,其特征在于,所述装置包括:
    接收单元,用于接收第一语义查询请求,所述第一语义查询请求包括查询对象变量以及第一查询条件,所述查询对象变量指示所述第一语义查询请求所请求查询的属性或资源,所述第一查询条件包括至少两条查询三元组,所述至少两条查询三元组分别指示所述查询对象关联的属性和/或资源;
    查询单元,用于使用所述至少两条查询三元组查询满足所述第一查询条件的第一查询对象;使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源,所述部分查询三元组为所述至少两条查询三元组中删除了至少一条查询三元组后的查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
    发送单元,用于向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定所述部分查询三元组指示的属性是否满足第二查询条件,所述第二查询条件包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。
  9. 根据权利要求8所述的语义查询的装置,其特征在于,
    所述接收单元,还用于接收所述部分查询三元组指示的属性链接的远程语义描述资源所 在的设备返回的第二语义查询成功响应;
    所述发送单元,还用于发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象和所述第二查询对象。
  10. 根据权利要求8所述的语义查询的装置,其特征在于,
    所述接收单元,还用于接收所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备返回的第二语义查询失败响应;
    所述发送单元,还用于发送第一语义查询响应,所述第一语义查询响应中包括所述第一查询对象,不包括所述第二查询对象。
  11. 根据权利要求9或10所述的语义查询的装置,其特征在于,当所述查询对象变量为一条查询三元组的主语时,所述至少两条查询三元组分别指示所述查询对象包含的属性和/或被所述查询对象包含的属性所包含的属性;
    当所述查询对象变量为一条查询三元组的宾语时,所述至少两条查询三元组分别指示所述查询对象所属的属性或资源,以及所述查询对象所属的属性所属的属性或资源。
  12. 根据权利要求11所述的语义查询的装置,其特征在于,
    所述查询单元,还用于删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组为所述部分查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;构造资源链接查询三元组,所述资源链接查询三元组的数量与被删除的查询三元组的数量相同,所述资源链接查询三元组的主语为所述被删除的查询三元组的主语,谓语指示为资源链接关系,宾语为任一查询变量,所述任一查询变量与第一查询条件中的查询变量不同;使用所述部分查询三元组以及所述资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象以及所述部分查询三元组指示的属性;
    所述发送单元,还用于当所述第二查询对象与所述第一查询对象不同时,向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求;
    所述查询单元,还用于将所述第一查询条件中除包含所述查询对象变量的查询三元组之外的查询三元组都删除一次。
  13. 根据权利要求12所述的语义查询的装置,其特征在于,
    所述查询单元,还用于判断所述第一查询条件中的查询三元组之间的级别是否相同;当所述第一查询条件中的查询三元组之间的级别不同时,按照查询三元组的级别从低到高的顺序,每次删除所述第一查询条件中的查询级别低的至少一条查询三元组;删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组;当所述第一查询条件中的查询三元组之间的级别相同时,采用遍历的方式每次删除所述第一查询条件中的至少一条查询三元组,其中,删除后剩余的查询三元组中至少存在所述包含所述查询对象变量的查询三元组。
  14. 根据权利要求12或13所述的语义查询的装置,其特征在于,所述第一语义查询请求中包括远程语义查询参数,所述远程语义查询参数用于指示是否需要进行远程查询;或
    接收所述第一语义查询请求的设备中包含远程查询指示策略,所述远程查询指示策略用于指示是否需要进行远程查询。
  15. 一种语义查询的装置,应用于机器通信M2M系统,其特征在于,包括:
    存储器,用于存储计算机可执行程序代码;
    收发器,以及
    处理器,与所述存储器和所述收发器耦合;
    其中所述程序代码包括指令,当所述处理器执行所述指令时,所述指令使所述装置执行以下操作:
    接收第一语义查询请求,所述第一语义查询请求包括查询对象变量以及第一查询条件,所述查询对象变量指示所述第一语义查询请求所请求查询的属性或资源,所述第一查询条件包括至少两条查询三元组,所述至少两条查询三元组分别指示所述查询对象关联的属性和/或资源;
    使用所述至少两条查询三元组查询满足所述第一查询条件的第一查询对象;
    使用部分查询三元组以及资源链接查询三元组查询所述部分查询三元组指示的属性链接到远程语义描述资源的第二查询对象,以及查询所述部分查询三元组指示的属性或资源,所述部分查询三元组为所述至少两条查询三元组中删除了至少一条查询三元组后的查询三元组,所述部分查询三元组中至少存在包含所述查询对象变量的查询三元组;
    向所述部分查询三元组指示的属性链接的远程语义描述资源所在的设备发送第二语义查询请求以确定所述部分查询三元组指示的属性是否满足第二查询条件,所述第二查询条件包含所述第一查询条件中除所述部分查询三元组之外的查询三元组。
PCT/CN2017/082233 2016-06-01 2017-04-27 一种语义查询的方法及装置 WO2017206634A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610387225.6A CN107451164B (zh) 2016-06-01 2016-06-01 一种语义查询的方法及装置
CN201610387225.6 2016-06-01

Publications (1)

Publication Number Publication Date
WO2017206634A1 true WO2017206634A1 (zh) 2017-12-07

Family

ID=60479730

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/082233 WO2017206634A1 (zh) 2016-06-01 2017-04-27 一种语义查询的方法及装置

Country Status (2)

Country Link
CN (1) CN107451164B (zh)
WO (1) WO2017206634A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569335B (zh) 2018-03-23 2022-05-27 百度在线网络技术(北京)有限公司 基于人工智能的三元组校验方法、装置及存储介质
CN110807311B (zh) * 2018-07-18 2023-06-23 百度在线网络技术(北京)有限公司 用于生成信息的方法和装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655862A (zh) * 2009-08-11 2010-02-24 华天清 信息对象搜索的方法和装置
US20100228794A1 (en) * 2009-02-25 2010-09-09 International Business Machines Corporation Semantic document analysis
JP2012073787A (ja) * 2010-09-28 2012-04-12 Toshiba Corp 情報検索装置
CN103049506A (zh) * 2012-12-12 2013-04-17 华南理工大学 移动设备的数据缓存方法及其系统
CN104424310A (zh) * 2013-09-06 2015-03-18 中国海洋大学 基于本体的智能家居语义查询方法和装置
CN104750709A (zh) * 2013-12-26 2015-07-01 中国移动通信集团公司 一种语义检索方法及系统
CN105045790A (zh) * 2015-03-13 2015-11-11 北京航空航天大学 图数据搜索系统、方法和设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11238073B2 (en) * 2014-02-07 2022-02-01 Convida Wireless, Llc Enabling resource semantics

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100228794A1 (en) * 2009-02-25 2010-09-09 International Business Machines Corporation Semantic document analysis
CN101655862A (zh) * 2009-08-11 2010-02-24 华天清 信息对象搜索的方法和装置
JP2012073787A (ja) * 2010-09-28 2012-04-12 Toshiba Corp 情報検索装置
CN103049506A (zh) * 2012-12-12 2013-04-17 华南理工大学 移动设备的数据缓存方法及其系统
CN104424310A (zh) * 2013-09-06 2015-03-18 中国海洋大学 基于本体的智能家居语义查询方法和装置
CN104750709A (zh) * 2013-12-26 2015-07-01 中国移动通信集团公司 一种语义检索方法及系统
CN105045790A (zh) * 2015-03-13 2015-11-11 北京航空航天大学 图数据搜索系统、方法和设备

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MA WUBIN ET AL.: "Spatial resource index construction and query optimization algorithm for internet of things", SYSTEMS ENGINEERING AND ELECTRONICS, vol. 36, no. 1, 31 January 2014 (2014-01-31) *
ZHANG XIAOSHUANG: "Ontology query expansion research based on the smart home", CHINA MASTER'S THESES FULL-TEXT DATABASE, 15 January 2015 (2015-01-15) *

Also Published As

Publication number Publication date
CN107451164A (zh) 2017-12-08
CN107451164B (zh) 2020-05-19

Similar Documents

Publication Publication Date Title
US20200280604A1 (en) Lightweight iot information model
US11563819B2 (en) Operation triggering method and apparatus for machine-to-machine communications
US10635663B2 (en) Mechanisms for semantics publishing and discovery
JP7065082B2 (ja) 分散されたセマンティック記述子に対するセマンティッククエリ
US11076013B2 (en) Enabling semantic mashup in internet of things
JP6734404B2 (ja) M2m/iotサービス層におけるセマンティクス推論サービス有効化
WO2020249032A1 (zh) 通信方法及装置
WO2017206634A1 (zh) 一种语义查询的方法及装置
US11088989B2 (en) Semantic validation method and apparatus
WO2018227695A1 (zh) 订阅数据的发送、接收方法、装置及系统
US20230045914A1 (en) Method and apparatus for controlling device in internet of things, and gateway device and storage medium
Kang et al. IoT framework for interoperability in the oneM2M architecture
US11456889B2 (en) Information notification method, apparatus, and system
Purnomo et al. Enhancing Semantic Discovery in oneM2M with Direct Query

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: 17805579

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: 17805579

Country of ref document: EP

Kind code of ref document: A1