Intelligent agent code processing method and device, equipment and storage medium
By acquiring the latest program execution logic of the intelligent agent, matching and identifying parsed templates, and utilizing caching to obtain or parse results, the contradiction between dynamism and efficiency in intelligent agent programs is resolved, thereby improving the operational efficiency of financial and medical auxiliary decision-making.
Patent Information
- Application Number
- CN202610052318.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-24
AI Technical Summary
Existing intelligent agent program execution and processing schemes suffer from low execution efficiency while maintaining dynamism. This is especially true in financial business and medical decision support, where compilation and deployment schemes lack flexibility, while runtime dynamic parsing schemes result in a large parsing workload, impacting efficiency.
By obtaining the latest program execution logic of the target agent, matching the program execution logic template, and after identifying whether the template has been parsed, the cache is used to obtain or parse the result to avoid repeated parsing, and the agent is converted into an executable form to run.
It improves the operational efficiency of intelligent agent programs, reduces program construction costs, and enhances the processing efficiency of financial transactions and medical decision support.
Smart Images

Figure CN121722388A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of program management technology, and is applied to the scenario of storing and managing the execution programs of intelligent agents. It relates to an intelligent agent code processing method, device, equipment and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, intelligent agent technology has been widely used in various fields, such as the automated processing of financial business. However, at present, most application industries mainly have two types of solutions for the operation and processing mechanism of intelligent agent programs: intelligent agent program operation and processing solution based on compilation and deployment, and intelligent agent operation and processing solution based on runtime dynamic parsing.
[0003] Firstly, the intelligent agent program execution and processing scheme based on compilation and deployment refers to first compiling the intelligent agent program, then deploying it, and finally running the corresponding intelligent agent code to handle related business after deployment. Secondly, the intelligent agent execution and processing scheme based on runtime dynamic parsing does not require static compilation, allowing users to dynamically define the intelligent agent's behavioral logic at runtime by passing templates, code snippets, or scripts, such as the Ping An Property & Casualty Insurance Kunpeng Intelligent Agent Platform. The former lacks dynamism and flexibility. Because the processes involved in financial business are relatively complex and the types of financial business are diverse and changeable, each modification to the business logic requires recompilation and deployment, causing the target intelligent agent to be unable to keep up with business changes, resulting in untimely processing of financial business programs. The latter requires parsing the program logic each time it is executed. The parsing task involved in financial business programs is large, and over time, the financial processing intelligent agent will experience low operating efficiency due to the increased parsing tasks. Therefore, how to maintain the runtime dynamism of intelligent agent programs while significantly improving their execution efficiency has become an urgent technical challenge. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, device and storage medium for processing intelligent agent code, so as to significantly improve the execution efficiency while maintaining the dynamic nature of the intelligent agent program during runtime.
[0005] In a first aspect, embodiments of this application provide a method for processing intelligent agent code, which adopts the following technical solution: A method for processing agent code includes the following steps: Obtain the latest program execution logic after it has been dynamically defined by the target intelligent agent; Based on the latest program execution logic, a program execution logic template to be identified is matched; A comparison and identification method is used to identify whether the program execution logic template to be identified is a program execution logic template that has been parsed previously; If the program execution logic template to be identified is a program execution logic template that has been parsed in the past, then the corresponding previous parsing result is obtained from the preset cache space as the target parsing result. If the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, then the program execution logic template to be identified is parsed according to the preset parsing method to obtain the target parsing result; When a program execution processing instruction is received for a target intelligent agent, the target parsing result is converted into an executable target form to obtain the target form conversion result; The target agent is run based on the transformation result of the target form and the pre-defined dynamic program running parameters.
[0006] Secondly, embodiments of this application also provide an intelligent agent code processing device, which adopts the following technical solution: An intelligent agent code processing device, comprising: The latest program execution logic acquisition module is used to acquire the latest program execution logic after it has been dynamically defined by the target intelligent agent. The program execution logic template matching module is used to match the program execution logic template to be identified based on the latest program execution logic; The comparison and identification module is used to identify whether the program execution logic template to be identified is a program execution logic template that has been parsed in the past by using a comparison and identification method. The first module for obtaining the target parsing result is used to obtain the corresponding prior parsing result from the preset cache space as the target parsing result if the program execution logic template to be identified is a previously parsed program execution logic template. The second target parsing result acquisition module is used to parse the program execution logic template to be identified according to a preset parsing method if it is identified that the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, and obtain the target parsing result. The target parsing result conversion module is used to convert the target parsing result into an executable target form when it receives a program execution processing instruction for a target intelligent agent, thereby obtaining a conversion result in the target form; The target agent running module is used to run the target agent according to the conversion result of the target form and the pre-defined dynamic program running parameters.
[0007] Thirdly, embodiments of this application also provide a computer device that adopts the technical solution described below: A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the intelligent agent code processing method described above.
[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium, which adopts the technical solutions described below: A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the intelligent agent code processing method described above.
[0009] Compared with the prior art, the embodiments of this application have the following main advantages: The intelligent agent code processing method described in this application can be widely applied in the field of artificial intelligence technology. It involves: acquiring the latest program execution logic dynamically defined by the target intelligent agent; matching the program execution logic template to be identified; identifying whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, acquiring the corresponding previously parsed result as the target parsing result; if not, parsing the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result; when receiving a program execution processing instruction for the target intelligent agent, converting the target parsing result into an executable target form; and running the target intelligent agent according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing can be avoided, and the parsing results can be reused reasonably. This can effectively improve the screening and operation efficiency of target intelligent agents. For example, in scenarios where intelligent AI processing models are used to replace manual task decision-making and machine operation, especially in financial application scenarios, this intelligent agent code processing method can be used to convert several pre-trained intelligent agents into corresponding parsing results for caching. In subsequent actual use, only the parsing results need to be obtained for executable format conversion and program execution parameters supplementation to achieve repeated calling and use of the target intelligent agent. This avoids rebuilding the business program for complex financial business scenarios every time, reducing program building costs to a certain extent, and also significantly improving the efficiency of financial business processing. In the field of health and medical applications, especially in medical decision support, such as identifying the cause and lesion based on medical images, several pre-trained image recognition agents can be converted into corresponding parsing results and cached. In subsequent actual use, it is only necessary to obtain the parsing results, convert them into executable formats, and supplement the program running parameters to achieve repeated calling and use of the target agent, thereby improving the efficiency of medical decision support. Attached Figure Description
[0010] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is an exemplary system architecture diagram to which this application can be applied; Figure 2 This is a flowchart of an embodiment of an intelligent agent code processing method according to this application; Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 202 shown; Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 203 shown; Figure 5 yes Figure 2 A flowchart of a specific embodiment of step 205 shown; Figure 6 yes Figure 2 A flowchart of a specific embodiment of step 207 shown; Figure 7 This is a schematic diagram of a structure of an embodiment of an intelligent agent code processing device according to this application; Figure 8 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0012] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0013] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0014] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0015] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Terminal device 101 may be a laptop 1011, tablet 1012, or mobile phone 1013. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables.
[0016] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0017] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.
[0018] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.
[0019] It should be noted that the intelligent agent code processing method provided in this application embodiment is generally executed by a server, and correspondingly, an intelligent agent code processing device is generally set in the server.
[0020] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0021] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of an agent code processing method according to this application. The agent code processing method includes the following steps: Step 201: Obtain the latest program execution logic after dynamic definition by the target intelligent agent.
[0022] In this embodiment, the target intelligent agent includes an intelligent AI model that performs automated program processing, and also includes an AI processing component that performs intelligent program execution. In this embodiment, the dynamic definition includes dynamically setting the execution order of the static program source code that has been compiled first, such as setting the execution priority of different branches and the execution connection relationship between different branches, as well as setting the corresponding program running parameters and function call parameters for the static program source code that has been compiled first.
[0023] By obtaining the latest program execution logic after the target agent is dynamically defined, it is convenient to use the latest program execution logic to batch deploy and generate the target agent in a replication generation mode.
[0024] Step 202: Match the program execution logic template to be identified based on the latest program execution logic.
[0025] In this embodiment, the program execution logic template refers to a code execution logic template generated in advance by various combinations of program execution order, conditional filtering relationship, loop recursion relationship, etc.
[0026] Step 203: Using a comparison and identification method, identify whether the program execution logic template to be identified is a program execution logic template that has been parsed previously.
[0027] Step 204: If the program execution logic template to be identified is a program execution logic template that has been parsed in the past, then the corresponding previous parsing result is obtained from the preset cache space as the target parsing result.
[0028] Step 205: If the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, then the program execution logic template to be identified is parsed according to the preset parsing method to obtain the target parsing result.
[0029] In this embodiment, after obtaining the latest program execution logic dynamically defined by the target agent, the program execution logic template matching the latest program execution logic is first determined, i.e., the program execution logic template to be identified is determined. Then, a comparison identification method is used to identify whether the program execution logic template to be identified has been parsed before. If it has been parsed before, the previous parsing result is directly reused, saving the template parsing step in this instance. If it has not been parsed before, the program execution logic template to be identified is parsed again. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing is avoided, and parsing results are reused reasonably, effectively improving the efficiency of obtaining the parsing results in this instance.
[0030] Step 206: When a program execution processing instruction for a target agent is received, the target parsing result is converted into an executable target form to obtain a conversion result of the target form, wherein the executable target form is a syntax tree form.
[0031] Specifically, the target parsing result is in a format suitable for storing intelligent agent programs. When a program execution processing instruction is received for the target intelligent agent, the target parsing result needs to be converted from the format for storing intelligent agent programs into an executable target form so that the target intelligent agent can more quickly understand and identify the program processing logic.
[0032] Step 207: Run the target agent according to the conversion result of the target form and the pre-defined dynamic program running parameters.
[0033] Specifically, since the conversion result of the target form is converted from the program execution logic template corresponding to the latest program execution logic, it is necessary to supplement the pre-defined dynamic program execution parameters before the actual operation to support the intelligent and automated operation of the target intelligent agent.
[0034] In this embodiment, the intelligent agent code processing method can be widely applied in the field of artificial intelligence technology. For example, it can be used in scenarios where intelligent AI processing models replace manual task decision-making and machine operation. Particularly in financial applications, this method can convert several pre-trained intelligent agents into corresponding parsing results for caching. In subsequent use, only the parsing results need to be obtained for executable format conversion and program running parameters supplementation to achieve repetitive calling and use of the target intelligent agent. This avoids rebuilding the business program for complex financial business scenarios each time, reducing program building costs and significantly improving the efficiency of financial business processing. In the field of health and medical applications, especially in medical decision support, such as identifying the cause and lesion based on medical images, several pre-trained image recognition intelligent agents can also be converted into corresponding parsing results for caching. In subsequent use, only the parsing results need to be obtained for executable format conversion and program running parameters supplementation to achieve repetitive calling and use of the target intelligent agent, improving the efficiency of medical decision support.
[0035] In this embodiment, the following steps are taken: First, the latest program execution logic, dynamically defined by the target agent, is obtained. Then, a program execution logic template to be identified is matched. Next, it is determined whether the template has been previously parsed. If so, the corresponding previously parsed result is obtained as the target parsing result. If not, the template is parsed according to a preset parsing method to obtain the target parsing result. Upon receiving a program execution processing instruction for the target agent, the target parsing result is converted into an executable target form. Finally, the target agent is run based on the converted target form and pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and considering the actual parsing situation, duplicate parsing is avoided, and parsing results are reused appropriately, effectively improving the screening and execution efficiency of the target agent.
[0036] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 202 shown includes: Step 301: Based on the dynamic definition log of the target agent, identify the program execution parameters that the target agent pre-defined dynamically in the latest program execution logic; Specifically, the program execution parameters refer to the data passed to the program that do not affect the overall structure of the program execution logic template, but only affect the specific implementation of the program execution. For example, in a certain program execution logic template, after condition judgment, the first branch processing adopts a cyclic sorting method, and the second branch processing adopts a clustering filtering method. Here, the program execution parameters only refer to the parameters of condition judgment, the number of loops in the cyclic sorting process, the sorting rule parameters, etc. Although the program execution parameters are identified, the overall structure of the program execution logic template is still a pattern of first performing condition judgment and then performing branch processing.
[0037] Step 302: Delete or blank the program running parameters to obtain program running logic source code that does not contain the program running parameters; Specifically, by deleting or blanking the program execution parameters, program execution logic source code without the program execution parameters is obtained. This enables multiple agents to reuse the same program execution logic template due to different program execution parameters, avoiding interference from program execution parameters and accurately identifying the program execution logic template.
[0038] Step 303: Based on the program execution logic source code that does not contain the program execution parameters, select a suitable program execution logic template from the pre-collected program execution logic template library, and use it as the program execution logic template to be identified.
[0039] Specifically, corresponding program execution logic templates are generated in advance in the program execution logic template library based on the program execution logic source code that does not contain program execution parameters. This facilitates the subsequent selection of program execution logic templates from the program execution logic template library. The program execution logic template can be the program execution logic source code that does not contain program execution parameters, or it can be a unique identifier corresponding to the program execution logic source code that does not contain program execution parameters. No special limitation is made here.
[0040] Continue to refer to Figure 4 , Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 203 shown includes: Step 401: Calculate the MD5 hash value of the program execution logic template to be identified; Specifically, since the MD5 algorithm supports arbitrary input data, the program execution logic template to be identified can be directly input into the MD5 encryption algorithm component to obtain the MD5 hash value of the program execution logic template to be identified.
[0041] Step 402: Input the MD5 hash value into the cache library corresponding to the previously parsed program execution logic template for index retrieval; Specifically, the cache library corresponding to the previously parsed program execution logic templates pre-caches a large number of template parsing results corresponding to the previously parsed program execution logic templates.
[0042] Step 403: If the search result is empty, the program execution logic template to be identified is a program execution logic template that has not been parsed in the past. Step 404: If the search result is not empty, then the program execution logic template to be identified is a program execution logic template that has been parsed in the past.
[0043] Specifically, if the program execution logic template to be identified, matched based on the latest program execution logic, has already been parsed previously, the search result will be non-empty, and the previously parsed result can be directly obtained and reused. Otherwise, the program execution logic template to be identified has not yet been parsed, and template parsing processing is required for the program execution logic template to be identified.
[0044] Continue to refer to Figure 5 , Figure 5 yes Figure 2 A flowchart of a specific embodiment of step 205 shown includes: Step 501: Parse the program execution logic template to be identified according to the abstract syntax tree parsing method to obtain the abstract syntax tree structure corresponding to the program execution logic template to be identified. Step 502: Based on the node position information, node connection relationship and node hierarchy relationship in the abstract syntax tree structure, perform logical execution serialization on all nodes to obtain a serialized node organization result as the target parsing result.
[0045] In this embodiment, after performing the step of parsing the program execution logic template to be identified according to the preset parsing method to obtain the target parsing result, the method further includes: using the serialized node sorting result as the value and the MD5 hash value as the key to construct a key-value pair parsing cache result corresponding to the program execution logic template to be identified; adding the key-value pair parsing cache result to a preset persistent cache layer for caching processing, wherein the preset persistent cache layer includes a persistent cache layer composed of a Redis caching component.
[0046] After parsing the program execution logic template to be identified according to the preset parsing method and obtaining the target parsing result, the parsing result is cached in the form of key-value pairs. This not only expands the cache library corresponding to the program execution logic template that has been parsed in advance, but also facilitates subsequent identification, filtering and reuse from the persistent cache layer.
[0047] In this embodiment, the step of converting the target parsing result into an executable target form to obtain the target form conversion result specifically includes: deserializing the target parsing result to obtain a syntax tree form conversion result. Specifically, the serialized nodes in the target parsing result are deserialized to construct a syntax tree form conversion result containing node position information, node connection relationships, and node hierarchical relationships.
[0048] In this embodiment, since the target parsing result is a serialized node organization result, it is suitable for intermediate caching of the latest program running logic corresponding to the target agent. The target parsing result is serialized based on the node position information, node connection relationship and node hierarchy relationship in the abstract syntax tree structure. Moreover, the syntax tree form can better reflect the program's running status. Therefore, a deserialization process is adopted to obtain the transformation result in the syntax tree form corresponding to the target parsing result, which facilitates the direct use of the transformation result to run the target agent.
[0049] Continue to refer to Figure 6 , Figure 6 yes Figure 2 A flowchart of a specific embodiment of step 207 shown includes: Step 601: Based on the dynamic definition log of the target intelligent agent, fill the pre-defined dynamic program running parameters into the transformation result in the form of a syntax tree containing node position information, node connection relationship and node hierarchical relationship, and generate a syntax tree with program running parameters. Step 602: Run the target agent according to the syntax tree with program execution parameters.
[0050] In this embodiment, the intelligent agent code processing method can be widely applied in the field of artificial intelligence technology. It involves: acquiring the latest program execution logic dynamically defined by the target intelligent agent; matching the program execution logic template to be identified; identifying whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, obtaining the corresponding previously parsed result as the target parsing result; if not, parsing the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result; when receiving a program execution processing instruction for the target intelligent agent, converting the target parsing result into an executable target form; and running the target intelligent agent according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing is avoided, and parsing results are reused reasonably, effectively improving the screening and execution efficiency of the target intelligent agent.
[0051] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0052] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0053] In this embodiment, the intelligent agent code processing method can be widely applied in the field of artificial intelligence technology. It involves: acquiring the latest program execution logic dynamically defined by the target intelligent agent; matching the program execution logic template to be identified; identifying whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, obtaining the corresponding previously parsed result as the target parsing result; if not, parsing the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result; when receiving a program execution processing instruction for the target intelligent agent, converting the target parsing result into an executable target form; and running the target intelligent agent according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing is avoided, and parsing results are reused reasonably, effectively improving the screening and execution efficiency of the target intelligent agent.
[0054] Further reference Figure 7 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of an intelligent agent code processing device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0055] like Figure 7 As shown, the intelligent agent code processing device 700 described in this embodiment includes: a latest program execution logic acquisition module 701, a program execution logic template matching module 702, a comparison and recognition module 703, a first target parsing result acquisition module 704, a second target parsing result acquisition module 705, a target parsing result conversion module 706, and a target intelligent agent execution module 707. Wherein: The latest program execution logic acquisition module 701 is used to acquire the latest program execution logic after it has been dynamically defined by the target intelligent agent. The program execution logic template matching module 702 is used to match the program execution logic template to be identified based on the latest program execution logic; The comparison and identification module 703 is used to identify, by comparison and identification method, whether the program execution logic template to be identified is a program execution logic template that has been parsed in the past; The first target parsing result acquisition module 704 is used to acquire the corresponding prior parsing result from the preset cache space as the target parsing result if the program execution logic template to be identified is a previously parsed program execution logic template. The second target parsing result acquisition module 705 is used to parse the program execution logic template to be identified according to a preset parsing method if it is identified that the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, and obtain the target parsing result. The target parsing result conversion module 706 is used to convert the target parsing result into an executable target form when receiving a program execution processing instruction for a target intelligent agent, thereby obtaining a conversion result of the target form, wherein the executable target form is a syntax tree form; The target agent running module 707 is used to run the target agent according to the conversion result of the target form and the pre-defined dynamic program running parameters.
[0056] This application improves the efficiency of target intelligence by acquiring the latest program execution logic dynamically defined by the target intelligent agent; matching the program execution logic template to be identified; identifying whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, acquiring the corresponding previously parsed result as the target parsing result; if not, parsing the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result; when receiving a program execution processing instruction for the target intelligent agent, converting the target parsing result into an executable target form; and running the target intelligent agent according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining the actual parsing situation, duplicate parsing is avoided, and parsing results are reused reasonably, effectively improving the screening and running efficiency of the target intelligent agent.
[0057] In this embodiment, the program execution logic template matching module 702 includes a program execution parameter identification unit, a program execution parameter processing unit, and a program execution logic template filtering unit. Wherein: The program execution parameter identification unit is used to identify the program execution parameters that the target intelligent agent has pre-defined dynamically in the latest program execution logic, based on the dynamic definition log of the target intelligent agent. The program execution parameter processing unit is used to delete or blank the program execution parameters to obtain program execution logic source code that does not contain the program execution parameters. The program execution logic template filtering unit is used to filter out suitable program execution logic templates from a pre-collected and organized program execution logic template library based on the program execution logic source code that does not contain the program execution parameters, and use them as the program execution logic templates to be identified.
[0058] In this embodiment, the comparison and recognition module 703 includes an index value calculation unit, an index retrieval unit, a first recognition result determination unit, and a second recognition result determination unit. Wherein: An index value calculation unit is used to calculate the MD5 hash value of the program execution logic template to be identified; The index retrieval unit is used to input the MD5 hash value into the cache library corresponding to the previously parsed program execution logic template for index retrieval; The first identification result determination unit is used to determine that if the search result is empty, the program execution logic template to be identified is a program execution logic template that has not been parsed in the past. The second identification result determination unit is used to determine that if the search result is not empty, the program execution logic template to be identified is a program execution logic template that has been parsed in the past.
[0059] In this embodiment, the second target parsing result acquisition module 705 includes an abstract syntax tree parsing unit and a node serialization and organization unit. Wherein: Abstract syntax tree parsing unit is used to parse the program execution logic template to be identified according to the abstract syntax tree parsing method, and obtain the abstract syntax tree structure corresponding to the program execution logic template to be identified. The node serialization and sorting unit is used to perform logical execution serialization and sorting on all nodes according to the node position information, node connection relationship and node hierarchical relationship in the abstract syntax tree structure, and obtain a serialized node sorting result as the target parsing result.
[0060] In this embodiment, the intelligent agent code processing device 700 further includes a parsing cache result construction module and a parsing result persistent cache module. Wherein: The parsing cache result construction module is used to construct the parsing cache result in key-value pair form corresponding to the program execution logic template to be identified by using the serialized node sorting result as the value and the MD5 hash value as the key. The parsing result persistent caching module is used to add the parsing cached results in the form of key-value pairs to a preset persistent caching layer for caching processing, wherein the preset persistent caching layer includes a persistent caching layer composed of Redis caching components.
[0061] In this embodiment, the target parsing result conversion module 706 includes a deserialization processing unit. The deserialization processing unit is used to deserialize the target parsing result to obtain a conversion result in the form of a syntax tree. Specifically, the serialized nodes in the target parsing result are deserialized to construct a conversion result in the form of a syntax tree that includes node position information, node connection relationship and node hierarchical relationship.
[0062] In this embodiment, the target intelligent agent operation module 707 includes a program operation parameter filling unit and a target intelligent agent operation unit. Wherein: The program execution parameter filling unit is used to fill the pre-defined program execution parameters into the transformation result in the form of a syntax tree containing node position information, node connection relationship and node hierarchical relationship according to the dynamic definition log of the target intelligent agent, so as to generate a syntax tree with program execution parameters. The target agent execution unit is used to run the target agent according to the syntax tree with program execution parameters.
[0063] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0064] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0065] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed] for details. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.
[0066] The computer device 8 includes a memory 8a, a processor 8b, and a network interface 8c that are interconnected via a system bus. It should be noted that... Figure 8 Only a computer device 8 with component memory 8a, processor 8b, and network interface 8c is shown. However, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0067] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0068] The memory 8a includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 8a may be an internal storage unit of the computer device 8, such as the hard disk or memory of the computer device 8. In other embodiments, the memory 8a may also be an external storage device of the computer device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Of course, the memory 8a may include both internal storage units and external storage devices of the computer device 8. In this embodiment, the memory 8a is typically used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions for an intelligent agent code processing method. In addition, the memory 8a can also be used to temporarily store various types of data that have been output or will be output.
[0069] In some embodiments, the processor 8b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 8b is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 8b is used to execute computer-readable instructions stored in the memory 8a or to process data, for example, to execute computer-readable instructions of the intelligent agent code processing method described above.
[0070] The network interface 8c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 8 and other electronic devices.
[0071] The computer device proposed in this embodiment belongs to the field of program management technology and is applied in scenarios involving the storage and operation management of programs executed by intelligent agents. This application obtains the latest program execution logic dynamically defined by the target intelligent agent; matches the program execution logic template to be identified; identifies whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, the corresponding previously parsed result is obtained as the target parsing result; if not, the program execution logic template to be identified is parsed according to a preset parsing method to obtain the target parsing result; upon receiving a program execution processing instruction for the target intelligent agent, the target parsing result is converted into an executable target form; and the target intelligent agent is run according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing can be avoided, and the parsing results can be reused reasonably. This can effectively improve the screening and operation efficiency of target intelligent agents. For example, in scenarios where intelligent AI processing models are used to replace manual task decision-making and machine operation, especially in financial application scenarios, this intelligent agent code processing method can be used to convert several pre-trained intelligent agents into corresponding parsing results for caching. In subsequent actual use, only the parsing results need to be obtained for executable format conversion and program execution parameters supplementation to achieve repeated calling and use of the target intelligent agent. This avoids rebuilding the business program for complex financial business scenarios every time, reducing program building costs to a certain extent, and also significantly improving the efficiency of financial business processing. In the field of health and medical applications, especially in medical decision support, such as identifying the cause and lesion based on medical images, several pre-trained image recognition agents can be converted into corresponding parsing results and cached. In subsequent actual use, it is only necessary to obtain the parsing results, convert them into executable formats, and supplement the program running parameters to achieve repeated calling and use of the target agent, thereby improving the efficiency of medical decision support.
[0072] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the intelligent agent code processing method described above.
[0073] The computer-readable storage medium proposed in this embodiment belongs to the field of program management technology and is applied in scenarios where intelligent agents execute programs for storage and management. This application obtains the latest program execution logic dynamically defined by the target intelligent agent; matches the program execution logic template to be identified; identifies whether the program execution logic template to be identified is a previously parsed program execution logic template; if so, obtains the corresponding previously parsed result as the target parsing result; if not, parses the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result; upon receiving a program execution processing instruction for the target intelligent agent, converts the target parsing result into an executable target form; and runs the target intelligent agent according to the conversion result of the target form and the pre-defined dynamically defined program execution parameters. By adding pre-identification conditions before parsing the program's execution logic template to be identified, and combining this with the actual parsing situation, duplicate parsing can be avoided, and the parsing results can be reused reasonably. This can effectively improve the efficiency of target intelligent agent selection and operation. For example, in scenarios where intelligent AI processing models replace manual task decision-making and machine operation, especially in financial applications, this intelligent agent code processing method can be used to convert several pre-trained intelligent agents into corresponding parsing results for caching. In subsequent actual use, only the parsing results need to be obtained, and executable format conversion and program execution parameters need to be added to achieve repeated calls and use of the target intelligent agent. This avoids rebuilding the business program for complex financial business scenarios every time, reducing program construction costs to a certain extent and significantly improving the efficiency of financial business processing. In the field of health and medical applications, especially in medical auxiliary decision-making, such as identifying the cause and lesion based on medical images, several pre-trained image recognition intelligent agents can also be converted into corresponding parsing results for caching. In subsequent actual use, only the parsing results need to be obtained, and executable format conversion and program execution parameters need to be added to achieve repeated calls and use of the target intelligent agent, improving the efficiency of medical auxiliary decision-making.
[0074] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0075] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to make the disclosure of this application more thorough and comprehensive. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application. Software tools or components not belonging to this company that appear in the embodiments of this application are merely illustrative examples and do not represent actual use.
Claims
1. A method for processing intelligent agent code, characterized in that, Includes the following steps: Obtain the latest program execution logic after it has been dynamically defined by the target intelligent agent; Based on the latest program execution logic, a program execution logic template to be identified is matched; A comparison and identification method is used to identify whether the program execution logic template to be identified is a program execution logic template that has been parsed previously; If the program execution logic template to be identified is a program execution logic template that has been parsed in the past, then the corresponding previous parsing result is obtained from the preset cache space as the target parsing result. If the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, then the program execution logic template to be identified is parsed according to the preset parsing method to obtain the target parsing result; When a program execution processing instruction is received for a target intelligent agent, the target parsing result is converted into an executable target form to obtain the target form conversion result; The target agent is run based on the transformation result of the target form and the pre-defined dynamic program running parameters.
2. The intelligent agent code processing method according to claim 1, characterized in that, The step of matching the program execution logic template to be identified based on the latest program execution logic specifically includes: Based on the dynamic definition log of the target agent, identify the program execution parameters that the target agent pre-defined dynamically in the latest program execution logic; The program execution parameters are deleted or blanked to obtain the program execution logic source code that does not contain the program execution parameters; Based on the program execution logic source code that does not contain the program execution parameters, a suitable program execution logic template is selected from a pre-collected and organized program execution logic template library and used as the program execution logic template to be identified.
3. The intelligent agent code processing method according to claim 1 or 2, characterized in that, The step of identifying whether the program execution logic template to be identified is a previously parsed program execution logic template using a comparison and recognition method specifically includes: Calculate the MD5 hash value of the program execution logic template to be identified; The MD5 hash value is input into the cache library corresponding to the previously parsed program execution logic template for index retrieval; If the search result is empty, then the program execution logic template to be identified is a program execution logic template that has not been parsed in the past. If the search result is not empty, then the program execution logic template to be identified is a program execution logic template that has been parsed in the past.
4. The intelligent agent code processing method according to claim 3, characterized in that, The step of parsing the program execution logic template to be identified according to a preset parsing method to obtain the target parsing result specifically includes: The program execution logic template to be identified is parsed according to the abstract syntax tree parsing method to obtain the abstract syntax tree structure corresponding to the program execution logic template to be identified. Based on the node position information, node connection relationship, and node hierarchy relationship in the abstract syntax tree structure, all nodes are logically executed and serialized to obtain a serialized node organization result as the target parsing result.
5. The intelligent agent code processing method according to claim 4, characterized in that, After performing the step of parsing the program execution logic template to be identified according to the preset parsing method to obtain the target parsing result, the method further includes: The serialized node organization result is used as the value, and the MD5 hash value is used as the key to construct the parsing cache result in key-value pair form corresponding to the program execution logic template to be identified; The parsed cache results in the form of key-value pairs are added to a preset persistent cache layer for caching processing. The preset persistent cache layer includes a persistent cache layer composed of Redis caching components.
6. The intelligent agent code processing method according to claim 1, characterized in that, The step of converting the target parsing result into an executable target form to obtain the converted target form specifically includes: The target parsing result is deserialized to obtain a syntax tree-form conversion result. Specifically, the serialized nodes in the target parsing result are deserialized to construct a syntax tree-form conversion result containing node position information, node connection relationships, and node hierarchical relationships.
7. The intelligent agent code processing method according to claim 1 or 6, characterized in that, The step of running the target agent based on the conversion result of the target form and the pre-defined dynamically defined program running parameters specifically includes: Based on the dynamic definition log of the target intelligent agent, the pre-defined dynamic program running parameters are filled into the transformation result in the form of a syntax tree containing node position information, node connection relationship and node hierarchical relationship, to generate a syntax tree with program running parameters; The target agent is run according to the syntax tree containing the program execution parameters.
8. A smart agent code processing device, characterized in that, include: The latest program execution logic acquisition module is used to acquire the latest program execution logic after it has been dynamically defined by the target intelligent agent. The program execution logic template matching module is used to match the program execution logic template to be identified based on the latest program execution logic; The comparison and identification module is used to identify whether the program execution logic template to be identified is a program execution logic template that has been parsed in the past by using a comparison and identification method. The first module for obtaining the target parsing result is used to obtain the corresponding prior parsing result from the preset cache space as the target parsing result if the program execution logic template to be identified is a previously parsed program execution logic template. The second target parsing result acquisition module is used to parse the program execution logic template to be identified according to a preset parsing method if it is identified that the program execution logic template to be identified is a program execution logic template that has not been parsed in the past, and obtain the target parsing result. The target parsing result conversion module is used to convert the target parsing result into an executable target form when it receives a program execution processing instruction for a target intelligent agent, thereby obtaining a conversion result in the target form; The target agent running module is used to run the target agent according to the conversion result of the target form and the pre-defined dynamic program running parameters.
9. A computer device, characterized in that, The system includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the intelligent agent code processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the intelligent agent code processing method as described in any one of claims 1 to 7.