CN114048356B - Knowledge input method, device and storage medium - Google Patents

Knowledge input method, device and storage medium Download PDF

Info

Publication number
CN114048356B
CN114048356B CN202210029322.3A CN202210029322A CN114048356B CN 114048356 B CN114048356 B CN 114048356B CN 202210029322 A CN202210029322 A CN 202210029322A CN 114048356 B CN114048356 B CN 114048356B
Authority
CN
China
Prior art keywords
node
frame
knowledge
child
child node
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.)
Active
Application number
CN202210029322.3A
Other languages
Chinese (zh)
Other versions
CN114048356A (en
Inventor
郑强
杨军红
曾伟刚
刘浩
陈振安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Zhongke Tianta Technology Co ltd
Guangdong Guangdong Hong Kong Macao Dawan District Hard Science And Technology Innovation Research Institute
Original Assignee
Xi'an Zhongke Tianta Technology Co ltd
Guangdong Guangdong Hong Kong Macao Dawan District Hard Science And Technology Innovation Research Institute
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 Xi'an Zhongke Tianta Technology Co ltd, Guangdong Guangdong Hong Kong Macao Dawan District Hard Science And Technology Innovation Research Institute filed Critical Xi'an Zhongke Tianta Technology Co ltd
Priority to CN202210029322.3A priority Critical patent/CN114048356B/en
Publication of CN114048356A publication Critical patent/CN114048356A/en
Application granted granted Critical
Publication of CN114048356B publication Critical patent/CN114048356B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation

Abstract

The invention discloses a knowledge input method, a knowledge input device and a storage medium, wherein the method comprises the following steps: receiving a knowledge expression; analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node; setting the style of a father node frame of a father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame; connecting the parent node frame to each child node frame; judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeatedly setting a node frame and connecting the node frame until no new node is detected; and filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression. The embodiment of the invention effectively improves the efficiency of knowledge input and the accuracy of knowledge input.

Description

Knowledge input method, device and storage medium
Technical Field
The invention relates to the technical field of knowledge processing, in particular to a knowledge input method, a knowledge input device and a storage medium.
Background
With the rapid development of science and technology in China, fault diagnosis is widely applied to the fields of industrial manufacturing, medical treatment, aerospace and the like, as functions of various machine equipment to be realized are more and more complex, the number of nodes which are likely to have faults is more, the difficulty in troubleshooting when problems occur is larger, and therefore more and more diagnosis rules are needed by a corresponding fault diagnosis system. How to conveniently and rapidly input the diagnosis rules and further generate the diagnosis knowledge becomes a problem which needs to be solved urgently. The existing knowledge input method generally includes dragging a frame line on a page through manual operation and filling a diagnosis rule to obtain a knowledge graph. However, the existing knowledge input method needs to consume large labor cost and time cost when inputting knowledge, and is easy to cause errors, so that the knowledge input efficiency is poor.
Disclosure of Invention
The invention provides a knowledge input method, which aims to solve the technical problems that the existing knowledge input method needs to consume larger labor cost and time cost when inputting knowledge, and is easy to cause errors, so that the knowledge input efficiency is poorer.
One embodiment of the invention provides a knowledge entry method, which comprises the following steps:
a data receiving step: receiving a knowledge expression;
an expression analysis step: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
a node frame setting step: setting the style of a father node frame of the father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
a node frame connection step: connecting the parent node frame to each child node frame;
a node judgment step: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the node frame setting step and the node frame connecting step until no new node is detected;
a data filling module: and filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression.
Further, the analyzing the knowledge expression to obtain a parent node and at least one child node directly connected to the parent node includes:
and analyzing the nodes in the knowledge expression, taking the first node as a father node, and taking the node directly connected with the father node as a child node of the father node.
Further, setting a style of a parent node frame of the parent node, setting a style of a child node frame according to a node type of the child node, setting the parent node frame at a default position, and setting the child node frame according to a set position of the parent node frame includes:
setting the father node frame at a default position according to a preset father node setting rule;
judging the node type of the child node according to the field in the knowledge expression, and setting the style of a child node frame according to the node type of the child node;
and setting the child node frames according to the number of the child node frames and the setting position of the father node frame.
Further, the node types include an initial node, a judgment node, a fault node and a normal node, and the judging the node types of the child nodes according to the fields in the knowledge expression includes:
detecting a field name contained in the child node, and if the field name contained in the child node is unknown, judging that the child node is an initial node; if the field name judggellabel is contained, judging the child node as a judgment node; if the field name DeducionName is contained, judging the child node as a fault node; and if the field name faultLevel is contained and the value is normal, judging that the child node is a normal node.
Further, setting the child node frames according to the number of the child node frames and the setting position of the parent node frame includes:
establishing a plane coordinate system according to the setting position of the father node frame as a Y axis;
if the number of the child node frames is odd, numbering the child node frames, and taking the child node frames with the numbered median as middle frames, wherein the X-axis coordinate of the middle frames is consistent with the X-axis coordinate of the father node frame, and the Y-axis coordinate of the middle frames is smaller than the preset Y-axis coordinate value of the father node frame;
and if the number of the child node frames is an even number, taking the X-axis coordinate of the father node frame as a central axis, equally dividing the child node frames to be arranged on two sides of the central axis, wherein the distance between the adjacent child node frames is a preset distance, and the Y-axis coordinate of each child node frame is smaller than the Y-axis coordinate preset value of the father node frame.
Further, the expression parsing step further includes:
analyzing to obtain each node, and recording a node ID of each node, wherein the node ID is consistent with a node frame ID corresponding to the node;
judging whether an image frame exists in the knowledge expression or not, and if so, taking the image frame as a node frame of the knowledge expression;
judging whether the number of the nodes in the knowledge expression is consistent with the number of the node frames or not and whether the node IDs in the knowledge expression are consistent with the node frame IDs of the node frames or not.
Further, when the number of the nodes in the knowledge expression is judged to be consistent with the number of the node boxes, and the node IDs in the knowledge expression are judged to be consistent with the node box IDs of the node boxes, the data filling step is executed.
Further, when the number of the nodes in the knowledge expression is judged to be inconsistent with the number of the node frames or the node IDs in the knowledge expression are judged to be inconsistent with the node frame IDs of the node frames, the node frame setting step is executed.
One embodiment of the present invention provides a knowledge entry device, comprising:
a data receiving module: receiving a knowledge expression;
an expression analysis module: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
a node frame setting step: setting the style of a father node frame of the father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
a node frame wiring module: connecting the parent node frame to each child node frame;
a node judgment step: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the steps of the node frame setting module and the node frame connecting module until no new node is detected;
a data filling module: and filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression.
An embodiment of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein the computer program, when executed, controls an apparatus on which the computer-readable storage medium is located to perform the knowledge entry method as described above.
According to the embodiment of the invention, the father node and the son node are determined by analyzing the knowledge expression, the corresponding node frame positions are set according to the father node and the son node, the graphic knowledge can be generated by filling data in the node frames after the node frames are connected, the input of the graphic knowledge is realized, the dragging of the frame lines on the page is not required by manual operation, the labor cost and the time cost can be effectively reduced during the input of the knowledge, the input efficiency of the knowledge can be effectively improved, the error caused by the manual operation is avoided, the input accuracy of the knowledge is improved, and a reliable basis is provided for the subsequent fault diagnosis.
Drawings
FIG. 1 is a flow chart diagram of a knowledge entry method provided by an embodiment of the invention;
FIG. 2 is another flow chart diagram of a knowledge entry method provided by an embodiment of the invention;
FIG. 3 is a graphical knowledge diagram provided by an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a knowledge input device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.
In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Referring to fig. 1, an embodiment of the present invention provides a knowledge entry method, including:
s1, data receiving step: receiving a knowledge expression;
in step S1, the received knowledge expression may be fault diagnosis knowledge, and is written according to a certain syntax rule.
In a specific embodiment, the grammar rule is specifically:
1) each line of data is written in a field name = value format, and ends with a colon when having a child attribute or child node, the child node or child attribute needs to be changed by one line, and a TAB space is added to the starting position.
2) The start node contains a field name knowledgname, which serves as the identification of the start node.
3) The judging node must contain a field name judgelael, the judgelael field is taken as the first line field of the judging node, and the field name is taken as the identification of the judging node.
4) The failed node must contain a field name, the field name acting as an identification of the failed node.
5) The normal node must contain the field name faultLevel and has a value of "Normal"
The grammar rule includes different field names, and the node types of the nodes corresponding to the field names, such as the initial node, the judgment node, the fault node and the normal node, can be judged according to the different field names in the knowledge expression. The starting node data comprises fault knowledge name information and custom variable information, the judging node data comprises judging statements of knowledge and target node IDs corresponding to the judging statements, the fault node data comprises information such as fault names, treatment suggestions, treatment operations, fault levels, fault plans and fault trees, and the normal node data is only used as normal target nodes and has no actual other data.
In a specific embodiment, the grammar rule further includes:
1) the customTable field is a variable, the next line is the sub-attribute of the variable, a TAB space is added to the starting position, other sub-attributes of the same level are aligned with the starting position, and the symbol of the sub-attribute # is preceded by the name of the Chinese character of the variable and is followed by the formula of the variable.
2) And judging that the judgeLabel field of the node is used as the ending identifier of the root node, and taking all the previous rows in which the judgeLabel field appears for the first time as the attribute values of the root node.
Illustratively, one example of an expression is:
knowledgeName = multi-layer diagnostic knowledge
customTable:
Test and # testAnd = TM6074&666| T96021
Test or # testOr = T0356| MN022
Judge Label = judgment voltage
JudggeDesc = judgment voltage
……
S2, expression analysis: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
in the embodiment of the present invention, a first parent node and a next-level child node corresponding to the parent node are determined, where the number of child nodes may be multiple, and each child node is connected to its parent node.
Illustratively, the specific details of the parsing of the knowledge expression are:
collecting received knowledge expressions line by line, transferring the knowledge expressions into an ordered set, extracting node data in the knowledge expressions, collecting the node data in the knowledge expressions separately, collecting a group of data with the consistent number of the TAB spaces in the next line into an ordered HashMap when the number of the TAB spaces in the next line starts to change for each next line of data, distinguishing which type of node data the current map is according to a special key value in the aggregate, for example, if the key value in the map contains the Judge Label, considering the data as a judgment node, and then storing the data into a large data set. When the data of a node is assembled, the node ID of the next less TAB space in front of the node is the ID on the image, and the node ID is stored until all data are analyzed.
S3, a node frame setting step: setting the style of a father node frame of a father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
in the embodiment of the present invention, the style of the first parent node frame may adopt a preset parent node frame, and the child node thereof needs to set the node frame according to the node type of the child node, for example, when the child node is a judgment node, the node frame of the node is set to be a diamond shape; when the child node is a real node, the node frame of the node is set to be an ellipse. In the embodiment of the invention, the style of the node frame corresponding to each type of node can be preset and stored in the node frame database, and when the type of the node is judged, the corresponding node frame in the node frame database is called quickly, so that the node frame corresponding to the child node is generated quickly.
S4, connecting the node frames: connecting the parent node frame to each child node frame;
in the embodiment of the present invention, a connection line between node frames usually takes one point in a parent node frame as a starting point, and one point of a child node frame as a connection point, for example, an X-axis coordinate taking an X-axis coordinate of the parent node frame as the starting point, a Y-axis coordinate taking a minimum Y-axis coordinate of the parent node frame as the Y-axis coordinate of the starting point, a coordinate position of the starting point is determined, an X-axis coordinate taking an X-axis coordinate of the child node frame as the starting point, and a Y-axis coordinate taking a maximum Y-axis coordinate of the child node frame as the Y-axis coordinate of the starting point are determined; or, the central point of the father node frame is obtained, the central point is moved downwards by half of the height value of the father node frame to be used as the starting point of the father node frame, the central point of the child node frame is obtained, and the central point is moved upwards by half of the height value of the child node frame to be used as the connecting point of the child node frame. In the embodiment of the present invention, the connection style may be set according to the requirement, for example, the end is an arrow-shaped connection.
S5, a node judgment step: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the node frame setting step and the node frame connecting step until no new node is detected;
preferably, in the embodiment of the present invention, when a parent node is determined, the node frames of the parent node and the child nodes connected to the parent node are preferentially set, wherein after the setting and connection of the parent node frame of the parent node and the child node frame connected to the parent node are completed, the next parent node is determined.
S6, a data filling module: and filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression.
In the implementation of the present invention, after filling in the corresponding node box data, a complete piece of knowledge graph data is formed. In a specific implementation mode, after the complete knowledge graph data is formed, a knowledge header box can be generated according to the knowledge graph data, a user can also directly write an expression according to the above rules after the knowledge header box is formed, when the expression is switched to an image, a background can automatically convert the expression into corresponding image data, and the user can visually check the correctness of the expression. On the contrary, if the parameters in a certain frame need to be quickly modified when the image is edited, the parameters which the user wants to modify can be seen on the expression interface without opening the image frame, so that the parameters can be quickly modified, and the parameters in the image frame are completely modified when the user returns to the image page after the parameters are modified.
Optionally, the data received in the embodiment of the present invention may also be image data. When the received data is image data, the knowledge can be input by means of image dragging and filling in diagnosis information in the image. As a specific implementation manner, the received data in the embodiment of the present invention may be at least one of image data and a knowledge expression, that is, may be only image data, or only a knowledge expression, or include image data and a knowledge expression, when entering knowledge, if the received data is only image data, the entering of knowledge may be performed by dragging an image and filling diagnostic information in the image, and the image data may also be quickly switched to an expression corresponding to the image data by editing the image, so as to further implement entering of knowledge; if the received data is a knowledge expression, the steps S1-S6 can be implemented according to the invention to realize the input of knowledge; the received image data and the knowledge expression can be mutually switched, and when the received data comprises the knowledge expression and the image data, the received data can be complemented by switching the image data and the knowledge expression to realize the input of knowledge, so that the efficiency of the input of knowledge can be effectively improved.
Based on the embodiment of the invention, the fusion of the graph style data and the expression data can be realized, if the user edits the position and the connecting line on the image and then goes to the expression page for modification, the system can continue to use the existing graph line style.
In one embodiment, parsing the knowledge expression to obtain a parent node and at least one child node directly connected to the parent node includes:
and analyzing the nodes in the knowledge expression, taking the first node as a father node, and taking the node directly connected with the father node as a child node of the father node.
In the embodiment of the present invention, the method for determining a parent node includes: and judging the first node appearing in the knowledge expression as a first father node, and judging the next father node as a child node directly connected with the node, namely judging the node as the father node of the level. And repeating the judging process until no new node can be detected, namely completing the setting and connection of all node frames in the knowledge expression, and filling the node frame data on the basis to realize the input of the knowledge graph.
In one embodiment, setting a style of a parent node frame of a parent node, setting a style of a child node frame according to a node type of a child node, setting the parent node frame at a default position, and setting the child node frame according to a set position of the parent node frame includes:
setting a father node frame at a default position according to a preset father node setting rule;
in the embodiment of the invention, the setting position of the first parent node can be above the interface, and then a coordinate system is established to set the child node frame in the negative direction of the Y axis.
Judging the node type of the child node according to the field in the knowledge expression, and setting the style of the child node frame according to the node type of the child node;
in the embodiment of the invention, different node types can be identified by identifying different fields, and in order to distinguish different node types, the node frames can be distinguished through different identifications such as different shapes or colors, namely, the nodes of different types correspond to different node frames, so that the final graphic knowledge is clear and the logic of the knowledge expression is visually displayed when the graphic knowledge is converted, thereby facilitating the preview and the check, and effectively enabling the inference engine to accurately identify the logic of the graphic knowledge after the graphic knowledge is transmitted to the inference engine so as to ensure the accuracy of fault diagnosis. It should be noted that the inference engine is a software system that can analyze the problem to draw a conclusion using the expert knowledge base.
And setting the child node frames according to the number of the child node frames and the setting position of the parent node frame.
In the embodiment of the invention, when the number of the child node frames is different, the positions of the child node frames are also different, and the positions of the child node frames are set according to the number of the child node frames, so that the relative positions of the father node frame and the child node frames are more reasonable, and the reasonability of the graph knowledge is improved.
In one embodiment, the node types include a start node, a judgment node, a fault node and a normal node, and the judging the node types of the child nodes according to the fields in the knowledge expression includes:
detecting field names contained in the child nodes, and if the field names are contained, judging the child nodes as initial nodes; if the field name JudgeLabel is contained, judging the child node as a judgment node; if the field name DeducionName is contained, judging the child node as a fault node; if the field name faultLevel is contained and the value is 'normal', the child node is judged to be a normal node.
In one embodiment, setting the child node box according to the number of the child node boxes and the setting position of the parent node box includes:
establishing a plane coordinate system according to the setting position of the father node frame as a Y axis;
if the number of the child node frames is odd, numbering the child node frames, taking the numbered child node frames with the median as an intermediate frame, wherein the X-axis coordinate of the intermediate frame is consistent with the X-axis coordinate of the parent node frame, and the Y-axis coordinate of the intermediate frame is smaller than the preset Y-axis coordinate value of the parent node frame;
in the embodiment of the present invention, by setting the X-axis coordinate of the middle frame to be consistent with the X-axis coordinate of the parent node frame, the horizontal length spanned by the child node frame can be reduced as much as possible, for example, when there are a plurality of parent nodes and each parent node has a plurality of child nodes, the setting mode of the child node frame in the embodiment of the present invention can make the horizontal length spanned by the child node frame as small as possible, so that the position setting between the node frames is more reasonable.
If the number of the child node frames is even, the X-axis coordinates of the father node frames are used as central axes, the child node frames are uniformly arranged on two sides of the central axes, the distance between every two adjacent child node frames is a preset distance, and the Y-axis coordinates of each child node frame are smaller than the Y-axis coordinate preset value of the father node frame.
It is understood that the preset value in the embodiment of the present invention may be set as required, for example, the preset value is 300PX, 400PX, or the like.
In one embodiment, the expression parsing step further comprises:
analyzing to obtain each node, and recording the node ID of each node, wherein the node ID is consistent with the node frame ID corresponding to the node;
in the embodiment of the present invention, for example, the node ID of the node is 1A, the node frame ID corresponding to the node is also 1A, and the node frame corresponding to the node is the node frame corresponding to the node type of the node.
Judging whether an image frame exists in the knowledge expression or not, and if so, taking the image frame as a node frame of the knowledge expression;
in the embodiment of the invention, the knowledge expression comprises the expression statement and the image frame, namely, the image frame can be inserted into the knowledge expression to directly form the graphic knowledge.
Whether the number of the nodes in the knowledge expression is consistent with the number of the node frames and whether the node IDs in the knowledge expression are consistent with the node frame IDs of the node frames are judged.
When the number and the ID are consistent, the node frames can be directly connected, and data is filled in the node frames to obtain the final graphic knowledge.
In one embodiment, the data filling step is performed when it is determined that the number of nodes in the intellectual expression is consistent with the number of node boxes and the node IDs in the intellectual expression are consistent with the node box IDs of the node boxes.
In the embodiment of the invention, the node data of each node frame can be automatically identified in the knowledge expression and automatically filled into the node frame, and the node frame can also be artificially filled with data.
In one embodiment, the node frame setting step is executed when the number of nodes in the knowledge expression is judged to be inconsistent with the number of node frames or the node IDs in the knowledge expression are judged to be inconsistent with the node frame IDs of the node frames.
The embodiment of the invention has the following beneficial effects:
according to the embodiment of the invention, the father node and the son node are determined by analyzing the knowledge expression, the corresponding node frame positions are set according to the father node and the son node, the graphic knowledge can be generated by filling data in the node frames after the node frames are connected, the input of the graphic knowledge is realized, the dragging of the frame lines on the page is not required by manual operation, the labor cost and the time cost can be effectively reduced during the input of the knowledge, the input efficiency of the knowledge can be effectively improved, the error caused by the manual operation is avoided, the input accuracy of the knowledge is improved, and a reliable basis is provided for the subsequent fault diagnosis.
Referring to fig. 4, a knowledge input device is provided for an embodiment of the present invention, including:
the data receiving module 10: receiving a knowledge expression;
the expression analysis module 20: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
node frame setting module 30: setting the style of a father node frame of a father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
the node frame wiring module 40: connecting the parent node frame to each child node frame;
the node judgment module 50: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the steps of the node frame setting module 30 and the node frame connecting module 40 until no new node is detected;
the data population module 60: and filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression.
In one embodiment, the expression parsing module 20 is specifically configured to:
and analyzing the nodes in the knowledge expression, taking the first node as a father node, and taking the node directly connected with the father node as a child node of the father node.
In one implementation, the node box setting module 30 is specifically configured to:
setting a father node frame at a default position according to a preset father node setting rule;
judging the node type of the child node according to the field in the knowledge expression, and setting the style of the child node frame according to the node type of the child node;
and setting the child node frames according to the number of the child node frames and the setting position of the parent node frame.
In one embodiment, the node types include a start node, a judgment node, a fault node and a normal node, and the judging the node types of the child nodes according to the fields in the knowledge expression includes:
detecting the field name contained in the child node, and if the field name contained in the child node is unknown, judging the child node as an initial node; if the field name JudgeLabel is contained, judging the child node as a judgment node; if the field name is contained, judging the child node as a fault node; if the field name faultLevel is contained and the value is 'normal', the child node is judged to be a normal node.
In one embodiment, setting the child node box according to the number of the child node boxes and the setting position of the parent node box includes:
establishing a plane coordinate system according to the setting position of the father node frame as a Y axis;
if the number of the child node frames is odd, numbering the child node frames, and taking the child node frames with the median number as an intermediate frame, wherein the X-axis coordinate of the intermediate frame is consistent with the X-axis coordinate of the parent node frame, and the Y-axis coordinate of the intermediate frame is smaller than the preset Y-axis coordinate value of the parent node frame;
if the number of the child node frames is even, the X-axis coordinates of the father node frames are used as central axes, the child node frames are uniformly arranged on two sides of the central axes, the distance between the adjacent child node frames is a preset distance, and the Y-axis coordinates of each child node frame are smaller than the Y-axis coordinate preset value of the father node frame.
In one embodiment, the expression parsing module 20 is further configured to:
analyzing to obtain each node, and recording the node ID of each node, wherein the node ID is consistent with the node frame ID corresponding to the node;
judging whether an image frame exists in the knowledge expression or not, and if so, taking the image frame as a node frame of the knowledge expression;
whether the number of the nodes in the knowledge expression is consistent with the number of the node frames and whether the node IDs in the knowledge expression are consistent with the node frame IDs of the node frames are judged.
In one embodiment, the steps in the data population module 60 are performed when it is determined that the number of nodes in the intellectual expression is consistent with the number of node boxes and the node IDs in the intellectual expression are consistent with the node box IDs of the node boxes.
In one embodiment, the steps in the node box setting module 30 are performed when it is determined that the number of nodes in the intellectual expression is not consistent with the number of node boxes, or the node IDs in the intellectual expression are not consistent with the node box IDs of the node boxes.
An embodiment of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the knowledge entry method as described above.
The foregoing is a preferred embodiment of the present invention, and it should be noted that modifications and embellishments could be made by those skilled in the art without departing from the principle of the present invention, and these modifications and embellishments are also regarded as the scope of the present invention.

Claims (10)

1. A knowledge entry method, comprising:
a data receiving step: receiving a knowledge expression;
and (3) analyzing an expression: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
a node frame setting step: setting the style of a father node frame of the father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
and a node frame connecting step: connecting the parent node frame to each child node frame;
a node judgment step: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the node frame setting step and the node frame connecting step until no new node is detected;
and a data filling step: filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression;
a data conversion step: when the received data is image data or after a knowledge graph is obtained, generating a knowledge header frame according to the image data or the knowledge graph, and compiling an expression in the knowledge header frame according to a preset rule;
data editing step: and if the parameters in a certain frame need to be modified when the image data is edited, converting the image data into an expression, modifying the parameters to be modified by searching the parameters to be modified in an expression interface, and returning to the image interface after the modification is finished.
2. A knowledge entry method as claimed in claim 1, wherein parsing the knowledge expression to obtain a parent node and at least one child node directly connected to the parent node comprises:
and analyzing the nodes in the knowledge expression, taking the first node as a father node, and taking the node directly connected with the father node as a child node of the father node.
3. A knowledge entry method as claimed in claim 1, wherein setting a style of a parent node box of the parent node, setting a style of a child node box according to a node type of the child node, setting the parent node box at a default position, and setting the child node box according to the set position of the parent node box comprises:
setting the father node frame at a default position according to a preset father node setting rule;
judging the node type of the child node according to the field in the knowledge expression, and setting the style of a child node frame according to the node type of the child node;
and setting the child node frames according to the number of the child node frames and the setting position of the father node frame.
4. A knowledge entry method as claimed in claim 3 wherein the node types include a start node, a judge node, a failed node and a normal node, and the judging the node type of the child node from the fields in the knowledge expression comprises:
detecting a field name contained in the child node, and if the field name contained in the child node is unknown, judging that the child node is an initial node; if the field name JudgeLabel is contained, judging the child node as a judgment node; if the field name DeducionName is contained, judging the child node as a fault node; and if the field name faultLevel is contained and the value is normal, judging that the child node is a normal node.
5. A knowledge entry method as claimed in claim 3, wherein setting the child node box according to the number of child node boxes and the setting position of the parent node box comprises:
establishing a plane coordinate system according to the setting position of the father node frame as a Y axis;
if the number of the child node frames is odd, numbering the child node frames, and taking the child node frames with the numbered median as middle frames, wherein the X-axis coordinate of the middle frames is consistent with the X-axis coordinate of the father node frame, and the Y-axis coordinate of the middle frames is smaller than the preset Y-axis coordinate value of the father node frame;
and if the number of the child node frames is an even number, taking the X-axis coordinate of the father node frame as a central axis, equally dividing the child node frames to be arranged on two sides of the central axis, wherein the distance between the adjacent child node frames is a preset distance, and the Y-axis coordinate of each child node frame is smaller than the Y-axis coordinate preset value of the father node frame.
6. The knowledge entry method of claim 1, wherein the expression parsing step further comprises:
analyzing to obtain each node, and recording the node ID of each node, wherein the node ID is consistent with the node frame ID corresponding to the node;
judging whether an image frame exists in the knowledge expression or not, and if so, taking the image frame as a node frame of the knowledge expression;
judging whether the number of the nodes in the knowledge expression is consistent with the number of the node frames or not, and whether the node IDs in the knowledge expression are consistent with the node frame IDs of the node frames or not.
7. A knowledge entry method as claimed in claim 6, wherein the data population step is performed when it is determined that the number of nodes in the intellectual expression is consistent with the number of node boxes and the node ID in the intellectual expression is consistent with the node box ID of the node box.
8. A knowledge entry method as claimed in claim 6, wherein the node frame setting step is performed when it is determined that the number of nodes in the intellectual expression is not consistent with the number of the node frames or the node IDs in the intellectual expression are not consistent with the node frame IDs of the node frames.
9. A knowledge entry device, comprising:
a data receiving module: receiving a knowledge expression;
an expression analysis module: analyzing the knowledge expression to obtain a father node and at least one child node directly connected with the father node;
the node frame setting module: setting the style of a father node frame of the father node, setting the style of a child node frame according to the node type of the child node, setting the father node frame at a default position, and setting the child node frame according to the setting position of the father node frame;
a node frame connecting line module: connecting the parent node frame to each child node frame;
a node judgment module: judging whether the child node has a next-level child node directly connected with the child node, if so, taking the child node as a new father node, taking the next-level child node as a child node of the father node, and repeating the steps of the node frame setting module and the node frame connecting module until no new node is detected;
a data filling module: filling corresponding node frame data in the node frame to obtain a knowledge graph corresponding to the knowledge expression;
the data conversion module: when the received data is image data or after a knowledge graph is obtained, generating a knowledge header frame according to the image data or the knowledge graph, and compiling an expression in the knowledge header frame according to a preset rule;
a data editing module: and if the parameters in a certain frame need to be modified when the image data is edited, converting the image data into an expression, modifying the parameters to be modified by searching the parameters to be modified in an expression interface, and returning to the image interface after the modification is finished.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus on which the computer-readable storage medium is located to perform a knowledge entry method as claimed in any one of claims 1 to 8.
CN202210029322.3A 2022-01-12 2022-01-12 Knowledge input method, device and storage medium Active CN114048356B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210029322.3A CN114048356B (en) 2022-01-12 2022-01-12 Knowledge input method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210029322.3A CN114048356B (en) 2022-01-12 2022-01-12 Knowledge input method, device and storage medium

Publications (2)

Publication Number Publication Date
CN114048356A CN114048356A (en) 2022-02-15
CN114048356B true CN114048356B (en) 2022-06-17

Family

ID=80196344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210029322.3A Active CN114048356B (en) 2022-01-12 2022-01-12 Knowledge input method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114048356B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101877075A (en) * 2009-10-29 2010-11-03 北京航空航天大学 Fault diagnosis knowledge acquiring system
US7926029B1 (en) * 2005-01-13 2011-04-12 21St Century Systems, Inc. System and method of progressive domain specialization product solutions
CN202394263U (en) * 2012-04-01 2012-08-22 中国人民解放军总参谋部陆航研究所 Visual interactive knowledge base editor for fault diagnosis system
CN106294664A (en) * 2016-08-03 2017-01-04 广州视睿电子科技有限公司 A kind of method and apparatus generating mind map

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2354849B (en) * 1999-09-29 2004-08-25 Ibm Method and tool for graphically defining an expression
US8601438B2 (en) * 2008-11-17 2013-12-03 Accenture Global Services Limited Data transformation based on a technical design document
US9031894B2 (en) * 2013-02-19 2015-05-12 Microsoft Technology Licensing, Llc Parsing and rendering structured images
US11017335B1 (en) * 2013-03-05 2021-05-25 Pma Technologies, Llc Graphical schedule risk analyzer
CN104598581A (en) * 2015-01-14 2015-05-06 国家电网公司 Power grid resource visualizing method based on RDF (resource description framework)
CN110690997A (en) * 2019-10-10 2020-01-14 深圳前海微众银行股份有限公司 Node formatting method, device, equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7926029B1 (en) * 2005-01-13 2011-04-12 21St Century Systems, Inc. System and method of progressive domain specialization product solutions
CN101877075A (en) * 2009-10-29 2010-11-03 北京航空航天大学 Fault diagnosis knowledge acquiring system
CN202394263U (en) * 2012-04-01 2012-08-22 中国人民解放军总参谋部陆航研究所 Visual interactive knowledge base editor for fault diagnosis system
CN106294664A (en) * 2016-08-03 2017-01-04 广州视睿电子科技有限公司 A kind of method and apparatus generating mind map

Also Published As

Publication number Publication date
CN114048356A (en) 2022-02-15

Similar Documents

Publication Publication Date Title
US5327568A (en) Apparatus for supporting graphic data driven program development and for displaying instruction execution results superimposed on the graphic program
CN105138752B (en) Intelligent substation SCD file land parcel change trace differentiation compares and methods of exhibiting
CN100512163C (en) Device and method for forming topological map and detecting topological structure
CN112953737B (en) Configuration abnormality detection method, server, and storage medium
CN111859847A (en) Method and device for detecting routing of printed circuit board and computer readable storage medium
CN112307718B (en) PDF full-automatic indexing system and method based on text features and grammar rules
CN102567565B (en) Cable parameter processing method and system utilizing same
CN111610744B (en) Logic control program generation method and system based on process time sequence and storage medium
CN105302115B (en) Train network application layer control software automated testing method
CN104516813B (en) The choosing method and device of the test node of Webpage
CN114153980A (en) Knowledge graph construction method and device, inspection method and storage medium
CN113761879B (en) Message format verification method, device and storage medium
CN113049935A (en) Semiconductor intelligent detection system, intelligent detection method and storage medium
CN104750608B (en) A kind of automatic location of mistake method performed in program based on dynamic symbol
CN114048356B (en) Knowledge input method, device and storage medium
CN113342907B (en) Energy consumption information acquisition system distribution room topology portrait drawing method and system
CN110008304A (en) The difference visible processing method and device of behavior tree
CN107741905B (en) Test case, analytic model thereof, execution method, storage medium and processor
US20240097934A1 (en) Vehicle bus topological graph display method and apparatus, and device
CN111143643B (en) Element identification method, element identification device, readable storage medium and electronic equipment
CN111538673B (en) Processing method, device, equipment and storage medium based on test case
CN113536762A (en) JSON text comparison method and device
CN114817558A (en) Method for constructing sub-graph model to query graph
CN113505283A (en) Test data screening method and system
CN113515443A (en) Multi-language automatic checking method, device, computer equipment and 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
GR01 Patent grant
GR01 Patent grant