[go: up one dir, main page]

CN112015973A - Relation reasoning method and terminal for heterogeneous network - Google Patents

Relation reasoning method and terminal for heterogeneous network Download PDF

Info

Publication number
CN112015973A
CN112015973A CN201910472285.1A CN201910472285A CN112015973A CN 112015973 A CN112015973 A CN 112015973A CN 201910472285 A CN201910472285 A CN 201910472285A CN 112015973 A CN112015973 A CN 112015973A
Authority
CN
China
Prior art keywords
inference
network
reasoning
rule
network layer
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
CN201910472285.1A
Other languages
Chinese (zh)
Other versions
CN112015973B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910472285.1A priority Critical patent/CN112015973B/en
Publication of CN112015973A publication Critical patent/CN112015973A/en
Application granted granted Critical
Publication of CN112015973B publication Critical patent/CN112015973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a relation reasoning method and a terminal of a heterogeneous network, wherein the method comprises the following steps: receiving query information input by a user; reasoning the query information in the heterogeneous network based on a preset reasoning strategy to obtain a target reasoning result; the heterogeneous network comprises a basic network layer and a high-level relation network layer, wherein the basic network layer takes people, affairs, places and objects as network nodes, and network layers are established by taking human-to-human, human-to-affairs, human-to-ground and human-to-object as network relations; the high-level relation network layer is a network layer with probability weight established by mining generated relations. The embodiment of the invention does not need to establish a plurality of network topologies aiming at different types of data, thereby reducing the difficulty of reasoning.

Description

一种异构网络的关系推理方法及终端A relational reasoning method and terminal for heterogeneous networks

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种异构网络的关系推理方法及终端。The present invention relates to the technical field of communications, and in particular, to a relational reasoning method and terminal for heterogeneous networks.

背景技术Background technique

互联网普及的大环境下,用户线上线下行为数据也与日俱增,每日都有PB级别的数据产生。警务场景下,对海量数据进行可疑信息的筛查和推理成为技术和业务难题。如果将数据类型归类为人-事-地-物的话,每天都有一个复杂异构的网络拓扑产生。为了洞悉用户意图、分析用户行为、解析用户与万物关联关系,现有技术中,通常的关系推理方式为基于同构网络的关系推理。然而对于不同类型(异构)的节点,需要构建多个网络拓扑,因此推理的难度较大。In the context of the popularization of the Internet, the online and offline behavior data of users is also increasing day by day, and PB-level data is generated every day. In policing scenarios, screening and reasoning of suspicious information from massive data has become a technical and business problem. If the data types are classified as people-things-land-things, a complex and heterogeneous network topology is generated every day. In order to gain insight into user intentions, analyze user behavior, and analyze the relationship between users and all things, in the prior art, a common relational reasoning method is relational reasoning based on isomorphic networks. However, for nodes of different types (heterogeneous), multiple network topologies need to be constructed, so reasoning is difficult.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种异构网络的关系推理方法及终端,以解决推理的难度较大的问题。Embodiments of the present invention provide a relational reasoning method and terminal for heterogeneous networks, so as to solve the problem of relatively difficult reasoning.

第一方面,本发明实施例提供了一种异构网络的关系推理方法,包括:In a first aspect, an embodiment of the present invention provides a relational reasoning method for heterogeneous networks, including:

接收用户输入查询信息;Receive user input query information;

基于预设推理策略在异构网络中对所述查询信息进行推理,获得目标推理结果;Inferring the query information in a heterogeneous network based on a preset inference strategy to obtain a target inference result;

其中,所述预设推理策略包括事件推理策略、规则推理策略和条件推理策略中的至少一项,所述异构网络包括基础网络层和高级关系网络层,所述基础网络层是以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立的网络层;所述高级关系网络层是通过挖掘产生的关系建立具有概率权重的网络层。Wherein, the preset reasoning strategy includes at least one of event reasoning strategy, rule reasoning strategy and conditional reasoning strategy, and the heterogeneous network includes a basic network layer and a high-level relational network layer, and the basic network layer is based on human, Things, places, and things are network nodes, and the network layer is established with people-to-people, people-to-things, people-to-land, and people-to-things. Network layer.

第二方面,本发明实施例还提供了一种终端,包括:In a second aspect, an embodiment of the present invention further provides a terminal, including:

接收模块,用于接收用户输入查询信息;a receiving module for receiving query information input by a user;

推理模块,用于基于预设推理策略在异构网络中对所述查询信息进行推理,获得目标推理结果;an inference module, configured to infer the query information in a heterogeneous network based on a preset inference strategy to obtain a target inference result;

其中,所述预设推理策略包括事件推理策略、规则推理策略和条件推理策略中的至少一项,所述异构网络包括基础网络层和高级关系网络层,所述基础网络层是以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立的网络层;所述高级关系网络层是通过挖掘产生的关系建立具有概率权重的网络层。Wherein, the preset reasoning strategy includes at least one of event reasoning strategy, rule reasoning strategy and conditional reasoning strategy, and the heterogeneous network includes a basic network layer and a high-level relational network layer, and the basic network layer is based on human, Things, places, and things are network nodes, and the network layer is established with people-to-people, people-to-things, people-to-land, and people-to-things. Network layer.

第三方面,本发明实施例还提供了一种终端,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述异构网络的关系推理方法的步骤。In a third aspect, an embodiment of the present invention further provides a terminal, including a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program is executed by the processor The steps to implement the above relational reasoning method for heterogeneous networks.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述异构网络的关系推理方法的步骤。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the above method for relational reasoning in a heterogeneous network.

本发明实施例中,由于将不同的类型的数据统一抽象成网络节点和关系形成异构网络,并根据用户输入的查询信息,利用事件推理策略、规则推理策略和条件推理策略中的至少一项在异构网络中查询获得对应的推理结果,从而实现异构网络的关系推理。无需针对不同类型的数据建立多个网络拓扑,降低了推理的难度。In the embodiment of the present invention, since different types of data are uniformly abstracted into network nodes and relationships to form a heterogeneous network, and according to the query information input by the user, at least one of an event reasoning strategy, a rule reasoning strategy, and a conditional reasoning strategy is used. The corresponding reasoning results are obtained by querying in the heterogeneous network, so as to realize the relational reasoning of the heterogeneous network. There is no need to build multiple network topologies for different types of data, which reduces the difficulty of reasoning.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.

图1是本发明实施例提供的异构网络的关系推理方法的流程图;FIG. 1 is a flowchart of a relational reasoning method for heterogeneous networks provided by an embodiment of the present invention;

图2是本发明实施例提供的异构网络的关系推理方法中Rete算法结构示意图;2 is a schematic structural diagram of a Rete algorithm in a relational reasoning method for heterogeneous networks provided by an embodiment of the present invention;

图3是本发明实施例提供的异构网络的关系推理方法规则推理策略的架构图;3 is an architecture diagram of a rule inference strategy of a relational reasoning method for heterogeneous networks provided by an embodiment of the present invention;

图4是本发明实施例提供的异构网络的关系推理方法中条件推理引擎的示例图;4 is an example diagram of a conditional reasoning engine in a relational reasoning method for heterogeneous networks provided by an embodiment of the present invention;

图5是本发明一实施例提供的终端的结构图;5 is a structural diagram of a terminal provided by an embodiment of the present invention;

图6是本发明另一实施例提供的终端的结构图。FIG. 6 is a structural diagram of a terminal provided by another embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

参见图1,图1是本发明实施例提供的一种异构网络的关系推理方法的流程图,如图1所示,包括以下步骤:Referring to FIG. 1, FIG. 1 is a flowchart of a relationship reasoning method for heterogeneous networks provided by an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:

步骤101,接收用户输入查询信息;Step 101, receiving query information input by a user;

步骤102,基于预设推理策略在异构网络中对所述查询信息进行推理,获得目标推理结果;Step 102, inferring the query information in a heterogeneous network based on a preset inference strategy, to obtain a target inference result;

其中,所述预设推理策略包括事件推理策略、规则推理策略和条件推理策略中的至少一项,所述异构网络包括基础网络层和高级关系网络层,所述基础网络层是以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立的网络层;所述高级关系网络层是通过挖掘产生的关系建立具有概率权重的网络层。Wherein, the preset reasoning strategy includes at least one of event reasoning strategy, rule reasoning strategy and conditional reasoning strategy, and the heterogeneous network includes a basic network layer and a high-level relational network layer, and the basic network layer is based on human, Things, places, and things are network nodes, and the network layer is established with people-to-people, people-to-things, people-to-land, and people-to-things. Network layer.

本发明实施例中,可以基于图数据库(已经图化的大规模异构网络)的对数据进行组织管理,以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立基础网络层,对于通过挖掘产生的关系,如疑似团伙关系,构成第二层还有概率权重的高级关系网络层。例如用户A在商场C内看了一场电影D,则在基础网络层中可以设置用户A、商场C和电影D作为网络节点,并以用户A与其他的网络节点的关系构成网络的层次关系。此外,用户A与用户B同时乘坐一趟航班,在高级关系网络层中确定用户A与用户B同行的概率为第一预设百分比。具体的,对于关系的确定以及概率权重的确定可以根据不同的策略确定,具体在此不做进一步的说明。In the embodiment of the present invention, data can be organized and managed based on a graph database (large-scale heterogeneous network that has been graphed), with people, things, places, and things as network nodes, and people to people, people to things, people The basic network layer is established for the network relationship with the land and people and things. For the relationship generated by mining, such as suspected gang relationship, the second layer is an advanced relationship network layer with probability weights. For example, user A watched a movie D in shopping mall C, user A, shopping mall C and movie D can be set as network nodes in the basic network layer, and the relationship between user A and other network nodes constitutes the hierarchical relationship of the network . In addition, user A and user B take a flight at the same time, and the probability that user A and user B travel together is determined as the first preset percentage in the advanced relationship network layer. Specifically, the determination of the relationship and the determination of the probability weight may be determined according to different strategies, which will not be further described herein.

上述事件推理策略是指针对特定的事实进行分析,例如在一可选实施例中,可以将将输入条件和数据都看成事件(主谓宾(Subject predicate object,SPO)三元组),推理的过程转变为输入SPO在基础网络层中匹配的过程。具体的,用户输入的查询信息即为输入的SPO,此时,需要对用户输入的查询信息进行语义解析,得到系统能够识别的SPO结构的查询语句,然后查询获得相应的结果。The above event reasoning strategy refers to analyzing specific facts. For example, in an optional embodiment, both input conditions and data can be regarded as events (subject predicate object (SPO) triples), and reasoning The process of transforming into a process in which the input SPOs are matched in the base network layer. Specifically, the query information input by the user is the input SPO. At this time, the query information input by the user needs to be semantically parsed to obtain a query statement of the SPO structure that the system can recognize, and then query to obtain corresponding results.

上述规则推理策略是指在所述基础网络层中筛选出与所述查询信息对应的规则匹配的数据。The above rule inference strategy refers to filtering out data matching the rules corresponding to the query information in the basic network layer.

上述条件推理策略是基于贝叶斯推理,对高层网络进行概率推理。The above conditional reasoning strategy is based on Bayesian reasoning, which performs probabilistic reasoning on high-level networks.

本发明实施例中,由于将不同的类型的数据统一抽象成网络节点和关系形成异构网络,并根据用户输入的查询信息,利用事件推理策略、规则推理策略和条件推理策略中的至少一项在异构网络中查询获得对应的推理结果,从而实现异构网络的关系推理。无需针对不同类型的数据建立多个网络拓扑,降低了推理的难度。In the embodiment of the present invention, since different types of data are uniformly abstracted into network nodes and relationships to form a heterogeneous network, and according to the query information input by the user, at least one of an event reasoning strategy, a rule reasoning strategy, and a conditional reasoning strategy is used. The corresponding reasoning results are obtained by querying in the heterogeneous network, so as to realize the relational reasoning of the heterogeneous network. There is no need to build multiple network topologies for different types of data, which reduces the difficulty of reasoning.

应当说明的是,上述预设推理策略可以包括事件推理策略、规则推理策略和条件推理策略中的部分或全部。其中每一种推理策略对应的一种结果。具体的,可以根据用户输入的查询信息确定使用事件推理策略、规则推理策略和条件推理策略中的一项或者多项进行推理,例如,类似在查询具体事实(例如,用户A的妻子的父亲)时,可以通过事件推理策略进行推理得到。类似查询可能的事件(查询用户A与用户B共同认识的人)时,可以根据事件推理策略、规则推理策略和条件推理策略获得三个推理结果,该三个推理结果共同构成上述目标推理结果。It should be noted that the above-mentioned preset reasoning strategies may include some or all of event reasoning strategies, rule reasoning strategies and conditional reasoning strategies. Each of these inference strategies corresponds to an outcome. Specifically, one or more of the event reasoning strategy, the rule reasoning strategy, and the conditional reasoning strategy may be used for reasoning according to the query information input by the user, for example, similar to querying specific facts (eg, the father of user A's wife) can be obtained by reasoning through the event reasoning strategy. When similarly querying possible events (inquiring about people known to user A and user B), three inference results can be obtained according to the event inference strategy, the rule inference strategy and the conditional inference strategy, and the three inference results together constitute the above target inference results.

在一可选实施例中,所述预设推理策略包括所述事件推理策略时,上述步骤102包括:In an optional embodiment, when the preset reasoning strategy includes the event reasoning strategy, the above step 102 includes:

步骤1021,对所述查询信息进行语义解析,获得主谓宾SPO三元组构成的查询语句;Step 1021, performing semantic analysis on the query information to obtain a query statement composed of subject-verb-object SPO triples;

步骤1022,根据所述查询语句在所述基础网络层中匹配,获得匹配结果;Step 1022, matching in the basic network layer according to the query statement to obtain a matching result;

其中,所述目标推理结果包括所述匹配结果。Wherein, the target inference result includes the matching result.

本实施例中,事件推理策略主要是将事件(查询信息)表达转化成三元组的形式,通过事件推理引擎遍历基础网络层,获取最终推理结论。事件推理引擎是一种嵌入在应用程序中的组件,实现了将业务决策从应用程序代码中分离出来,省却各种复杂的if-else,判断并使用预定义的语义模块编写业务决策。接收用户的数据输入,解释业务规则,并根据业务规则做出业务决策。In this embodiment, the event reasoning strategy mainly converts the expression of events (query information) into the form of triples, and traverses the basic network layer through the event reasoning engine to obtain the final reasoning conclusion. The event inference engine is a component embedded in the application, which realizes the separation of business decisions from the application code, saves various complex if-else, and judges and uses predefined semantic modules to write business decisions. Receive data input from users, interpret business rules, and make business decisions based on business rules.

上述事件推理引擎主要基于RETE算法做了很多优化工作,提供了专家系统的一个高效实现,Rete算法是一种前向规则快速匹配算法。如图2所示系统的黑盒解释:左侧是规则的添加和删除;右侧是事实的添加和删除。其中,规则由左件和右件构成,左件由规则单元或函数单元构成,右件由动作单元构成。一条规则的激发即满足了左侧条件的事实会触发右侧的动作。The above event reasoning engine has done a lot of optimization work mainly based on the RETE algorithm, which provides an efficient implementation of the expert system. The Rete algorithm is a fast forward rule matching algorithm. The black box explanation of the system shown in Figure 2: the left side is the addition and deletion of rules; the right side is the addition and deletion of facts. The rule is composed of left and right components, the left component is composed of rule units or function units, and the right component is composed of action units. The firing of a rule, the fact that the condition on the left is satisfied, triggers the action on the right.

应理解,在Rete算法中,对于Rete网络的结构可以参照相关的技术,例如Rete网络包括alpha部分和beta部分,alpha部分对WME执行常量的测试。Alpha节点的输出保存在alpha memories(AM)中。比如(<x>on<y>)这个条件的alpha memories就会保存属性域等于on的WMEs。beta部分主要包含汇合节点join nodes以及beta memories。Join nodes用来执行条件之间的变量绑定的一致性检查。Beta memories保存部分产生式的实例(满足部分产生式的条件但不是全部条件的WMEs的组合)。这些部分实例化叫做tokens。Alpha网络执行所有包含一个WME的检测(大于、等于、小于,有变量的、固定值的),Beta网络执行包含两个以上WME的检测。It should be understood that in the Rete algorithm, related technologies may be referred to for the structure of the Rete network, for example, the Rete network includes an alpha part and a beta part, and the alpha part performs constant tests on the WME. The output of the alpha node is saved in alpha memories (AM). For example, alpha memories for the condition (<x>on<y>) will store WMEs with fields equal to on. The beta part mainly contains join nodes and beta memories. Join nodes are used to perform consistency checks on variable bindings between conditions. Beta memories hold instances of partial productions (combinations of WMEs that satisfy the conditions of some, but not all, of the productions). These partial instantiations are called tokens. The Alpha network performs all detections involving one WME (greater than, equal to, less than, variable, fixed), and the Beta network performs detections involving more than two WMEs.

在另一可选实施例中,所述预设推理策略包括所述规则推理策略时,所述步骤102包括:In another optional embodiment, when the preset reasoning strategy includes the rule reasoning strategy, the step 102 includes:

步骤1023,对所述查询信息进行识别获得第一事实,所述第一事实包括所述网络节点对应的实体、所述实体的关系信息和所述实体的属性信息;Step 1023, identifying the query information to obtain a first fact, where the first fact includes the entity corresponding to the network node, the relationship information of the entity, and the attribute information of the entity;

步骤1024,按照属性约束条件筛选所述第一事实,获得所述第一事实中满足所述属性约束条件的第二事实;Step 1024: Filter the first fact according to the attribute constraint condition, and obtain a second fact in the first fact that satisfies the attribute constraint condition;

步骤1025,基于所述基础网络层,将所述第一事实在规则网络中进行传递,获得规则推理结果;Step 1025, based on the basic network layer, transmit the first fact in the rule network to obtain a rule inference result;

其中,所述目标推理结果包括所述规则推理结果,所述规则网络根据预设规则库中与所述查询信息匹配的目标规则建立。Wherein, the target inference result includes the rule inference result, and the rule network is established according to target rules matching the query information in a preset rule base.

例如上述查询信息中需要查询用户E的信息,则上述第一事实可以包括歌星E、演员E和作家E。若上述属性约束条件为歌星,则可以根据属性约束条件滤除演员E和作家E。该属性约束条件可以根据上述查询信息确定。例如,查询与歌星A同台演出的用户E的信息时,可以确地属性约束条件为歌星。此外上述属性约束条件还可以包括其他属性约束信息,在此不做进一步的限定。For example, in the above query information, the information of user E needs to be queried, and the above first fact may include singer E, actor E, and writer E. If the above attribute constraints are singers, then actor E and writer E can be filtered out according to the attribute constraints. The attribute constraint condition may be determined according to the above query information. For example, when querying the information of user E who performs on the same stage as singer A, the attribute constraint can be determined to be singer. In addition, the above attribute constraint conditions may also include other attribute constraint information, which is not further limited herein.

进一步的,基于上述实施例,在本实施例中,在将所述第一事实在规则网络中进行传递的过程中,所述方法还包括:Further, based on the foregoing embodiment, in this embodiment, in the process of transmitting the first fact in the rule network, the method further includes:

按照所述属性约束条件对所述第一事实在规则网络中进行传递的过程中产生的中间事实进行属性约束。According to the attribute constraint conditions, attribute constraints are performed on the intermediate facts generated during the process of transmitting the first fact in the rule network.

应理解,在本发明实施例中,将第一事实将所述第一事实在规则网络中进行传递的过程中将会产生中间事实,该中间事实可以包括所述网络节点对应的实体、所述实体的关系信息和所述实体的属性信息。在加入新的中间事实后,还可以对中间事实按照属性约束条件进行约束,即在中间事实中滤除不满足属性约束条件的事实后继续将中间事在规则网络中进行传递,直到获得最终的事实,该最终的事实为规则推理结果。It should be understood that, in this embodiment of the present invention, an intermediate fact will be generated in the process of transmitting the first fact in the rule network, and the intermediate fact may include the entity corresponding to the network node, the The relationship information of the entity and the attribute information of the entity. After adding new intermediate facts, the intermediate facts can also be constrained according to the attribute constraints, that is, after filtering out the facts that do not meet the attribute constraints in the intermediate facts, the intermediate facts continue to be transmitted in the rule network until the final result is obtained. Fact, the final fact is the rule inference result.

由于在本发明实施例中,传入网络中的事实进行动态约束,从而可以减少事实推理的时间,提高推理的效率。In this embodiment of the present invention, the facts introduced into the network are dynamically constrained, so that the time for fact reasoning can be reduced and the efficiency of reasoning can be improved.

规则推理策略的具体实现可以参照图3所示,以下对图3中,各流程模块进行详细说明:The specific implementation of the rule inference strategy can be referred to as shown in FIG. 3 , and each process module in FIG. 3 is described in detail below:

在进行规则解析时,可以逐条读入规则库中与查询信息匹配的目标规则,按照规则的表示方法解析规则,从而将目标规则转换成规则服务系统RuleBase需要的数据格式,调用规则服务系统的接口添加规则,供规则服务系统构建规则网络。When performing rule parsing, you can read the target rules matching the query information in the rule base one by one, and parse the rules according to the representation method of the rules, so as to convert the target rules into the data format required by the rule service system RuleBase, and call the interface of the rule service system. Add rules for the rule service system to build a rule network.

在进行有效性检查时,通过属性约束条件对第一事实以及规则执行过程中产生的中间事实进行有效性检查。During the validity check, the first fact and the intermediate fact generated during the execution of the rule are checked for validity through attribute constraints.

推理策略的核心模块为规则推理引擎,规则推理引擎完成事实与规则的高效匹配。具体实现可用多种规则匹配算法,主要包括规则编辑和运行时执行两个阶段。规则编辑使用规则库中的规则生成规则网络,运行时执行对加入的事实在网络中进行传递。The core module of the inference strategy is the rule inference engine, which completes the efficient matching of facts and rules. A variety of rule matching algorithms can be used for specific implementation, mainly including two stages of rule editing and runtime execution. The rule editor uses the rules in the rule base to generate a network of rules, and the runtime execution propagates the fact of joining in the network.

查询模块Query的处理过程具体是将实事传入到规则服务系统,触发规则的推导。The processing process of the query module Query is to transmit the facts to the rule service system to trigger the derivation of the rules.

规则网络中具有多种规则实例,管理模块(例如可以采用Agenda,agenda是nodejs实现的基于mongodb数据库的分布式定时任务管理系统。)可以根据某种策略确定处于激活状态的规则实例的执行顺序,并执行规则实例。与此同时,Agenda还可以进行冲突解决,具体的,冲突解决方案可以参照相关的技术,在此不再赘述。There are many kinds of rule instances in the rule network, and the management module (for example, Agenda can be used. Agenda is a distributed timed task management system based on mongodb database implemented by nodejs.) The execution order of the activated rule instances can be determined according to a certain strategy, and execute the rule instance. At the same time, Agenda can also perform conflict resolution. For specific conflict resolution solutions, reference may be made to related technologies, which will not be repeated here.

由于不常用数据的加入会产生很多推理的中间数据,垃圾回收模块用来批量清理推理的中间数据/内存资源。具体的可以定时回收。Since the addition of infrequent data will generate a lot of intermediate data for inference, the garbage collection module is used to clean up the intermediate data/memory resources of inference in batches. Specifically, it can be recycled regularly.

进一步的,在又一实施例中,上述所述预设推理策略包括所述条件推理策略时,所述步骤102包括:Further, in yet another embodiment, when the above-mentioned preset reasoning strategy includes the conditional reasoning strategy, the step 102 includes:

利用贝叶斯推理的条件推理引擎,从所述基础网络层和高级关系网络层中推理获得所述查询信息对应的条件推理结果;Using the conditional reasoning engine of Bayesian reasoning, the conditional reasoning result corresponding to the query information is obtained by reasoning from the basic network layer and the advanced relational network layer;

其中,所述目标推理结果包括所述规则推理结果,如图4所示,所述条件推理引擎包括多树传播推理引擎、团树传播推理引擎、基于组合优化的方法引擎、基于搜索的方法引擎和蒙特卡罗Mante Carlo算法引擎中的至少一项。Wherein, the target reasoning result includes the rule reasoning result. As shown in FIG. 4 , the conditional reasoning engine includes a multi-tree propagation inference engine, a cluster tree propagation inference engine, a method engine based on combinatorial optimization, and a method engine based on search. and at least one of the Monte Carlo Mante Carlo algorithm engines.

本发明实施例中,上述多树传播推理引擎、团树传播推理引擎和基于组合优化的方法引擎用于实现精确推理,即希望能计算出目标变量的边际分布或条件分布的精确值,然而此类算法的计算复杂度随着极大团规模的增长呈指数增长,因此仅适用于贝叶斯网络的规模较小时。In the embodiment of the present invention, the above-mentioned multi-tree propagation inference engine, clique-tree propagation inference engine, and method engine based on combinatorial optimization are used to realize accurate inference, that is, it is desirable to calculate the exact value of the marginal distribution or conditional distribution of the target variable. The computational complexity of the class algorithm grows exponentially with the size of very large cliques, so it is only applicable when the size of the Bayesian network is small.

基于搜索的方法引擎和Mante Carlo算法引擎用于实现近似推理,当网络的规模较大时,多采用近似推理,近似推理算法可以在较低时间复杂度下获得原问题的近似解。The search-based method engine and the Mante Carlo algorithm engine are used to realize approximate inference. When the scale of the network is large, approximate inference is often used. The approximate inference algorithm can obtain the approximate solution of the original problem with low time complexity.

具体的,多树传播推理引擎、团树传播推理引擎、基于组合优化的方法引擎、基于搜索的方法引擎和Mante Carlo算法引擎的具体实现可以参照相关技术,在此不再详述。Specifically, the specific implementation of the multi-tree propagation inference engine, the clique tree propagation inference engine, the method engine based on combinatorial optimization, the method engine based on search, and the Mante Carlo algorithm engine can refer to related technologies, and will not be described in detail here.

需要说明的是,本发明实施例中介绍的多种可选的实施方式,彼此可以相互结合实现,也可以单独实现,对此本发明实施例不作限定。It should be noted that the various optional implementation manners introduced in the embodiments of the present invention may be implemented in combination with each other, or may be implemented independently, which are not limited by the embodiments of the present invention.

参见图5,图5是本发明实施例提供的终端的结构图,如图5所示,终端500包括:Referring to FIG. 5, FIG. 5 is a structural diagram of a terminal provided by an embodiment of the present invention. As shown in FIG. 5, the terminal 500 includes:

接收模块501,用于接收用户输入查询信息;A receiving module 501, configured to receive query information input by a user;

推理模块502,用于基于预设推理策略在异构网络中对所述查询信息进行推理,获得目标推理结果;an inference module 502, configured to infer the query information in a heterogeneous network based on a preset inference strategy to obtain a target inference result;

其中,所述预设推理策略包括事件推理策略、规则推理策略和条件推理策略中的至少一项,所述异构网络包括基础网络层和高级关系网络层,所述基础网络层是以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立的网络层;所述高级关系网络层是通过挖掘产生的关系建立具有概率权重的网络层。Wherein, the preset reasoning strategy includes at least one of event reasoning strategy, rule reasoning strategy and conditional reasoning strategy, and the heterogeneous network includes a basic network layer and a high-level relational network layer, and the basic network layer is based on human, Things, places, and things are network nodes, and the network layer is established with people-to-people, people-to-things, people-to-land, and people-to-things. Network layer.

可选的,所述预设推理策略包括所述事件推理策略时,所述推理模块502包括:Optionally, when the preset reasoning strategy includes the event reasoning strategy, the reasoning module 502 includes:

解析单元,用于对所述查询信息进行语义解析,获得主谓宾SPO三元组构成的查询语句;a parsing unit, configured to perform semantic parsing on the query information to obtain a query statement composed of subject-verb-object SPO triples;

匹配单元,用于根据所述查询语句在所述基础网络层中匹配,获得匹配结果;a matching unit, configured to match in the basic network layer according to the query statement to obtain a matching result;

其中,所述目标推理结果包括所述匹配结果。Wherein, the target inference result includes the matching result.

可选的,所述预设推理策略包括所述规则推理策略时,所述推理模块502包括:Optionally, when the preset reasoning strategy includes the rule reasoning strategy, the reasoning module 502 includes:

识别单元,用于对所述查询信息进行识别获得第一事实,所述第一事实包括所述网络节点对应的实体、所述实体的关系信息和所述实体的属性信息;an identification unit, configured to identify the query information to obtain a first fact, where the first fact includes an entity corresponding to the network node, relationship information of the entity, and attribute information of the entity;

控制单元,用于按照属性约束条件筛选所述第一事实,获得所述第一事实中满足所述属性约束条件的第二事实;a control unit, configured to filter the first fact according to attribute constraints, and obtain a second fact in the first fact that satisfies the attribute constraints;

推理单元,用于基于所述基础网络层,将所述第一事实在规则网络中进行传递,获得规则推理结果;an inference unit, configured to transmit the first fact in the rule network based on the basic network layer to obtain a rule inference result;

其中,所述目标推理结果包括所述规则推理结果,所述规则网络根据预设规则库中与所述查询信息匹配的目标规则建立。Wherein, the target inference result includes the rule inference result, and the rule network is established according to target rules matching the query information in a preset rule base.

可选的,所述控制单元还用于,在将所述第一事实在规则网络中进行传递的过程中,按照所述属性约束条件对所述第一事实在规则网络中进行传递的过程中产生的中间事实进行属性约束。Optionally, the control unit is further configured to, in the process of transmitting the first fact in the rule network, in the process of transmitting the first fact in the rule network according to the attribute constraint condition. The resulting intermediate facts are subject to attribute constraints.

可选的,所述预设推理策略包括所述条件推理策略时,所述推理模块502用于:利用贝叶斯推理的条件推理引擎,从所述基础网络层和高级关系网络层中推理获得所述查询信息对应的条件推理结果;Optionally, when the preset reasoning strategy includes the conditional reasoning strategy, the reasoning module 502 is configured to: use a conditional reasoning engine of Bayesian reasoning to infer from the basic network layer and the advanced relational network layer. the conditional reasoning result corresponding to the query information;

其中,所述目标推理结果包括所述规则推理结果,所述条件推理引擎包括多树传播推理引擎、团树传播推理引擎、基于组合优化的方法引擎、基于搜索的方法引擎和蒙特卡罗Mante Carlo算法引擎中的至少一项。Wherein, the target inference result includes the rule inference result, and the conditional inference engine includes a multi-tree propagation inference engine, a clique tree propagation inference engine, a combinatorial optimization-based method engine, a search-based method engine, and a Monte Carlo Mante Carlo method engine. At least one of the algorithm engines.

本发明实施例提供的终端能够实现图1至图4的方法实施例中终端实现的各个过程,为避免重复,这里不再赘述。The terminal provided in the embodiment of the present invention can implement each process implemented by the terminal in the method embodiments of FIG. 1 to FIG. 4 , and to avoid repetition, details are not described here.

图6为实现本发明各个实施例的一种终端的硬件结构示意图。FIG. 6 is a schematic diagram of a hardware structure of a terminal implementing various embodiments of the present invention.

该终端600包括但不限于:射频单元601、网络模块602、音频输出单元603、输入单元604、传感器605、显示单元606、用户输入单元607、接口单元608、存储器609、处理器610、以及电源611等部件。本领域技术人员可以理解,图6中示出的终端结构并不构成对终端的限定,终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,终端包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。The terminal 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611 and other components. Those skilled in the art can understand that the terminal structure shown in FIG. 6 does not constitute a limitation on the terminal, and the terminal may include more or less components than the one shown, or combine some components, or arrange different components. In the embodiment of the present invention, the terminal includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.

其中,处理器610,用于接收用户输入查询信息;The processor 610 is configured to receive query information input by a user;

基于预设推理策略在异构网络中对所述查询信息进行推理,获得目标推理结果;Inferring the query information in a heterogeneous network based on a preset inference strategy to obtain a target inference result;

其中,所述预设推理策略包括事件推理策略、规则推理策略和条件推理策略中的至少一项,所述异构网络包括基础网络层和高级关系网络层,所述基础网络层是以人、事、地和物为网络节点,以人与人、人与事、人与地以及人与物为网络关系建立的网络层;所述高级关系网络层是通过挖掘产生的关系建立具有概率权重的网络层。Wherein, the preset reasoning strategy includes at least one of event reasoning strategy, rule reasoning strategy and conditional reasoning strategy, and the heterogeneous network includes a basic network layer and a high-level relational network layer, and the basic network layer is based on human, Things, places, and things are network nodes, and the network layer is established with people-to-people, people-to-things, people-to-land, and people-to-things. Network layer.

可选的,所述预设推理策略包括所述事件推理策略时,处理器610,用于:对所述查询信息进行语义解析,获得主谓宾SPO三元组构成的查询语句;根据所述查询语句在所述基础网络层中匹配,获得匹配结果;其中,所述目标推理结果包括所述匹配结果。Optionally, when the preset reasoning strategy includes the event reasoning strategy, the processor 610 is configured to: perform semantic analysis on the query information to obtain a query statement composed of subject-verb-object SPO triples; according to the The query sentence is matched in the basic network layer, and a matching result is obtained; wherein, the target inference result includes the matching result.

可选的,所述预设推理策略包括所述规则推理策略时,处理器610,用于:Optionally, when the preset inference strategy includes the rule inference strategy, the processor 610 is configured to:

对所述查询信息进行识别获得第一事实,所述第一事实包括所述网络节点对应的实体、所述实体的关系信息和所述实体的属性信息;Identifying the query information to obtain a first fact, where the first fact includes an entity corresponding to the network node, relationship information of the entity, and attribute information of the entity;

按照属性约束条件筛选所述第一事实,获得所述第一事实中满足所述属性约束条件的第二事实;Filter the first fact according to the attribute constraint, and obtain a second fact in the first fact that satisfies the attribute constraint;

基于所述基础网络层,将所述第一事实在规则网络中进行传递,获得规则推理结果;Based on the basic network layer, the first fact is transmitted in the rule network to obtain a rule inference result;

其中,所述目标推理结果包括所述规则推理结果,所述规则网络根据预设规则库中与所述查询信息匹配的目标规则建立。Wherein, the target inference result includes the rule inference result, and the rule network is established according to target rules matching the query information in a preset rule base.

可选的,处理器610还用于:在将所述第一事实在规则网络中进行传递的过程中,按照所述属性约束条件对所述第一事实在规则网络中进行传递的过程中产生的中间事实进行属性约束。Optionally, the processor 610 is further configured to: in the process of transmitting the first fact in the rule network, generate the first fact in the process of transmitting the first fact in the rule network according to the attribute constraint condition attribute constraints on the intermediate facts.

可选的,所述预设推理策略包括所述条件推理策略时,处理器610,用于:利用贝叶斯推理的条件推理引擎,从所述基础网络层和高级关系网络层中推理获得所述查询信息对应的条件推理结果;其中,所述目标推理结果包括所述规则推理结果,所述条件推理引擎包括多树传播推理引擎、团树传播推理引擎、基于组合优化的方法引擎、基于搜索的方法引擎和蒙特卡罗Mante Carlo算法引擎中的至少一项。Optionally, when the preset reasoning strategy includes the conditional reasoning strategy, the processor 610 is configured to: use a conditional reasoning engine of Bayesian reasoning to infer the obtained information from the basic network layer and the advanced relational network layer. The conditional inference result corresponding to the query information; wherein, the target inference result includes the rule inference result, and the conditional inference engine includes a multi-tree propagation inference engine, a cluster tree propagation inference engine, a method engine based on combinatorial optimization, and a search-based inference engine. At least one of the method engine and the Monte Carlo Mante Carlo algorithm engine.

本发明实施例中,由于将不同的类型的数据统一抽象成网络节点和关系形成异构网络,并根据用户输入的查询信息,利用事件推理策略、规则推理策略和条件推理策略中的至少一项在异构网络中查询获得对应的推理结果,从而实现异构网络的关系推理。无需针对不同类型的数据建立多个网络拓扑,降低了推理的难度。In the embodiment of the present invention, since different types of data are uniformly abstracted into network nodes and relationships to form a heterogeneous network, and according to the query information input by the user, at least one of an event reasoning strategy, a rule reasoning strategy, and a conditional reasoning strategy is used. The corresponding reasoning results are obtained by querying in the heterogeneous network, so as to realize the relational reasoning of the heterogeneous network. There is no need to build multiple network topologies for different types of data, which reduces the difficulty of reasoning.

应理解的是,本发明实施例中,射频单元601可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器610处理;另外,将上行的数据发送给基站。通常,射频单元601包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元601还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in this embodiment of the present invention, the radio frequency unit 601 may be used for receiving and sending signals during sending and receiving of information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 610; The uplink data is sent to the base station. Generally, the radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 601 can also communicate with the network and other devices through a wireless communication system.

终端通过网络模块602为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The terminal provides the user with wireless broadband Internet access through the network module 602, such as helping the user to send and receive emails, browse web pages, and access streaming media.

音频输出单元603可以将射频单元601或网络模块602接收的或者在存储器609中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元603还可以提供与终端600执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元603包括扬声器、蜂鸣器以及受话器等。The audio output unit 603 may convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into audio signals and output as sound. Also, the audio output unit 603 may also provide audio output related to a specific function performed by the terminal 600 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, and the like.

输入单元604用于接收音频或视频信号。输入单元604可以包括图形处理器(Graphics Processing Unit,GPU)6041和麦克风6042,图形处理器6041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元606上。经图形处理器6041处理后的图像帧可以存储在存储器609(或其它存储介质)中或者经由射频单元601或网络模块602进行发送。麦克风6042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元601发送到移动通信基站的格式输出。The input unit 604 is used to receive audio or video signals. The input unit 604 may include a graphics processor (Graphics Processing Unit, GPU) 6041 and a microphone 6042, and the graphics processor 6041 captures images of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 606 . The image frames processed by the graphics processor 6041 may be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602 . The microphone 6042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 601 for output in the case of a telephone call mode.

终端600还包括至少一种传感器605,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板6061的亮度,接近传感器可在终端600移动到耳边时,关闭显示面板6061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器605还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。Terminal 600 also includes at least one sensor 605, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and/or when the terminal 600 is moved to the ear. or backlight. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal posture (such as horizontal and vertical screen switching, related games, The sensor 605 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared Sensors, etc., will not be repeated here.

显示单元606用于显示由用户输入的信息或提供给用户的信息。显示单元606可包括显示面板6061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板6061。The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

用户输入单元607可用于接收输入的数字或字符信息,以及产生与终端的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元607包括触控面板6071以及其他输入设备6072。触控面板6071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板6071上或在触控面板6071附近的操作)。触控面板6071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器610,接收处理器610发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板6071。除了触控面板6071,用户输入单元607还可以包括其他输入设备6072。具体地,其他输入设备6072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 607 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the terminal. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072 . The touch panel 6071, also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable object or accessory on or near the touch panel 6071). operate). The touch panel 6071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 610, the command sent by the processor 610 is received and executed. In addition, the touch panel 6071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 6071 , the user input unit 607 may also include other input devices 6072 . Specifically, other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which are not described herein again.

进一步的,触控面板6071可覆盖在显示面板6061上,当触控面板6071检测到在其上或附近的触摸操作后,传送给处理器610以确定触摸事件的类型,随后处理器610根据触摸事件的类型在显示面板6061上提供相应的视觉输出。虽然在图6中,触控面板6071与显示面板6061是作为两个独立的部件来实现终端的输入和输出功能,但是在某些实施例中,可以将触控面板6071与显示面板6061集成而实现终端的输入和输出功能,具体此处不做限定。Further, the touch panel 6071 can be covered on the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it transmits it to the processor 610 to determine the type of the touch event, and then the processor 610 determines the type of the touch event according to the touch The type of event provides a corresponding visual output on the display panel 6061. Although in FIG. 6, the touch panel 6071 and the display panel 6061 are used as two independent components to realize the input and output functions of the terminal, in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to form a Realize the input and output functions of the terminal, which is not limited here.

接口单元608为外部装置与终端600连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元608可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到终端600内的一个或多个元件或者可以用于在终端600和外部装置之间传输数据。The interface unit 608 is an interface for connecting an external device to the terminal 600 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 608 may be used to receive input (eg, data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal 600 or may be used to communicate between the terminal 600 and the external device. transfer data between.

存储器609可用于存储软件程序以及各种数据。存储器609可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器609可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 609 may be used to store software programs as well as various data. The memory 609 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc. Additionally, memory 609 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

处理器610是终端的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器609内的软件程序和/或模块,以及调用存储在存储器609内的数据,执行终端的各种功能和处理数据,从而对终端进行整体监控。处理器610可包括一个或多个处理单元;优选的,处理器610可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器610中。The processor 610 is the control center of the terminal, uses various interfaces and lines to connect various parts of the entire terminal, and executes by running or executing the software programs and/or modules stored in the memory 609, and calling the data stored in the memory 609. Various functions of the terminal and processing data, so as to monitor the terminal as a whole. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 610.

终端600还可以包括给各个部件供电的电源611(比如电池),优选的,电源611可以通过电源管理系统与处理器610逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The terminal 600 may also include a power supply 611 (such as a battery) for supplying power to various components. Preferably, the power supply 611 may be logically connected to the processor 610 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system. Function.

另外,终端600包括一些未示出的功能模块,在此不再赘述。In addition, the terminal 600 includes some unshown functional modules, which will not be repeated here.

优选的,本发明实施例还提供一种终端,包括处理器610,存储器609,存储在存储器609上并可在所述处理器610上运行的计算机程序,该计算机程序被处理器610执行时实现上述异构网络的关系推理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, an embodiment of the present invention further provides a terminal, including a processor 610, a memory 609, a computer program stored in the memory 609 and running on the processor 610, and the computer program is implemented when the processor 610 executes it. The various processes of the above embodiments of the method for relational reasoning in heterogeneous networks can achieve the same technical effect, and are not repeated here to avoid repetition.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述异构网络的关系推理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random AccessMemory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, each process of the above embodiment of the method for relational reasoning in heterogeneous networks is implemented, and can To achieve the same technical effect, in order to avoid repetition, details are not repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk or an optical disk, and the like.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solutions in the embodiments of the present invention.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention. should be included within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (12)

1. A relationship inference method for a heterogeneous network, comprising:
receiving query information input by a user;
reasoning the query information in the heterogeneous network based on a preset reasoning strategy to obtain a target reasoning result;
the heterogeneous network comprises a basic network layer and a high-level relation network layer, wherein the basic network layer takes people, affairs, places and objects as network nodes, and network layers are established by taking human-to-human, human-to-affairs, human-to-ground and human-to-object as network relations; the high-level relation network layer is a network layer with probability weight established by mining generated relations.
2. The method according to claim 1, wherein when the preset inference policy includes the event inference policy, the inferring the query information in the heterogeneous network based on the preset inference policy, and obtaining a target inference result includes:
performing semantic analysis on the query information to obtain a query statement consisting of a Supper-predicate object (SPO) triple;
matching in the basic network layer according to the query statement to obtain a matching result;
wherein the target inference result comprises the matching result.
3. The method according to claim 1, wherein when the preset inference policy includes the rule inference policy, the inferring the query information in the heterogeneous network based on the preset inference policy, and obtaining a target inference result includes:
identifying the query information to obtain a first fact, wherein the first fact comprises an entity corresponding to the network node, relationship information of the entity and attribute information of the entity;
screening the first facts according to attribute constraint conditions to obtain second facts meeting the attribute constraint conditions in the first facts;
transmitting the first fact in a rule network based on the basic network layer to obtain a rule reasoning result;
and the target inference result comprises the rule inference result, and the rule network is established according to a target rule matched with the query information in a preset rule base.
4. The method of claim 3, wherein in communicating the first fact in a regular network, the method further comprises:
and performing attribute constraint on intermediate facts generated in the process of transmitting the first fact in the regular network according to the attribute constraint conditions.
5. The method according to claim 1, wherein when the preset inference policy includes the conditional inference policy, the inferring the query information in the heterogeneous network based on the preset inference policy, and obtaining a target inference result includes:
a conditional inference engine of Bayesian inference is utilized to infer from the basic network layer and the advanced relationship network layer to obtain a conditional inference result corresponding to the query information;
wherein the target inference result comprises the rule inference result, and the conditional inference engine comprises at least one of a multi-tree propagation inference engine, a clique-tree propagation inference engine, a combinatorial optimization-based method engine, a search-based method engine, and a Monte Carlo algorithm engine.
6. A terminal, comprising:
the receiving module is used for receiving query information input by a user;
the reasoning module is used for reasoning the query information in the heterogeneous network based on a preset reasoning strategy to obtain a target reasoning result;
the heterogeneous network comprises a basic network layer and a high-level relation network layer, wherein the basic network layer takes people, affairs, places and objects as network nodes, and network layers are established by taking human-to-human, human-to-affairs, human-to-ground and human-to-object as network relations; the high-level relation network layer is a network layer with probability weight established by mining generated relations.
7. The terminal according to claim 6, wherein when the preset inference policy comprises the event inference policy, the inference module comprises:
the analysis unit is used for carrying out semantic analysis on the query information to obtain a query statement consisting of a principal and predicate object oriented Service (SPO) triple;
the matching unit is used for matching in the basic network layer according to the query statement to obtain a matching result;
wherein the target inference result comprises the matching result.
8. The terminal according to claim 6, wherein when the preset inference policy comprises the rule inference policy, the inference module comprises:
the identification unit is used for identifying the query information to obtain a first fact, wherein the first fact comprises an entity corresponding to the network node, the relationship information of the entity and the attribute information of the entity;
the control unit is used for screening the first facts according to attribute constraint conditions to obtain second facts meeting the attribute constraint conditions in the first facts;
the inference unit is used for transmitting the first fact in a rule network based on the basic network layer to obtain a rule inference result;
and the target inference result comprises the rule inference result, and the rule network is established according to a target rule matched with the query information in a preset rule base.
9. The terminal according to claim 8, wherein the control unit is further configured to, during the transferring of the first fact in the regular network, perform attribute constraint on an intermediate fact generated during the transferring of the first fact in the regular network according to the attribute constraint condition.
10. The terminal of claim 6, wherein when the preset inference policy comprises the conditional inference policy, the inference module is configured to: a conditional inference engine of Bayesian inference is utilized to infer from the basic network layer and the advanced relationship network layer to obtain a conditional inference result corresponding to the query information;
wherein the target inference result comprises the rule inference result, and the conditional inference engine comprises at least one of a multi-tree propagation inference engine, a clique-tree propagation inference engine, a combinatorial optimization-based method engine, a search-based method engine, and a Monte Carlo algorithm engine.
11. A terminal, characterized in that it comprises a processor, a memory and a computer program stored on said memory and executable on said processor, said computer program, when executed by said processor, implementing the steps of the method of relational inference of heterogeneous networks according to any of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for relational inference of heterogeneous networks according to any one of claims 1 to 5.
CN201910472285.1A 2019-05-31 2019-05-31 A relational reasoning method and terminal for heterogeneous networks Active CN112015973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910472285.1A CN112015973B (en) 2019-05-31 2019-05-31 A relational reasoning method and terminal for heterogeneous networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910472285.1A CN112015973B (en) 2019-05-31 2019-05-31 A relational reasoning method and terminal for heterogeneous networks

Publications (2)

Publication Number Publication Date
CN112015973A true CN112015973A (en) 2020-12-01
CN112015973B CN112015973B (en) 2023-08-01

Family

ID=73506268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910472285.1A Active CN112015973B (en) 2019-05-31 2019-05-31 A relational reasoning method and terminal for heterogeneous networks

Country Status (1)

Country Link
CN (1) CN112015973B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590782A (en) * 2021-07-28 2021-11-02 北京百度网讯科技有限公司 Training method, reasoning method and device of reasoning model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090070323A1 (en) * 2007-09-12 2009-03-12 Nishith Parikh Inference of query relationships
US20100241644A1 (en) * 2009-03-19 2010-09-23 Microsoft Corporation Graph queries of information in relational database
CN101930437A (en) * 2009-06-19 2010-12-29 日电(中国)有限公司 Method and equipment for reasoning inconsistent and uncertain ontology associated with specific query
CN103942614A (en) * 2014-04-09 2014-07-23 清华大学 Method and system for predicting heterogeneous network linking relation
CN107092516A (en) * 2017-03-29 2017-08-25 东南大学 A kind of inference method for combining body and default program
CN109710737A (en) * 2018-12-21 2019-05-03 神思电子技术股份有限公司 A kind of intelligent inference method based on structuralized query

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090070323A1 (en) * 2007-09-12 2009-03-12 Nishith Parikh Inference of query relationships
US20100241644A1 (en) * 2009-03-19 2010-09-23 Microsoft Corporation Graph queries of information in relational database
CN101930437A (en) * 2009-06-19 2010-12-29 日电(中国)有限公司 Method and equipment for reasoning inconsistent and uncertain ontology associated with specific query
CN103942614A (en) * 2014-04-09 2014-07-23 清华大学 Method and system for predicting heterogeneous network linking relation
CN107092516A (en) * 2017-03-29 2017-08-25 东南大学 A kind of inference method for combining body and default program
CN109710737A (en) * 2018-12-21 2019-05-03 神思电子技术股份有限公司 A kind of intelligent inference method based on structuralized query

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JOANNA GOLINSKA-PILAREK 等: "Relational Reasoning in Formal Concept Analysis", 2007 IEEE INTERNATIONAL FUZZY SYSTEMS CONFERENCE *
马雷雷;李宏伟;梁汝鹏;李丽;: "本体辅助的定性空间关系推理机制", 计算机应用研究, no. 01 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590782A (en) * 2021-07-28 2021-11-02 北京百度网讯科技有限公司 Training method, reasoning method and device of reasoning model
CN113590782B (en) * 2021-07-28 2024-02-09 北京百度网讯科技有限公司 Training method of reasoning model, reasoning method and device

Also Published As

Publication number Publication date
CN112015973B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN111274777B (en) Thinking guide display method and electronic equipment
CN111611369B (en) Interaction method and related device based on artificial intelligence
CN115730047A (en) Intelligent question-answering method, equipment, device and storage medium
CN110008234B (en) A business data search method, device and electronic device
CN111753520B (en) Risk prediction method and device, electronic equipment and storage medium
CN111125307A (en) Chat record query method and electronic equipment
CN110309422A (en) Method for pushing, server and terminal
CN110825475A (en) An input method and electronic device
CN111614544A (en) Message processing method and electronic device
CN114238766A (en) Material recommendation method, material recommendation device and electronic equipment
CN107133296B (en) Application program recommendation method and device and computer readable storage medium
CN115589432B (en) Message push management method, device, medium and equipment
CN112015973B (en) A relational reasoning method and terminal for heterogeneous networks
CN115984643A (en) Model training method, related equipment and storage medium
CN107329948B (en) Method, device and storage medium for estimating occurrence time of event described in sentence
CN115454392A (en) Code template extraction method and related equipment
CN111859240A (en) A kind of picture exporting method, related device and storage medium
CN112084420B (en) Friend recommendation method and device, electronic equipment and storage medium
CN115048463B (en) Data migration method, system and storage medium
CN107885887B (en) file storage method and mobile terminal
CN118195008A (en) Data abuse behavior reasoning method, device, equipment and storage medium
CN111050223A (en) Bullet screen information processing method and electronic equipment
CN117115590A (en) Content auditing model training method, device and medium based on self-supervision learning
CN108881481A (en) A file retrieval method, device and terminal equipment thereof
CN115905416B (en) A data processing method and related apparatus

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