Intelligent agent structure data updating method and device, electronic equipment and storage medium

By using multi-level caching in the data update of agent structure, the problems of slow update process and request blocking in the prior art are solved, and more efficient data updates and better user experience are achieved.

CN119690466AActive Publication Date: 2025-03-25NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Application Number
CN202311237082.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2025-03-25
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

The process of updating the structural data of the agent in the prior art is slow, usually 200 to 500 milliseconds, resulting in stuttering of user experience and prone to request blockage when data change operations are continuously triggered.

Method used

Through multi-level caching, including user session-level caching, data request-level caching and logical policy-level caching, the update and data return of the agent structure data is completed, reducing dependence on storage devices and improving data processing efficiency.

Benefits of technology

It realizes that the data update of the agent structure is more efficient and takes less time, avoids request blockage and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690466A_ABST
    Figure CN119690466A_ABST
Patent Text Reader

Abstract

The invention provides an agent structure data updating method and device, electronic equipment and a storage medium. The method comprises the following steps: receiving an agent structure data updating request initiated by a client; based on a user session level cache and a data request level cache in the multi-level cache, obtaining agent structure request data corresponding to the update request; determining at least one target logic triggered by the update request according to a preset logic in a memory; executing a processing process corresponding to the target logic based on the logic strategy level cache and the agent structure request data in the multi-level cache to obtain updated agent structure data; and returning the updated agent structure data to the client, so that the client displays a flow chart or a tree chart corresponding to the updated agent structure data to a user. The intelligent agent structure data updating and data returning are completed through the multi-level cache, the data updating efficiency is higher, the consumed time is shorter, the request blocking situation is avoided, and the user experience feeling is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software technology, and in particular to a method, device, electronic device and storage medium for updating intelligent body structure data. Background Art

[0002] Agent Oriented Programming (AOP) can directly describe tasks to agents more efficiently and seamlessly connect the capabilities of various agents. AOP = IDL (Interactive Data Language) + target language. AOP uses IDL to describe task elements, such as task objectives, task environment, agent status, and capabilities required to complete tasks.

[0003] In AOP, it is usually necessary to define the properties, cognitive logic, and decision logic of the agent. This process is called "updating the agent structure data". In the prior art, users use a visual editing platform to configure the properties of the agent through a tree model, and write cognitive and decision logic through a flowchart, thereby initiating a data update request from the client to the server. The server completes the corresponding read and write logic and data persistence based on the data in the storage device before returning. The entire process is relatively slow, usually taking 200 to 500 milliseconds depending on the amount of data. The user experience is quite obvious, and when the data change operation is continuously triggered, request blocking will occur. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for updating the structure data of an intelligent entity, which completes the update of the structure data of the intelligent entity and the return of data through multi-level caching. The data update efficiency is higher, the time is shorter, and there is no request blocking, so the user experience is better.

[0005] In the first aspect, the present application provides a method for updating agent structure data, the method comprising: receiving an agent structure data update request initiated by a client; obtaining agent structure request data corresponding to the update request based on the user session level cache and the data request level cache in the multi-level cache; the agent structure request data comprises: the agent structure data to be updated and the update operation type; determining at least one target logic triggered by the update request according to the preset logic in the memory; executing the processing corresponding to the target logic based on the logic strategy level cache and the agent structure request data in the multi-level cache to obtain the updated agent structure data; returning the updated agent structure data to the client, so that the client displays the flowchart or tree diagram corresponding to the updated agent structure data to the user.

[0006] In the second aspect, the present application also provides an agent structure data update device, the device comprising: a request receiving module, used to receive an agent structure data update request initiated by a client; a data acquisition module, used to obtain the agent structure request data corresponding to the update request based on the user session level cache and the data request level cache in the multi-level cache; the agent structure request data includes: the agent structure data to be updated and the update operation type; a logic determination module, used to determine at least one target logic triggered by the update request according to the preset logic in the memory; a data update module, used to execute the processing corresponding to the target logic based on the logic strategy level cache and the agent structure request data in the multi-level cache, to obtain the updated agent structure data; a data return module, used to return the updated agent structure data to the client, so that the client can display the flowchart or tree diagram corresponding to the updated agent structure data to the user.

[0007] In a third aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method described in the first aspect above.

[0008] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method described in the first aspect above.

[0009] In the method, device, electronic device and storage medium for updating the agent structure data provided by the present application, firstly, an update request for the agent structure data initiated by the client is received; based on the user session level cache and the data request level cache in the multi-level cache, the agent structure request data corresponding to the update request is obtained; the agent structure request data includes: the agent structure data to be updated and the update operation type; according to the preset logic in the memory, at least one target logic triggered by the update request is determined; based on the logic strategy level cache and the agent structure request data in the multi-level cache, the processing process corresponding to the target logic is executed to obtain the updated agent structure data; the updated agent structure data is returned to the client so that the client can show the flowchart or tree diagram corresponding to the updated agent structure data to the user. This method completes the update of the agent structure data through multi-level cache, user session level cache, data request level cache, and logic strategy level cache. Compared with using storage devices to extract, process, store and return data, it is more efficient, takes less time, and will not cause request blocking. It can quickly respond to the user's data update request and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0011] Figure 1 A flowchart of updating data for a server in the related art;

[0012] Figure 2 A flowchart of a method for updating agent structure data provided in an embodiment of the present application;

[0013] Figure 3 A schematic diagram of an updating process of an intelligent agent structure data provided in an embodiment of the present application;

[0014] Figure 4 A structural block diagram of a device for updating structure data of an intelligent agent provided in an embodiment of the present application;

[0015] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The technical solution of the present application will be described clearly and completely below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0017] According to the common CS (Server-Client) architecture project, the client initiates an agent structure data update request to the server, and the server completes the corresponding read and write logic and data persistence and returns. Figure 1 It can be seen from steps 1 to 7 that the entire process is relatively slow. The reason is that after the user initiates a request, the server will go through "reading data from the storage device", "executing logic", and "saving data to the storage device". The "reading data from the storage device" and "saving data to the storage device" steps are relatively slow because large-scale data storage generally uses hard disks as storage devices, and the read and write speed of hard disks is generally only 1 / 30 to 1 / 100 of that of memory. Depending on the amount of data, it usually takes 200 to 500 milliseconds (ms), and the user experience is quite noticeable.

[0018] When users continuously create, delete, drag, and edit visual flowcharts, a large number of data changes will be triggered. Figure 1 According to statistics, each persistence takes about 100 milliseconds for normal data volume in steps 3 to 5. In the case of continuous triggering of data change operations, the pressure on the data storage device is relatively large, and if the user triggers more than 10 data changes within 1 second, the request will be blocked.

[0019] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for updating the intelligent body structure data, which completes the update of the intelligent body structure data and data return through multi-level caching. The data update efficiency is higher, the time is shorter, and there is no request blocking, which provides a better user experience.

[0020] To facilitate understanding of this embodiment, a method for updating agent structure data disclosed in an embodiment of the present application is first introduced in detail.

[0021] Figure 2 A flowchart of a method for updating agent structure data provided in an embodiment of the present application, which method can be applied to a server; the method specifically comprises the following steps:

[0022] Step S202: receiving an agent structure data update request initiated by the client.

[0023] The above update request can be initiated by operating in the visual editor in the client. The update operation of the agent structure data includes two operations: "write agent attributes" and "write agent logic".

[0024] (1) Editing agent attributes: When a user clicks “Add attribute” on the visual editor, a request to add an attribute is sent to the server. The same is true for modifying or deleting attributes.

[0025] (2) Editing agent logic: When users use flowchart components on a visual editor to write a logical flowchart, they initiate a request to the server to update the agent's cognition and decision-making logic.

[0026] Step S204, based on the user session level cache and the data request level cache in the multi-level cache, obtaining the agent structure request data corresponding to the update request; the agent structure request data includes: the agent structure data to be updated and the update operation type;

[0027] The multi-level cache in the embodiment of the present application includes: user session level cache, data request level cache and logic policy level cache; the ranking of the read and write speeds of the three-level cache and the storage device is: logic policy cache>data request cache>user session cache>storage device; wherein, the user session level cache is used to store data related to a specific user's session, usually created when the user logs into an application or system, and is destroyed until the user logs out or the session ends. The data request level cache is used to store results or data fragments temporarily generated when processing data requests, so that they can be reused in similar requests later. The logic policy level cache is used to store calculation results, decisions, or intermediate states of business logic in the process of executing multiple logic policies, so that they can be quickly accessed when needed without having to re-execute the same calculation logic.

[0028] After receiving the request, firstly, the agent structure data to be updated and the update operation type are obtained from the multi-level cache according to the parameters carried in the update request. The parameters carried in the update request include: user ID, project ID, agent identification information to be updated, and update operation type; the agent identification information to be updated includes: agent identification, attribute identification, and logical identification; the agent structure data to be updated includes: data corresponding to the agent identification information to be updated, that is, data corresponding to the agent identification, data corresponding to the attribute identification, and data corresponding to the logical identification.

[0029] Step S206: Determine at least one target logic triggered by the update request according to the preset logic in the memory.

[0030] The update request carries the identification information of the intelligent agent to be updated. The above preset logic includes a plurality of logical matching rules. If the identification information of the intelligent agent hits a matching rule, the logic corresponding to the matching rule is triggered.

[0031] Step S208, based on the logic strategy level cache and the agent structure request data in the multi-level cache, execute the processing corresponding to the target logic to obtain the updated agent structure data.

[0032] In the process of executing logical processing to update data, the participation of the logical strategy level cache in the multi-level cache is required. The corresponding data of each target logic to be executed can be stored in the logical strategy level cache first. After the target logic is executed, the updated data can be stored in the logical strategy level cache.

[0033] Step S210, returning the updated agent structure data to the client, so that the client displays the flowchart or tree diagram corresponding to the updated agent structure data to the user.

[0034] Finally, the updated agent structure data is returned to the client through the three-level cache in the multi-level cache, and the client further displays the flowchart or tree diagram corresponding to the updated agent structure data through a visual editor.

[0035] In the method for updating the agent structure data provided by the present application, firstly, an update request for the agent structure data initiated by the client is received; then, based on the user session level cache and the data request level cache in the multi-level cache, the agent structure request data corresponding to the update request is obtained; the agent structure request data includes: the agent structure data to be updated and the update operation type; according to the preset logic in the memory, at least one target logic triggered by the update request is determined; based on the logic strategy level cache and the agent structure request data in the multi-level cache, the processing process corresponding to the target logic is executed to obtain the updated agent structure data; the updated agent structure data is returned to the client, so that the client can show the flowchart or tree diagram corresponding to the updated agent structure data to the user. This method completes the update of the agent structure data through multi-level cache, user session level cache, data request level cache, and logic strategy level cache. Compared with using storage devices to extract, process, store and return data, it is more efficient, takes less time, and will not cause request blocking. It can quickly respond to user data update requests and improve user experience.

[0036] In the embodiment of the present application, a "multi-level cache" based on memory is used to replace the "reading data from the storage device" and "saving data to the storage device" in the existing solution with reading data from the cache and saving data to the cache. "Reading data from the storage device to the cache" and "saving data from the cache to the storage device" are separated from the user request process and executed asynchronously (such as the subsequent content about the transaction processor), thereby reducing the response time in the user request process.

[0037] The embodiment of the present application also provides another method for updating agent structure data, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the data update process based on the three-level cache.

[0038] Furthermore, the update request carries a project identifier and / or a user identifier; based on the user session level cache and the data request level cache in the multi-level cache, the step of obtaining the agent structure request data corresponding to the update request includes:

[0039] (1) Determine whether there is intelligent agent structure data corresponding to the project identifier and / or user identifier in the multi-level cache; if not, read the intelligent agent structure data corresponding to the project identifier and / or user identifier from the storage device and load it into the user session level cache; if yes, directly extract the intelligent agent structure data corresponding to the project identifier and / or user identifier from the user session cache in the multi-level cache, as in the next step (2). The contents in the above user session level cache include: user identifier, project identifier, all intelligent agent information located by user identifier and project identifier (including ID (Identit Document, identity identifier), name, attribute list, logical list).

[0040] (2) extracting agent structure data corresponding to the project identifier and / or user identifier from the user session level cache;

[0041] (3) Based on the agent structure data and the update request, the agent structure request data is generated, and the agent structure request data is stored in the data request level cache of the multi-level cache. The contents of the above data request level cache include: user ID, project ID, the operation to be performed by the current request (the ID information of the updated agent includes the updated agent ID, the updated attribute ID, the updated logical ID, and the type of update operation (create, delete, modify)), and the information of all agents that will be used in the current request (obtained based on the agent ID in the operation to be performed by the previous current request).

[0042] In specific implementation, the above update request carries the identification information of the intelligent agent to be updated and the update operation type; first, the intelligent agent structure data to be updated corresponding to the identification information to be updated is searched from the intelligent agent structure data; then the intelligent agent structure data to be updated and the update operation type are determined as the intelligent agent structure request data, and stored in the data request level cache in the multi-layer cache.

[0043] Furthermore, the preset logic includes: a plurality of logics and matching rules and logic priorities corresponding to each logic; and the step of determining at least one target logic triggered by the update request according to the preset logic in the memory includes:

[0044] (1) According to the identification information of the agent to be updated carried in the update request, find the matching rule that matches, and use the logic corresponding to the matching rule that matches as the target logic;

[0045] (2) Sort by logic priority corresponding to each target logic to obtain at least one target logic triggered by the update request.

[0046] Furthermore, the above-mentioned step of executing the processing corresponding to the target logic based on the logic strategy level cache and the agent structure request data in the multi-level cache to obtain the updated agent structure data includes:

[0047] According to the order of the target logic, take out the target logic to be executed in turn:

[0048] (1) Extract the target agent structure data corresponding to the target logic from the agent structure request data and save it in the logic strategy level cache; the contents of the above logic strategy level cache include: user ID, project ID, current logic information (priority, execution rules), agent information before the current logic starts to execute, and the latest agent information during the current logic execution process.

[0049] (2) Read the target agent structure data in the logical strategy level cache;

[0050] (3) According to the execution rules in the target logic, the target agent structure data is logically processed and the processed agent structure data is stored in the logic strategy level cache.

[0051] Furthermore, the processed agent structure data can be written into the data request level cache according to the agent identification information to be updated, and the logic strategy level cache corresponding to the processed agent structure data can be destroyed. When all target logics are executed, the processed agent structure data in the data request level cache is written into the user session level cache; and the data request level cache is destroyed.

[0052] It should be noted that the above steps can all be completed by the logical processor configured in the server.

[0053] See also Figure 3 As shown, the specific execution steps of the logical processor are as follows:

[0054] A. Check whether the target user's data under the target project exists in the agent structure multi-level data cache (although the "multi-level cache" has faster reading and writing speeds than storage devices, it is more expensive, so the capacity is smaller than the storage device and cannot meet the needs of saving all data, so there will be a timed deletion strategy to clear inactive data in the multi-level cache every 30 minutes. If a user's data in a project has not been operated for 30 minutes, then the data of this user under this project will be considered inactive and deleted). If it does not exist, read the existing agent structure data directly from the storage device (referring to the list of all existing agents in the target user's data under the target project. The structure of each agent includes the agent's unique identifier, name, attribute list, cognitive logic, and decision logic), load it into the "user session level cache", and generate a "user session object" to save it in the memory of the logical processor, and bind it to the "user session level cache" in the data multi-level cache. The "user session object" contains the ID corresponding to the "user session level cache", the user's basic information, the user's project information, and the agent update ID queue.

[0055] B. Create a "data request object" that contains the ID of the "user session object" corresponding to the request received by the server, the agent ID of the operation in this request, the agent attribute ID and logic ID of this operation, the type of this operation (create, modify, delete), the client identity information of this request, the timestamp of this request, the unique ID of this request, and the logic queue (empty in the initial state). At the same time, in the "multi-level cache", the "data request level cache" is used to save the agent structure information in a request, and allows multiple logic strategies triggered in a request to share access to this part of the agent structure information.

[0056] C. The logic processor loads the code logic and script / IDL (Interactive Data Language) logic from the memory. The code logic is the logic written by the developer during the development process, and the script / IDL logic is the logic configured using the logic plug-in processor. The logic here includes "matching rules", "execution rules", and "priority". The logic processor determines whether this request triggers a certain logic based on the matching rules of the logic. If it is triggered, the logic is added to the logic queue of the "data request object" and sorted from high to low according to the priority of the logic.

[0057] Among them, the matching rule is used to determine whether a logic needs to be executed in a request. The execution rule refers to which specific steps this logic needs to execute. The priority is used to determine which logic should be executed first among multiple logics.

[0058] For example, if a logic is needed for an agent with a power attribute, when the agent senses that the power is less than 10%, it will automatically go to charge. The matching rules and execution rules can be as follows:

[0059] Matching rule: When the request of "update agent structure" is to add a power attribute to the structure of an agent, the match is successful.

[0060] Execution rules:

[0061] 1. Add power attribute to the agent;

[0062] 2. Add the "sense battery level" perception logic to the agent. The steps of this logic are:

[0063] a. Obtain power from the power supply device;

[0064] b. Determine whether the power level is less than 10%;

[0065] c. When the battery level is lower than 10%, the “Charge” decision logic is triggered.

[0066] 3. Add the decision logic of "execute charging" to the agent. The steps of this logic are:

[0067] a. Get the charger location;

[0068] b. Move to the charger position;

[0069] c. Connect the charger.

[0070] D. The logical processor executes the logic in the logical queue in descending order of priority.

[0071] E. When executing a logic, the logic processor will create a "Logical Strategy Level Request Object" in the memory, and save the current structure of the agent in the "Data Request Level Cache" in the "Logical Strategy Level Cache", and the "Logical Strategy Request Object" will record its ID. During the execution of a logical strategy, multiple threads may be created to complete the strategy. These threads can read the data in the "Logical Strategy Level Cache" through the "Logical Strategy Request Object", and save the processed results in the "Logical Strategy Level Cache". After the current logic is executed, the information stored in the "Data Request Object" in the current logical processor will be used to write the processed agent structure data into the "Data Request Level Cache", and then the "Logical Strategy Level Cache" will be destroyed.

[0072] F. When all logics are executed, the processed agent structure data in the "data request level cache" will be written into the "user session level cache", which will include the ID information of the updated agent (the ID information of the updated agent includes the updated agent ID, updated attribute ID, updated logic ID, and the type of update operation (create, delete, modify)) and the agent update ID queue added to the "user session object", and returned to the visual editor.

[0073] Furthermore, after the above step of destroying the data request level cache, the method further includes:

[0074] According to the agent identification information to be updated, the corresponding agent structure data is extracted from the user session level cache; the extracted agent structure data is aggregated with the user identification and the project identification; and the aggregated data is stored in a storage device.

[0075] The above step of storing the aggregated data in the storage device can be completed by the transaction processor configured in the server. That is, when the logic processor in the above server returns the updated data to the visual editor, it will take out the agent update ID queue in the "user session object", and then take out the corresponding agent structure data from the "user session level cache" according to the ID, and then aggregate the data according to the user basic information and user project information, and initiate a storage transaction to the transaction processor. The transaction processor then executes the step of storing the aggregated data in the storage device.

[0076] In the embodiment of the present application, after all the target logics are completed, the data is stored in the storage device, which is equivalent to asynchronously initiating a data storage request to the transaction processor to persist the multi-level cache of the intelligent structure. The transaction processor merges the data from the multi-level cache of the intelligent structure and writes it to the storage device. In a specific implementation, after receiving the data storage request, the transaction processor creates a data buffer according to the project information and user information. The buffer is cleared every 2 seconds, or when the data volume exceeds 10MB. "Clear" means that data persistence is performed once for all data change records in the buffer, written to the storage device, and the data in the data buffer is deleted. When the clearing is triggered, a new data buffer is first created. After the creation is completed, all subsequent transactions received by the transaction processor will be written into the new data buffer. At the same time, a snapshot is taken of the old data buffer, and then the snapshot is used to perform data persistence. This solution is to delete the old data buffer after the data persistence is successful. In this way, the snapshot can be regenerated when an exception occurs during the persistence process, causing an exception in the snapshot.

[0077] The above method reduces the number of times the server communicates with the storage device, reduces the additional network overhead caused by frequent communications and the load of the storage device frequently processing IO events (input / output events), thereby improving the efficiency of the storage device in performing data reading and writing.

[0078] In the related art, there are a large number of linkage rules in the attribute definition of the agent. According to the common implementation method, developers need to implement the corresponding logic according to the client's request. However, since the request generated during the agent editing process is a description of the data change, there may be multiple combinations. For example, there may be two requests of "change attribute 1" and "change attribute 2", which can combine the two requests of "update attribute 1 first, then update attribute 2" or "update attribute 2 first, then update attribute 1". This combination increases geometrically with the increase of different types of basic attributes, that is, Figure 1 Step 4 requires developers to write a lot of combinatorial logic, which requires a lot of development costs.

[0079] In response to the above problems, an embodiment of the present application provides a method for completing rapid logic development through a logic plug-in processor. The system administrator can modify the JavaScript script and IDL file definition through the service background, and update the new logic to the memory of the logic processor through the logic plug-in processor, thereby reducing the maintenance, development, and online costs brought about by changes in data update rules, thereby reducing the overall cost of the server.

[0080] Specifically, the above server is also configured with a logic plug-in processor; the preset logic includes code logic and script / IDL logic; code logic is different from script logic and IDL logic. Code logic refers to the logic that implements the server-related functions in this solution, which cannot be dynamically modified once compiled and deployed to the server. However, script logic and IDL logic can be updated by sending an "update processing logic" request to the server through the service backend.

[0081] The script / IDL logic update process is as follows: receiving a processing logic update request through a logic plug-in processor; processing the logic update request including a logic form; and updating the script / IDL logic in the memory based on the logic in the logic form.

[0082] Furthermore, before the step of updating the script / IDL logic in the memory based on the logic in the logic form, the step also includes: pausing receiving the update request for the intelligent structure data initiated by the client; after the step of updating the script / IDL logic in the memory based on the logic in the logic form, the step also includes: resuming receiving the update request for the intelligent structure data initiated by the client.

[0083] The specific implementation process of the system administrator modifying the JavaScript script and IDL file definition through the service background and updating the new logic to the memory of the logic processor through the logic plug-in processor is as follows:

[0084] 1. The system administrator fills in the logical rules through the form provided by the service background. The logical rules include "matching rules", "execution rules" and "priority". The execution rules support JavaScript syntax and IDL rules. When using IDL rules, the dependency relationship of the value of the agent attribute can be specified through variable expressions, such as ${agent 1}.${attribute 1}.value=10*${agent 1}.${attribute 2}.

[0085] 2. After the system administrator completes the editing, he can submit the service background form to enable the "Logic Plugin Processor" to initiate a request to the "Logic Processor" to update the processing logic.

[0086] 3. After receiving the request to update the logic, the logic processor will temporarily stop receiving new requests from the visual editor and add the newly added logic to the logic record in the memory. After completion, it will continue to accept requests from the visual editor.

[0087] In the embodiment of the present application, the above-mentioned problem of requiring a large amount of logic development cost is solved through priorities and matching rules, and the user only needs to define the two logics of "change attribute 1" and "change attribute 2". When the matching rules of these two logics are matched successfully, the effect of "changing attribute 1 first, then changing attribute 2" can be automatically achieved according to the priority, and the execution order of "changing attribute 1" and "changing attribute 2" can be adjusted by modifying the priority. In addition, the submission operation can allow the server to temporarily stop receiving new user requests, avoiding the anomalies that may be caused by "the logic processing processes user requests while updating the logic". In the prior art, it is generally necessary to recompile the logic, stop the running server logic, update the logic, and restart the server logic.

[0088] Based on the above method embodiment, the present application embodiment also provides a device for updating the structure data of an intelligent agent, see Figure 4 As shown, the device includes: a request receiving module 402, which is used to receive an update request for the intelligent agent structure data initiated by the client; a data acquisition module 404, which is used to obtain the intelligent agent structure request data corresponding to the update request based on the user session level cache and the data request level cache in the multi-level cache; the intelligent agent structure request data includes: the intelligent agent structure data to be updated and the update operation type; a logic determination module 406, which is used to determine at least one target logic triggered by the update request according to the preset logic in the memory; a data update module 408, which is used to execute the processing corresponding to the target logic based on the logic strategy level cache and the intelligent agent structure request data in the multi-level cache to obtain the updated intelligent agent structure data; a data return module 410, which is used to return the updated intelligent agent structure data to the client, so that the client can show the flowchart or tree diagram corresponding to the updated intelligent agent structure data to the user.

[0089] Furthermore, the above-mentioned update request carries a project identifier and / or a user identifier; the data acquisition module 404 is used to extract the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache; based on the intelligent agent structure data and the update request, the intelligent agent structure request data is generated, and the intelligent agent structure request data is stored in the data request level cache of the multi-level cache.

[0090] Furthermore, the above-mentioned data acquisition module 404 is used to determine whether the intelligent body structure data corresponding to the project identification and / or user identification exists in the multi-level cache before extracting the intelligent body structure data corresponding to the project identification and / or user identification from the user session level cache; if not, read the intelligent body structure data corresponding to the project identification and / or user identification from the storage device and load it into the user session level cache.

[0091] Furthermore, the above-mentioned update request carries the identification information of the intelligent agent to be updated and the type of update operation; the above-mentioned data acquisition module 404 is used to search for the intelligent agent structure data to be updated corresponding to the identification information of the intelligent agent to be updated from the intelligent agent structure data; the intelligent agent structure data to be updated and the update operation type are determined as the intelligent agent structure request data, and stored in the data request level cache in the multi-layer cache.

[0092] Furthermore, the above-mentioned preset logic includes: multiple logics and matching rules and logic priorities corresponding to each logic; a logic determination module 406, which is used to search for the hit matching rules according to the identification information of the intelligent entity to be updated carried in the update request, and use the logic corresponding to the hit matching rules as the target logic; sort according to the logic priority corresponding to each target logic, and obtain at least one target logic triggered by the update request.

[0093] Furthermore, the above-mentioned data update module 408 is used to take out the current target logic to be executed in sequence according to the arrangement order of the target logic, extract the target agent structure data corresponding to the target logic from the agent structure request data, and save it in the logic strategy level cache; read the target agent structure data in the logic strategy level cache; according to the execution rules in the target logic, perform logical processing on the target agent structure data, and save the processed agent structure data in the logic strategy level cache.

[0094] Furthermore, the above-mentioned data update module 408 is used to write the processed agent structure data into the data request level cache according to the agent identification information to be updated after the step of saving the processed agent structure data in the logical strategy level cache, and destroy the logical strategy level cache corresponding to the processed agent structure data.

[0095] Furthermore, the data updating module 408 is used to write the processed agent structure data in the data request level cache into the user session level cache after all target logics are executed; and destroy the data request level cache.

[0096] Furthermore, the above-mentioned data update module 408 is used to extract corresponding agent structure data from the user session level cache according to the agent identification information to be updated after the step of destroying the data request level cache; aggregate the extracted agent structure data with the user identification and project identification; and store the aggregated data in a storage device.

[0097] Furthermore, the above-mentioned server is also configured with a logic plug-in processor; the preset logic includes code logic and script / interactive data language logic; the above-mentioned device also includes: a logic update module, which is used to execute the following script / interactive data language logic update process: receiving and processing logic update requests through the logic plug-in processor; processing logic update requests including logic forms; updating the script / interactive data language logic in the memory based on the logic in the logic form.

[0098] Furthermore, the above-mentioned logic update module is used to suspend receiving the update request of the intelligent structure data initiated by the client before updating the script / interactive data language logic in the memory based on the logic in the logic form; and resume receiving the update request of the intelligent structure data initiated by the client after updating the script / interactive data language logic in the memory based on the logic in the logic form.

[0099] The device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the device, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0100] The present application also provides an electronic device, such as Figure 5 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 51 and a memory 50, the memory 50 stores computer executable instructions that can be executed by the processor 51, and the processor 51 executes the computer executable instructions to implement the above method.

[0101] exist Figure 5 In the illustrated embodiment, the electronic device further includes a bus 52 and a communication interface 53 , wherein the processor 51 , the communication interface 53 and the memory 50 are connected via the bus 52 .

[0102] Among them, the memory 50 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 52 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0103] The processor 51 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 51. The above processor 51 can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 51 reads the information in the memory and completes the steps of the method of the above embodiment in combination with its hardware.

[0104] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.

[0105] The computer program products of the methods, devices, and electronic devices provided in the embodiments of the present application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0106] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0108] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0109] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A method for updating agent structure data, characterized in that: The method comprises: Receive the update request of the agent structure data initiated by the client; Based on the user session level cache and the data request level cache in the multi-level cache, obtaining the agent structure request data corresponding to the update request; the agent structure request data includes: the agent structure data to be updated and the update operation type; Determine at least one target logic triggered by the update request according to the preset logic in the memory; Based on the logic strategy level cache and the agent structure request data in the multi-level cache, the processing process corresponding to the target logic is executed to obtain the updated agent structure data; The updated agent structure data is returned to the client, so that the client displays the flowchart or tree diagram corresponding to the updated agent structure data to the user.

2. The method according to claim 1, characterized in that The update request carries a project identifier and / or a user identifier; Based on the user session level cache and the data request level cache in the multi-level cache, obtaining the agent structure request data corresponding to the update request includes: Extracting the agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache; Based on the agent structure data and the update request, agent structure request data is generated, and the agent structure request data is stored in the data request level cache of the multi-level cache.

3. The method according to claim 2, characterized in that Before extracting the agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache, the method further includes: Determine whether there is agent structure data corresponding to the project identifier and / or the user identifier in the multi-level cache; If not, the agent structure data corresponding to the project identifier and / or the user identifier is read from a storage device and loaded into the user session level cache.

4. The method according to claim 3, characterized in that The update request carries the identification information of the agent to be updated and the update operation type; Based on the agent structure data and the update request, generating agent structure request data, including: From the agent structure data, searching for the agent structure data to be updated corresponding to the agent identification information to be updated; The agent structure data to be updated and the update operation type are determined as agent structure request data, and stored in a data request level cache in the multi-level cache.

5. The method according to claim 4, characterized in that The preset logic includes: a plurality of logics and matching rules and logic priorities corresponding to each logic; and determining at least one target logic triggered by the update request according to the preset logic in the memory, including: According to the identification information of the agent to be updated carried in the update request, searching for a matching rule that matches, and taking the logic corresponding to the matching rule that matches as the target logic; Sorting is performed according to the logic priority corresponding to each of the target logics to obtain at least one target logic triggered by the update request.

6. The method according to claim 5, characterized in that Based on the logic strategy level cache and agent structure request data in the multi-level cache, the processing process corresponding to the target logic is executed to obtain the updated agent structure data, including: According to the arrangement order of the target logics, the target logics to be executed are taken out in turn, the target agent structure data corresponding to the target logics are extracted from the agent structure request data, and stored in the logic strategy level cache; Reading the target agent structure data in the logic strategy level cache; According to the execution rules in the target logic, the target agent structure data is logically processed, and the processed agent structure data is stored in the logic strategy level cache.

7. The method according to claim 6, characterized in that After the processed agent structure data is stored in the logic strategy level cache, the method further includes: According to the agent identification information to be updated, the processed agent structure data is written into the data request level cache, and the logic strategy level cache corresponding to the processed agent structure data is destroyed.

8. The method according to claim 6, characterized in that The method further comprises: When all target logics are executed, the processed agent structure data in the data request level cache is written into the user session level cache; Destroy the data request level cache.

9. The method according to claim 8, characterized in that After destroying the data request level cache, the method further includes: According to the agent identification information to be updated, extracting corresponding agent structure data from the user session level cache; Aggregate the extracted agent structure data with the user ID and project ID; The aggregated data is stored in a storage device.

10. The method according to claim 1, characterized in that The preset logic includes code logic and script / interactive data language logic; the updating process of the script / interactive data language logic is as follows: Receiving a processing logic update request through a logic plug-in processor; the processing logic update request includes a logic form; The in-memory script / interactive data language logic is updated based on the logic in the logic form.

11. The method according to claim 10, characterized in that Before updating the script / interactive data language logic in the memory based on the logic in the logic form, the method further includes: Stop receiving agent structure data update requests initiated by the client; After the step of updating the script / interactive data language logic in the memory based on the logic in the logic form, the method further includes: Resume receiving agent structure data update requests initiated by the client.

12. A device for updating agent structure data, characterized in that: The device comprises: A request receiving module, used to receive an update request for the agent structure data initiated by the client; A data acquisition module is used to acquire the agent structure request data corresponding to the update request based on the user session level cache and the data request level cache in the multi-level cache; the agent structure request data includes: the agent structure data to be updated and the update operation type; A logic determination module, used to determine at least one target logic triggered by the update request according to a preset logic in the memory; A data update module is used to execute a processing process corresponding to the target logic based on the logic strategy level cache and the agent structure request data in the multi-level cache to obtain updated agent structure data; The data return module is used to return the updated agent structure data to the client, so that the client can display the flowchart or tree diagram corresponding to the updated agent structure data to the user.

13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data caching method and device, electronic equipment and storage medium

    CN110515962A

  • Multi-level caching method and device, computer equipment and storage medium

    CN115269619A

  • MPC cache updating method and system based on multiple agents

    CN116521584A

  • Providing rolling updates of distributed systems with a shared cache

    US20170192884A1

  • Distributed in-memory buffer cache system using buffer cache nodes

    US9880933B1

Cited By

  • AI agent data communication management method and device, medium and electronic device

    CN121486119A

  • Intelligent agent-oriented multi-level cache multiplexing method

    CN121680833A