Visual and-or graph construction method and device, medium and equipment
By highlighting AND/OR graph nodes on the front end and supporting breakpoint settings, the visualization method solves the problem that developers find it difficult to quickly locate program errors and optimize performance during AND/OR graph development, thus achieving efficient program debugging and monitoring.
Patent Information
- Application Number
- CN202410536297.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-11-04
AI Technical Summary
In the process of developing intelligent agents based on AND-OR graphs, developers need to view tedious log records, making it difficult to quickly determine the program's execution path, locate program errors and defects, optimize performance, and monitor program status.
By configuring the execution script and AND-OR graph data structure of the intelligent agent in the backend, sending it to the frontend, and highlighting the nodes in the frontend according to the execution progress, the system supports node status flowcharts, breakpoint settings, execution control, and monitoring logs, thus realizing the construction of a visual AND-OR graph.
It improves development efficiency, helps developers intuitively identify program paths, locate errors, and optimize performance, thus enhancing the developer experience.
Smart Images

Figure CN120892297A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence and computer information technology, and in particular to a method and device for constructing a visual AND / OR graph, a medium and an apparatus. BACKGROUND
[0002] In the development process of developing an intelligent agent based on an AND / OR graph, the developer needs to view a large amount of and cumbersome log records during debugging, which is very inconvenient. For developers who are new to intelligent agent development, it is difficult to build and debug the AND / OR graph under the command line. How to help the developer quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program has become a technical problem that needs to be solved by those skilled in the art. SUMMARY
[0003] Therefore, the present application aims to solve the technical problem of how to help the developer quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program in the field of artificial intelligence and computer information technology.
[0004] To solve the above technical problems, the embodiment of the present application provides a method for constructing a visual AND / OR graph, comprising: configuring an execution script and an AND / OR graph data structure of an intelligent agent in a back end, and sending the AND / OR graph data structure to a front end, wherein the AND / OR graph data structure comprises nodes and node attributes, and the execution script calls the AND / OR graph data structure when executed; and drawing an AND / OR graph according to the AND / OR graph data structure in the front end, wherein the AND / OR graph is configured to highlight the corresponding nodes according to the execution progress of the execution script.
[0005] In the embodiment of the present application, the AND / OR graph is further configured to display a node state flowchart of the node according to the node attributes of the node in response to clicking on the node, and the node state flowchart is configured to highlight the corresponding state nodes according to the execution progress of the execution script.
[0006] In the embodiment of the present application, the node state flowchart is further configured to obtain a breakpoint instruction of the state node in the back end in response to clicking on the state node, and insert the breakpoint instruction into the execution script, and the execution script is paused when executing to the breakpoint instruction.
[0007] In the embodiment of the present application, the front end displays a breakpoint form, and the state node is added to the breakpoint form display in response to clicking on the state node.
[0008] In the embodiment of the present application, the front end displays a start execution button, and in response to a click on the start execution button, the execution script that is being paused starts to continue execution; when the start execution button is not clicked, after a set time period, the execution script that is being paused starts to continue execution.
[0009] In the embodiment of the present application, the front end displays a monitoring log that is adapted to the execution progress of the and-or graph.
[0010] In the embodiment of the present application, the front end displays a pause and / or stop execution button, and in response to a click on the pause and / or stop execution button, the execution script stops execution.
[0011] Another aspect of the embodiment of the present application provides a construction device of a visual and-or graph, comprising: a generation module, configured to generate an and-or graph data structure according to an execution script of an agent in a back end, and send the and-or graph data structure to a front end, wherein the and-or graph data structure comprises nodes and node attributes; and a drawing module, configured to draw an and-or graph according to the and-or graph data structure in the front end, wherein the and-or graph is configured to highlight corresponding nodes according to execution progress of the execution script.
[0012] Another aspect of the embodiment of the present application provides an electronic device, comprising one or more processors and a storage device, wherein the storage device is configured to store executable instructions, and the executable instructions are configured to implement the method of the embodiment of the present application when executed by the processor.
[0013] Another aspect of the embodiment of the present application provides a computer readable storage medium, storing computer executable instructions, and the instructions are configured to implement the method of the embodiment of the present application when executed by a processor.
[0014] Another aspect of the embodiment of the present application provides a computer program, comprising computer executable instructions, and the instructions are configured to implement the method of the embodiment of the present application when executed.
[0015] In the embodiment of the present application, the execution script and the AND / OR graph data structure of the agent are configured at the backend, and the AND / OR graph data structure is sent to the front end, wherein the AND / OR graph data structure comprises nodes and node attributes, and the execution script calls the AND / OR graph data structure when executed. The front end draws the AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight the corresponding nodes according to the execution progress of the execution script. Thus, the user of the AND / OR graph, such as a developer, can construct the AND / OR graph on the visualization interface in this simple way of the construction method of the visualization AND / OR graph, and the developer can intuitively see and feel the AND / OR graph constructed by himself, thereby helping the developer to quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program, so that the development efficiency is greatly improved, and the experience of the developer is better.
[0016] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the scope of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0017] The following drawings attached are part of the specification of the present application, which illustrate the example embodiments of the present application, and together with the description of the specification, serve to explain the principles of the present application.
[0018] Figure 1 A flowchart of the construction method of the visualization AND / OR graph according to the embodiment of the present application is schematically shown.
[0019] Figure 2 A schematic diagram of the display content of the front end interface according to the embodiment of the present application is schematically shown.
[0020] Figure 3 A structure block diagram of the construction device of the visualization AND / OR graph according to the embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical scheme and advantages of the embodiments of the present application more clear, the drawings and detailed description will be used to clearly explain the spirit of the present application, and any person skilled in the art can make changes and modifications to the technology taught by the present application without departing from the spirit and scope of the present application.
[0022] The schematic embodiments of the present application and their descriptions are used to explain the present application, but not as a limitation of the present application. In addition, the same or similar reference numerals of elements / components used in the drawings and embodiments are used to represent the same or similar parts.
[0023] The use of "first", "second", etc. herein does not by itself convey any meaning of order or precedence, and is not used to limit the application. The use of "first", "second", etc. is merely to distinguish one element from another.
[0024] The use of directional terms such as "upper", "lower", "left", "right", "front", "back", etc. herein is merely to describe the orientation of the figures as shown and is not used to limit the application.
[0025] The use of "including", "containing", "comprising", "having" and the like herein is open-ended and is intended to permit the inclusion of any item, whether or not it is recited in the specification.
[0026] The use of "and / or" herein is to be taken as a specific interpretation of the inclusion of one or more of the items, whether or not the items are recited in the specification.
[0027] The use of "multiple" herein includes "two" and "more than two"; the use of "multiple groups" herein includes "two groups" and "more than two groups".
[0028] The use of the terms "substantially", "approximately", and the like, are to be construed as permitting a margin of error of no more than a few percent, unless otherwise indicated. The use of the terms "substantially", "approximately", and the like, are to be construed as permitting a margin of error of no more than 20% in some embodiments, no more than 10% in some embodiments, no more than 5% in some embodiments, or other values as appropriate. Those skilled in the art will appreciate that the aforementioned values are provided by way of example and are not intended to be limiting.
[0029] All terms used herein, including technical and scientific terms, have the meaning commonly understood by one of ordinary skill in the art unless otherwise defined. It should be further borne in mind that the
[0030] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should generally be interpreted to include any one of A, B, and C, etc. or a combination thereof, unless otherwise indicated. In the case of using expressions similar to "at least one of A, B, or C, etc.", it should generally be interpreted to include any one of A, B, or C, etc. or a combination thereof, unless otherwise indicated.
[0031] Those skilled in the art will also appreciate that, of essentially any conjunctive term and / or phrase denoting two or more optional items, whether in the specification, claims, or drawings, should be construed to give rise to the possibility that one of the items, either of the items, or both items are included. For example, the phrase "A or B" should be construed to include the possibility of "A", or "B", or "A and B".
[0032] In the development process of developing an agent based on an AND / OR graph, the developer needs to view a large amount of and relatively cumbersome log records during debugging, which is very inconvenient. For developers who are just starting to develop agents, it is difficult to build and debug the AND / OR graph under the command line. How to help developers quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program has become a technical problem that those skilled in the art need to solve.
[0033] Reference is made below to Figures 1-3 A method, apparatus, electronic device, computer readable storage medium and computer program product for visualizing an AND / OR graph are described according to embodiments of the present application.
[0034] Figure 1 A flowchart of a method for visualizing an AND / OR graph according to an embodiment of the present application is schematically shown.
[0035] Figure 2 A schematic diagram of the display content of a front-end interface according to an embodiment of the present application is schematically shown.
[0036] As Figure 1 The method for visualizing an AND / OR graph according to the embodiment includes operation S110 and operation S120.
[0037] In operation S110, the execution script and the AND / OR graph data structure of the agent are configured in the back-end, and the AND / OR graph data structure is sent to the front-end, wherein the AND / OR graph data structure includes nodes and node attributes, and the execution script calls the AND / OR graph data structure when executed.
[0038] In operation S120, the front-end draws the AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight the corresponding nodes according to the execution progress of the execution script.
[0039] It can be understood that the execution script of the agent is a program for controlling the agent to have a value tendency and performing a behavior action, and the AND / OR graph data structure is a data structure capable of representing nodes and node attributes of the AND / OR graph. During execution of the execution script, the AND / OR graph data structure can be called. The AND / OR graph data structure stores, for example, nodes and node attributes of an AND / OR graph for constructing an agent to walk to a table to pick up a water cup and drink water due to thirst. The node attributes are sub-steps for implementing the corresponding nodes. By sending the AND / OR graph data structure to the front end, the front end can visualize the nodes and edges of the AND / OR graph by using, for example, an AND / OR graph visualization plug-in. In the present application, the visualized AND / OR graph of the front end is further configured to visualize the nodes corresponding to the AND / OR graph according to the execution progress of the execution script of the back end.
[0040] According to the method for constructing the visualized AND / OR graph, the execution script of the agent and the AND / OR graph data structure are configured in the back end, and the AND / OR graph data structure is sent to the front end. The AND / OR graph data structure includes nodes and node attributes, and the execution script calls the AND / OR graph data structure during execution. The front end draws the AND / OR graph according to the AND / OR graph data structure. The AND / OR graph is configured to highlight the corresponding nodes according to the execution progress of the execution script. Thus, a user of the AND / OR graph, for example, a developer, can construct the AND / OR graph on a visualized interface in a simple way by using the method for constructing the visualized AND / OR graph of the present application. The developer can intuitively see and feel the AND / OR graph constructed by the developer, which can help the developer to quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program. On this basis, the program of the execution script is debugged, which greatly improves the development efficiency and provides a good experience for the developer.
[0041] According to some embodiments of the present application, as Figure 2 The AND / OR graph is further configured to display a node state flowchart of the node according to the node attributes of the node in response to clicking of the node. The node state flowchart is configured to highlight the corresponding state nodes according to the execution progress of the execution script. It can be understood that the node attributes are sub-steps for implementing the corresponding nodes. In the present application, each node of the AND / OR graph of the front end is linked to the node attributes of the node of the back end. In response to clicking of the node of the AND / OR graph of the front end, the node attributes are transmitted to the front end, which can be visualized as a node state flowchart by using a visualization tool. The node state flowchart can help the developer to more intuitively understand the development progress and execution situation of each node during execution, which facilitates the developer to debug and improve the program and improves the development efficiency.
[0042] According to some embodiments of the present application, the node state flowchart is further configured to, in response to a click on the state node, acquire breakpoint instructions of the state node by the backend, insert the breakpoint instructions into the execution script, and pause the execution of the execution script when the execution of the execution script reaches the breakpoint instructions. Thus, the developer can conveniently set a breakpoint node according to requirements, so as to pause the execution of the program. After the pause, the developer can conveniently perform operations of adding, deleting, modifying and inquiring on the program.
[0043] According to some embodiments of the present application, as shown in Figure 2 the front end displays a breakpoint form, and in response to a click on the state node, the state node is added to the breakpoint form for display. Thus, the developer can clearly see the breakpoint node in the breakpoint list in the front end, so as to better complete the development task.
[0044] According to some embodiments of the present application, as shown in Figure 2 the front end displays a start execution button, and in response to a click on the start execution button, the paused execution script starts to continue execution; when the start execution button is not clicked, after a set time period, the paused execution script starts to continue execution. Thus, when the developer wants to resume the execution of the program, the execution of the program can be resumed by clicking the start execution button. This way is convenient and easy to operate. Of course, the present application can also control the resumption of the execution of the program by setting a time period. The set time period can be set according to actual requirements, and is not specifically limited.
[0045] According to some embodiments of the present application, as shown in Figure 2 the front end displays monitoring logs adapted to the execution progress of the AND-OR graph. Thus, the developer can understand the execution progress of the program through the monitoring logs, so as to facilitate the mining of defects of the program.
[0046] According to some embodiments of the present application, as shown in Figure 2 the front end displays a pause execution button and / or a stop execution button, and in response to a click on the pause execution button and / or the stop execution button, the execution script stops execution. It should be noted that the pause execution button is used to pause the program, and the paused program can continue execution from the paused position in response to a start operation; the stop execution button is used to stop the program, and the stopped program needs to start from the beginning in response to a start operation. Through the pause execution button, the developer can pause the program at any position. Through the stop execution button, the developer can stop the program at any time.
[0047] Figure 3 A structural block diagram of a construction device of a visual AND-OR graph according to some embodiments of the present application is provided.
[0048] As shown in Figure 3As shown, the visualization and construction device 10 of the AND / OR graph can include a generation module 1 and a drawing module 2.
[0049] The generation module 1 is used for the backend, and performs operation S110: generating an AND / OR graph data structure according to an execution script of an agent, and sending the AND / OR graph data structure to the frontend, wherein the AND / OR graph data structure includes nodes and node attributes.
[0050] The drawing module 2 is used for the frontend, and performs operation S120: drawing an AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight corresponding nodes according to an execution progress of the execution script.
[0051] According to the visualization and construction device 10 of the AND / OR graph of the embodiment of the present application, the execution script of the agent is configured in the backend, and the AND / OR graph data structure is sent to the frontend, wherein the AND / OR graph data structure includes nodes and node attributes, and the execution script calls the AND / OR graph data structure when executed. The frontend draws the AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight corresponding nodes according to an execution progress of the execution script. Thus, the AND / OR graph user, such as a developer, can construct the AND / OR graph on the visualization interface in this simple way through the visualization and construction method of the AND / OR graph of the present application, the developer can intuitively see and feel the AND / OR graph constructed by himself, which can help the developer to quickly determine the execution path of the program, locate program errors and defects, optimize performance, and monitor the running state of the program, and on this basis, the program is debugged and the execution script is executed, which greatly improves the development efficiency and the experience of the developer is good.
[0052] In addition, according to the embodiments of the present application, any of the generation module 1 and the drawing module 2 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module.
[0053] According to the embodiments of the present application, at least one of the generation module 1 and the drawing module 2 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of integrating or packaging a circuit, or can be implemented by hardware or firmware, or any one of software, hardware and firmware or a proper combination of any of them.
[0054] Alternatively, at least one of the generating module 1 and the rendering module 2 can be implemented at least in part as a computer program module, which, when executed, can perform the respective function.
[0055] The present application also provides an electronic device comprising: one or more processors; one or more memories storing executable instructions that, when executed by the processor, implement the above method. The electronic device is intended to represent a variety of forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the applications described and / or claimed in this document.
[0056] The device includes a computing unit that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0057] A plurality of components in the device are connected to the I / O interface, including: an input unit, such as a keyboard, a mouse, etc.; an output unit, such as various types of displays, speakers, etc.; a storage unit, such as a magnetic disk, an optical disk, etc.; and a communication unit, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.
[0058] The computing unit can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit performs various methods and processes described above, such as the image recognition method. For example, in some embodiments, the image recognition method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit.
[0059] In some embodiments, part or all of the computer program can be loaded onto and / or installed on the device via the ROM and / or the communication unit. When the computer program is loaded onto the RAM and executed by the computing unit, one or more steps of the image recognition method described above can be performed. Alternatively, in other embodiments, the computing unit can be configured to perform the image recognition method by any other suitable means, for example by means of firmware.
[0060] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip systems (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0061] According to embodiments of the present application, the method flow according to embodiments of the present application can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable storage medium, the computer program comprising program code for implementing the methods illustrated by the flowcharts. According to embodiments of the present application, the electronic device, device, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0062] The present application also provides a computer readable storage medium, which can be contained in the device / apparatus / system described in the above embodiments, or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which, when executed, implement the method according to embodiments of the present application.
[0063] According to embodiments of the present application, the computer readable storage medium can be a non-transitory computer readable storage medium, such as, for example, without limitation, a portable computer diskette, a hard disk, random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0064] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functional processes and operational processes, according to various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0065] Those skilled in the art will understand that features of the various embodiments and / or claims of the present application can be combined or / and integrated with one another, even though such combinations or integrations are not expressly disclosed in the present application. In particular, the features of the various embodiments and / or claims of the present application can be combined and / or integrated with one another in any number of ways, without departing from the spirit and scope of the present application. All such combinations and / or integrations are within the scope of the present application.
[0066] The embodiments of the present application have been described above. However, these embodiments are merely intended to illustrate the present application, and are not intended to limit the scope of the present application. Although the embodiments are described separately above, this does not mean that the measures in the various embodiments cannot be advantageously combined. The scope of the present application is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present application, and such substitutions and modifications should fall within the scope of the present application.
Claims
1. A method of visualizing the construction of an or-map, characterized by, The method comprises: The backend configures an execution script of an agent and an AND / OR graph data structure, and sends the AND / OR graph data structure to the frontend, wherein the AND / OR graph data structure comprises nodes and node attributes, and the execution script calls the AND / OR graph data structure when executed; and The frontend draws an AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight corresponding nodes according to the execution progress of the execution script.
2. The method of constructing a visual AND / OR graph according to claim 1, wherein, The AND / OR graph is further configured to display a node state flowchart of the node according to the node attributes of the node in response to clicking on the node, and the node state flowchart is configured to highlight corresponding state nodes according to the execution progress of the execution script.
3. The method of constructing a visual AND / OR graph according to claim 2, wherein, The node state flowchart is further configured to obtain a breakpoint instruction of the state node by the backend in response to clicking on the state node, and insert the breakpoint instruction into the execution script, and the execution script is paused when executed to the breakpoint instruction.
4. The method of constructing a visual AND / OR graph according to claim 3, wherein, The frontend displays a breakpoint form, and adds the state node to the breakpoint form display in response to clicking on the state node.
5. The method for constructing a visualized AND / OR graph according to claim 3, wherein The frontend displays a start execution button, and the execution script that is paused starts to continue execution in response to clicking on the start execution button; When the start execution button is not clicked, the execution script that is paused starts to continue execution after a set time period.
6. The method of constructing a visual AND / OR graph according to any one of claims 1 to 5, characterized in that, The frontend displays a monitoring log that is adapted to the execution progress of the AND / OR graph.
7. The method of constructing a visual AND / OR graph according to any one of claims 1 to 5, characterized in that, The frontend displays a pause and / or stop execution button, and the execution script stops execution in response to clicking on the pause and / or stop execution button.
8. A device for constructing a visual AND / OR graph, characterized in that, The apparatus comprises: A generation module for the backend to generate an AND / OR graph data structure according to an execution script of an agent, and send the AND / OR graph data structure to the frontend, wherein the AND / OR graph data structure comprises nodes and node attributes; and A drawing module for the frontend to draw an AND / OR graph according to the AND / OR graph data structure, wherein the AND / OR graph is configured to highlight corresponding nodes according to the execution progress of the execution script.
9. An electronic device, comprising: Comprise: One or more processors; One or more memories for storing executable instructions, which, when executed by the processor, implement the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium has stored executable instructions, which, when executed by the processor, implement the method according to any one of claims 1-7.