CN113987279A - Modeling method and device for entity node and computer readable storage medium - Google Patents

Modeling method and device for entity node and computer readable storage medium Download PDF

Info

Publication number
CN113987279A
CN113987279A CN202111200624.4A CN202111200624A CN113987279A CN 113987279 A CN113987279 A CN 113987279A CN 202111200624 A CN202111200624 A CN 202111200624A CN 113987279 A CN113987279 A CN 113987279A
Authority
CN
China
Prior art keywords
node
modeling
equipment
relationship
user
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.)
Pending
Application number
CN202111200624.4A
Other languages
Chinese (zh)
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.)
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software Co Ltd
Original Assignee
Shenzhen ZNV Technology Co Ltd
Nanjing ZNV Software 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 Shenzhen ZNV Technology Co Ltd, Nanjing ZNV Software Co Ltd filed Critical Shenzhen ZNV Technology Co Ltd
Priority to CN202111200624.4A priority Critical patent/CN113987279A/en
Publication of CN113987279A publication Critical patent/CN113987279A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a modeling method, a device and a computer readable storage medium of entity nodes, wherein the method comprises the following steps: generating equipment nodes in a graph database according to the equipment names, the equipment types and the equipment numbers when the equipment names, the equipment types and the equipment numbers are received; generating a user node in a graph database according to the login name, the nickname and the login password when the login name, the nickname and the login password are received; when a relation type is received, associating the equipment node and the user node in the graph database according to the relation type, wherein the relation type comprises an attribute relation and a relationship; and modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to the query request aiming at the equipment nodes and/or the user nodes. The invention can reduce the development complexity of the modeling of the entity node.

Description

Modeling method and device for entity node and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for modeling an entity node, and a computer-readable storage medium.
Background
The modeling device of the entity node relates to various entity nodes, such as equipment, users and the like, the attributes of various entity nodes are different, and the conventional method generally comprises the steps of respectively modeling different entity nodes and storing the attribute data of the entity nodes by utilizing a relational database. The modeling mode is intuitive and simple, but different data table structures need to be designed aiming at different entity nodes, so that the development complexity is high in the prior art during modeling.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for modeling an entity node, and a computer-readable storage medium, so as to solve a technical problem of how to reduce the development complexity of modeling an entity node.
The embodiment of the invention provides a modeling method of an entity node, which comprises the following steps:
when receiving the equipment name, the equipment type and the equipment number, generating equipment nodes in a graph database according to the equipment name, the equipment type and the equipment number;
when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password;
when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship;
modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to query requests aiming at the equipment nodes and/or the user nodes.
In one embodiment, the step of associating the device node and the user node in the graph database according to the relationship type upon receiving the relationship type comprises:
when the relationship type is received, determining whether the relationship type is the attribute relationship;
and when the relationship type is the attribute relationship, associating the equipment node and the user node in the graph database and adding an attribute label corresponding to the attribute relationship in the association relationship.
In an embodiment, after the step of determining whether the relationship type is the attribute relationship when the relationship type is received, the method further includes:
and when the relationship type is not the attribute relationship, directly associating the equipment node and the user node in the graph database.
In an embodiment, after the step of modeling according to the association relationship between the device node and the user node, the method further includes:
when an adding request of a custom attribute is received, determining a target entity node in the equipment node and the user node according to the adding request;
and adding the custom attribute in the attribute set corresponding to the target entity node.
In an embodiment, after the step of adding the custom attribute at the target entity node, the method further comprises:
when a deleting request of the custom attribute is received, determining a target entity node in the equipment node and the user node according to the deleting request;
and deleting the custom attribute in the attribute set corresponding to the target entity node.
In an embodiment, after the step of modeling according to the association relationship between the device node and the user node, the method further includes:
and outputting the knowledge graph.
In an embodiment, after the step of modeling according to the association relationship between the device node and the user node, the method further includes:
when an inquiry request is received, determining a device node and/or a user node corresponding to the inquiry request;
traversing the modeled knowledge graph according to the incidence relation of the equipment nodes and/or the user nodes corresponding to the query request to obtain a target knowledge graph corresponding to the query request;
and outputting the target knowledge graph.
In an embodiment, after the step of modeling according to the association relationship between the device node and the user node, the method further includes:
and outputting prompt information of successful modeling.
The embodiment of the present invention further provides a modeling apparatus for an entity node, where the modeling apparatus for an entity node includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of modeling a physical node as described above when executing the computer program.
An embodiment of the present invention further provides 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, the computer program implements the steps of the modeling method for the entity node as described above.
In the technical scheme of the embodiment, when receiving a device name, a device type and a device number, generating a device node in a graph database according to the device name, the device type and the device number; when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password; when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship; modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to query requests aiming at the equipment nodes and/or the user nodes. The modeling device of the entity node can generate the equipment node in the graph database based on the received equipment name, equipment type and equipment number, and can also generate the user node in the graph database based on the received login name, nickname and login password, and when the relation type is received, the equipment node and the user node can be associated in the graph database according to the relation type, so that modeling is realized according to the knowledge graph technology, different data table structures do not need to be designed for different entity nodes, and different data table structures do not need to be designed. Therefore, all the entities of the modeling device of the entity node can be modeled by the universal data structure, and the development complexity of modeling of the entity node is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a hardware architecture of a modeling apparatus for a physical node according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a modeling method of an entity node according to a first embodiment of the present invention;
FIG. 2A is a diagram illustrating a modeling method of a solid node according to a first embodiment of the present invention;
FIG. 2B is a diagram illustrating a modeling method for a solid node according to a first embodiment of the present invention;
FIG. 2C is a diagram illustrating a modeling method for a solid node according to a first embodiment of the present invention;
FIG. 3 is a detailed flowchart of step 30 of a second embodiment of the method for modeling a solid node according to the present invention;
FIG. 4 is a schematic flow chart of a modeling method for a physical node according to a third embodiment of the present invention;
FIG. 4A is a diagram illustrating a modeling method for a solid node according to a third embodiment of the present invention;
FIG. 4B is a diagram illustrating a modeling method for a solid node according to a third embodiment of the present invention;
FIG. 5 is a flowchart illustrating a fourth embodiment of a method for modeling an entity node according to the present invention.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The main solution of the invention is: when receiving the equipment name, the equipment type and the equipment number, generating equipment nodes in a graph database according to the equipment name, the equipment type and the equipment number; when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password; when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship; modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to query requests aiming at the equipment nodes and/or the user nodes.
The modeling device of the entity node can generate the equipment node in the graph database based on the received equipment name, equipment type and equipment number, and can also generate the user node in the graph database based on the received login name, nickname and login password, and when the relation type is received, the equipment node and the user node can be associated in the graph database according to the relation type, so that modeling is realized according to the knowledge graph technology, different data table structures do not need to be designed for different entity nodes, and different data table structures do not need to be designed. Therefore, all the entities of the modeling device of the entity node can be modeled by the universal data structure, and the development complexity of modeling of the entity node is reduced.
As an implementation, the modeling apparatus of the entity node may be as shown in fig. 1.
The embodiment of the invention relates to a modeling device of an entity node, which comprises: a processor 101, e.g. a CPU, a memory 102, a communication bus 103. Wherein a communication bus 103 is used for enabling the connection communication between these components.
The memory 102 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). As in fig. 1, a detection program may be included in the memory 103 as a computer-readable storage medium; and the processor 101 may be configured to call the detection program stored in the memory 102 and perform the following operations:
when receiving the equipment name, the equipment type and the equipment number, generating equipment nodes in a graph database according to the equipment name, the equipment type and the equipment number;
when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password;
when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship;
modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein when a query request aiming at the equipment nodes and/or the user nodes is received, the knowledge graph is output to respond.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
when the relationship type is received, determining whether the relationship type is the attribute relationship;
and when the relationship type is the attribute relationship, associating the equipment node and the user node in the graph database and adding an attribute label corresponding to the attribute relationship in the association relationship.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
and when the relationship type is not the attribute relationship, directly associating the equipment node and the user node in the graph database.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
when an adding request of a custom attribute is received, determining a target entity node in the equipment node and the user node according to the adding request;
and adding the custom attribute in the attribute set corresponding to the target entity node.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
when a deleting request of the custom attribute is received, determining a target entity node in the equipment node and the user node according to the deleting request;
and deleting the custom attribute in the attribute set corresponding to the target entity node.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
and outputting the knowledge graph.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
when an inquiry request is received, determining a device node and/or a user node corresponding to the inquiry request;
traversing the modeled knowledge graph according to the incidence relation of the equipment nodes and/or the user nodes corresponding to the query request to obtain a target knowledge graph corresponding to the query request;
and outputting the target knowledge graph.
In one embodiment, the processor 101 may be configured to call a detection program stored in the memory 102 and perform the following operations:
and outputting prompt information of successful modeling.
In the technical scheme of the embodiment, when receiving a device name, a device type and a device number, generating a device node in a graph database according to the device name, the device type and the device number; when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password; when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship; modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to query requests aiming at the equipment nodes and/or the user nodes. The modeling device of the entity node can generate the equipment node in the graph database based on the received equipment name, equipment type and equipment number, and can also generate the user node in the graph database based on the received login name, nickname and login password, and when the relation type is received, the equipment node and the user node can be associated in the graph database according to the relation type, so that modeling is realized according to the knowledge graph technology, different data table structures do not need to be designed for different entity nodes, and different data table structures do not need to be designed. Therefore, all the entities of the modeling device of the entity node can be modeled by the universal data structure, and the development complexity of modeling of the entity node is reduced.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Referring to fig. 2, fig. 2 is a first embodiment of the modeling method of the entity node of the present invention, and the method includes the following steps:
step S10, when receiving the device name, the device type, and the device number, generates a device node in the map database according to the device name, the device type, and the device number.
In this embodiment, the modeling of platform entity objects is implemented by using knowledge-graph technology, a knowledge-graph can describe concept entities and their relationships in the objective world in a structured form, a triplet is a general representation of a knowledge-graph, the basic form of the triplet includes (entity-relationship-entity) and (entity-attribute value), each entity can be identified by a globally unique ID, each attribute-attribute value pair can be used to describe the intrinsic characteristics of the entity, and a relationship can be used to connect two entities to describe the association between them. The knowledge graph technology can enable the entities in the modeling device of the entity node, the attributes of the entities and the incidence relation between the entities to be described in a general cognitive mode, and therefore the information is constructed into a net-shaped information structure. A knowledge graph is a unified store of entities, attributes, and relationships using graphs rather than tables. The graph consists of two elements: the method comprises the following steps of nodes and edges, wherein each node represents an entity, and the edges between the two nodes represent the association relationship. Therefore, all the entities of the modeling device of the entity node can be modeled by using the common data structure, and the modeling process is as follows: the modeling device of the entity node newly builds the entity node in the graph database; adding corresponding attributes and attribute values to the entity nodes; adding corresponding relations among different entity nodes; external applications utilize the API provided by the graph database to retrieve entities and access data. The modeling device of the entity node introduces Neo4j open source Graph Database (Graph Database), and the Graph Database adopts Native Graph (Native Graph) to store and process data, so that the modeling device has excellent operation performance. And based on the attribute graph model, rich data semantic description is supported. The Cypher query language is provided, and is simple, intuitive and easy to understand. And transactions are supported, and data consistency is guaranteed. The method has an active community, provides rich programming language driving support and is convenient to use. Therefore, the modeling apparatus of the entity node selects to store and retrieve the entity node, and its attributes and relationships using Neo4j, and it is easily understood that the above-mentioned device node is the entity node.
The background service of the modeling device of the entity node is responsible for providing an REST API interface, so that a user can execute operations of creating, modifying, deleting and the like of the entity node through a WEB management platform of the modeling device of the entity node, and the management function of the entity node is realized.
Optionally, the user executes a new entity node building operation through the WEB management platform of the modeling apparatus for the entity node, and for this reason, the user needs to input a label (label) of the entity object to indicate the node type in the graph database. In addition, basic attributes of the entity object, such as a device name (devName), a device type (devType), a device number (devId), and the like, also need to be input. The background service interface of the modeling device of the entity node is responsible for calling the Neo4j API to create a new node in the graph database, label is used as the label of the node, and devName, devType and devId are used as the attributes of the node. For example, a face capture device is newly built, and after the operation is completed, a device node is newly built in a graph database, where the node includes the following attributes: device { "devId": 12345678 "," devName ": myFace1 #", "devType": faceDevice "}.
Step S20, upon receiving the login name, nickname and login password, generates a user node in the graph database based on the login name, nickname and login password.
In the present embodiment, the graph database is modeled based on a directed graph, where nodes, edges, and attributes are the core concepts of the graph database. The nodes are used to represent entity nodes, which may be understood as the above device nodes and user nodes, and may also be analogous to records in a relational database or row data in a data table. Characters, places, movies, devices may all be nodes in the graph.
Optionally, the user newly establishes a user node in the graph database through the WEB management platform, the basic user attributes to be input include a login name (loginnname), a nickName (nickName), and a login password (password), and after the operation is completed, a user node is created in the graph database, and the node includes the following attributes: user { "loginName": User1 "," nickName ": is me", "password": 123456 "}.
Step S30, when a relationship type is received, associating the device node and the user node in the graph database according to the relationship type, where the relationship type includes a relationship and an attribute relationship.
In this embodiment, the belonging relationship and the attribute relationship may be edges in the graph database, where an edge refers to a directional line connecting nodes in the graph and is used to represent a relationship between different nodes. For example, co-worker relationships between people can all be used as edges in the graph. Attributes are used to describe the characteristics of a node or edge. Such as the name, sex, hobby, etc. of the person (node) are attributes.
Step S40, modeling is carried out according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to the query request aiming at the equipment nodes and/or the user nodes.
In this embodiment, a user has a management right on a device, that is, there is an association relationship between the device and the user, and we can establish a relationship in a graph database to connect a device node and a user node through a WEB management platform, where the relationship is directional, where the device points to the user, the user needs to input a relationship type, such as BELONGTO, and the relationship may also include an attribute, where we add an authorization day attribute auth _ date in the relationship, and after the operation is completed, there is an association relationship between the device and the user. Moreover, the same association relationship needs to be established between all the devices managed by the user and the user, and fig. 2A is referred to as an attribute graph model schematic diagram of the device entity and the user entity.
Optionally, after modeling is completed, the knowledge graph is output, so that a user can intuitively know modeling effects.
Optionally, when modeling is completed, prompt information of successful modeling is output, so that a user can know the prompt information in time.
Specifically, the entity modeling process of the modeling apparatus of the entity node is specifically explained through several application scenarios: firstly, starting a modeling device of an entity node, and then logging in a WEB management platform of the modeling device of the entity node by a user through a browser; a user can create a device (device node) on a WEB management platform, and the operation calls a REST API interface of a modeling device of an entity node, wherein the URL of the API interface is as follows: http:// cmp _ server:8080/api/v1/device, the sending mode is post, the Content-type is application/JSON, the authentication mode is JWT Token, and the sender is a device basic attribute in JSON format: { "raw _ ID": … "," name ": …", "kid": … "," type ": …", "access _ device _ ID": … ", … }, wherein raw _ ID is the original number of the device, name is the device name, kid is the device type, type is the device type, and access _ device _ ID is the access server ID connected to the device. The main business process of the newly built device can refer to fig. 2B.
A user appoints a management user for equipment on a WEB management platform, the operation calls an REST API interface of a modeling device of an entity node, and the URL of the API interface is as follows: http:// cmp _ server:8080/api/v1/customer/{ customer id }/device/{ device id }, sending mode is POST, Accept is application/json, and authentication mode is JWT Token. Wherein, customerId is the platform ID of the management user, and deviceId is the platform ID of the device. The API interface returns the execution result in the JSON format: { "result": succ "," errorMsg ": …", … }. The main business process of assigning an administrative user to a device can be seen with reference to fig. 2C.
In the technical solution of this embodiment, the modeling apparatus of the entity node may generate the device node in the graph database based on the received device name, device type, and device number, and may also generate the user node in the graph database based on the received login name, nickname, and login password, and when the relationship type is received, the device node and the user node may be associated in the graph database according to the relationship type, thereby implementing modeling according to the knowledge graph technology, without designing different data table structures for different entity nodes, wherein, by using the knowledge graph technology, the entity in the modeling apparatus of the entity node, the attribute of the entity, and the association between the entities may be described in a general way conforming to cognition, thereby constructing these information into a mesh information structure. Therefore, all the entities of the modeling device of the entity node can be modeled by the universal data structure, and the development complexity of modeling of the entity node is reduced.
Referring to fig. 3, fig. 3 is a second embodiment of the modeling method for entity nodes of the present invention, and based on the first embodiment, step S30 includes:
step S31, when receiving the relationship type, determining whether the relationship type is the attribute relationship.
In the present embodiment, the belonging relationship may be understood as a default relationship in the graph database, and the attribute relationship may be understood as a specific relationship.
Step S32, when the relationship type is the attribute relationship, associating the device node and the user node in the graph database, and adding an attribute label corresponding to the attribute relationship in the association relationship.
Optionally, when the relationship type is not the attribute relationship, directly associating the device node and the user node in the graph database.
In the technical scheme of the embodiment, different relationship identifiers are displayed through different identifiers, so that a user can more intuitively know the association relationship between the equipment node and the user node.
Referring to fig. 4, fig. 4 is a third embodiment of the modeling method for an entity node according to the present invention, and based on any one of the first to second embodiments, after step S40, the method further includes:
step S50, when receiving an addition request of a custom attribute, determining a target entity node in the device node and the user node according to the addition request.
And step S60, adding the custom attribute in the attribute set corresponding to the target entity node.
In this embodiment, the custom attribute may be understood as an attribute that a user wants to add to an entity node, and when the user initiates an addition request, the custom attribute is added to a target entity node corresponding to the request.
In this embodiment, the modeling apparatus of the entity node provides a REST API interface, and the external application can add custom attributes to an existing entity object, for example, add a manufacturer name, purchase time, and the like to the face snapshot machine device, so that the external application can conveniently extend the attribute set of the entity node according to business needs, and the custom attribute data can also be stored in Neo4 j. Similarly, the external application can delete some custom attributes on the entity object through the REST API interface provided by the modeling device of the entity node.
The kafka message engine is introduced into the modeling device of the entity node, when the core service of the modeling device of the entity node receives an operation request for entity custom attributes transmitted from the API gateway, such as adding custom attributes or deleting custom attributes, the core service sends a custom attribute change message in a JSON format to the kafka, and other external applications can timely acquire the entity and the notification of attribute change thereof by subscribing related topics, so that corresponding business processing can be triggered.
Specifically, a user adds a custom attribute to the device on the WEB management platform, and this operation will call the REST API interface of the modeling apparatus of the entity node, where the URL of the API interface is as follows: http:// cmp _ server:8080/api/v1/attributes/{ deviceId }, the sending mode is post, the Content-type is application/JSON, the authentication mode is JWT Token, and the sender is a device attribute in JSON format: { "newAttributeName": newAttributeValue ", … }, wherein deviceId is the platform ID of the device, newAttributeName is the custom attribute name, and newAttributeValue is the custom attribute value. The main business process of adding device custom attributes refers to fig. 4A.
The user views all the custom attributes of the equipment on the WEB management platform, the operation calls the REST API interface of the modeling device of the entity node, and the URL of the API interface is as follows: http:// cmp _ server:8080/api/v1/attributes/{ deviceId }, the transmission mode is GET, the acceptance is application/json, and the authentication mode is JWT Token. Wherein, deviceId is platform ID of the device, and the API interface returns all custom attributes of the device in JSON format: { "attribute 1": value1 "," attribute2 ": value 2", … }. The main business process for obtaining all the custom attributes of the device can refer to fig. 4B.
Optionally, the custom data may be added by a data insertion mode, where the data insertion indicates that a new triple is inserted into an existing RDF diagram, and the function is completed through an INSERT DATA statement.
Optionally, when a deletion request of the custom attribute is received, a target entity node is determined in the device node and the user node according to the deletion request; and deleting the custom attribute in the attribute set corresponding to the target entity node.
In the technical scheme of this embodiment, through the modeling method of this embodiment, when a user adds or deletes a custom attribute, the integrity of the graph database is not greatly affected, and the complexity of adding or deleting the attribute is lower than that of the modeling method in the prior art.
Referring to fig. 5, fig. 5 is a fourth embodiment of the modeling method for an entity node according to the present invention, based on any one of the first to third embodiments, after step S40, the method further includes:
step S70, when receiving the query request, determining a device node and/or a user node corresponding to the query request.
Step S80, traversing the modeled knowledge graph according to the incidence relation of the device node and/or the user node corresponding to the query request to obtain a target knowledge graph corresponding to the query request.
And step S90, outputting the target knowledge graph.
In the technical scheme of the embodiment, the device node and/or the user node to be searched is displayed through the knowledge graph, and the incidence relation between the search target and other entities can be intuitively embodied.
In order to achieve the above object, an embodiment of the present invention further provides a modeling apparatus for an entity node, where the modeling apparatus for an entity node includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of modeling a physical node as described above when executing the computer program.
To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the modeling method for a solid node as described above.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a network configuration product program embodied on one or more computer-usable computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A modeling method of an entity node is characterized by comprising the following steps:
when receiving the equipment name, the equipment type and the equipment number, generating equipment nodes in a graph database according to the equipment name, the equipment type and the equipment number;
when a login name, a nickname and a login password are received, generating a user node in the graph database according to the login name, the nickname and the login password;
when a relationship type is received, associating the equipment node and the user node in the graph database according to the relationship type, wherein the relationship type comprises a relationship and an attribute relationship;
modeling according to the incidence relation of the equipment nodes and the user nodes to obtain a knowledge graph, wherein the knowledge graph is used for responding to query requests aiming at the equipment nodes and/or the user nodes.
2. The method of modeling an entity node of claim 1, wherein said step of associating said device node with said user node in said graph database according to a relationship type upon receiving said relationship type comprises:
when the relationship type is received, determining whether the relationship type is the attribute relationship;
and when the relationship type is the attribute relationship, associating the equipment node and the user node in the graph database and adding an attribute label corresponding to the attribute relationship in the association relationship.
3. The method for modeling an entity node of claim 1, wherein after the step of determining whether the relationship type is the attribute relationship upon receiving the relationship type, the method further comprises:
and when the relationship type is not the attribute relationship, directly associating the equipment node and the user node in the graph database.
4. The method for modeling an entity node of claim 1, wherein after the step of modeling based on the association of the device node and the user node, the method further comprises:
when an adding request of a custom attribute is received, determining a target entity node in the equipment node and the user node according to the adding request;
and adding the custom attribute in the attribute set corresponding to the target entity node.
5. The method for modeling an entity node of claim 4, wherein after the step of adding the custom attribute to the target entity node, the method further comprises:
when a deleting request of the custom attribute is received, determining a target entity node in the equipment node and the user node according to the deleting request;
and deleting the custom attribute in the attribute set corresponding to the target entity node.
6. The method for modeling an entity node of claim 1, wherein after the step of modeling based on the association of the device node and the user node, the method further comprises:
and outputting the knowledge graph.
7. The method for modeling an entity node of claim 1, wherein after the step of modeling based on the association of the device node and the user node, the method further comprises:
when an inquiry request is received, determining a device node and/or a user node corresponding to the inquiry request;
traversing the modeled knowledge graph according to the incidence relation of the equipment nodes and/or the user nodes corresponding to the query request to obtain a target knowledge graph corresponding to the query request;
and outputting the target knowledge graph.
8. The method for modeling an entity node of claim 1, wherein after the step of modeling based on the association of the device node and the user node, the method further comprises:
and outputting prompt information of successful modeling.
9. An apparatus for modeling a physical node, the apparatus comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of modeling a physical node according to any of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of modeling a solid node according to any one of claims 1 to 8.
CN202111200624.4A 2021-10-14 2021-10-14 Modeling method and device for entity node and computer readable storage medium Pending CN113987279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111200624.4A CN113987279A (en) 2021-10-14 2021-10-14 Modeling method and device for entity node and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111200624.4A CN113987279A (en) 2021-10-14 2021-10-14 Modeling method and device for entity node and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113987279A true CN113987279A (en) 2022-01-28

Family

ID=79738671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111200624.4A Pending CN113987279A (en) 2021-10-14 2021-10-14 Modeling method and device for entity node and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113987279A (en)

Similar Documents

Publication Publication Date Title
US10831802B2 (en) Techniques to respond to user requests using natural-language machine learning based on example conversations
CN108733713B (en) Data query method and device in data warehouse
RU2632168C2 (en) Method and device for displaying information streams in social network and server
CN102725770B (en) Social network search
US7827242B2 (en) Method and system for providing a common collaboration framework accessible from within multiple applications
CN107450903B (en) Information processing method and device
CA2711279C (en) Social community generated answer system with collaboration constraints
US20140245178A1 (en) Communication device and method for profiling and presentation of message threads
US20110307455A1 (en) Contact information merger and duplicate resolution
US20120047143A1 (en) Sparse profile augmentation using a mobile aggregate profiling system
US8195691B2 (en) Query-based tree formation
US20100312820A1 (en) Identifying and recommending connections across multiple online services
US20090248729A1 (en) Online application platform and user communities
US10599654B2 (en) Method and system for determining unique events from a stream of events
CN109787785A (en) Group management, background server and terminal
US20090164987A1 (en) System and method for updating a dual layer browser
US10956278B2 (en) Intelligent captain selection for disaster recovery of search head cluster
EP2770761B1 (en) Communication device and method for profiling and presentation of message threads
AU2017268599A1 (en) Method, device, server and storage medium of searching a group based on social network
CN110888672B (en) Expression engine implementation method and system based on metadata architecture
KR20120087221A (en) System and method for dynamic digital community management based locational and societal-aware
CN102316128A (en) A kind ofly be used to generate network service method and device
CN109614271A (en) Control method, device, equipment and the storage medium of multiple company-data consistency
US20160154828A1 (en) Business rules manager
CN113987279A (en) Modeling method and device for entity node and computer readable storage medium

Legal Events

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