Template file generation method and apparatus, and computer-readable storage medium

By generating consultation template files in a visual interface, the problem of low development efficiency of online consultation and pre-consultation templates is solved, realizing a convenient and intuitive development process and efficient logic editing.

CN113761861BActive Publication Date: 2026-04-14BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING JINGDONG TUOXIAN TECH CO LTD
Filing Date
2021-01-18
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, the development efficiency of online consultation and pre-consultation templates is low, doctors and developers need to do repetitive work, and the code logic is difficult to verify intuitively, making it difficult to comprehensively consider the global logic when making business adjustments.

Method used

A method and apparatus for generating template files are provided. The method obtains nodes and connections through a visual interface, generates a list of nodes and connections, performs serialization processing, and automatically generates a consultation template file. The method also supports users to edit the logic in the visual interface.

Benefits of technology

It improves the convenience and intuitiveness of template development, enhances development efficiency, and simplifies the logic verification and business adjustment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113761861B_ABST
    Figure CN113761861B_ABST
Patent Text Reader

Abstract

The application discloses a template file generation method and device and a computer readable storage medium, and relates to the technical field of computers. The template file generation method comprises the following steps: acquiring nodes and connection lines in a visual interface, wherein the nodes have one or more upstream ports and downstream ports, and each port is connected with the ports of other nodes through the connection lines; the nodes comprise problem nodes and operation nodes, and each downstream port of the problem node corresponds to a candidate answer; generating a node list, wherein the node list comprises the information of one or more nodes, and the information of each node comprises the attributes of the node and the connection lines connected with the node; generating a connection line list, wherein the connection line list comprises the information of one or more connection lines, and the information of each connection line comprises the nodes and ports connected with the connection line; and performing serialization processing on the node list and the connection line list to generate an inquiry template file. Therefore, the development efficiency of the template is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus and computer-readable storage medium for generating template files. Background Technology

[0002] With the development of internet technology, healthcare services have expanded online. Online consultations are one type of online healthcare service. Users communicate with doctors about their conditions or seek medical advice via the internet. Before formally communicating with a doctor, users can answer pre-set questions, such as providing personal information, a brief description of current symptoms, and previously used treatments. This allows doctors to obtain key information about the user before starting formal communication, improving efficiency. This process can also be called a "pre-consultation."

[0003] In related technologies, the pre-consultation templates for online medical consultations are generally based on rules established by doctors or product designers. These rules include the order of pre-consultation questions, candidate options, and branching information. Software engineers then write code based on these rules and deploy the code online. Summary of the Invention

[0004] In related technologies, there is a lack of commonality in the development of various pre-consultation templates. For each pre-consultation template, doctors need to compile rules and hand them over to developers for coding each time, resulting in a large amount of repetitive work. Furthermore, non-professionals cannot intuitively verify the logical correctness of the code developed by developers, making it difficult to review. Moreover, most rule-based code is filled with numerous conditional branching structures. When business adjustments require modifications to a particular pre-consultation logic, it is difficult to comprehensively consider the overall logic. Therefore, related technologies suffer from low development efficiency in pre-consultation templates.

[0005] One technical problem that this invention aims to solve is: how to improve the development efficiency of templates.

[0006] According to a first aspect of some embodiments of the present invention, a method for generating a template file is provided, comprising: obtaining nodes and connections in a visualization interface, wherein in the visualization interface, a node has one or more upstream ports and downstream ports, and each port is connected to the ports of other nodes via connections; the nodes include question nodes and operation nodes, and each downstream port of a question node corresponds to a candidate answer; generating a node list, wherein the node list includes information of one or more nodes, and the information of each node includes the node's attributes and the connections to the node; generating a connection list, wherein the connection list includes information of one or more connections, and the information of each connection includes the nodes and ports to which the connection is connected; and serializing the node list and the connection list to generate a consultation template file.

[0007] In some embodiments, the attributes of a problem node include problem information; and the attributes of an operation node include the operation type of the operation node, wherein the operation type includes logical type and operational type.

[0008] In some embodiments, the node information includes input dictionary attributes and output dictionary attributes. The input dictionary attributes include the identifiers of the node's upstream ports and the connections they are connected to, and the output dictionary attributes include the identifiers of the node's downstream ports and the connections they are connected to.

[0009] In some embodiments, each connection has a reference attribute of the upstream node to which the connection is connected, a port identifier of the upstream node to which the connection is connected, a reference attribute of the downstream node to which the connection is connected, and a port identifier of the downstream node to which the connection is connected.

[0010] In some embodiments, the generation method further includes: converting the read consultation template file into one or more node lists and one or more connection lists; creating an instance of a node based on the information of each node in the node list and displaying it in a visualization interface; creating an instance of a connection based on the information of each connection in the connection list and connecting the corresponding node using each connection in the visualization interface.

[0011] In some embodiments, creating an instance of a node based on the information of each node in the node list and displaying it in the visualization interface includes: constructing a graph structure of the nodes in the node list based on the information of each connection in the connection list; calculating the depth of each node in the graph structure based on the starting node, where the starting node is the node corresponding to the first problem; determining the horizontal coordinate of each node in the visualization interface based on the depth of each node and the pre-configured node size and spacing, where the horizontal coordinate of the node is positively correlated with the depth of the node; and determining the vertical coordinate of each node such that each node does not overlap in the vertical direction.

[0012] In some embodiments, creating an instance of a node based on the information of each node in the node list and displaying it in the visualization interface includes: reading the node list; reading the question configuration file, wherein the question configuration file includes one or more questions and candidate answers for each question; creating an instance of a node based on each question in the node list and the information corresponding to the question in the question configuration file, and displaying it in the visualization interface.

[0013] In some embodiments, the generation method further includes: in response to a user performing a node addition operation, creating a node object and displaying the created node in a visualization interface; or, in response to a user performing a node connection operation, creating a connection object and displaying the created connection between the connected nodes in a visualization interface.

[0014] In some embodiments, the generation method further includes: generating a first consultation interface based on the question and its corresponding candidate answer in the first node of the consultation template file; finding the next node connected to the port of the candidate answer selected by the user in the previous consultation interface from the consultation template file, and generating a next consultation interface based on the question and its corresponding candidate answer in the next node.

[0015] According to a second aspect of some embodiments of the present invention, an apparatus for generating a template file is provided, comprising: an acquisition module configured to acquire nodes and connections in a visualization interface, wherein in the visualization interface, a node has one or more upstream ports and downstream ports, and each port is connected to the ports of other nodes via connections; the nodes include question nodes and operation nodes, and each downstream port of a question node corresponds to a candidate answer; a node list generation module configured to generate a node list, wherein the node list includes information of one or more nodes, and the information of each node includes the node's attributes and the connections to which the node is connected; a connection list generation module configured to generate a connection list, wherein the connection list includes information of one or more connections, and the information of each connection includes the nodes and ports to which the connection is connected; and a serialization processing module configured to serialize the node list and the connection list to generate a consultation template file.

[0016] In some embodiments, the generation apparatus further includes: a visualization module configured to convert the read consultation template file into one or more node lists and one or more connection lists; create an instance of a node based on the information of each node in the node list and display it in the visualization interface; create an instance of a connection based on the information of each connection in the connection list and connect the corresponding node using each connection in the visualization interface.

[0017] In some embodiments, the generation apparatus further includes: a creation module configured to create a node object and display the created node in a visualization interface in response to a user performing a node addition operation; or, to create a connection object and display the created connection between the connected nodes in a visualization interface in response to a user performing a node connection operation.

[0018] In some embodiments, the generation apparatus further includes: a consultation module configured to generate a first consultation interface based on the question and its corresponding candidate answer in the first node of the consultation template file; to find the next node connected to the port of the candidate answer selected by the user in the previous consultation interface from the consultation template file, and to generate a next consultation interface based on the question and its corresponding candidate answer in the next node.

[0019] According to a third aspect of some embodiments of the present invention, an apparatus for generating a template file is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute any of the aforementioned template file generation methods based on instructions stored in the memory.

[0020] According to a fourth aspect of some embodiments of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, wherein the program, when executed by a processor, implements any of the aforementioned methods for generating template files.

[0021] Some embodiments of the above invention have the following advantages or beneficial effects. Through the embodiments of the present invention, users can edit the consultation logic in a visual interface, making the template development process more convenient and intuitive for users. Furthermore, for the logic determined by the user in the visual interface, a template file containing the connection relationships between nodes and lines can be automatically generated. This improves development efficiency.

[0022] Other features and advantages of the invention will become clear from the following detailed description of exemplary embodiments of the invention with reference to the accompanying drawings. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A schematic diagram of a visual interface for editing a consultation template according to some embodiments of the present invention is shown.

[0025] Figure 2A flowchart illustrating a method for generating template files according to some embodiments of the present invention is shown.

[0026] Figure 3 A flowchart illustrating a deserialization process according to some embodiments of the present invention is shown.

[0027] Figure 4 A flowchart illustrating a layout method for a visual interface according to some embodiments of the present invention is shown.

[0028] Figure 5 A diagram illustrates the text in a preset format used to convert to problem profiles and consultation template files.

[0029] Figure 6 A flowchart illustrating a method for generating a pre-consultation interface according to some embodiments of the present invention is shown.

[0030] Figure 7 A schematic diagram of the structure of the device for generating a consultation template according to some embodiments of the present invention is shown.

[0031] Figure 8 A schematic diagram of a device for generating a consultation template according to other embodiments of the present invention is shown.

[0032] Figure 9 A schematic diagram of a device for generating a consultation template according to some embodiments of the present invention is shown. Detailed Implementation

[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0034] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0035] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0036] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0037] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0038] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0039] Embodiments of the present invention provide a solution that supports the creation of consultation rules based on a visual interface and the generation of consultation templates based on the content in the visual interface. Figure 1 A schematic diagram of a visual interface for editing a consultation template according to some embodiments of the present invention is shown. Figure 1 As shown, the visualization interface contains nodes and connections; 11 is a node, and 12 is a connection. In the visualization interface, each node has one or more upstream and downstream ports, and each port is connected to the ports of other nodes via connections. Nodes include question nodes and operation nodes. Each downstream port of a question node corresponds to a candidate answer. Upstream and downstream refer to the relative execution order of questions when the user executes the pre-diagnosis process. For example, node 13 is the upstream node of node 11, 111 is the upstream port of node 11, and 112 is the downstream port of node 11.

[0040] In some embodiments, in response to a user adding a node, a node object is created and the created node is displayed in the visualization interface; in response to a user connecting nodes, a connection object is created and the created connection is displayed between the connected nodes in the visualization interface.

[0041] Figure 2 A flowchart illustrating a method for generating template files according to some embodiments of the present invention is shown. Figure 2 As shown, the template file generation method in this embodiment includes steps S202 to S208.

[0042] In step S202, the nodes and connections in the visualization interface are obtained.

[0043] In some embodiments, node objects and connection objects are predefined. When the user runs the visual interface, the nodes and connections created in the interface exist as instances of objects in the background program logic.

[0044] In step S204, a node list is generated, wherein the node list includes information about one or more nodes, and the information about each node includes the node's attributes and the connections to which the node is connected.

[0045] In some embodiments, the attributes of a problem node include problem information. Additionally, the node type may also be included.

[0046] In some embodiments, the attributes of an operation node include the operation type of the operation node, which includes logical type and operational type. Logical type, for example, corresponds to operations such as AND, OR, XOR, and branching (if...else...); operational type, for example, includes operations such as greater than, less than, equal to, not equal to, and contain.

[0047] In some embodiments, node information includes input dictionary attributes and output dictionary attributes. Input dictionary attributes include the node's upstream port and the identifiers of the connections it is connected to. Output dictionary attributes include the node's downstream port and the identifiers of the connections it is connected to. For example, a node's input dictionary attribute might be "input:{2:connection1}", indicating that its upstream port 2 is connected to connection1; a node's output dictionary attribute might be "output:{1:connection2}", indicating that its downstream port 1 is connected to connection2.

[0048] In step S206, a connection list is generated, wherein the connection list includes the nodes and ports connected to each of one or more connections.

[0049] In some embodiments, each connection has a reference attribute of the upstream node to which the connection is connected, a port identifier of the upstream node to which the connection is connected, a reference attribute of the downstream node to which the connection is connected, and a port identifier of the downstream node to which the connection is connected.

[0050] By associating upstream and downstream nodes through references in the connection information, it is possible to avoid adjusting the information of the connected nodes when the information of the nodes themselves changes, thereby improving flexibility and development efficiency.

[0051] By generating a list of nodes and a list of connections, the logical relationships between nodes and connections in the visualization interface can be automatically generated.

[0052] In step S208, the node list and the connection list are serialized to generate a consultation template file.

[0053] During the operation of the visualization interface, nodes, connections, and the two lists are all accessible. However, once the visualization interface finishes running, the nodes, connections, and lists, which exist as object instances, are likely to be deleted. Therefore, by performing serialization, a storable and readable consultation template file can be generated. For example, it can be stored as a text file. In the text file, each type of information (such as question, type, port number, etc.) and its content can be presented in key-value pairs or field-value pairs.

[0054] In some embodiments, the node list and the connection list are stored as strings in JSON format. For example, all nodes in the node list are retrieved, along with the position of each node in the visualization interface, and each node is assigned a random, unique ID index. Additionally, information such as the node type and name can be retrieved. All connections and their attributes are retrieved from the connection list. This information is then saved in a text format such as JSON.

[0055] Using the methods described in the above embodiments, users can edit the consultation logic within a visual interface, making the template development process more convenient and intuitive. Furthermore, for the logic defined by the user in the visual interface, a template file containing the connection relationships between nodes and lines can be automatically generated, thereby improving development efficiency.

[0056] In some embodiments, the consultation template file is deserialized to generate nodes and connections in a visual interface, allowing users to browse the consultation template or edit the source consultation template as needed. See below for reference. Figure 3 An example of a deserialization processing method is described.

[0057] Figure 3 A flowchart illustrating a deserialization process according to some embodiments of the present invention is shown. Figure 3 As shown, the deserialization processing method of this embodiment includes steps S302 to S306.

[0058] In step S302, the read consultation template file is converted into one or more node lists and one or more connection lists.

[0059] For example, deserialization logic can be used to convert JSON-formatted text files into a list that can be parsed by a program with a visual interface.

[0060] In step S304, an instance of a node is created based on the information of each node in the node list and displayed in the visualization interface.

[0061] In step S306, an instance of a connection is created based on the information of each connection in the connection list, and each connection is used to connect the corresponding nodes in the visualization interface.

[0062] Since the consultation template file records the logical relationship between nodes and connections, the above embodiment can restore the persistently stored consultation template file into visual information, thereby facilitating users to edit the consultation logic and improving the flexibility and efficiency of consultation template development.

[0063] In some embodiments, the node list only stores the node's connection information, basic structure, and basic information, while the text of the candidate answer corresponding to each port is stored in the question configuration file. When restoring the consultation template file to the visualization interface, the node list corresponding to the consultation template file and the question configuration file can be combined to completely restore the nodes.

[0064] An example snippet of the issue configuration file is shown below.

[0065]

[0066]

[0067] In the above snippet of the problem configuration file, the first field "14" represents the content corresponding to node 14, the "suggestDesc" field represents the problem, and the "option" field represents the candidate answers. See the visualization results for this consultation template snippet. Figure 1 Node 14.

[0068] In some embodiments, the process of displaying nodes in the visualization interface includes: reading a list of nodes; reading a question configuration file, wherein the question configuration file includes one or more questions and candidate answers for each question; creating an instance of a node based on each question in the node list and the information corresponding to the question in the question configuration file, and displaying it in the visualization interface.

[0069] By storing the node list and problem configuration file separately, the amount of information in the node list can be reduced, allowing it to store only the basic information and logical connection information of the nodes, thereby improving the calculation speed during the operation of the visualization interface.

[0070] If needed, those skilled in the art may also choose to store the information in the problem configuration file into a node list, which will not be elaborated here.

[0071] In some embodiments, when the location information of nodes is missing in the consultation template file and the problem configuration file, the nodes and connections are automatically restored to the visual interface through layout. See below for reference. Figure 4 An example of a method for visualizing interface layout is described.

[0072] Figure 4 A flowchart illustrating a layout method for a visual interface according to some embodiments of the present invention is shown. Figure 4 As shown, the layout method of the visual interface in this embodiment includes steps S402 to S408.

[0073] In step S402, a graph structure of the nodes in the node list is constructed based on the information of each connection in the connection list. The graph structure is a structure composed of nodes and edges. The nodes of the graph correspond to the nodes corresponding to the problem in this invention. If two nodes are connected by a connection in the visualization interface, then there is an edge between the corresponding two nodes in the graph structure.

[0074] In step S404, the depth of each node in the graph structure is calculated based on the starting node, where the starting node is the node corresponding to the first problem.

[0075] The starting node is the node corresponding to the first problem. The depth of each node can be represented by the number of edges it traverses to the starting node.

[0076] In some embodiments, in a graph structure, if there are multiple paths from the starting node to a certain node, the depth of the node is determined based on the longest path. For example, the depth of the node is determined by the number of edges included in the longest path.

[0077] In step S406, the horizontal coordinate of each node in the visualization interface is determined based on the depth of each node and the pre-configured node size and spacing, wherein the horizontal coordinate of the node is positively correlated with the depth of the node.

[0078] In some embodiments, nodes at the same depth have the same x-coordinate, and as the depth increases, the x-coordinates of nodes at different depths increase sequentially. The difference in x-coordinates between nodes at adjacent depths is, for example, the sum of a pre-configured node width and spacing.

[0079] Therefore, the nodes do not overlap in the horizontal direction.

[0080] In step S408, the ordinate of each node is determined such that each node does not overlap in the longitudinal direction.

[0081] For example, the ordinate of each node is determined sequentially in a preset order, and the difference between the ordinates of two adjacent nodes is the sum of the pre-configured node height and spacing.

[0082] By using the methods described in the above embodiments, when the location information of nodes is missing, for example, by using artificial intelligence or by manually editing indented text to automatically generate the logical relationship between nodes, the above embodiments can be used to achieve a reasonable layout of nodes in the visual interface, thereby improving the efficiency of developing consultation templates.

[0083] In some embodiments, the graph structure is also used for logical detection of the consultation template. During the design of the consultation template, logical design errors may occur, resulting in logical rules with loops. This can cause users to repeatedly answer the same questions during use. To avoid this problem, in some embodiments, a graph structure is first constructed with reference to step S402, and this graph is a directed graph. Then, the following algorithm process is executed:

[0084] 1. Use the breadth-first graph traversal algorithm to calculate the in-degree of 3 for each node;

[0085] 2. Remove all identified nodes with an in-degree of 0 from the graph structure, and remove the edges between those nodes that affect other nodes;

[0086] 3. Repeat steps 1 and 2 until all nodes have been deleted or no node with an in-degree of 1 can be found;

[0087] 4. If all nodes are deleted, it means that there is no loop in the consultation template; if nodes still exist, it means that the remaining nodes form a loop.

[0088] This improves the usability of the consultation template, thereby increasing development efficiency.

[0089] Some implementations also support converting pre-formatted text into problem configuration files and consultation template files.

[0090] The pre-formatted text includes question text and candidate answer text, distinguished by different markers (e.g., color or special identifiers). Each candidate answer text is linked to the corresponding question text on the next line; that is, selecting a candidate answer jumps to the question on the next line. Multiple candidate answers to the same question that are linked to different questions have the same indentation. The indentation of the candidate text for each question is greater than the indentation of the question text. An example of the pre-formatted text can be found here. Figure 5 .For example, Figure 5 The fifth line of the question, “(Single Choice) Do you experience seeing things spinning, floating, or swaying?” is a single choice question. If the answer to this question is “Yes,” the next question is “(Multiple Choice) Okay, do you experience the following discomforts during an attack?”; if the answer is “No,” the next question is “(Multiple Choice) In addition to dizziness, do you also experience the following symptoms?”

[0091] In some embodiments, text with a preset format is converted into a tree structure based on indentation. If text with the same indentation is considered the same "level," then each lower-level text is considered a branch, or child node, of the upper-level text. A depth-first search is used to traverse all questions and options in the tree structure. Based on the option information in the child nodes of the questions, a question configuration file is generated. Then, a depth-first search is used to traverse the tree starting from the first question. During the traversal, the child nodes of a candidate answer to the current question can be identified, i.e., the next question corresponding to the candidate answer, thus establishing connections between question nodes. This yields a list of nodes and a list of connections, which can then be used to generate a consultation template file.

[0092] The above embodiments allow users to edit initial questions, answers, and logical relationships using text, improving the applicability of consultation template development. Furthermore, after generating the question configuration file and consultation template file, they can be imported into a visual interface for further refinement.

[0093] In some embodiments, after a consultation template file is built, a pre-consultation interface for the user can be dynamically generated based on the file when the template file is put into use. See below for reference. Figure 6 This invention describes an embodiment of the pre-consultation interface generation method.

[0094] Figure 6 A flowchart illustrating a method for generating a pre-consultation interface according to some embodiments of the present invention is shown. Figure 6 As shown, the pre-consultation interface generation method of this embodiment includes steps S602 to S606.

[0095] In step S602, the first consultation interface is generated based on the question and its corresponding candidate answer in the first node of the consultation template file.

[0096] If candidate answers are not stored in the consultation template file, they are retrieved from the question configuration file.

[0097] The consultation interface may be a standalone page or a separate module within a page.

[0098] In step S604, based on the candidate answer selected by the user in the previous consultation interface, the next node connected to the port of the candidate answer is found in the consultation template file.

[0099] In step S606, the next consultation interface is generated based on the question in the next node and its corresponding candidate answers.

[0100] Steps S604 and S606 can be repeated until the end node is reached. The end node has no downstream nodes.

[0101] The method described in the above embodiments allows for dynamic pre-diagnosis based on the consultation template and the user's selection of candidate answers. This eliminates the need for repeatedly developing the pre-diagnosis interface, improving development efficiency.

[0102] The following is for reference. Figure 7 An embodiment of the diagnostic template generation device of the present invention is described.

[0103] Figure 7 A schematic diagram of the structure of the apparatus for generating a consultation template according to some embodiments of the present invention is shown. For example... Figure 7 As shown, the consultation template generation device 70 of this embodiment includes: an acquisition module 710, configured to acquire nodes and connections in a visualization interface, wherein in the visualization interface, a node has one or more upstream ports and downstream ports, and each port is connected to the ports of other nodes through a connection; the nodes include question nodes and operation nodes, and each downstream port of the question node corresponds to a candidate answer; a node list generation module 720, configured to generate a node list, wherein the node list includes information of one or more nodes, and the information of each node includes the node's attributes and the connections to the node; a connection list generation module 730, configured to generate a connection list, wherein the connection list includes information of one or more connections, and the information of each connection includes the node and port to which the connection is connected; and a serialization processing module 740, configured to serialize the node list and the connection list to generate a consultation template file.

[0104] In some embodiments, the attributes of a problem node include problem information; and the attributes of an operation node include the operation type of the operation node, wherein the operation type includes logical type and operational type.

[0105] In some embodiments, the node information includes input dictionary attributes and output dictionary attributes. The input dictionary attributes include the identifiers of the node's upstream ports and the connections they are connected to, and the output dictionary attributes include the identifiers of the node's downstream ports and the connections they are connected to.

[0106] In some embodiments, each connection has a reference attribute of the upstream node to which the connection is connected, a port identifier of the upstream node to which the connection is connected, a reference attribute of the downstream node to which the connection is connected, and a port identifier of the downstream node to which the connection is connected.

[0107] In some embodiments, the generation apparatus 70 further includes: a visualization module 750, configured to convert the read consultation template file into one or more node lists and one or more connection lists; create an instance of a node based on the information of each node in the node list and display it in the visualization interface; create an instance of a connection based on the information of each connection in the connection list and connect the corresponding node using each connection in the visualization interface.

[0108] In some embodiments, the visualization module 750 is further configured to construct a graph structure of nodes in the node list based on the information of each connection in the connection list; calculate the depth of each node in the graph structure based on the starting node, wherein the starting node is the node corresponding to the first problem; determine the horizontal coordinate of each node in the visualization interface based on the depth of each node and the pre-configured node size and spacing, wherein the horizontal coordinate of the node is positively correlated with the depth of the node; and determine the vertical coordinate of each node such that each node does not overlap in the vertical direction.

[0109] In some embodiments, the visualization module 750 is further configured to read a node list; read a question configuration file, wherein the question configuration file includes one or more questions and candidate answers for each question; create an instance of a node based on each question in the node list and the information corresponding to the question in the question configuration file, and display it in the visualization interface.

[0110] In some embodiments, the generation apparatus 70 further includes: a creation module 760, configured to create a node object and display the created node in a visualization interface in response to a user's node addition operation; or, to create a connection object and display the created connection between the connected nodes in a visualization interface in response to a user's node connection operation.

[0111] In some embodiments, the generation device 70 further includes: a consultation module 770, configured to generate a first consultation interface based on the question and its corresponding candidate answer in the first node of the consultation template file; to find the next node connected to the port of the candidate answer selected by the user in the previous consultation interface, and to generate a next consultation interface based on the question and its corresponding candidate answer in the next node.

[0112] Figure 8 A schematic diagram of a device for generating a consultation template according to other embodiments of the present invention is shown. Figure 8 As shown, the consultation template generation apparatus 80 of this embodiment includes: a memory 810 and a processor 820 coupled to the memory 810. The processor 820 is configured to execute the consultation template generation method of any of the foregoing embodiments based on instructions stored in the memory 810.

[0113] The memory 810 may include, for example, system memory, fixed non-volatile storage media, etc. The system memory may store, for example, the operating system, application programs, boot loader, and other programs.

[0114] Figure 9A schematic diagram of a device for generating a consultation template according to some embodiments of the present invention is shown. Figure 9 As shown, the consultation template generation device 90 of this embodiment includes a memory 910 and a processor 920, and may also include an input / output interface 930, a network interface 940, a storage interface 950, etc. These interfaces 930, 940, 950, and the memory 910 and processor 920 can be connected, for example, via a bus 960. The input / output interface 930 provides a connection interface for input / output devices such as a display, mouse, keyboard, and touchscreen. The network interface 940 provides a connection interface for various networked devices. The storage interface 950 provides a connection interface for external storage devices such as SD cards and USB flash drives.

[0115] Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements any of the aforementioned methods for generating a consultation template.

[0116] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0117] This 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 should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0118] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0119] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating a template file, comprising: Obtain nodes and connections in a visualization interface, wherein each node in the visualization interface has one or more upstream ports and downstream ports, and each port is connected to the ports of other nodes through connections. The nodes include question nodes and operation nodes, and each downstream port of the question node corresponds to a candidate answer. A node list is generated, wherein the node list includes information about one or more nodes, and the information of each node includes the node's attributes and the connections to which the node is connected. The attributes of the question node include question information. The node list only stores the connection information, basic structure, and basic information of the nodes. The text of the candidate answer corresponding to each port of the node is stored in the question configuration file. The question configuration file is generated based on a text in a preset format that includes the question text and the candidate answer text. The node information includes input dictionary attributes and output dictionary attributes. The input dictionary attributes include the identifiers of the upstream port of the node and the connections to which it is connected. The output dictionary attributes include the identifiers of the downstream port of the node and the connections to which it is connected. Generate a connection list, wherein the connection list includes information about one or more connections, and the information about each connection includes the node and port to which the connection is connected; and The node list and the connection list are serialized to generate a consultation template file. In the process of restoring the consultation template file to the visualization interface, the nodes are restored by combining the node list and the problem configuration file corresponding to the consultation template file.

2. The generation method according to claim 1, wherein: The attributes of the operation node include the operation type of the operation node, which includes logical type and operation type.

3. The generation method according to claim 1, wherein, Each connection has a reference attribute for the upstream node it connects to, a port identifier for the upstream node it connects to, a reference attribute for the downstream node it connects to, and a port identifier for the downstream node it connects to.

4. The generation method according to claim 1 further includes: Convert the read consultation template file into a list of one or more nodes and a list of one or more connections; An instance of the node is created based on the information of each node in the node list and displayed in the visualization interface; Create an instance of the connection based on the information of each connection in the connection list, and use each connection to connect the corresponding nodes in the visualization interface.

5. The generation method according to claim 4, wherein creating an instance of a node based on the information of each node in the node list and displaying it in the visualization interface includes: Based on the information of each connection in the connection list, construct a graph structure of the nodes in the node list; Based on the starting node, calculate the depth of each node in the graph structure, where the starting node is the node corresponding to the first problem; Based on the depth of each node and the pre-configured node size and spacing, the horizontal coordinate of the node in the visualization interface is determined, wherein the horizontal coordinate of the node is positively correlated with the depth of the node; Determine the ordinate of each node so that no nodes overlap in the vertical direction.

6. The generation method according to claim 4, wherein, The step of creating an instance of a node based on the information of each node in the node list and displaying it in the visualization interface includes: Read the list of nodes; Read the question configuration file, which includes one or more questions and candidate answers for each question; Based on each issue in the node list and the corresponding information for that issue in the issue configuration file, an instance of the node is created and displayed in the visualization interface.

7. The generation method according to claim 1, further comprising: In response to a user's node addition operation, a node object is created and the created node is displayed in the visualization interface; or, In response to a user's node connection operation, a connection object is created and the created connection is displayed between the connected nodes in the visualization interface.

8. The generation method according to claim 1, further comprising: The first consultation interface is generated based on the question and its corresponding candidate answer in the first node of the consultation template file; Based on the candidate answer selected by the user in the previous consultation interface, the next node connected to the port of the candidate answer is found in the consultation template file, and the next consultation interface is generated based on the question and its corresponding candidate answer in the next node.

9. A template file generation apparatus, comprising: The acquisition module is configured to acquire nodes and connections in a visualization interface, wherein in the visualization interface, the node has one or more upstream ports and downstream ports, and each port is connected to the ports of other nodes through connections. The node includes question nodes and operation nodes, and each downstream port of the question node corresponds to a candidate answer. A node list generation module is configured to generate a node list, wherein the node list includes information about one or more nodes, and the information of each node includes the node's attributes and the connections to which the node is connected. The attributes of the question node include question information. The node list only stores the node's connection information, basic structure, and basic information. The text of the candidate answer corresponding to each port of the node is stored in the question configuration file, which is generated based on a preset formatted text including the question text and the candidate answer text. The node information includes input dictionary attributes and output dictionary attributes. The input dictionary attributes include the identifiers of the upstream port of the node and the connections to which it is connected. The output dictionary attributes include the identifiers of the downstream port of the node and the connections to which it is connected. A connection list generation module is configured to generate a connection list, wherein the connection list includes information about one or more connections, and the information about each connection includes the node and port to which the connection is connected; and The serialization processing module is configured to serialize the node list and the connection list to generate a consultation template file. In the process of restoring the consultation template file to the visualization interface, the nodes are restored by combining the node list corresponding to the consultation template file and the problem configuration file.

10. The generating apparatus according to claim 9, further comprising: The visualization module is configured to convert the read consultation template file into a list of one or more nodes and a list of one or more connections; Instances of nodes are created based on the information of each node in the node list and displayed in the visualization interface; instances of connections are created based on the information of each connection in the connection list, and each connection is used to connect the corresponding nodes in the visualization interface.

11. The generating apparatus according to claim 9, further comprising: The creation module is configured to create node objects and display the created nodes in the visualization interface in response to a user's node addition operation. Alternatively, in response to a user's node connection operation, a connection object is created and the created connection is displayed between the connected nodes in the visualization interface.

12. The generating apparatus according to claim 9, further comprising: The consultation module is configured to generate the first consultation interface based on the question and its corresponding candidate answer in the first node of the consultation template file; Based on the candidate answer selected by the user in the previous consultation interface, the next node connected to the port of the candidate answer is found in the consultation template file, and the next consultation interface is generated based on the question and its corresponding candidate answer in the next node.

13. A template file generation apparatus, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute a method for generating a template file as described in any one of claims 1 to 8 based on instructions stored in the memory.

14. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating a template file according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Flow chart creation method and system, flow chart display method and system and storage medium

    CN109816754A

  • Authoring knowledge-based systems using interactive directed graphs

    US5673369A