CN110705316A - Method and device for generating linear time sequence logic protocol of smart home - Google Patents

Method and device for generating linear time sequence logic protocol of smart home Download PDF

Info

Publication number
CN110705316A
CN110705316A CN201910935932.8A CN201910935932A CN110705316A CN 110705316 A CN110705316 A CN 110705316A CN 201910935932 A CN201910935932 A CN 201910935932A CN 110705316 A CN110705316 A CN 110705316A
Authority
CN
China
Prior art keywords
clause
tree
logic
semantic
natural
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.)
Granted
Application number
CN201910935932.8A
Other languages
Chinese (zh)
Other versions
CN110705316B (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.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201910935932.8A priority Critical patent/CN110705316B/en
Publication of CN110705316A publication Critical patent/CN110705316A/en
Application granted granted Critical
Publication of CN110705316B publication Critical patent/CN110705316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Machine Translation (AREA)

Abstract

The invention discloses a method and a device for generating a linear time sequence logic protocol by an intelligent home, which are used for converting a natural language requirement text input by a user into the linear time sequence logic protocol in the field of the intelligent home. Firstly, preprocessing an input natural language text; then, generating a syntax analysis tree and a syntax dependency relationship by using a natural language processing technology; identifying each clause in the sentence, and subject, predicate, object, Boolean operator, condition variable and time sequence operator in each clause to generate an intermediate representation form of a tree; and finally traversing the tree structure and automatically generating a corresponding linear time sequence logic protocol. The invention solves the problem that common intelligent household users are difficult to directly provide formal conventions, effectively saves time and labor cost, and can make up the defects of the existing intelligent household Internet of things verification system, so that natural language requirements provided by common users without professional knowledge can be automatically verified.

Description

Method and device for generating linear time sequence logic protocol of smart home
Technical Field
The invention relates to automatic generation of a linear time sequence logic protocol in the field of intelligent home furnishing.
Background
Rapidly developing and popularizing smart home technologies and devices are changing lives of people, and a plurality of IoT platforms (such as IFTTT, Apple HomeKit and the like) provide services for constructing home automation for common smart home users, connect various smart home devices by compiling rules and meet complex requirements of the users. The technology brings convenience and introduces some potential safety hazards. A great variety of intelligent devices are connected together through complex user-defined rules, so that the behavior of the system is difficult to predict, and a user cannot know whether the user-defined intelligent home system can correctly meet the own requirements when in operation. Some incorrect rules or uncertain chain reactions may even cause safety accidents, so it is necessary to verify the user-defined smart home system.
It is an emerging trend to use formal methods, particularly model checking techniques, to simulate and verify the correctness of user-defined smart home systems. Existing research is primarily concerned with modeling and validating system behavior, but the input to model verification, i.e., the generation of formalization conventions, is of less concern.
The mastering of formal conventions requires a lot of learning and training, and writing formal conventions is almost impossible for ordinary users, which causes a problem that the ordinary users want to verify their own needs.
Disclosure of Invention
The problems to be solved by the invention are as follows: the method and the device for converting the natural language requirements of the user into the linear time sequence logic protocols in the field of smart home are provided, so that an ordinary user does not need to learn the formal protocols professionally, and only needs to provide texts defined by the natural language requirements.
In order to solve the problems, the invention adopts the following scheme:
the method for generating the linear time sequence logic protocol of the smart home comprises the following steps:
s1: acquiring a domain knowledge vocabulary, a semantic translation template, a protocol translation template, intelligent household equipment description information in a current scene and a natural language requirement text input by a user; the domain knowledge vocabulary is a comparison table of system terms and natural language; the semantic translation template defines the translation contrast from a natural semantic logic clause to a logic operation clause; the protocol translation template defines the translation contrast from a natural semantic logic clause to a time sequence operation clause;
s2: converting the natural language in the natural language requirement text into system terms according to the domain knowledge vocabulary;
s3: analyzing the natural language requirement text obtained in the step S2 by using a natural language processing technology to generate a syntactic analysis tree;
s4: recognizing each clause in the syntax analysis tree obtained in the step S3 by using a semantic analysis technology, and generating a natural semantic logic clause tree by combining a subject, a predicate, an object, a Boolean operator, a condition variable and a time sequence operator in each clause;
s5: translating the natural semantic logic clauses in the natural semantic logic clause tree and the relation between the natural semantic logic clauses into linear time sequence logic conventions according to the semantic translation template and the convention translation template;
the step S4 includes the steps of:
s41: through the recognition of noun phrases and verb phrases in sentence nodes and clause nodes of the syntactic analysis tree, dividing subtrees corresponding to the corresponding sentence nodes and clause nodes into syntactic clause trees;
s42: extracting a subject, a predicate and an object from the syntax clause tree;
s43: extracting Boolean operators, condition variables and time sequence operators from the syntax clause tree through keyword matching;
s44: and according to the syntactic analysis tree, composing the subject, predicate, object, Boolean operator, condition variable and time sequence operator extracted from each syntactic clause tree into a natural semantic logic clause tree.
Further, according to the method for generating a linear time sequence logic specification of a smart home, in the step S3, the method further includes:
s31: when the natural language requirement text is analyzed by using a natural language processing technology to generate the syntactic analysis tree, generating a syntactic dependency relationship;
s32: and adjusting the syntax analysis tree through ambiguity analysis of the syntax dependency relationship.
Further, according to the method for generating a linear time sequence logic specification of a smart home, the step S5 includes:
s51: converting a subject, a predicate and an object in a natural semantic logic clause in the natural semantic logic clause tree into an atomic proposition according to the semantic translation template;
s52: traversing the tree structure of the natural semantic logic clause tree, translating Boolean operators, condition variables and time sequence operators according to the specification translation template, and combining all the atomic propositions into a complete linear time sequence logic specification.
The device for generating the linear time sequence logic protocol of the smart home comprises the following modules:
m1, used for: acquiring a domain knowledge vocabulary, a semantic translation template, a protocol translation template, intelligent household equipment description information in a current scene and a natural language requirement text input by a user; the domain knowledge vocabulary is a comparison table of system terms and natural language; the semantic translation template defines the translation contrast from a natural semantic logic clause to a logic operation clause; the protocol translation template defines the translation contrast from a natural semantic logic clause to a time sequence operation clause;
m2, used for: converting the natural language in the natural language requirement text into system terms according to the domain knowledge vocabulary;
m3, used for: analyzing the natural language requirement text obtained by the module M2 by using a natural language processing technology to generate a syntactic analysis tree;
m4, used for: using a semantic analysis technology to identify each clause in the syntax analysis tree obtained by the module M3, and combining a subject, a predicate, an object, a Boolean operator, a condition variable and a time sequence operator in each clause to generate a natural semantic logic clause tree;
m5, used for: translating the natural semantic logic clauses in the natural semantic logic clause tree and the relation between the natural semantic logic clauses into linear time sequence logic conventions according to the semantic translation template and the convention translation template;
the module M4 comprises the following steps:
m41, used for: through the recognition of noun phrases and verb phrases in sentence nodes and clause nodes of the syntactic analysis tree, dividing subtrees corresponding to the corresponding sentence nodes and clause nodes into syntactic clause trees;
m42, used for: extracting a subject, a predicate and an object from the syntax clause tree;
m43, used for: extracting Boolean operators, condition variables and time sequence operators from the syntax clause tree through keyword matching;
m44, used for: and according to the syntactic analysis tree, composing the subject, predicate, object, Boolean operator, condition variable and time sequence operator extracted from each syntactic clause tree into a natural semantic logic clause tree.
Further, according to the apparatus for generating a linear timing logic specification of a smart home according to the present invention, the module M3 further includes:
m31, used for: when the natural language requirement text is analyzed by using a natural language processing technology to generate the syntactic analysis tree, generating a syntactic dependency relationship;
m32, used for: and adjusting the syntax analysis tree through ambiguity analysis of the syntax dependency relationship.
Further, according to the apparatus for generating a linear time sequence logic specification of a smart home according to the present invention, the module M5 includes:
m51, used for: converting a subject, a predicate and an object in a natural semantic logic clause in the natural semantic logic clause tree into an atomic proposition according to the semantic translation template;
m52, used for: traversing the tree structure of the natural semantic logic clause tree, translating Boolean operators, condition variables and time sequence operators according to the specification translation template, and combining all the atomic propositions into a complete linear time sequence logic specification.
The invention has the following technical effects:
1. the invention provides a method for converting the natural language requirements of a user into a generated linear time sequence logic protocol, so that a common user does not need to learn a formal protocol professionally, only needs to provide a text defined by the natural language requirements, and can also realize the correctness verification of a user-defined intelligent home system.
2. The conversion method of the invention fully considers the ambiguity of natural language and corrects the attaching ambiguity and conjunctive ambiguity caused by the ambiguity in English.
Drawings
FIG. 1 is a flow chart of a method of an embodiment of the present invention.
FIG. 2 is an example of a parse tree requiring an output of an open source toolkit according to an embodiment of the present invention.
FIG. 3 is an example parse tree for an example requirement two open source toolkit output according to an embodiment of the present invention.
FIG. 4 is an example of syntactic dependencies that illustrate the output of the requirement two open source toolkit according to an embodiment of the present invention.
FIG. 5 is an example of the parse tree of FIG. 3 adjusted by the syntax dependency ambiguity analysis of FIG. 4.
FIG. 6 is an example parse tree illustrating the output of the requirement three-way open source toolkit according to an embodiment of the present invention.
FIG. 7 is a diagram illustrating an example of syntactic dependencies requiring the output of a three-channel open source toolkit according to an embodiment of the present invention.
FIG. 8 is an example of the parse tree of FIG. 6 adjusted by the syntax dependency ambiguity analysis of FIG. 7.
Fig. 9 is an example of the parse tree of fig. 2 converted into a natural semantic logical clause tree.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
The invention discloses a method for generating a linear time sequence logic protocol of an intelligent home, which comprises the following five steps:
s1: acquiring data;
s2: the term replacement;
s3: generating a syntax analysis tree;
s4: converting the syntax analysis tree into a natural semantic logic clause tree;
s5: and traversing the natural semantic logic clause tree to generate a linear time sequence logic specification.
In step S1, the data in the step of acquiring data is composed of five parts, which are a domain knowledge vocabulary, a semantic translation template, a specification translation template, smart home device description information, and a natural language requirement text. Wherein, the domain knowledge vocabulary, the semantic translation template and the protocol translation template are preset by the method; the intelligent household equipment description information is the intelligent household equipment description information in the current application scene and is generally obtained by automatic provision of the intelligent household equipment through network connection; the natural language requirement text is edited and input by the user. Therefore, the actual input of the method of the present invention is only the natural language requirement text input by the user. The description information of the intelligent home equipment is defined by the intelligent home equipment of various different manufacturers, can be automatically provided and obtained by the intelligent home equipment, and can also be obtained by manual editing. The description information of the intelligent household equipment comprises basic information definition of the equipment, accessible data definition of the equipment and executable action of the equipment. Device basic information includes, but is not limited to, name, type, serial number, location, etc.
The domain knowledge vocabulary is a comparison of system terms to natural language. The system terminology herein falls into two categories: the first category is terminology related to smart home devices; the second category is the term associated with linear sequential logic conventions. The terminology related to the smart home device is divided into noun terminology and verb terminology. The term, such as GAS _ condensation, refers to GAS CONCENTRATION, and natural language includes GAS CONCENTRATION, GAS level, GAS density, etc. Verb terms, such as Turnon, denote device on actions, which in contrast to natural language include turn on, switch on, activate, open, and the like. Terms related to linear sequential logic conventions are generally adverbs, such as the sequential operator F in linear sequential logic conventions, against natural languages including eventualy, finaly, etc.
The semantic translation template defines the translation contrast from a natural semantic logic clause to a logic operation clause. The protocol translation template defines the translation contrast from the natural semantic logic clause to the time sequence operation clause. As is well known, a linear sequential logic convention consists of atomic propositions and operations between them. The syntax of the linear sequential logic specification can be expressed as:
Figure BDA0002221588260000051
wherein p is an atomic proposition;a V and B are logic operators, G, X, F, U and → are time sequence operators. The semantic translation template is compared with the logic operation of the atomic propositions in the linear time sequence logic specification, and the specification translation template is compared with the time sequence operation between the atomic propositions in the linear time sequence logic specification. For example, the following is an example of a semantic translation template:
natural semantic logical clauses Translated logical operation clause
subj be_GreaterThan obj subj>obj
subj be_LessThan obj subj<obj
subj be_TurnOn subj_state=ON
subj be_TurnOff subj_state=OFF
The following are examples of protocol translation templates:
natural semantic logical clauses Translated sequential operation clause
φ1untilφ2 φ12
φ1beforeφ2 2→(φ12)
φ1afterφ2 G(φ2→Gφ1)
The natural language requirement text is edited and input by the user. The following text is an example of a natural language requirement text:
REQ1:When the gas concentration exceeds 10%,the alarm should beactivated immediately until the gas concentration is below 8%.
REQ2:When the camera gets a new photo,a message should be sent to themobile phone with the photo.
REQ3:The AC cooler in the bedroom and the AC heater in the livingroom shouldn’tbe on simultaneously.
in the above example of natural language requirement text, the user defines three requirements: demand one, when the gas concentration exceeds 10%, the alarm must be turned on immediately until the gas concentration is lower than 8%; secondly, when a camera takes a new photo, information with the photo needs to be sent to the mobile phone; and thirdly, the air-conditioning refrigerator in the bedroom and the air-conditioning heater in the living room cannot be started simultaneously.
The above example of the natural language requirement text is converted into a linear time sequence logic specification by a manual conversion method as follows:
G(GAS_CONCENTRATION>10→X(ALARM_state=ON U GAS_CONCENTRATION<8))
G(CAMERA.NewPhoto=TRUE→MOBILE_PHONE.SendMsg=TRUE)
Figure BDA0002221588260000061
the invention aims to convert the natural language requirement text input by the user into the linear time sequence logic protocol in the form.
Step S2 term replacement refers to converting the natural language in the natural language requirement text into system terms according to the domain knowledge vocabulary. Therefore, the input of step S2 is the preset domain knowledge vocabulary and the natural language requirement text input by the user, and the output is the natural language requirement text after term replacement. Specifically, a corresponding natural language in the domain knowledge vocabulary is found in the natural language requirement text, and then the natural language is replaced by a corresponding system term, for example, if the system term corresponding to the GAS CONCENTRATION in the domain knowledge vocabulary in requirement one is GAS _ CONCENTRATION, all the GAS CONCENTRATION character strings in the natural language requirement text are replaced by the system term GAS _ CONCENTRATION. The natural language requirement text of the aforementioned three requirements is replaced by terms as follows:
REQ1:When the GAS_CONCENTRATION exceeds 10%,the ALARM should beactivated immediately until the GAS_CONCENTRATION is below 8%.
REQ2:When the CAMERA gets a new photo,a MESSAGE should be sent to theMOBILE_PHONE with the PHOTO.
REQ3:The AC_COOLER in the BEDROOM and the AC_HEATER in the LIVINGROOMshouldn’t be on simultaneously.
the purpose of the term substitution in step S2 is to facilitate the use of subsequent natural language processing tools, resulting in more accurate parsing results.
The input of step S3 is the natural language requirement text after term replacement in step S2, and the output is a parse tree, specifically, the natural language requirement text obtained in step S2 is analyzed by using a natural language processing technique to generate a parse tree. Natural Language processing techniques, i.e., nlp (natural Language processing), are familiar to those skilled in the art. In this embodiment, an open source toolkit Stanford Parser is used to perform part-of-speech tagging and syntax analysis on a sentence, so as to obtain a syntax analysis tree. FIG. 2 is a diagram of a parse tree obtained by analyzing a requirement in the natural language requirement text of the three requirements through natural language processing technology. In fig. 2, ROOT represents a ROOT node of an entire sentence; IN the non-leaf nodes, S represents a sentence, SBAR represents a clause, NP represents a noun phrase, VP represents a verb phrase, WHADVP represents a Wh adverb phrase, DT represents a qualifier, NN represents a noun, VB represents a verb, VBZ represents a verb third person, VBN represents a verb past participle of the verb, CD represents a number, MD represents a modal verb, RB represents an adverb, IN represents a preposition, and PP represents a preposition phrase; the leaf node is the sentence content.
Ambiguity is one of the characteristics of natural language, which is an inevitable problem for most natural language processing efforts. Ambiguity can lead to errors in the results of the parsing and thus to the generation of erroneous LTLs. It is difficult to quickly locate ambiguities by directly parsing the parse tree. For this reason, in the present embodiment, the parse tree obtained after parsing by the natural language processing technique is simultaneously parsed by the natural language processing technique to obtain the syntactic dependency, and then the parse tree is adjusted by the ambiguity analysis of the syntactic dependency. That is, in this embodiment, after the open source toolkit Stanford Parser is used to perform part-of-speech tagging and parsing on the sentence, the open source toolkit Stanford Parser outputs a parsing tree and a syntax dependency relationship, and then the parsing tree is adjusted according to ambiguity analysis of the syntax dependency relationship, and finally the output of step S3 is the parsing tree after ambiguity analysis adjustment. Common english structural ambiguities are attaching ambiguities and conjunctive ambiguities. The ambiguity analysis of the grammar dependency relationship in this embodiment processes the following two ambiguities respectively:
attaching ambiguity: attachment ambiguity refers to the fact that a particular component in a sentence can be attached at multiple locations on the syntax tree. Taking the aforementioned requirement two as an example, fig. 3 is a parsing tree output by the open source toolkit Stanford Parser, and fig. 4 is a syntax dependency relationship output by the open source toolkit Stanford Parser. As can be readily seen by human processing, the dotted preposed phrase with the PHOTO in FIG. 3 is a definition of MESSAGE. As can be seen from the dashed-line labeled syntactic dependencies of FIG. 4, the parsing associates PHOTO and MOBILE _ PHONE together. In the definition of the smart device description information, there is no direct relationship between PHOTO and MOBILE _ PHONE, and PHOTO belongs to a MESSAGE, and there is a direct relationship between them. Therefore, by means of the intelligent device description information, after errors are detected from the grammar dependency relationship, the MESSAGE node is found, and the preposed phrase with the PHOTO in the grammar tree is moved to the correct position. FIG. 5 is an adjusted parse tree for ambiguity analysis.
Word connection ambiguity: conjunctive ambiguity refers to the multiple understandings resulting from different structural relationships in the parallel structures connected by the conjunctions. Taking the aforementioned requirement three as an example, fig. 6 is a parsing tree output by the open source toolkit Stanford Parser, and fig. 7 is a syntax dependency relationship output by the open source toolkit Stanford Parser. As can be readily seen by the human process, the terms AC _ COOLER in the BEDROOM and AC _ HEATOR in the LIVINGROOM are two juxtaposed noun phrases, and the terms BEDROOM and AC _ HEATOR in the LIVINGROOM are juxtaposed from the parse tree labeled in FIG. 6 and the grammar dependency labeled in FIG. 7. In the definition of the smart Device description information, the type of bediron is "Location", and the type of AC _ provider is "Device", and the two types cannot be collocated in a subject and share a predicate. Thus, the nearest noun of type match, i.e., AC _ COOLER, is found, thus shifting the conjunction and its nodes to the right up. FIG. 8 is an ambiguity analysis adjusted parse tree.
In order to obtain the semantic and time series information required for generating the linear time series logic convention from the syntax tree, in step S4, each clause in the syntax analysis tree obtained in step S3 is identified by using a semantic analysis technique, and a natural semantic logic clause tree is generated by combining the subject, predicate, object, boolean operator, condition variable, and time series operator in each clause. The method comprises the following specific steps:
first, step S41 is to divide the sub-tree corresponding to the sentence node and the clause node into a syntax clause tree by recognizing the noun phrase and the verb phrase in the sentence node and the clause node of the syntax parsing tree. Taking the parsing tree of requirement one in fig. 2 as an example, in the sentence node represented by S and the Clause node represented by SBAR, through recognition of noun phrases and verb phrases, the corresponding grammatical clauses "the GAS _ conversation excepted 10", "the GAS _ conversation is below 8", and "the ALARM shell be activated" can be found out, so as to form a syntax Clause tree, and the parent node of the syntax Clause tree is defined as a class node.
Each clause is then processed separately in step S42. In order to reduce unnecessary workload, clauses are firstly subjected to word shape reduction, and for example, "am", "is" and "was" are all reduced to "be". Then extracting main, predicate and object meaning information in the clauses, wherein the main words are obtained by noun phrases in the clauses; the predicate is obtained from a verb phrase in the clause; the object is obtained from the noun phrase in the verb phrase. Taking the syntax clause trees corresponding to the aforementioned syntax clauses "the GAS _ conversation excepted 10%", "the GAS _ conversation is below 8%", and "the ALARM short belated activated" as examples, the corresponding subject, predicate, and object are { GAS _ conversation, be _ great, 10% }, { GAS _ conversation, be _ LessThan, 10% }, { ALARM, be _ TurnOn }, respectively, can be extracted.
In step S43, keyword matching is performed on each clause, and boolean operators, conditional variables, and timing operators are extracted. Boolean operatorExtracted from negative words, such as "not" and "nover". The condition variable can be extracted from some keywords in natural language, such as "if" or "where" is followed by a Clause node, and then this Clause represents the condition that the specification satisfies. The timing operators are divided into unary operators, which describe single atomic propositions, and binary operators, which describe two or more atomic propositions. The timing operator may be extracted from the adverb, such as "always" for G and "eventuality" for F.
In step S44, the subject, predicate, object, boolean operator, condition variable, and sequential operator extracted from each syntax clause tree are combined into a natural semantic logic clause tree based on the syntax analysis tree. Taking the syntax parsing tree requiring one in fig. 2 as an example, the finally obtained natural semantic logical clause tree is shown in fig. 9. Wherein, the node Clause represents a natural semantic logic Clause, Clause (R) represents a root node, Clause (C) represents a condition variable, Clause (T-B-U) represents a node with a binary operator unity, and Clause (T-U-X) represents a node with a unary operator X.
Step S5 traverses the natural semantic logic clause tree to generate a linear temporal logic convention. The specific treatment process is as follows:
first, in step S51, using a semantic translation template, the subject, predicate, and object of each clause are generated into an atomic proposition of linear sequential logical conventions in the natural semantic logical clause tree obtained in step S4. If the corresponding template can not be found, the clause structure is removed. Taking the natural semantic logical clause tree in fig. 9 as an example, three atomic propositions will be obtained through step S51:
GAS_CONCENTRATION>10,ALARM_state=ON,GAS_CONCENTRATION<8.
then step S52, traversing the tree structure from top to bottom with depth first, using the specification translation template to translate boolean, conditional and temporal operators to combine the atomic propositions into a complete linear temporal logical specification. The linear sequential logic conventions finally generated by the natural language requirement texts of the three requirements are as follows:
G(GAS_CONCENTRATION>10→X(ALARM_state=ON U GAS_CONCENTRATION<8))
G(CAMERA.NewPhoto=TRUE→MOBILE_PHONE.SendMsg=TRUE)

Claims (6)

1. a method for generating a linear time sequence logic protocol of an intelligent home is characterized by comprising the following steps:
s1: acquiring a domain knowledge vocabulary, a semantic translation template, a protocol translation template, intelligent household equipment description information in a current scene and a natural language requirement text input by a user; the domain knowledge vocabulary is a comparison table of system terms and natural language; the semantic translation template defines the translation contrast from a natural semantic logic clause to a logic operation clause; the protocol translation template defines the translation contrast from a natural semantic logic clause to a time sequence operation clause;
s2: converting the natural language in the natural language requirement text into system terms according to the domain knowledge vocabulary;
s3: analyzing the natural language requirement text obtained in the step S2 by using a natural language processing technology to generate a syntactic analysis tree;
s4: recognizing each clause in the syntax analysis tree obtained in the step S3 by using a semantic analysis technology, and generating a natural semantic logic clause tree by combining a subject, a predicate, an object, a Boolean operator, a condition variable and a time sequence operator in each clause;
s5: translating the natural semantic logic clauses in the natural semantic logic clause tree and the relation between the natural semantic logic clauses into linear time sequence logic conventions according to the semantic translation template and the convention translation template;
the step S4 includes the steps of:
s41: through the recognition of noun phrases and verb phrases in sentence nodes and clause nodes of the syntactic analysis tree, dividing subtrees corresponding to the corresponding sentence nodes and clause nodes into syntactic clause trees;
s42: extracting a subject, a predicate and an object from the syntax clause tree;
s43: extracting Boolean operators, condition variables and time sequence operators from the syntax clause tree through keyword matching;
s44: and according to the syntactic analysis tree, composing the subject, predicate, object, Boolean operator, condition variable and time sequence operator extracted from each syntactic clause tree into a natural semantic logic clause tree.
2. The method for generating linear time series logic conventions for smart homes according to claim 1, wherein the step S3 further comprises:
s31: when the natural language requirement text is analyzed by using a natural language processing technology to generate the syntactic analysis tree, generating a syntactic dependency relationship;
s32: and adjusting the syntax analysis tree through ambiguity analysis of the syntax dependency relationship.
3. The method for generating linear time-series logic conventions for smart homes according to claim 1, wherein the step S5 comprises:
s51: converting a subject, a predicate and an object in a natural semantic logic clause in the natural semantic logic clause tree into an atomic proposition according to the semantic translation template;
s52: traversing the tree structure of the natural semantic logic clause tree, translating Boolean operators, condition variables and time sequence operators according to the specification translation template, and combining all the atomic propositions into a complete linear time sequence logic specification.
4. The utility model provides a device that linear sequential logic stipulations of intelligence house generated which characterized in that includes following module:
m1, used for: acquiring a domain knowledge vocabulary, a semantic translation template, a protocol translation template, intelligent household equipment description information in a current scene and a natural language requirement text input by a user; the domain knowledge vocabulary is a comparison table of system terms and natural language; the semantic translation template defines the translation contrast from a natural semantic logic clause to a logic operation clause; the protocol translation template defines the translation contrast from a natural semantic logic clause to a time sequence operation clause;
m2, used for: converting the natural language in the natural language requirement text into system terms according to the domain knowledge vocabulary;
m3, used for: analyzing the natural language requirement text obtained by the module M2 by using a natural language processing technology to generate a syntactic analysis tree;
m4, used for: using a semantic analysis technology to identify each clause in the syntax analysis tree obtained by the module M3, and combining a subject, a predicate, an object, a Boolean operator, a condition variable and a time sequence operator in each clause to generate a natural semantic logic clause tree;
m5, used for: translating the natural semantic logic clauses in the natural semantic logic clause tree and the relation between the natural semantic logic clauses into linear time sequence logic conventions according to the semantic translation template and the convention translation template;
the module M4 comprises the following steps:
m41, used for: through the recognition of noun phrases and verb phrases in sentence nodes and clause nodes of the syntactic analysis tree, dividing subtrees corresponding to the corresponding sentence nodes and clause nodes into syntactic clause trees;
m42, used for: extracting a subject, a predicate and an object from the syntax clause tree;
m43, used for: extracting Boolean operators, condition variables and time sequence operators from the syntax clause tree through keyword matching;
m44, used for: and according to the syntactic analysis tree, composing the subject, predicate, object, Boolean operator, condition variable and time sequence operator extracted from each syntactic clause tree into a natural semantic logic clause tree.
5. The apparatus for generating linear sequential logic conventions for smart homes according to claim 4, wherein the module M3 further comprises:
m31, used for: when the natural language requirement text is analyzed by using a natural language processing technology to generate the syntactic analysis tree, generating a syntactic dependency relationship;
m32, used for: and adjusting the syntax analysis tree through ambiguity analysis of the syntax dependency relationship.
6. The apparatus for generating linear sequential logic conventions for smart homes according to claim 4, wherein the module M5 comprises:
m51, used for: converting a subject, a predicate and an object in a natural semantic logic clause in the natural semantic logic clause tree into an atomic proposition according to the semantic translation template;
m52, used for: traversing the tree structure of the natural semantic logic clause tree, translating Boolean operators, condition variables and time sequence operators according to the specification translation template, and combining all the atomic propositions into a complete linear time sequence logic specification.
CN201910935932.8A 2019-09-29 2019-09-29 Method and device for generating linear time sequence logic protocol of smart home Active CN110705316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910935932.8A CN110705316B (en) 2019-09-29 2019-09-29 Method and device for generating linear time sequence logic protocol of smart home

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910935932.8A CN110705316B (en) 2019-09-29 2019-09-29 Method and device for generating linear time sequence logic protocol of smart home

Publications (2)

Publication Number Publication Date
CN110705316A true CN110705316A (en) 2020-01-17
CN110705316B CN110705316B (en) 2023-03-24

Family

ID=69196805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910935932.8A Active CN110705316B (en) 2019-09-29 2019-09-29 Method and device for generating linear time sequence logic protocol of smart home

Country Status (1)

Country Link
CN (1) CN110705316B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112099764A (en) * 2020-08-13 2020-12-18 南京航空航天大学 Formal conversion rule-based avionics field requirement standardization method
CN113255295A (en) * 2021-04-27 2021-08-13 西安电子科技大学 Method and system for automatically generating formalized protocol from natural language to PPTL (Power Point language)
CN114091430A (en) * 2020-06-29 2022-02-25 微软技术许可有限责任公司 Clause-based semantic parsing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1226327A (en) * 1996-06-28 1999-08-18 微软公司 Method and system for computing semantic logical forms from syntax trees
CN102662932A (en) * 2012-03-15 2012-09-12 中国科学院自动化研究所 Method for establishing tree structure and tree-structure-based machine translation system
US20140136188A1 (en) * 2012-11-02 2014-05-15 Fido Labs Inc. Natural language processing system and method
CN106843849A (en) * 2016-12-28 2017-06-13 南京大学 A kind of automatic synthesis method of the code model of the built-in function based on document

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1226327A (en) * 1996-06-28 1999-08-18 微软公司 Method and system for computing semantic logical forms from syntax trees
CN102662932A (en) * 2012-03-15 2012-09-12 中国科学院自动化研究所 Method for establishing tree structure and tree-structure-based machine translation system
US20140136188A1 (en) * 2012-11-02 2014-05-15 Fido Labs Inc. Natural language processing system and method
CN106843849A (en) * 2016-12-28 2017-06-13 南京大学 A kind of automatic synthesis method of the code model of the built-in function based on document

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MOHD IBRAHIM: "Class Diagram Extraction from Textual Requirements Using Natural Language Processing (NLP) Techniques", 《2010 SECOND INTERNATIONAL CONFERENCE ON COMPUTER RESEARCH AND DEVELOPMENT》 *
薛丽娟: "基于规则推理引擎的实体关系抽取研究", 《计算机科学与探索》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114091430A (en) * 2020-06-29 2022-02-25 微软技术许可有限责任公司 Clause-based semantic parsing
CN112099764A (en) * 2020-08-13 2020-12-18 南京航空航天大学 Formal conversion rule-based avionics field requirement standardization method
CN112099764B (en) * 2020-08-13 2022-03-15 南京航空航天大学 Formal conversion rule-based avionics field requirement standardization method
CN113255295A (en) * 2021-04-27 2021-08-13 西安电子科技大学 Method and system for automatically generating formalized protocol from natural language to PPTL (Power Point language)
CN113255295B (en) * 2021-04-27 2024-04-09 西安电子科技大学 Automatic generation method and system for formal protocol from natural language to PPTL

Also Published As

Publication number Publication date
CN110705316B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
US11250842B2 (en) Multi-dimensional parsing method and system for natural language processing
Hawkins et al. Criterial features in learner corpora: Theory and illustrations
CN110705316B (en) Method and device for generating linear time sequence logic protocol of smart home
US11501082B2 (en) Sentence generation method, sentence generation apparatus, and smart device
Abdelnabi et al. Generating UML class diagram using NLP techniques and heuristic rules
Aguado de Cea et al. Natural language-based approach for helping in the reuse of ontology design patterns
CN112183059B (en) Chinese structured event extraction method
Abdelnabi et al. Generating uml class diagram from natural language requirements: A survey of approaches and techniques
CN111814451A (en) Text processing method, device, equipment and storage medium
Zhang et al. Automated generation of ltl specifications for smart home iot using natural language
CN113255295A (en) Method and system for automatically generating formalized protocol from natural language to PPTL (Power Point language)
Tapsai Information processing and retrieval from CSV file by natural language
JP2016164707A (en) Automatic translation device and translation model learning device
CN113792542A (en) Intention understanding method fusing syntactic analysis and semantic role pruning
Osman et al. Generate use case from the requirements written in a natural language using machine learning
Anju et al. Malayalam to English machine translation: An EBMT system
CN116483314A (en) Automatic intelligent activity diagram generation method
Ortmann Automatic topological field identification in (historical) german texts
CN115169370A (en) Corpus data enhancement method and device, computer equipment and medium
Posevkin et al. Multilanguage natural user interface to database
Ferraro et al. NLP Techniques for Normative Mining.
CN113128202B (en) Intelligent arrangement method and device for Internet of things service
CN110569510A (en) method for identifying named entity of user request data
Wang et al. Automatic generation of specification from natural language based on temporal logic
CN114281940B (en) Computer cognition method and system based on semantic engineering and case learning

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