Knowledge base construction method and apparatus, and computer readable storage medium
By adopting hierarchical architecture and two-way dynamic update of subclass and parent class attributes in the knowledge base, the problem of low efficiency in knowledge base construction in the existing technology is solved, and an efficient and low-cost knowledge base construction is achieved.
Patent Information
- Application Number
- PCT/CN2024/098203
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-08
- Filing Date
- 2024-06-07
- Publication Date
- 2025-08-14
AI Technical Summary
In the prior art, the attribute information of elements in the knowledge base relies on manual entry, which lacks systematization capabilities, resulting in low construction efficiency and high cost.
Use a hierarchical architecture to obtain the relationship of the class, perform two-way dynamic updates of subclasses and parent class attributes, determine the class to which the target element belongs at each level, and determine the attributes and attribute values of the element based on the attributes.
Through automated attribute processing, the efficiency of knowledge base construction is improved, the hierarchical architecture of classes is simplified, and the construction cost is reduced.
Smart Images

Figure CN2024098203_14082025_PF_FP_ABST
Abstract
Description
Knowledge base construction method and device, and computer-readable storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application is based on and claims priority to an application filed in China with application number 202410178155.8 and filing date February 8, 2024. The disclosure of the application in China is hereby incorporated as a whole into this application. Technical Field
[0003] The present disclosure relates to the field of computer technology, and in particular to a method and device for constructing a knowledge base, and a computer-readable storage medium. Background Art
[0004] A knowledge base is a structured database that systematically organizes, manages, and stores knowledge, such as facts, information, rules, data, and expert knowledge related to a specific or cross-domain domain. A knowledge base is a core component of intelligent systems such as expert systems, chatbots, and decision support systems, providing the knowledge foundation these systems need for reasoning and problem solving.
[0005] In the smart home space, by building knowledge bases for the robots in the space and the spatial environment respectively, comprehensive information processing can be achieved, and the intelligence level of service robots and the intelligence level of space can be improved.
[0006] Summary of the Invention
[0007] According to a first aspect of the present disclosure, a method for constructing a knowledge base is provided, comprising: obtaining a hierarchical architecture of classes, wherein each level in the architecture includes one or more classes, and classes at different levels constitute a parent-child relationship; performing a two-way dynamic update between the attributes of the child class and the attributes of the parent class; determining the class to which a target element belongs at each level; and determining the attributes and attribute values of each target element based on the attributes of the class to which the target element belongs at each level.
[0008] In some embodiments, the bidirectional dynamic update between the attributes of the subclass and the attributes of the parent class includes: when the number of subclasses with the same attributes exceeds a first threshold, upgrading the same attributes to the attributes of the parent class; saving the correspondence between the subclasses with the same attributes and the attributes of the parent class; and for the subclasses with the same attributes, deleting the same attributes from their attributes.
[0009] In some embodiments, the bidirectional dynamic update between the attributes of the subclass and the attributes of the parent class includes: when the number of subclasses corresponding to the attributes of the parent class does not exceed a second threshold, based on the correspondence between the subclass with the same attributes and the attributes of the parent class, downgrading the attributes of the parent class to the attributes of the corresponding subclass; and deleting the attributes of the parent class.
[0010] In some embodiments, the knowledge base construction method further includes: determining an attribute feature domain to which the attributes of the class belong, wherein each attribute feature domain includes one or more attributes, and the attribute feature domain is used to process the attributes.
[0011] In some embodiments, determining the class to which the target element belongs at each level includes: for multiple target elements in the target space, determining the class to which each target element belongs at each level; for each class in the hierarchical structure, determining whether there is a target element corresponding to the class; and for the hierarchical structure corresponding to the target space, recycling the classes that do not have corresponding target elements.
[0012] In some embodiments, the target element includes at least one of an environmental element and an interactive element of the robot; the attribute includes at least one of an interactive attribute between the target element and the robot, and an interactive attribute between the target element and other elements in the target space.
[0013] In some embodiments, the method for constructing a knowledge base further includes: for the attributes of a class in a hierarchical structure, obtaining information about the attribute, the information about the attribute including at least one of the following: the identifier of the class corresponding to the attribute, the identifier of the attribute, the name of the attribute, the name of the target element corresponding to the attribute, the attribute value of the target element corresponding to the attribute, the lower-level subclass corresponding to the attribute, and the attribute feature domain to which the attribute belongs.
[0014] According to a second aspect of the present disclosure, a knowledge base construction device is provided, comprising: a class processing module configured to obtain a hierarchical architecture of classes, wherein each level in the architecture includes one or more classes, and classes at different levels constitute a parent-child relationship; a class attribute processing module configured to perform a two-way dynamic update between the attributes of the child class and the attributes of the parent class; a target element processing module configured to determine the class to which the target element belongs at each level; and a target element attribute processing module configured to determine the attributes and attribute values of each target element based on the attributes of the class to which the target element belongs at each level.
[0015] According to a third aspect of the present disclosure, a device for constructing a knowledge base is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute a method for constructing a knowledge base according to any of the embodiments of the present disclosure based on instructions stored in the memory.
[0016] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the instructions are executed by a processor, the method for constructing a knowledge base according to any of the embodiments of the present disclosure is implemented.
[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, implement the method for constructing a knowledge base according to any of the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] The present disclosure can be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0020] FIG1 shows a flow chart of a method for constructing a knowledge base according to some embodiments of the present disclosure;
[0021] FIG2 is a schematic diagram showing an information framework of an attribute according to some embodiments of the present disclosure;
[0022] FIG3 shows a block diagram of a device for constructing a knowledge base according to some embodiments of the present disclosure;
[0023] FIG4 shows a schematic diagram of constructing a knowledge base according to some embodiments of the present disclosure;
[0024] FIG5 shows a block diagram of a device for constructing a knowledge base according to other embodiments of the present disclosure;
[0025] FIG6 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0026] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure.
[0027] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0028] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0029] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0030] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0031] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0032] The types of elements in a knowledge base are diverse and their states are complex and changeable, so the element attributes involved are also very complex. In related technologies, the attribute information of elements in the knowledge base relies on manual entry, which lacks systematization capabilities, is costly, and inefficient.
[0033] FIG1 shows a flowchart of a method for constructing a knowledge base according to some embodiments of the present disclosure.
[0034] As shown in Figure 1, the knowledge base construction method includes steps S1 to S4. In some embodiments, the knowledge base construction method is executed by a knowledge base construction device.
[0035] In step S1 , a hierarchical structure of classes is obtained, wherein each level in the structure includes one or more classes, and classes at different levels form a parent-child relationship.
[0036] For example, furniture can be categorized according to basic function into support, reliance, and storage. These three categories are subcategories of furniture, and are also subcategories of furniture. Furniture is the parent category of these three categories. The support category can be further divided into stools, chairs, sofas, beds, and other categories. Element classification is based on pre-set standards or empirical knowledge.
[0037] In step S2, a two-way dynamic update is performed between the attributes of the subclass and the attributes of the parent class. For example, the attributes of the parent class are updated according to the attributes of the subclass; and the attributes of the subclass are updated according to the attributes of the parent class, thereby dynamically classifying the attributes and improving efficiency.
[0038] In some embodiments, the bidirectional dynamic update between the attributes of the subclass and the attributes of the parent class includes: when the number of subclasses with the same attributes exceeds a first threshold, upgrading the same attributes to the attributes of the parent class; saving the correspondence between the attributes of the subclass and the parent class with the same attributes; and for the subclasses with the same attributes, deleting the same attributes from their attributes.
[0039] For example, the target space initially contains only one class, "Potted Basin." When a plastic basin appears in the target space for the first time, a subclass called "Plastic Basin" is created. Similarly, subclasses like "Wooden Basin" and "Ceramic Basin" are created. These subclasses all have a "diameter" attribute. If the number of subclasses with this attribute exceeds a threshold or a preset percentage, the "diameter" attribute of these subclasses is uniformly transferred to the parent class. At this point, the "diameter" attribute is no longer stored for the subclasses, but is instead stored for the parent class.
[0040] The source of the "diameter" attribute is also saved, that is, which subclasses the "diameter" attribute corresponds to. For example, after the A attribute of "Subclass 1" and "Subclass 2" is adjusted to the attribute of the basin class, the A attribute of the basin class now comes from "Subclass 1" and "Subclass 2" and is not used in other subclasses, so it is marked in the attribute information table.
[0041] Through the two-way dynamic update between the attributes of the subclass and the parent class, when there are many subclasses with the same attributes, only the attributes of the parent class need to be stored, rather than the attributes of each subclass, thereby simplifying the class hierarchy and the overall structure of the class attributes and improving the efficiency of knowledge base construction.
[0042] In some embodiments, the bidirectional dynamic update between the attributes of the subclass and the attributes of the parent class includes: when the number of subclasses corresponding to the attributes of the parent class does not exceed a second threshold, based on the correspondence between the attributes of the subclass and the parent class with the same attributes, downgrading the attributes of the parent class to the attributes of the corresponding subclass; and deleting the attributes of the parent class.
[0043] For example, if the subclasses of "plastic basin", "wooden basin", and "ceramic basin" previously corresponded to the "diameter" attribute of the parent class "basin", but as the class hierarchy is updated, the number of subclasses of "basin" decreases, and the number of subclasses corresponding to "diameter" decreases, and does not exceed the second threshold, then the "diameter" attribute of the parent class will be downgraded to the attribute of the corresponding subclass, and this attribute will be deleted from the parent class's attributes.
[0044] In step S3, the class to which the target element belongs at each level is determined. For example, if the target element is a specific object, the class to which the target element belongs is determined for each level in the hierarchical structure. For example, if the target element is a stool, the classes to which it belongs at each level are: furniture, support, and stool.
[0045] In some embodiments, determining the class to which the target element belongs at each level includes: for multiple target elements in the target space, determining the class to which each target element belongs at each level; for each class in the hierarchical structure, determining whether there is a target element corresponding to the class; and for the hierarchical structure corresponding to the target space, recycling the classes that do not have corresponding target elements.
[0046] For example, let's say the target space is a bedroom. First, we retrieve the hierarchical framework of classes for common bedroom objects. However, if there's no bed in the current bedroom, the bed class and its associated attributes have no corresponding objects in the bedroom. Therefore, the bed class and its associated attributes should be recycled, thereby specifically simplifying the class and attribute structure of the target space. These recycled classes and attributes still exist in the general knowledge base model, but are no longer applicable to the current target space's hierarchical architecture. If new related elements are subsequently added to the target space, the recycled classes and attributes will be restored for use.
[0047] In step S4, the attributes and attribute values of each target element are determined based on the attributes of the class to which the target element belongs at each level. For example, if the class to which the target element belongs and the attributes possessed by these classes are known, it is possible to determine which attributes the target element should have, and then determine the corresponding attribute values based on the specific information of the target element. All attributes of the lowest-level subclass to which the element belongs and all parent classes at all levels are considered attributes of the element.
[0048] In some embodiments, the method for constructing a knowledge base further includes: determining an attribute feature domain to which the attributes of the class belong, wherein each attribute feature domain includes one or more attributes, and the attribute feature domain is used to process the attributes.
[0049] For example, a cup has more than a dozen attributes. To determine whether a robot can operate the cup, it doesn't need to process all of the cup's attributes. For example, the cup's color attribute is unnecessary. Therefore, an attribute feature domain is established for robot operation. This feature domain only contains the attributes relevant to robot operation, thereby improving the efficiency of feature extraction for robot operation. By constructing an attribute feature domain, attributes can be classified, extracted, analyzed, and mined from multiple dimensions, improving the efficiency of attribute information processing.
[0050] In some embodiments, the target element includes an interactive element of the robot; and the attribute includes at least one of an interactive attribute between the target element and the robot, and an interactive attribute between the target element and other elements in the target space.
[0051] For example, attributes include data attributes and interaction attributes. Data attributes describe the element itself, while interaction attributes describe how it interacts with other elements. Accordingly, attribute values include data attribute values and interaction attribute values. These attribute values are mapped to the knowledge base.
[0052] Data attributes are information used to describe the environmental elements themselves (such as shape, size, color, material, etc.). For a specific element or space, the value of the data attribute can be obtained based on the multimodal information of the element or space (such as pictures, videos, various sensor devices, etc.).
[0053] Interaction attributes include interactions between environmental elements, between environmental elements and the robot, and between environmental elements and the user. For target elements, based on their determined data attributes, the interaction attribute values for these elements are generated by combining overall environmental information, robot, user, and task information. These values are then mapped to the knowledge base. An example of an interaction attribute is the part of an object that a robot can grasp.
[0054] According to some embodiments of the present disclosure, by assigning and updating attributes to the robot's environmental elements by category, an attribute information foundation is provided for fully exploring the interactive relationships between environmental elements, and between the environment and core elements such as users and robots. This facilitates further characterization and analysis of the element attributes, facilitates the construction of a knowledge base of home environmental elements that is easy for computers to understand, analyze, and process, and improves the efficiency and accuracy of information fusion processing. Through this solution, home service robots can quickly understand and adapt to the home environment, establish interactive relationships with environmental elements, and achieve rapid adaptation to the environment, thereby providing better services to users.
[0055] In some embodiments, the method for constructing a knowledge base further includes: for the attributes of a class in a hierarchical structure, obtaining attribute information, the attribute information including at least one of the following: the identifier of the class corresponding to the attribute, the identifier of the attribute, the name of the attribute, the name of the target element corresponding to the attribute, the attribute value of the target element corresponding to the attribute, the subordinate subclass corresponding to the attribute, and the attribute feature domain to which the attribute belongs.
[0056] In some embodiments, element attributes unique to the element are further added based on the element's information. Unique element attributes are used to describe attributes other than those of the class to which the element belongs. In other words, the element's unique attributes are not derived from its corresponding class, but are instead added, for example, by identifying the target element. Unique elements include, for example, imprinted information, such as a name engraved on a cup.
[0057] In addition, for attributes whose attribute values have been obtained, the attributes will be updated synchronously or asynchronously according to the changes in the actual status of the corresponding elements.
[0058] According to some embodiments of the present disclosure, a method for constructing a knowledge base includes: obtaining a hierarchical architecture of classes, wherein each level in the architecture includes one or more classes, and classes at different levels constitute a parent-child relationship; performing two-way dynamic updates between the attributes of the child class and the attributes of the parent class; determining the class to which the target element belongs at each level; and determining the attributes and attribute values of each target element based on the attributes of the class to which the target element belongs at each level.
[0059] According to the above scheme, by determining the class to which the target element belongs at each level, the target element's attributes and attribute values can be automatically determined, improving the efficiency of knowledge base construction. Furthermore, by dynamically updating the attributes of subclasses and parent classes in both directions, the efficiency of attribute processing can be improved, and a stable class and attribute architecture can be established.
[0060] FIG2 shows a schematic diagram of an attribute information framework according to some embodiments of the present disclosure.
[0061] As shown in Figure 2, the information framework of an attribute includes the following contents.
[0062] Class ID: Indicates the class or element to which the attribute belongs. If the attribute belongs to a class, the class ID is composed of the last subclass ID and the element ID.
[0063] Attribute ID: Each attribute has a global ID.
[0064] Attribute Name: The name of the attribute.
[0065] Attribute type: used to identify the type of attribute. Attributes include at least two types: data attributes and interaction attributes.
[0066] Attribute value: The specific value and unit of the attribute. When the framework is applied to a specific space or element, the actual attribute value is obtained. If the attribute belongs to a specific element, the attribute value represents the information of that element; if the attribute belongs to a certain class, the attribute value must include the attribute information of all elements in the class. If the attribute value cannot be obtained when targeting a specific space or element (i.e., the attribute value is empty), the attribute is invalid for that space or individual.
[0067] Subclass list: A list of subclasses that apply to the attribute. By default, the attribute applies to all subclasses. If not all subclasses apply, for example, if the attribute is derived from some subclasses, the identifiers of these subclasses are indicated in the list.
[0068] Attribute feature domain: the feature domain to which the attribute belongs.
[0069] FIG3 shows a block diagram of a device for constructing a knowledge base according to some embodiments of the present disclosure.
[0070] As shown in FIG3 , the knowledge base construction device 3 includes a class processing module 31 , a class attribute processing module 32 , a target element processing module 33 and a target element attribute processing module 34 .
[0071] The class processing module 31 is configured to obtain a hierarchical structure of classes, wherein each level in the structure includes one or more classes, and classes at different levels form a parent-child relationship, for example, executing step S1 as shown in FIG1 .
[0072] The class attribute processing module 32 is configured to perform a two-way dynamic update between the attributes of the subclass and the attributes of the parent class, for example, executing step S2 as shown in FIG1 .
[0073] The target element processing module 33 is configured to determine the class to which the target element belongs at each level, for example, by executing step S3 as shown in FIG1 .
[0074] The target element attribute processing module 34 is configured to determine the attributes and attribute values of each target element according to the attributes of the class to which the target element belongs at each level, for example, executing step S4 as shown in FIG1 .
[0075] In some embodiments, the class attribute processing module 32 is further configured to: when the number of subclasses with the same attributes exceeds a first threshold, upgrade the same attributes to the attributes of the parent class; save the correspondence between the attributes of the subclasses with the same attributes and the parent class; for the subclasses with the same attributes, delete the same attributes from their attributes.
[0076] In some embodiments, the class attribute processing module 32 is further configured to: when the number of subclasses corresponding to the attributes of the parent class does not exceed a second threshold, downgrade the attributes of the parent class to the attributes of the corresponding subclasses according to the correspondence between the subclasses with the same attributes and the attributes of the parent class; and delete the attributes of the parent class.
[0077] In some embodiments, the knowledge base construction device further includes: a feature domain determination module configured to determine the attribute feature domain to which the attributes of the class belong, wherein each attribute feature domain includes one or more attributes, and the attribute feature domain is used to process the attributes.
[0078] In some embodiments, the target element processing module 33 is further configured to determine, for multiple target elements in the target space, the class to which each target element belongs at each level; for each class in the hierarchical structure, determine whether there is a target element corresponding to the class; and for the hierarchical structure corresponding to the target space, recycle the classes that have no corresponding target elements.
[0079] In some embodiments, the target element includes at least one of an environmental element and an interactive element of the robot; the attribute includes at least one of an interactive attribute between the target element and the robot and an interactive attribute between the target element and other elements in the target space.
[0080] In some embodiments, the knowledge base construction device also includes: an attribute information management module, which is configured to obtain attribute information for the attributes of the class in the hierarchical structure, and the attribute information includes at least one of the following: the identifier of the class corresponding to the attribute, the identifier of the attribute, the name of the attribute, the name of the target element corresponding to the attribute, the attribute value of the target element corresponding to the attribute, the subordinate subclass corresponding to the attribute, and the attribute feature domain to which the attribute belongs.
[0081] FIG4 shows a schematic diagram of constructing a knowledge base according to some embodiments of the present disclosure.
[0082] As shown in Figure 4, the class processing module 41 obtains the class hierarchy framework and updates the classes therein, for example, deleting or adding a new class. In some embodiments, the class processing module completes the classification of environmental elements, assigns a global identifier to each class, and recycles the class.
[0083] The class attribute processing module 42 assigns attributes to subclasses at all levels, dynamically updates class attributes, generates attribute identifiers, and recycles attributes.
[0084] Element processing module 43: maps the actual information of spatial elements to the model and adds elements, thereby reflecting the actual relationship between elements. Elements are added by element processing module 33 based on the lowest level class and assigned identifiers to the elements.
[0085] The target element attribute processing module 44 allocates and dynamically updates the attributes of the element.
[0086] The present disclosure also provides a computer program product, including computer program instructions, which, when executed by a processor, implement the method for constructing a knowledge base according to any embodiment of the present disclosure.
[0087] FIG5 shows a block diagram of a device for constructing a knowledge base according to some other embodiments of the present disclosure.
[0088] As shown in FIG5 , the knowledge base construction apparatus 5 includes a memory 51 and a processor 52 coupled to the memory 51. The memory 51 is configured to store and execute the knowledge base construction method. The processor 52 is configured to execute the knowledge base construction method in any of the embodiments of the present disclosure based on the instructions stored in the memory 51.
[0089] FIG6 illustrates a block diagram of a computer system for implementing some embodiments of the present disclosure.
[0090] 6 , a computer system 60 may be implemented as a general-purpose computing device and includes a memory 610 , a processor 620 , and a bus 600 that connects various system components.
[0091] The memory 610 may include, for example, a system memory, a non-volatile storage medium, and the like. The system memory may store, for example, an operating system, application programs, a boot loader, and other programs. The system memory may include volatile storage media, such as random access memory (RAM) and / or cache memory. The non-volatile storage medium may store, for example, instructions for executing the method for constructing a knowledge base in any of the embodiments of the present disclosure. Non-volatile storage media include, but are not limited to, disk storage, optical storage, flash memory, and the like.
[0092] The processor 620 can be implemented as a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, or as discrete hardware components such as discrete gates or transistors. Accordingly, each module, such as the judgment module and the determination module, can be implemented by a central processing unit (CPU) executing instructions in a memory that execute corresponding steps, or by dedicated circuits that execute corresponding steps.
[0093] The bus 600 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0094] The computer system 60 may also include an input / output interface 630, a network interface 640, a storage interface 650, and the like. These interfaces 630, 640, and 650, as well as the memory 610 and the processor 620, may be connected via a bus 600. The input / output interface 630 provides a connection interface for input / output devices such as a display, mouse, and keyboard. The network interface 640 provides a connection interface for various networked devices. The storage interface 650 provides a connection interface for external storage devices such as floppy disks, USB flash drives, and SD cards.
[0095] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks, can be implemented by computer-readable program instructions.
[0096] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.
[0097] These computer-readable program instructions can also be readable and stored in a computer-readable memory. These instructions cause the computer to work in a specific manner, thereby producing an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.
[0098] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0099] The knowledge base construction method and apparatus, and the computer-readable storage medium in the above embodiments improve the efficiency of knowledge base construction.
[0100] Thus far, the method and apparatus for constructing a knowledge base, and the computer-readable storage medium, according to the present disclosure have been described in detail. To avoid obscuring the concepts of the present disclosure, some details known in the art have been omitted. Based on the above description, those skilled in the art will fully understand how to implement the technical solutions disclosed herein.
Claims
1. A method for constructing a knowledge base, comprising: Obtaining a hierarchical structure of classes, wherein each level in the structure includes one or more classes, and classes at different levels form a parent-child relationship; Perform two-way dynamic updates between the attributes of the subclass and the attributes of the parent class; Determine the class to which the target element belongs at each level; According to the attributes of the class to which the target element belongs at each level, the attributes and attribute values of each target element are determined.
2. The method for constructing a knowledge base according to claim 1, wherein: Bidirectional dynamic updates between subclass attributes and parent class attributes, including: When the number of subclasses with the same attribute exceeds a first threshold, upgrading the same attribute to the attribute of the parent class; Saving the corresponding relationship between the subclasses with the same attributes and the attributes of the parent class; For the subclass having the same attribute, delete the same attribute from its attributes.
3. The method for constructing a knowledge base according to claim 1 or 2, wherein: Bidirectional dynamic updates between subclass attributes and parent class attributes, including: When the number of subclasses corresponding to the attributes of the parent class does not exceed a second threshold, downgrading the attributes of the parent class to the attributes of the corresponding subclasses according to the correspondence between the subclasses having the same attributes and the attributes of the parent class; Delete the attribute of the parent class.
4. The method for constructing a knowledge base according to any one of claims 1 to 3, further comprising: An attribute feature domain to which the attribute of the class belongs is determined, wherein each attribute feature domain includes one or more attributes, and the attribute feature domain is used to process the attributes.
5. The method for constructing a knowledge base according to any one of claims 1 to 4, wherein: Determine the class to which the target element belongs at each level, including: For multiple target elements in the target space, determine the class to which each target element belongs at each level; For each class in the hierarchy, determining whether there is a target element corresponding to the class; For the hierarchical structure corresponding to the target space, classes without corresponding target elements are recycled.
6. The method for constructing a knowledge base according to any one of claims 1 to 5, wherein: The target element includes at least one of an environmental element and an interactive element of the robot; The attributes include at least one of an interaction attribute between the target element and the robot, and an interaction attribute between the target element and other elements in the target space.
7. The method for constructing a knowledge base according to any one of claims 1 to 6, further comprising: For an attribute of a class in a hierarchical structure, information about the attribute is obtained, where the information about the attribute includes at least one of the following: The identifier of the class corresponding to the attribute, the identifier of the attribute, the name of the attribute, the name of the target element corresponding to the attribute, the attribute value of the target element corresponding to the attribute, the lower subclass corresponding to the attribute, and the attribute feature domain to which the attribute belongs.
8. The method for constructing a knowledge base according to any one of claims 1 to 7, wherein: The attributes include at least one of shape, size, color, and material.
9. The method for constructing a knowledge base according to any one of claims 1 to 8, wherein: The attribute value is obtained based on at least one of the picture and the video.
10. A device for constructing a knowledge base, comprising: The class processing module is configured to obtain a hierarchical structure of classes, wherein each level in the structure includes one or more classes, and classes at different levels form a parent-child relationship; A class attribute processing module is configured to perform a two-way dynamic update between the attributes of the subclass and the attributes of the parent class; a target element processing module configured to determine the class to which the target element belongs at each level; The target element attribute processing module is configured to determine the attributes and attribute values of each target element according to the attributes of the class to which the target element belongs at each level.
11. A device for constructing a knowledge base, comprising: Memory; as well as a processor coupled to the memory, the processor being configured to, based on instructions stored in the memory, Execute the method for constructing a knowledge base according to any one of claims 1 to 9.
12. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the method for constructing a knowledge base according to any one of claims 1 to 9.
13. A computer program product, comprising computer program instructions, which, when executed by a processor, implement the method for constructing a knowledge base according to any one of claims 1 to 9.
14. A computer program comprising: Instructions, when executed by a processor, cause the processor to execute the method for constructing a knowledge base according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for identifying similar elements and computing equipment
CN110187880A
Management system for object-oriented database based on BS architecture
CN116010658A
Method and system for automatically constructing home environment ontology knowledge base
CN116756331A
Method and system for providing objects with extendable attibutes
US20070192287A1