Method and device for updating structure data of agent, electronic equipment and storage medium
By using a multi-level caching mechanism to process intelligent agent structure data, the problems of slow data update speed and request blocking in existing technologies are solved, achieving more efficient data updates and a better user experience.
Patent Information
- Application Number
- CN202311237082.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-09-22
AI Technical Summary
In existing technologies, the large amount of data during the data update process of intelligent agents leads to slow response speed and request blocking, resulting in a poor user experience.
A multi-level caching mechanism is adopted, including user session-level caching, data request-level caching, and logical strategy-level caching. The target logic processing is executed through preset logic in memory, reducing the dependence on storage devices and enabling fast data updates and returns.
It improves data update efficiency, shortens response time, avoids request blocking, and enhances user experience.
Smart Images

Figure CN119690466B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software, in particular to an agent structure data updating method and device, electronic equipment and storage medium. BACKGROUND
[0002] Agent Oriented Programmig (AOP) can directly and efficiently describe the task of an agent and seamlessly connect the capabilities of various agents. AOP = IDL (Interactive Data Language) + target language, and AOP uses IDL to describe task elements such as task objectives, task environments, agent states, and capabilities required to complete tasks.
[0003] In AOP, it is usually necessary to define the attributes, cognitive logic, and decision logic of an agent, which is referred to as "updating agent structure data". In the prior art, a user configures the attributes of an agent through a tree model and writes cognitive and decision logic through a flowchart using a visual editing platform, so that the client initiates a data update request to the server, the server completes the corresponding read-write logic and data persistence based on the data in the storage device, and then returns the result. The entire process is relatively slow, and it usually takes 200-500 milliseconds depending on the size of the data, which significantly affects the user experience. In the case of continuous triggering of data change operations, the request may be blocked. SUMMARY
[0004] The present application provides an agent structure data updating method and device, electronic equipment and storage medium, which complete the updating and data return of agent structure data through multi-level caching, have higher data updating efficiency, take less time, do not appear request blocking situation, and have better user experience.
[0005] In a first aspect, the present application provides an agent structure data updating method, which includes: receiving an updating request for agent structure data initiated by a client; obtaining agent structure request data corresponding to the updating request based on a user session cache and a data request cache in a multi-level cache; the agent structure request data includes to-be-updated agent structure data and an updating operation type; determining at least one target logic triggered by the updating request according to a preset logic in the memory; executing a processing process corresponding to the target logic based on a logic strategy cache in the multi-level cache and the agent structure request data to obtain updated agent structure data; and returning the updated agent structure data to the client to enable the client to show a flowchart or a tree diagram corresponding to the updated agent structure data to the user.
[0006] In a second aspect, the present application also provides an agent structure data updating apparatus, which comprises: a request receiving module, configured to receive an agent structure data updating request initiated by a client; a data obtaining module, configured to obtain agent structure request data corresponding to the updating request based on a user session level cache and a data request level cache in a multi-level cache; the agent structure request data comprises: to-be-updated agent structure data and an updating operation type; a logic determining module, configured to determine at least one target logic triggered by the updating request according to a preset logic in a memory; a data updating module, configured to execute a processing procedure corresponding to the target logic based on a logic strategy level cache in the multi-level cache and the agent structure request data, to obtain updated agent structure data; and a data returning module, configured to return the updated agent structure data to the client, so that the client shows a flowchart or a tree diagram corresponding to the updated agent structure data to a user.
[0007] In a third aspect, the present application also provides an electronic device, which comprises a processor and a memory, the memory stores computer executable instructions capable of being executed by the processor, and the processor executes the computer executable instructions to implement the method in the first aspect.
[0008] In a fourth aspect, the present application also provides a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions, when invoked and executed by a processor, cause the processor to implement the method in the first aspect.
[0009] In the agent structure data updating method, apparatus, electronic device and storage medium provided by the present application, first, an updating request of agent structure data initiated by a client is received; then, agent structure request data corresponding to the updating request is obtained based on a user session level cache and a data request level cache in a multi-level cache; the agent structure request data comprises: to-be-updated agent structure data and an updating operation type; at least one target logic triggered by the updating request is determined according to a preset logic in a memory; a processing procedure corresponding to the target logic is executed based on a logic strategy level cache in the multi-level cache and the agent structure request data, to obtain updated agent structure data; and the updated agent structure data is returned to the client, so that the client shows a flowchart or a tree diagram corresponding to the updated agent structure data to a user. This way updates the agent structure data through the multi-level cache, the user session level cache, the data request level cache and the logic strategy level cache, and is more efficient and takes less time than using a storage device to extract, process, store and return data, and does not cause request blocking, can quickly respond to the data updating request of the user, and improves the user experience. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the specific embodiments or the prior art of the present application, the drawings required to be used in the description of the specific embodiments or the prior art will be briefly introduced. Obviously, the drawings described below are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0011] Figure 1 A flowchart for updating data of a server in the related art;
[0012] Figure 2 A flowchart of an agent structure data updating method provided by an embodiment of the present application;
[0013] Figure 3 A schematic diagram of an agent structure data updating process provided by an embodiment of the present application;
[0014] Figure 4 A structural block diagram of an agent structure data updating device provided by an embodiment of the present application;
[0015] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0016] The technical solutions of the present application will be described clearly and completely below in conjunction with embodiments. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0017] According to a common CS (Server-Client, server / client) architecture project, the client initiates an agent structure data updating request to the server, and the server returns after completing corresponding read-write logic and data persistence. From the perspective of the server, the process is as follows: Figure 1 As can be seen from the first step to the seventh step shown in the figure, the whole process is relatively slow, and the reason is that after the user initiates a request, the server will go through "reading data from a storage device", "executing logic", and "saving data to a storage device". Among them, the two steps of "reading data from a storage device" and "saving data to a storage device" are relatively slow, and the reason is that large-scale data storage generally uses a hard disk as a storage device, and the read-write speed of the hard disk is generally only 1 / 30 to 1 / 100 of the memory. According to the size of the data, it usually takes 200-500 milliseconds (ms), and the user experience is obviously lagging.
[0018] When the user continuously creates, deletes, drags, and edits a visual flowchart, a large amount of data changes will be triggered, that is,Figure 1 According to statistics, it usually takes about 100 milliseconds to persist each time under the normal data volume. In the case of continuous triggering of data change operations, the pressure on the data storage device is relatively large, and if a 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 an agent structure data updating method and device, electronic equipment and storage medium. The multi-level cache is used to complete the updating and data returning of the agent structure data, so that the data updating efficiency is higher, the time is shorter, the request blocking situation does not occur, and the user experience is better.
[0020] In order to facilitate the understanding of the present embodiment, first, a kind of agent structure data updating method disclosed in the embodiments of the present application is introduced in detail.
[0021] Figure 2 The flow chart of the agent structure data updating method provided by the embodiments of the present application, the method can be applied to server;The method specifically includes the following steps:
[0022] Step S202, receiving the update request of the agent structure data initiated by the client.
[0023] The above update request can be initiated by operation in the visual editor in the client, and the update operation of the agent structure data includes "writing agent attribute" and "writing agent logic" two operations.
[0024] (1) Writing agent attribute: when the user clicks "add attribute" on the visual editor, a request for adding attribute will be initiated to the server. When modifying or deleting attribute, the same applies.
[0025] (2) Editing agent logic: when the user uses flowchart component to write logic flowchart on the visual editor, a request for updating agent cognitive and decision logic will be initiated to the server.
[0026] Step S204, based on the user session level cache and data request level cache in the multi-level cache, the agent structure request data corresponding to the update request is obtained;Agent structure request data includes: to be updated agent structure data and update operation type;
[0027] The multi-level cache in the embodiments of the present application includes: a user session level cache, a data request level cache, and a logic strategy level cache; the read-write speed of the three-level cache and the storage device is ranked as: logic strategy cache > data request cache > user session cache > storage device; wherein the user session level cache is used to store data related to the session of a specific user, which is usually created when the user logs in to an application or system and destroyed when the user logs out or the session ends. The data request level cache is used to store the results or data fragments generated temporarily when processing data requests, so as to be reused in similar requests later. The logic strategy level cache is used to store the intermediate state of the calculation results, decisions or business logic in the process of executing multiple logic strategies, so as to be quickly accessed when needed without having to re-execute the same calculation logic.
[0028] After receiving the request, first, according to the parameters carried in the update request, the agent structure data to be updated and the update operation type are obtained from the multi-level cache. The parameters carried in the update request include: user identifier, project identifier, agent identifier information to be updated, update operation type; the agent identifier information to be updated includes: agent identifier, attribute identifier, logic identifier; the agent structure data to be updated includes: data corresponding to the agent identifier information to be updated, i.e. data corresponding to the agent identifier, data corresponding to the attribute identifier, and data corresponding to the logic identifier.
[0029] In step S206, at least one target logic triggered by the update request is determined according to a preset logic in the memory.
[0030] The update request carries the agent identifier information to be updated, and the preset logic includes matching rules of multiple logics. If the agent identifier information hits a matching rule, the logic corresponding to the matching rule is triggered.
[0031] In step S208, based on the logic strategy level cache in the multi-level cache and the agent structure request data, a processing process corresponding to the target logic is executed to obtain updated agent structure data.
[0032] In the process of executing the logic processing for data update, the participation of the logic strategy level cache in the multi-level cache is required. The data corresponding to each target logic to be executed can be first stored in the logic strategy level cache, and after the target logic is executed, the updated data is stored in the logic strategy level cache again.
[0033] In step S210, the updated agent structure data is returned to the client, so that the client shows 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 the visual editor.
[0035] The method for updating agent structure data provided in the present application first receives an update request for agent structure data initiated by a client, then acquires agent structure request data corresponding to the update request based on the user session cache and the data request cache in the multi-level cache, the agent structure request data including to-be-updated agent structure data and an update operation type, determines at least one target logic triggered by the update request according to a preset logic in the memory, executes a processing procedure corresponding to the target logic based on the logic strategy cache in the multi-level cache and the agent structure request data, and obtains updated agent structure data, and returns the updated agent structure data to the client to enable the client to display a flowchart or tree diagram corresponding to the updated agent structure data to the user. This method updates the agent structure data through the multi-level cache, the user session cache, the data request cache, and the logic strategy cache, and is more efficient and takes less time than using a storage device to extract, process, store, and return data, and does not cause request blocking, can quickly respond to user data update requests, and improves user experience.
[0036] In the present application, the "multi-level cache" based on memory is used to replace "reading data from a storage device" and "saving data to a storage device" in the existing scheme with reading data from a cache and saving data to a cache. "Reading data from a storage device to a cache" and "saving data from a cache to a storage device" are separated from the user request flow and executed asynchronously (such as the content about the transaction processor later), thereby reducing the response time in the user request flow.
[0037] The present application also provides another method for updating agent structure data, which is implemented on the basis of the above-mentioned embodiments; the present embodiment focuses on the data update process based on a three-level cache.
[0038] Further, the update request carries a project identifier and / or a user identifier; the step of acquiring agent structure request data corresponding to the update request based on the user session cache and the data request cache in the multi-level cache includes:
[0039] (1) judging whether the intelligent agent structure data corresponding to the project identifier and / or the user identifier exists in the multi-level cache; if not, reading the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the storage device and loading the intelligent agent structure data into the user session level cache; if yes, directly extracting the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the user session cache in the multi-level cache, as in the next step (2). The content in the user session level cache includes the user identifier, the project identifier, and all intelligent agent information (including ID (Identit Document, identity identifier), name, attribute list, and logic list) located by the user identifier and the project identifier.
[0040] (2) extracting the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache;
[0041] (3) generating intelligent agent structure request data based on the intelligent agent structure data and the update request, and storing the intelligent agent structure request data in the data request level cache of the multi-level cache. The content in the data request level cache includes the user identifier, the project identifier, the operation to be performed in the current request (updating the intelligent agent ID information including the updated intelligent agent ID, the updated attribute ID, the updated logic ID, and the type of update operation (creation, deletion, modification)), and all intelligent agent information to be used in the current request (obtained according to the intelligent agent ID in the operation to be performed in the current request).
[0042] In a specific implementation, the update request carries the intelligent agent identifier information to be updated and the update operation type. First, the intelligent agent structure data to be updated corresponding to the intelligent agent identifier information to be updated is found 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 are stored in the data request level cache in the multi-level cache.
[0043] Further, the preset logic includes a plurality of logics, a matching rule corresponding to each logic, and a logic priority. 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) finding the matching rule hit according to the intelligent agent identifier information to be updated carried in the update request, and taking the logic corresponding to the matching rule hit as the target logic;
[0045] (2) sorting the target logics according to the logic priority corresponding to each target logic to obtain at least one target logic triggered by the update request.
[0046] Further, the step of executing the processing process corresponding to the target logic based on the logic strategy level cache in the multi-level cache and the intelligent agent structure request data to obtain the updated intelligent agent structure data includes:
[0047] According to the order of the target logic, retrieve the target logic to be executed in sequence:
[0048] (1) Extract the target agent structure data corresponding to the target logic from the agent structure request data and store it in the logic policy level cache; the contents of the above logic policy level cache include: user identifier, project identifier, information of the current logic (priority, execution rules), agent information before the current logic starts to execute, and the latest information of the agent during the execution of the current logic.
[0049] (2) Read the target agent structure data from the logical policy-level cache;
[0050] (3) Based on 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 logical policy-level cache.
[0051] Furthermore, based on the agent identifier information to be updated, the processed agent structure data can be written to the data request-level cache, and the corresponding logic policy-level cache can be destroyed. After all target logic has been executed, the processed agent structure data in the data request-level cache is written to the user session-level cache; the data request-level cache is then destroyed.
[0052] It should be noted that all of the above steps can be performed by the logical processor configured in the server.
[0053] See Figure 3 As shown, the specific execution steps of the logic processor are as follows:
[0054] A. Check if the target user's data for the target project exists in the multi-level data cache of the agent structure. (Although the "multi-level cache" has a faster read / write speed than storage devices, it is more expensive and therefore has a smaller capacity, which cannot meet the need to store all data. Therefore, there is a timed deletion strategy to clear inactive data from the multi-level cache every 30 minutes. If a user's data in a project has not been accessed for 30 minutes, then that user's data in that project will be considered inactive and deleted.) If it does not exist, directly read the existing agent structure data from the storage device (referring to the list of all existing agents in the target user's data for 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" which is stored in the memory of the logic processor and bound to the "user session-level cache" in the multi-level data cache. The "user session object" contains the ID of the corresponding "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" containing the ID of the "user session object" corresponding to the request received by the server this time, the ID of the agent in the operation this time, the ID of the agent attribute and logic in the operation this time, the type of the operation (create, modify, delete), the client identity information of the request this time, the timestamp of the request this time, the unique ID of the request this time, and the logic queue (initially empty). At the same time, the "data request level cache" in the "multi-level cache" is used to save the agent structure information in the request, and multiple logic strategies triggered in the request are allowed 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 development, 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 a logic is triggered by the request according to the matching rules of the logic, and if it is triggered, the logic is added to the logic queue of the "data request object", and the logic is sorted from high to low according to the priority.
[0057] The matching rule is used to determine whether a logic needs to be executed in a request. The execution rule indicates which steps the logic needs to execute. The priority is used to determine which logic should be executed first among multiple logics.
[0058] For example, when a logic is needed for an agent with a power attribute, when the agent senses that the power is less than 10%, it automatically charges. The matching rule and the execution rule can be as follows:
[0059] Matching rule: match successfully when the "update agent structure" request is to add a power attribute to the structure of an agent.
[0060] Execution rule:
[0061] 1. Add a power attribute to the agent;
[0062] 2. Add a "sense power" sensing logic to the agent. The steps of this logic are:
[0063] a. Get the power from the power supply device;
[0064] b. Determine whether the power is less than 10%;
[0065] c. Trigger the "execute charging" decision logic when the power is less than 10%.
[0066] 3. Add the decision logic of "execute charging" for the agent. The steps of this logic are:
[0067] a. Get the charger position;
[0068] b. Move to the charger position;
[0069] c. Connect the charger.
[0070] D. The logic processor executes the logic in the logic queue from high to low priority.
[0071] E. When executing a logic, the logic processor creates a "logic strategy level request object" in the memory, and saves the current structure of the agent in the "data request level cache" in the "logic strategy level cache". The "logic strategy request object" records its ID. During the execution of a logic strategy, multiple threads may be created to complete the strategy. These threads can read the data in the "logic strategy level cache" through the "logic strategy request object", and save the processed results to the "logic strategy level cache". After the current logic is executed, the agent structure data after processing is written to the "data request level cache" through the information stored in the "data request object" in the current logic processor, and then the "logic strategy level cache" is destroyed.
[0072] F. After all the logic is executed, the agent structure data after processing in the "data request level cache" is written to the "user session level cache", the updated agent ID information (including the updated agent ID, the updated attribute ID, the updated logic ID, and the type of update operation (create, delete, modify)) is added to the agent update ID queue of the "user session object", and returned to the visual editor.
[0073] Further, after the above step of destroying the data request level cache, further comprising:
[0074] According to the to-be-updated agent identification information, extracting the corresponding agent structure data from the user session level cache; data aggregation of the extracted agent structure data with the user identification and the project identification; storing the aggregated data in the storage device.
[0075] The step of storing the aggregated data in the storage device can be completed by a transaction processor configured in the server. That is, while the logical processor in the server returns the updated data to the visual editor, the agent update ID queue in the "user session object" is taken out, the corresponding agent structure data is taken out from the "user session level cache" according to the ID, the data is aggregated according to the user basic information and the user project information, and a storage transaction is initiated 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 application, after all the target logic is completed, the data storage of the storage device is performed, which is equivalent to asynchronously initiating a data storage request to the transaction processor to persist the agent structure multi-level cache. The transaction processor combines the data from the agent structure multi-level cache and writes it into the storage device. In the specific implementation, after receiving the data storage request, the transaction processor creates a data buffer according to the project information and the user information. The buffer is emptied every 2 seconds or when the data volume exceeds 10 MB. "Emptying" means that all data change records in the buffer are executed once for data persistence, written into the storage device, and the data in the data buffer is deleted. When the emptying is triggered, a new data buffer is first created, and subsequent transaction processors receive transactions and write them into the new data buffer. At the same time, a snapshot of the old data buffer is taken, and then the snapshot is used for data persistence. The old data buffer is deleted after the data persistence is successful. In this way, if an exception occurs during the persistence process, the snapshot can be regenerated.
[0077] The above-mentioned method reduces the number of communications between the server and the storage device, reduces the additional network overhead caused by frequent communications, and reduces the load of the storage device caused by frequent processing of IO events (input / output events), thereby improving the efficiency of the storage device in executing data read / write.
[0078] In related technologies, there are a large number of linkage rules in the attribute definition of the agent. According to the common implementation method, the developer needs to implement the corresponding logic according to the request of the client. However, since the request generated in the agent editing process is a description of data changes, there can be multiple combinations, for example, there can be "change attribute 1" and "change attribute 2" requests, thereby combining "update attribute 1 first, then update attribute 2" or "update attribute 2 first, then update attribute 1" requests. Such combinations increase geometrically with the increase of different types of basic attributes, that is, Figure 1 Step 4 in the related art needs the developer to write a large amount of combined logic, which requires a large amount of development cost.
[0079] To solve the above problems, the embodiment of the application provides a method for completing logic rapid development through a logic plug-in processor. A system administrator can modify JavaScript scripts and IDL file definitions through a service background, and update new logic into the memory of a logic processor through the logic plug-in processor, thereby reducing the maintenance, development and online costs caused by data update rule changes, and reducing the overall cost of the service end.
[0080] Specifically, the server is further configured with a logic plug-in processor; the preset logic includes code logic and script / IDL logic; the code logic is different from the script logic and the IDL logic. The code logic refers to logic for realizing the functions of the server in the scheme and cannot be dynamically modified once compiled and deployed onto the server. The script logic and the IDL logic can be updated by sending an "update processing logic" request to the server through the service background.
[0081] The update process of the script / IDL logic is as follows: the logic plug-in processor receives a processing logic update request; the processing logic update request includes a logic form; and the script / IDL logic in the memory is updated based on the logic in the logic form.
[0082] Further, before the step of updating the script / IDL logic in the memory based on the logic in the logic form, the method further includes: suspending the reception of an update request of agent structure data initiated by a client; and after the step of updating the script / IDL logic in the memory based on the logic in the logic form, the method further includes: resuming the reception of the update request of the agent structure data initiated by the client.
[0083] The specific implementation process of the system administrator modifying JavaScript scripts and IDL file definitions through the service background and updating new logic into the memory of the logic processor through the logic plug-in processor is as follows:
[0084] 1. The system administrator fills in the logic rules through a form provided by the service background. The logic rules include "matching rules", "execution rules" and "priority". The execution rules support JavaScript syntax and IDL rules. When the IDL rules are used, the value dependency relationship of an agent attribute can be specified through a variable expression, for example, ${Agent1}.${Property1}.value=10*${Agent1}.${Property2}.
[0085] 2. After the system administrator completes the editing, the system administrator can make the "logic plug-in processor" initiate an update processing logic request to the "logic processor" through the submission operation of the service background form.
[0086] 3. The logic processor receives a request to update the logic, temporarily interrupts receiving new requests from the visual editor, adds the new logic to the logic record in memory, and resumes accepting requests from the visual editor after the new logic is added.
[0087] In the embodiments of the present application, the above problem of requiring a large amount of logic development cost is solved by priority and matching rules. The user only needs to define two kinds of logic, "change attribute 1" and "change attribute 2". When the matching rules of the two logics are both matched successfully, the effect of "changing attribute 1 first, then changing attribute 2" can be automatically realized according to the priority, and the execution order of "change attribute 1" and "change attribute 2" can be adjusted by modifying the priority. In addition, the submission operation can make the server temporarily stop receiving new user requests, avoiding the abnormality caused by "logic processing on one side processing user requests, and updating logic on the other side". 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 embodiments, the embodiments of the present application also provide an agent structure data updating device, as shown in Figure 4 The device includes: a request receiving module 402 configured to receive an agent structure data updating request initiated by a client; a data obtaining module 404 configured to obtain agent structure request data corresponding to the updating request based on a user session level cache and a data request level cache in a multi-level cache; the agent structure request data includes: to-be-updated agent structure data and an updating operation type; a logic determining module 406 configured to determine at least one target logic triggered by the updating request according to preset logic in memory; a data updating module 408 configured to execute a processing process corresponding to the target logic based on a logic strategy level cache and the agent structure request data in the multi-level cache, and obtain updated agent structure data; and a data returning module 410 configured to return the updated agent structure data to the client, so that the client shows a flowchart or a tree diagram corresponding to the updated agent structure data to the user.
[0089] Further, the updating request carries a project identifier and / or a user identifier; the data obtaining module 404 is configured to extract agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache; generate agent structure request data based on the agent structure data and the updating request, and store the agent structure request data in the data request level cache of the multi-level cache.
[0090] Further, the data acquisition module 404 is configured to determine whether the intelligent agent structure data corresponding to the project identifier and / or the user identifier exists in the multi-level cache before extracting the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache; if not, read the intelligent agent structure data corresponding to the project identifier and / or the user identifier from the storage device and load the intelligent agent structure data into the user session level cache.
[0091] Further, the update request carries the intelligent agent identifier information to be updated and the update operation type; the data acquisition module 404 is configured to search for the intelligent agent structure data to be updated corresponding to the intelligent agent identifier information to be updated from the intelligent agent structure data; determine the intelligent agent structure data to be updated and the update operation type as intelligent agent structure request data, and store the intelligent agent structure request data in the data request level cache in the multi-level cache.
[0092] Further, the preset logic includes a plurality of logics, a matching rule corresponding to each logic, and a logic priority; the logic determination module 406 is configured to search for a matching rule hit according to the intelligent agent identifier information to be updated carried in the update request, take the matching rule hit as a target logic, and sort the target logics triggered by the update request according to the logic priority corresponding to each target logic.
[0093] Further, the data update module 408 is configured to take out the target logic to be executed currently in sequence according to the arrangement order of the target logics, extract the target intelligent agent structure data corresponding to the target logic from the intelligent agent structure request data, and save the target intelligent agent structure data in the logic strategy level cache; read the target intelligent agent structure data in the logic strategy level cache; perform logic processing on the target intelligent agent structure data according to the execution rule in the target logic, and save the processed intelligent agent structure data in the logic strategy level cache.
[0094] Further, the data update module 408 is configured to, after the step of saving the processed intelligent agent structure data in the logic strategy level cache, write the processed intelligent agent structure data into the data request level cache according to the intelligent agent identifier information to be updated, and destroy the logic strategy level cache corresponding to the processed intelligent agent structure data.
[0095] Further, the data update module 408 is configured to, after the step of saving the processed intelligent agent structure data in the logic strategy level cache, write the processed intelligent agent structure data into the data request level cache according to the intelligent agent identifier information to be updated, and destroy the logic strategy level cache corresponding to the processed intelligent agent structure data.
[0096] Furthermore, after the step of destroying the data request-level cache, the data update module 408 extracts the corresponding agent structure data from the user session-level cache according to the agent identifier information to be updated; aggregates the extracted agent structure data with the user identifier and the project identifier; and stores the aggregated data in the storage device.
[0097] Furthermore, the server is also configured with a logic plug-in processor; the preset logic includes code logic and script / interactive data language logic; the device further includes: a logic update module, used to perform the following update process of the script / interactive data language logic: 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 memory based on the logic in the logic forms.
[0098] Furthermore, the aforementioned logic update module is used to pause receiving update requests for agent structure data initiated by the client before updating the script / interactive data language logic in memory based on the logic in the logic form; and to resume receiving update requests for agent structure data initiated by the client after updating the script / interactive data language logic in memory based on the logic in the logic form.
[0099] The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts of the device embodiment not mentioned can be referred to the corresponding content in the aforementioned method embodiment.
[0100] This application also provides an electronic device, such as... Figure 5 The diagram shows the structure of the electronic device, which 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-described 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] The memory 50 can include a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. 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, a wide area network, a local network, a 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 222>Only one bidirectional arrow is used in the figure to represent only one bus or one type of bus.
[0103] The processor 51 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 51 or the instructions in the form of software. The processor 51 described above can be a general-purpose 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 device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, or other mature storage media in the art. The storage medium is located in the memory, and the processor 51 reads the information in the memory and combines the hardware to complete the steps of the method of the foregoing embodiments.
[0104] The embodiment of 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 cause the processor to implement the method described above. For details, refer to the foregoing method embodiments, which will not be described here again.
[0105] The computer program product of the method, the device and the electronic device provided by the embodiment of the present application includes a computer readable storage medium storing program codes. The instructions included in the program codes can be used to execute the method described in the foregoing method embodiments. For details, refer to the method embodiments, which will not be described here again.
[0106] Unless specifically stated, the relative arrangement of the components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application.
[0107] If the functions are realized in the form of software function units and sold or used as independent products, the functions can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0108] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", and the like indicate the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present application and simplify the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0109] Finally, it should be noted that the above-described embodiments are merely specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit the same. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any skilled person in the art can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features, within the technical scope disclosed by the present application. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An updating method of an agent structure data, characterized by, The method comprises: receiving an update request of agent structure data initiated by a client; based on the user session level cache and the data request level cache in the multi-level cache, obtaining agent structure request data corresponding to the update request; the agent structure request data comprises: to-be-updated agent structure data and an update operation type; determining 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, executing a processing process corresponding to the target logic to obtain updated agent structure data; returning the updated agent structure data to the client to enable the client to show a flowchart or a tree diagram corresponding to the updated agent structure data to a user.
2. The method of claim 1, wherein, 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 agent structure request data corresponding to the update request comprises: extracting agent structure data corresponding to the project identifier and / or the user identifier from the user session level cache; generating agent structure request data based on the agent structure data and the update request, and storing the agent structure request data in the data request level cache of the multi-level cache.
3. The method of claim 2, wherein, 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 comprises: determining whether the multi-level cache comprises agent structure data corresponding to the project identifier and / or the user identifier; if not, reading the agent structure data corresponding to the project identifier and / or the user identifier from a storage device and loading the agent structure data into the user session level cache.
4. The method of claim 3, wherein, The update request carries to-be-updated agent identifier information and an update operation type; generating agent structure request data based on the agent structure data and the update request comprises: finding to-be-updated agent structure data corresponding to the to-be-updated agent identifier information from the agent structure data; determining the to-be-updated agent structure data and the update operation type as agent structure request data, and storing the agent structure request data in the data request level cache in the multi-level cache.
5. The method of claim 4, wherein, The preset logic comprises a plurality of logics, a matching rule corresponding to each logic, and a logic priority; determining at least one target logic triggered by the update request according to the preset logic in the memory comprises: finding a matching rule that is hit according to the to-be-updated agent identifier information carried in the update request, and taking a logic corresponding to the matching rule that is hit as a target logic; sorting the target logics according to a logic priority corresponding to each target logic to obtain at least one target logic triggered by the update request.
6. The method of claim 5, wherein, based on the logic strategy level cache and the agent structure request data in the multi-level cache, executing a processing process corresponding to the target logic to obtain updated agent structure data, comprises: According to the arrangement order of the target logics, the current target logic to be executed is taken out in sequence, target agent structure data corresponding to the target logic is extracted from the agent structure request data, and is saved in the logic strategy level cache; The target agent structure data in the logic strategy level cache is read; The target agent structure data is logically processed according to the execution rule in the target logic, and the processed agent structure data is saved in the logic strategy level cache.
7. The method of claim 6, wherein, After the processed agent structure data is saved in the logic strategy level cache, the method further comprises: 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 of claim 6, wherein, The method further comprises: When all the target logics are executed, the processed agent structure data in the data request level cache is written into the user session level cache; The data request level cache is destroyed.
9. The method of claim 8, wherein, After the data request level cache is destroyed, the method further comprises: 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; The aggregated data is stored in the storage device.
10. The method of claim 1, wherein, The preset logic comprises code logic and script / interactive data language logic; and the updating process of the script / interactive data language logic is as follows: A logic update request is received by a logic plug-in processor; the logic update request comprises a logic form; The script / interactive data language logic in the memory is updated based on the logic in the logic form.
11. The method of claim 10, wherein, Before the script / interactive data language logic in the memory is updated based on the logic in the logic form, the method further comprises: Pausing receiving an update request of agent structure data initiated by a client; After the script / interactive data language logic in the memory is updated based on the logic in the logic form, the method further comprises: Resuming receiving the update request of the agent structure data initiated by the client.
12. An apparatus for updating structure data of an agent, characterized by comprising: The apparatus comprises: A request receiving module configured to receive an update request of agent structure data initiated by a client; A data obtaining module configured to obtain agent structure request data corresponding to the update request based on a user session level cache and a data request level cache in a multi-level cache; the agent structure request data comprises agent structure data to be updated and an update operation type; A logic determining module configured to determine at least one target logic triggered by the update request based on preset logic in a memory; A data updating module configured to execute a processing process corresponding to the target logic based on a logic strategy level cache and the agent structure request data in the multi-level cache, and obtain updated agent structure data; A data returning module configured to return the updated agent structure data to the client, so that the client shows a flowchart or a tree diagram corresponding to the updated agent structure data to a user.
13. An electronic device, comprising: A computer readable storage medium storing computer executable instructions that, when called and executed by a processor, cause the processor to implement the method of 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 that, when called and executed by a processor, cause the processor to implement the method of 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