Intelligent logistics agent tool orchestration method and system
Patent Information
- Application Number
- CN202611095315.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-09
AI Technical Summary
通过根据字段更新时间和不同状态查询工具的返回结果生成具有有效状态、待核验状态和冲突状态的业务状态证据集,并以所述业务状态证据集作为工具编排和调用控制的依据,在写入工具执行前比较当前业务状态版本与基准业务状态版本,在写入工具执行后再根据实际业务状态核验执行结果,使工具编排、写入控制和结果确认均基于业务对象的实际字段状态进行,能够减少过期状态、冲突状态及调用期间状态变化造成的错误写入、重复调用和编排失效。
Smart Images

Figure CN122884623A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of smart logistics and artificial intelligence technology, specifically to a method and system for orchestrating smart logistics intelligent agent tools. Background Technology
[0002] With the development of artificial intelligence technology, large language models are increasingly being used to recognize natural language requests input by users, and combined with intelligent agents to complete task decomposition, process orchestration, and business processing. In smart logistics scenarios, meeting room reservations, access control authorization, equipment allocation, and service processing often involve the continuous invocation of multiple business tools. Therefore, it is necessary to select the appropriate skill according to the user request and orchestrate the invocation order of multiple tools.
[0003] Chinese invention patent application CN118551751A, published on August 27, 2024, discloses a multi-agent collaborative method, apparatus, device, and medium based on a large language model. It involves a master agent performing intent recognition, process reasoning, and process decomposition on the natural language to be processed. A task creation agent generates the decomposed tasks, an intent orchestration agent generates the processing flow, a target professional agent obtains the processing result according to the processing flow, and the master agent outputs the reasoning conclusion. However, this invention patent application primarily focuses on task division among multiple agents, process orchestration, and the correctness of processing results. When agents call tools to generate or modify logistics business records, it does not yet address the validity or conflict of the status data based on the update time of the business status data and different query results, nor does it provide a specific method for verifying changes in business status before writing to the tool.
[0004] Therefore, the present invention provides a method and system for orchestrating intelligent logistics agent tools. Summary of the Invention
[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a method and system for orchestrating intelligent logistics agent tools. By generating a business state evidence set, an orchestration execution chain is generated based on the input and output fields of the tool and changes in business state. Before writing the tool call, the current business state version is compared with the baseline business state version. After the call, the execution results are verified, duplicate calls are prevented, compensation is provided, and the system is re-orchestrated based on the actual business state. This achieves state consistency control and abnormal execution handling during the intelligent logistics tool call process.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a method for orchestrating intelligent logistics agent tools, comprising: S1. Determine the target skill record, target business object set, target completion time, and target business status based on the logistics service request; S2. Generate a business status evidence set based on the target skill records and the target business object set; S3. Generate the orchestration execution chain and baseline business state version based on the target business state and the business state evidence set; S4. Generate the current business state version and call the tools in the orchestration execution chain based on the comparison result between it and the baseline business state version; S5. Verify the execution results of the writing tool based on the actual business status; S6. Generate a confirmation execution record based on the execution result of the writing tool and update the skill call data and tool call data.
[0007] Preferably, the system acquires logistics service requests and multiple skill records. The logistics service request includes pending logistics matters, the business entities involved, and the processing time. Each skill record includes a skill identifier, skill description, applicable object type, skill completion status, and associated tool identifier. The skill description records the logistics matters that the corresponding skill can handle. The skill completion status includes one or more completion status items. Each completion status item includes the applicable object type, target field name, target field value, and status query tool identifier, which are used to indicate the field status that the business object should reach after the corresponding skill is executed. Obtain the large language model by inputting the logistics service request, skill identifiers, skill descriptions, and applicable object types from each skill record into the large language model. The large language model then extracts the pending logistics items, the business objects involved, and the processing time from the logistics service request. When the pending logistics items are the same as those recorded in the skill description, and the object type of the business objects involved is the same as the applicable object type, the skill identifier in the corresponding skill record is used as the target skill identifier, the business objects involved are used as the target business objects, and the processing time is used as the target completion time. The target business object includes the object type and the business object identifier; one or more target business objects output by the large language model are combined into a target business object set; Query all skill records to find the skill record whose skill identifier matches the target skill identifier, obtain the target skill record, and use the skill completion status in the target skill record as the target business status; Record the number of input tokens and output tokens generated by the large language model in processing logistics service requests, and use the sum of the two as the number of model call tokens.
[0008] Preferably, the tool capability record is read based on the associated tool identifier in the target skill record; each tool capability record includes a tool identifier, applicable object type, required input fields, output fields, business status before invocation, expected status change, execution side effect flag, invocation parameters, status query tool identifier, business record query tool identifier, business chain identifier parameter name, compensable flag, and compensation tool identifier; the invocation parameters include the input parameter name, parameter value format, and return field name; the parameter value format includes the data type of the input parameter, and the corresponding data length and value range when the input parameter has data length and value range; Tools that perform side effects marked as queries are status query tools; tools that perform side effects marked as writes are write tools. The pre-call business status of each write tool includes one or more pre-call status items. Each pre-call status item includes the applicable object type, the pre-call field name, the pre-call field value, and the status query tool identifier. The expected status change of each write tool includes one or more expected change items. Each expected change item includes the applicable object type, the expected change field name, the expected change field value, and the status query tool identifier. For each pre-call status item, select the target business object whose object type matches the applicable object type from the target business object set, input its business object identifier into the corresponding status query tool, and read the field value and field update time corresponding to the pre-call field name; A status evidence record is generated based on the query results. The status evidence record includes the business object identifier, field name, field value, status query tool identifier, and field update time. For the same business object identifier, the same field name, and the same status query tool identifier, read historical status evidence records, calculate the time interval between adjacent update times from the different field update times, and use the median of the time interval as the evidence update cycle; For the status evidence records generated this time, first determine whether the field values returned by different status query tools for the same business object identifier and the same field name are the same; when the returned field values are different, mark the corresponding status evidence record as a conflict state; When different status query tools return the same field value, and there are fewer than two field update times that can be used to calculate the evidence update cycle, the current status evidence record will be marked as pending verification. When different status query tools return the same field value, and there are at least two field update times that can be used to calculate the evidence update cycle, calculate the interval between the field update time and the current query time; when the interval is not greater than the evidence update cycle, mark the status evidence record as valid; when the interval is greater than the evidence update cycle, mark the status evidence record as pending verification, thereby obtaining the business status evidence set.
[0009] Preferably, the target business state is used as the orchestration endpoint, and the field values in the business state evidence set are used as the initial input to establish a tool state dependency graph based on the associated tool identifiers in the target skill record. When the output field name of the preceding tool is the same as the required input field name of the following tool, and the field value of the output field of the preceding tool conforms to the parameter value format of the corresponding input parameter of the following tool, a data transfer relationship is established between the two tools; when the expected change item of the preceding writing tool and the pre-call state item of the following writing tool have the same applicable object type, field name, and field value, a state dependency relationship is established between the two writing tools; when the compensable flag of the writing tool is yes, a state recovery relationship is established between the writing tool and the compensation tool. The system searches backward from the completion status item in the target business state to find the writing tool that can form the corresponding target field value, and continues to search for tools that can provide the necessary input fields for the writing tool and writing tools that can enable the writing tool to reach the business state before the call; the found tools are arranged before the corresponding writing tool to form a candidate orchestration path; When a candidate orchestration path uses a status evidence record of a pending verification status, the corresponding status query tool is called before the first writing tool that uses the status evidence record, and the status evidence record is updated with the query result. When a candidate orchestration path uses a conflict state status evidence record, call the status query tool that forms the conflict state respectively; select the field value with the latest field update time as the input field value; when the latest field update time corresponds to more than two different field values, delete the candidate orchestration path that uses the conflict field; If any of the following situations occur in a candidate orchestration path: the required input field cannot be obtained, the writing tool does not record the status query tool identifier, the writing tool does not record the business record query tool identifier, or the compensation is marked as yes but the compensation tool identifier is not recorded; delete the candidate orchestration path. For the remaining candidate orchestration paths, the number of pending status evidence records, the number of writing tools, and the total number of tools are compared in turn, and the candidate orchestration path with the smallest values in each category is selected as the orchestration execution chain. To orchestrate the execution chain, generate a business chain identifier and record the calling order of each tool, the source of the input fields, the business state before the call, the expected state changes, and the associated tool identifier; For each write tool, read the business object identifier, field name, field value, field update time, and status query tool identifier from the status evidence record that provides the field values before the call for that write tool, and form a baseline status item; combine all the baseline status items of a write tool to form a baseline business status version.
[0010] Preferably, tools are invoked sequentially according to the invocation order in the orchestrated execution chain; For status query tools, the field values they return are provided to the subsequent tool that uses those field values; For the writing tool, before sending the call request, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and form the current status item; all the current status items of a writing tool are combined to form the current business status version; When the field values and field update times of all current status items are equal to the field values and field update times of the corresponding baseline status items, it is determined that the current business status version is consistent with the baseline business status version; read the call parameters of the current writing tool, convert the input field values recorded in the orchestration execution chain into parameter values that conform to the corresponding parameter value format, and fill the converted parameter values into the corresponding input parameters; when the tool capability record contains a business chain identifier parameter name, fill the business chain identifier into the input parameter corresponding to that business chain identifier parameter name; The current writing tool is invoked according to the input parameter values, and the interface response is read from the call result based on the returned field name. A tool call record is generated for this tool call, which includes the business chain identifier, tool identifier, input parameters, call start time, interface response, and call end time. When the business chain identifier parameter name is not recorded in the tool capability record, the business chain identifier is only recorded in the tool call record. When the current business status version is inconsistent with the baseline business status version, stop calling the current write tool, update the corresponding status evidence record with the current field value and the current field update time, and return to S3 to regenerate the orchestration execution chain for the part that has not yet been executed; the write tool that has been confirmed to be completed will no longer be included in the regenerated orchestration execution chain.
[0011] Preferably, when the writing tool returns a normal interface response, the status query tool in each expected change item is called to read the actual field value corresponding to the expected change field name, and all the read actual field values are combined to form the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as confirmed as completed.
[0012] When the connection call ends and the writing tool does not return an interface response, the status query tool in each expected change item is called to read the actual field value corresponding to the expected change field name, and all the read actual field values are combined to form the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as having a missing response but has completed execution, and the writing tool is prohibited from being called again under the same business chain identifier. When all actual field values in the actual business status are not equal to the corresponding expected change field values, the business record query tool of the current writing tool is invoked; if the tool capability record of the current writing tool contains the business chain identifier parameter name, the business chain identifier is input into the business record query tool; if the tool capability record does not contain the business chain identifier parameter name, the business object identifier that matches the applicable object type of each expected change item is read from the target business object set, and the business object identifier and target completion time are input into the business record query tool; based on the return result of the business record query tool, it is determined whether the current writing tool has generated a business record; When no business record is found, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and then the current business status version is regenerated. When the regenerated current business status version is consistent with the baseline business status version, the current write tool is called again; after the second call, the status query tool in each expected change item is called to reread the actual field value corresponding to the expected change field name, and the actual business status is updated with the reread actual field value. When all the actual field values after the update are equal to the corresponding expected change field values, mark the current write tool as confirmed and completed; When all the actual field values after the update are not equal to the corresponding expected change field values, return to S3 to regenerate the orchestration execution chain for the part that has not yet been executed; When at least one of the updated actual field values is equal to the corresponding expected change field value, and at least one is not equal to the corresponding expected change field value, the current writing tool is marked as partially formed. When the regenerated current business state version is inconsistent with the baseline business state version, the current write tool will no longer be called, and the process will return to S3 to regenerate the orchestration execution chain of the unexecuted part. When a business record is found but none of the actual field values have reached the expected change field values, the current writing tool will be marked as a business record that has been formed but is incomplete. When at least one actual field value in the actual business state reaches the expected change field value, and at least one actual field value does not reach the expected change field value, the current writing tool is marked as a partial state formation. For writing tools where business records have been formed but the status is incomplete or partially formed, the compensation tool can be called when the compensation mark is set, and the status query tool in the baseline status item can be called after compensation; when the field values after compensation are equal to the field values in the corresponding baseline status item, return to S3 to regenerate the orchestration execution chain of the unexecuted part; If the compensable flag is set to "No", or if the compensated field value is not restored to the field value in the baseline status item, the execution of subsequent tools will be stopped and an abnormal execution record will be generated. The abnormal execution record includes the business chain identifier, tool identifier, time of abnormal occurrence, interface response, actual business status, and compensation result.
[0013] Preferably, when all write tools in the orchestration execution chain are marked as either confirmed completion or missing response but completed execution, the status query tool corresponding to each completion status item in the target business status is invoked to read the actual field value corresponding to the target field name; When all actual field values are equal to the corresponding target field values, the target business status is determined to have been formed, and a confirmation execution record is generated. The confirmation execution record includes the logistics service request, target skill identifier, business chain identifier, number of model call tokens, tool call order, interface response, actual business status, status verification result, compensation result, call start time, and call end time. Update the number of calls, number of completions, and average processing time for the target skill based on the confirmed execution records, and update the number of calls, number of confirmed completions, number of times the response was missing but the execution was completed, number of compensations, and average call time for each tool; Write the field update times generated during this confirmation process into the corresponding historical status evidence record; for the same business object identifier, the same field name, and the same status query tool identifier, extract the distinct field update times from the updated historical status evidence record, arrange the field update times in chronological order, calculate the time interval between two adjacent field update times, and update the median of each time interval as the evidence update cycle; when there are fewer than two distinct field update times, keep the original evidence update cycle unchanged. Write the skill call data, tool call data, model call token count, and abnormal execution records into the corresponding statistical records of the data dashboard.
[0014] A smart logistics intelligent agent tool orchestration system includes a request processing module, an evidence generation module, an orchestration module, a call control module, a result verification module, and a data update module. The request processing module is used to determine the target skill record, the target business object set, the target completion time, and the target business status based on the logistics service request. The evidence generation module is used to call the status query tool to generate a set of business status evidence. The orchestration module is used to generate an orchestration execution chain and a baseline business state version based on the target business state and the business state evidence set. The call control module is used to generate the current business status version, and calls the write tool when the current business status version is consistent with the baseline business status version; The result verification module is used to mark the execution results of the tool according to the actual business status, and to perform re-call, compensation processing and rearrangement. The data update module is used to generate confirmation execution records, update skill call data, tool call data, and evidence update cycle, and write the update results to the corresponding statistical records in the data dashboard.
[0015] (III) Beneficial Effects This invention provides a method and system for orchestrating intelligent logistics agent tools, which has the following beneficial effects: By generating a business status evidence set with valid status, pending verification status, and conflicting status based on the field update time and the return results of different status query tools, and using the business status evidence set as the basis for tool orchestration and invocation control, the current business status version is compared with the baseline business status version before the writing tool is executed, and the execution result is verified based on the actual business status after the writing tool is executed. This ensures that tool orchestration, writing control, and result confirmation are all based on the actual field status of the business object, which can reduce erroneous writing, duplicate calls, and orchestration failures caused by expired status, conflicting status, and status changes during the invocation.
[0016] 2. By establishing data transfer relationships, state dependency relationships, and state recovery relationships between tools, and by looking up tools from the target business state, it can automatically form an orchestration execution chain based on the input fields, output fields, and state changes of the tools, reducing the loss of necessary input fields and errors in the order of tool calls.
[0017] 3. By generating the current business state version before calling the write tool and comparing it with the baseline business state version, the write operation can be stopped and the orchestration execution chain can be regenerated when the business object state changes, thus preventing the write tool from continuing to execute on an invalid business state.
[0018] 4. By querying the actual business status after the write tool is invoked, and combining business record query, response missing prevention of duplicate calls, compensation processing and rearrangement, it is possible to distinguish execution results such as confirmed completion, response missing but execution completed, partial status formed and status incomplete, thereby reducing the risk of duplicate writing and abnormal business record residue. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the process for arranging intelligent logistics agent tools according to the present invention; Figure 2 This is a schematic diagram of the structure of a smart logistics intelligent agent tool orchestration system according to the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Please see Figure 1 This invention provides a method for orchestrating intelligent logistics agent tools, comprising the following steps: S1. Determine the target skill record, target business object set, target completion time, and target business status based on the logistics service request and skill record.
[0022] Retrieves logistics service requests and multiple skill records; a logistics service request is the content of the logistics matter to be handled, including the logistics matter to be handled, the business objects involved, and the handling time; each skill record includes a skill identifier, skill description, applicable object type, skill completion status, and associated tool identifier; the skill description records the logistics matters that the corresponding skill can handle; In one specific embodiment, the skill record is generated using the skill name, skill tag, skill description, skill content, and associated tools stored in the skill management function of the intelligent agent management platform; wherein, the skill identifier is the number of the corresponding skill record, the skill description is a description of the logistic matters that the skill can handle, and the associated tool identifier is the number of the tool associated with the skill; The skill completion status includes one or more completion status items. Each completion status item includes the applicable object type, target field name, target field value, and status query tool identifier, which are used to indicate the field status that the business object should reach after the corresponding skill is executed. A large language model is obtained by inputting the logistics service request, skill identifiers, skill descriptions, and applicable object types from each skill record into the large language model. The large language model then extracts the pending logistics items, the involved business objects, and the processing time from the logistics service request. When the pending logistics items are the same as those recorded in the skill description, and the object type of the involved business objects is the same as the applicable object type, the skill identifier in the corresponding skill record is used as the target skill identifier, the involved business objects are used as the target business objects, and the processing time is used as the target completion time. In a specific embodiment, the large language model adopts the Tongyi Qianwen large language model, which outputs the target skill identifier, target business object, and target completion time based on the input logistics service request, candidate skill information, and field output format. The target business object includes the object type and the business object identifier. The object type is one of personnel, resources, equipment and service items. The business object identifier is one or more of the target business object's number, name and location identifier in the logistics business. The target business object set is composed of one or more target business objects output by the large language model. Query all skill records to find the skill record whose skill identifier matches the target skill identifier, obtain the target skill record, and use the skill completion status in the target skill record as the target business status; Record the number of input tokens and output tokens generated by the large language model in processing logistics service requests, and use the sum of the two as the number of model call tokens.
[0023] S2. Generate a business status evidence set based on the target skill records and the target business object set.
[0024] Read the tool capability record based on the associated tool identifier in the target skill record; each tool capability record includes tool identifier, applicable object type, required input fields, output fields, business status before call, expected status change, execution side effect flag, call parameters, status query tool identifier, business record query tool identifier, business chain identifier parameter name, compensable flag, and compensation tool identifier; In one specific embodiment, the tool capability record is generated using the tool identifier, input parameters, return fields, and associated tools stored in the tool management function and the business API management function; the status query tool uses the meeting room status query interface and the access control permission status query interface, and the writing tool uses the meeting room reservation interface and the access control permission activation interface; The call parameters include the input parameter name, parameter value format, and return field name; the parameter value format includes the data type of the input parameter, as well as the data length and value range when the input parameter has a data length and value range; the business chain identifier parameter name is the name of the corresponding input parameter when the writing tool can receive the business chain identifier; The tool marked as a query for executing side effects is a status query tool, which is used to read the field values and field update times of business objects; the field update time is the time when the corresponding field value was last formed or changed; the tool marked as a write for executing side effects is a write tool, which is used to generate or modify logistics business records. The pre-call business status of each write tool includes one or more pre-call status items. Each pre-call status item includes the applicable object type, the pre-call field name, the pre-call field value, and the status query tool identifier. The expected status change of each write tool includes one or more expected change items. Each expected change item includes the applicable object type, the expected change field name, the expected change field value, and the status query tool identifier. For each pre-call status item, select the target business object whose object type matches the applicable object type from the target business object set, input its business object identifier into the corresponding status query tool, and read the field value and field update time corresponding to the pre-call field name; A status evidence record is generated based on the query results. The status evidence record includes the business object identifier, field name, field value, status query tool identifier, and field update time. For the same business object identifier, the same field name, and the same status query tool identifier, read historical status evidence records, calculate the time interval between adjacent update times from the different field update times, and use the median of the time interval as the evidence update cycle; For the status evidence records generated this time, first determine whether the field values returned by different status query tools for the same business object identifier and the same field name are the same; when the returned field values are different, mark the corresponding status evidence record as a conflict state; When different status query tools return the same field value, and there are fewer than two field update times that can be used to calculate the evidence update cycle, the current status evidence record will be marked as pending verification. When different status query tools return the same field value, and there are at least two field update times that can be used to calculate the evidence update cycle, calculate the interval between the field update time and the current query time; when the interval is not greater than the evidence update cycle, mark the status evidence record as valid; when the interval is greater than the evidence update cycle, mark the status evidence record as pending verification, thereby obtaining the business status evidence set.
[0025] S3. Generate the orchestration execution chain and the baseline business state version based on the target business state and the business state evidence set.
[0026] Using the target business state as the orchestration endpoint and the field values in the business state evidence set as the initial input, a tool state dependency graph is established based on the associated tool identifiers in the target skill record. When the output field name of the preceding tool is the same as the required input field name of the following tool, and the field value of the output field of the preceding tool conforms to the parameter value format of the corresponding input parameter of the following tool, a data transfer relationship is established between the two tools; when the expected change item of the preceding writing tool and the pre-call state item of the following writing tool have the same applicable object type, field name, and field value, a state dependency relationship is established between the two writing tools; when the compensable flag of the writing tool is yes, a state recovery relationship is established between the writing tool and the compensation tool. The system searches backward from the completion status item in the target business state to find the writing tool that can form the corresponding target field value, and continues to search for tools that can provide the necessary input fields for the writing tool and writing tools that can enable the writing tool to reach the business state before the call; the found tools are arranged before the corresponding writing tool to form a candidate orchestration path; When a candidate orchestration path uses a status evidence record of a pending verification status, the corresponding status query tool is called before the first writing tool that uses the status evidence record, and the status evidence record is updated with the query result. When a candidate orchestration path uses a conflict state status evidence record, call the status query tool that forms the conflict state respectively; select the field value with the latest field update time as the input field value; when the latest field update time corresponds to more than two different field values, delete the candidate orchestration path that uses the conflict field; If any of the following situations occur in a candidate orchestration path: the required input field cannot be obtained, the writing tool does not record the status query tool identifier, the writing tool does not record the business record query tool identifier, or the compensation is marked as yes but the compensation tool identifier is not recorded; delete the candidate orchestration path. For the remaining candidate orchestration paths, the number of pending status evidence records, the number of writing tools, and the total number of tools are compared in turn, and the candidate orchestration path with the smallest values in each category is selected as the orchestration execution chain. To orchestrate the execution chain, generate a business chain identifier and record the calling order of each tool, the source of the input fields, the business state before the call, the expected state changes, and the associated tool identifier; For each write tool, read the business object identifier, field name, field value, field update time, and status query tool identifier from the status evidence record that provides the field values before the call for that write tool, and form a baseline status item; combine all the baseline status items of a write tool to form a baseline business status version.
[0027] S4. Generate the current business state version and call the tools in the orchestration execution chain based on the comparison result between it and the baseline business state version.
[0028] The tools are invoked sequentially according to the calling order in the orchestration execution chain; For status query tools, the field values they return are provided to the subsequent tool that uses those field values; For the writing tool, before sending the call request, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and form the current status item; all the current status items of a writing tool are combined to form the current business status version; When the field values and field update times of all current status items are equal to the field values and field update times of the corresponding baseline status items, it is determined that the current business status version is consistent with the baseline business status version; read the call parameters of the current writing tool, convert the input field values recorded in the orchestration execution chain into parameter values that conform to the corresponding parameter value format, and fill the converted parameter values into the corresponding input parameters; when the tool capability record contains a business chain identifier parameter name, fill the business chain identifier into the input parameter corresponding to that business chain identifier parameter name; The current writing tool is invoked according to the input parameter values, and the interface response is read from the call result based on the returned field name. A tool call record is generated for this tool call, which includes the business chain identifier, tool identifier, input parameters, call start time, interface response, and call end time. When the business chain identifier parameter name is not recorded in the tool capability record, the business chain identifier is only recorded in the tool call record. When the current business status version is inconsistent with the baseline business status version, stop calling the current write tool, update the corresponding status evidence record with the current field value and the current field update time, and return to S3 to regenerate the orchestration execution chain for the part that has not yet been executed; the write tool that has been confirmed to be completed will no longer be included in the regenerated orchestration execution chain.
[0029] S5. Verify the execution results of the writing tool based on the actual business status.
[0030] When the writing tool returns a normal interface response, it calls the status query tool for each expected change item to read the actual field value corresponding to the expected change field name, and combines all the read actual field values into the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as confirmed as completed.
[0031] When the connection call ends and the writing tool does not return an interface response, the status query tool in each expected change item is called to read the actual field value corresponding to the expected change field name, and all the read actual field values are combined to form the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as having a missing response but has completed execution, and the writing tool is prohibited from being called again under the same business chain identifier. When all actual field values in the actual business status are not equal to the corresponding expected change field values, the business record query tool of the current writing tool is invoked; if the tool capability record of the current writing tool contains the business chain identifier parameter name, the business chain identifier is input into the business record query tool; if the tool capability record does not contain the business chain identifier parameter name, the business object identifier that matches the applicable object type of each expected change item is read from the target business object set, and the business object identifier and target completion time are input into the business record query tool; based on the return result of the business record query tool, it is determined whether the current writing tool has generated a business record; When no business record is found, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and then the current business status version is regenerated. When the regenerated current business status version is consistent with the baseline business status version, the current write tool is called again; after the second call, the status query tool in each expected change item is called to reread the actual field value corresponding to the expected change field name, and the actual business status is updated with the reread actual field value. When all the actual field values after the update are equal to the corresponding expected change field values, mark the current write tool as confirmed and completed; When all the actual field values after the update are not equal to the corresponding expected change field values, return to S3 to regenerate the orchestration execution chain for the part that has not yet been executed; When at least one of the updated actual field values is equal to the corresponding expected change field value, and at least one is not equal to the corresponding expected change field value, the current writing tool is marked as partially formed. When the regenerated current business state version is inconsistent with the baseline business state version, the current write tool will no longer be called, and the process will return to S3 to regenerate the orchestration execution chain of the unexecuted part. When a business record is found but none of the actual field values have reached the expected change field values, the current writing tool will be marked as a business record that has been formed but is incomplete. When at least one actual field value in the actual business state reaches the expected change field value, and at least one actual field value does not reach the expected change field value, the current writing tool is marked as a partial state formation. For writing tools where business records have been formed but the status is incomplete or partially formed, the compensation tool can be called when the compensation mark is set, and the status query tool in the baseline status item can be called after compensation; when the field values after compensation are equal to the field values in the corresponding baseline status item, return to S3 to regenerate the orchestration execution chain of the unexecuted part; If the compensable flag is set to "No", or if the compensated field value is not restored to the field value in the baseline status item, the execution of subsequent tools will be stopped and an abnormal execution record will be generated. The abnormal execution record includes the business chain identifier, tool identifier, time of abnormal occurrence, interface response, actual business status, and compensation result.
[0032] S6. Generate a confirmation execution record based on the execution result of the writing tool and update the skill call data and tool call data.
[0033] When all write tools in the orchestration execution chain are marked as either confirmed completion or missing response but completed execution, the status query tool corresponding to each completion status item in the target business status is invoked to read the actual field value corresponding to the target field name. When all actual field values are equal to the corresponding target field values, the target business status is determined to have been formed, and a confirmation execution record is generated. The confirmation execution record includes the logistics service request, target skill identifier, business chain identifier, number of model call tokens, tool call order, interface response, actual business status, status verification result, compensation result, call start time, and call end time. Update the number of calls, number of completions, and average processing time for the target skill based on the confirmed execution records, and update the number of calls, number of confirmed completions, number of times the response was missing but the execution was completed, number of compensations, and average call time for each tool; Write the field update times generated during this confirmation process into the corresponding historical status evidence record; for the same business object identifier, the same field name, and the same status query tool identifier, extract the distinct field update times from the updated historical status evidence record, arrange the field update times in chronological order, calculate the time interval between two adjacent field update times, and update the median of each time interval as the evidence update cycle; when there are fewer than two distinct field update times, keep the original evidence update cycle unchanged. Write the skill call data, tool call data, model call token count, and abnormal execution records into the corresponding statistical records of the data dashboard; In one specific embodiment, the data dashboard uses a line chart to display the number of times the target skill is called and the average processing time, and a bar chart to display the number of times each tool is confirmed to be completed, the number of times the response is missing but the execution is completed, and the number of times compensation is made. It also displays the number of model call tokens generated by the large language model in processing logistics service requests.
[0034] Please see Figure 2 This invention provides a smart logistics intelligent agent tool orchestration system, including a request processing module, an evidence generation module, an orchestration module, a call control module, a result verification module, and a data update module. The request processing module is used to determine the target skill record, the target business object set, the target completion time, and the target business status based on the logistics service request. The evidence generation module is used to call the status query tool to generate a set of business status evidence. The orchestration module is used to generate an orchestration execution chain and a baseline business state version based on the target business state and the business state evidence set. The call control module is used to generate the current business status version, and calls the write tool when the current business status version is consistent with the baseline business status version; The result verification module is used to mark the execution results of the tool according to the actual business status, and to perform re-call, compensation processing and rearrangement. The data update module is used to generate confirmation execution records, update skill call data, tool call data, and evidence update cycle, and write the update results to the corresponding statistical records in the data dashboard.
[0035] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0036] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0037] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for orchestrating intelligent logistics agent tools, characterized in that, include: S1. Determine the target skill record, target business object set, target completion time, and target business status based on the logistics service request; S2. Generate a business status evidence set based on the target skill records and the target business object set; S3. Generate the orchestration execution chain and baseline business state version based on the target business state and the business state evidence set; S4. Generate the current business state version and call the tools in the orchestration execution chain based on the comparison result between it and the baseline business state version; S5. Verify the execution results of the writing tool based on the actual business status; S6. Generate a confirmation execution record based on the execution result of the writing tool and update the skill call data and tool call data.
2. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S1, the target skill record, target business object set, target completion time, and target business status are determined based on the logistics service request and skill record, as follows: Retrieves logistics service requests and multiple skill records; logistics service requests include pending logistics matters, involved business entities, and processing time; each skill record includes a skill identifier, skill description, applicable object type, skill completion status, and associated tool identifier; the skill description records the logistics matters that the corresponding skill can handle; The skill completion status includes one or more completion status items. Each completion status item includes the applicable object type, target field name, target field value, and status query tool identifier, which are used to indicate the field status that the business object should reach after the corresponding skill is executed. Obtain the large language model by inputting the logistics service request, skill identifiers, skill descriptions, and applicable object types from each skill record into the large language model. The large language model then extracts the pending logistics items, the business objects involved, and the processing time from the logistics service request. When the pending logistics items are the same as those recorded in the skill description, and the object type of the business objects involved is the same as the applicable object type, the skill identifier in the corresponding skill record is used as the target skill identifier, the business objects involved are used as the target business objects, and the processing time is used as the target completion time. The target business object includes the object type and the business object identifier; one or more target business objects output by the large language model are combined into a target business object set; Query all skill records to find the skill record whose skill identifier matches the target skill identifier, obtain the target skill record, and use the skill completion status in the target skill record as the target business status; Record the number of input tokens and output tokens generated by the large language model in processing logistics service requests, and use the sum of the two as the number of model call tokens.
3. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S2, a business status evidence set is generated based on the target skill records and the target business object set, as follows: The tool capability record is retrieved based on the associated tool identifier in the target skill record. Each tool capability record includes a tool identifier, applicable object type, required input fields, output fields, business status before invocation, expected status change, execution side effect flag, invocation parameters, status query tool identifier, business record query tool identifier, business chain identifier parameter name, compensable flag, and compensation tool identifier. The invocation parameters include the input parameter name, parameter value format, and return field name. The parameter value format includes the data type of the input parameter, as well as the corresponding data length and value range when the input parameter has data length and value range. Tools that perform side effects marked as queries are status query tools; tools that perform side effects marked as writes are write tools. The pre-call business status of each write tool includes one or more pre-call status items. Each pre-call status item includes the applicable object type, the pre-call field name, the pre-call field value, and the status query tool identifier. The expected status change of each write tool includes one or more expected change items. Each expected change item includes the applicable object type, the expected change field name, the expected change field value, and the status query tool identifier. For each pre-call status item, select the target business object whose object type matches the applicable object type from the target business object set, input its business object identifier into the corresponding status query tool, and read the field value and field update time corresponding to the pre-call field name; A status evidence record is generated based on the query results. The status evidence record includes the business object identifier, field name, field value, status query tool identifier, and field update time. For the same business object identifier, the same field name, and the same status query tool identifier, read historical status evidence records, calculate the time interval between adjacent update times from the different field update times, and use the median of the time interval as the evidence update cycle; For the status evidence records generated this time, first determine whether the field values returned by different status query tools for the same business object identifier and the same field name are the same; when the returned field values are different, mark the corresponding status evidence record as a conflict state; When different status query tools return the same field value, and there are fewer than two field update times that can be used to calculate the evidence update cycle, the current status evidence record will be marked as pending verification. When different status query tools return the same field value, and there are at least two field update times that can be used to calculate the evidence update cycle, calculate the interval between the field update time and the current query time. When the interval is no greater than the evidence update cycle, the status evidence record is marked as valid; when the interval is greater than the evidence update cycle, the status evidence record is marked as pending verification, thus obtaining the business status evidence set.
4. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S3, an orchestration execution chain and a baseline business state version are generated based on the target business state and the business state evidence set, as follows: Using the target business state as the orchestration endpoint and the field values in the business state evidence set as the initial input, a tool state dependency graph is established based on the associated tool identifiers in the target skill record. When the output field name of the preceding tool is the same as the required input field name of the following tool, and the field value of the output field of the preceding tool conforms to the parameter value format of the corresponding input parameter of the following tool, a data transfer relationship is established between the two tools; when the expected change item of the preceding writing tool and the pre-call state item of the following writing tool have the same applicable object type, field name, and field value, a state dependency relationship is established between the two writing tools; when the compensable flag of the writing tool is yes, a state recovery relationship is established between the writing tool and the compensation tool. The system searches backward from the completion status item in the target business state to find the writing tool that can form the corresponding target field value, and continues to search for tools that can provide the necessary input fields for the writing tool and writing tools that can enable the writing tool to reach the business state before the call; the found tools are arranged before the corresponding writing tool to form a candidate orchestration path; When a candidate orchestration path uses a status evidence record of a pending verification status, the corresponding status query tool is called before the first writing tool that uses the status evidence record, and the status evidence record is updated with the query result. When a candidate orchestration path uses the state evidence record of a conflict state, the state query tool that forms the conflict state is invoked respectively. Select the field value with the latest update time as the input field value; when the latest field update time corresponds to more than two different field values, delete the candidate orchestration path that uses the conflicting field; If any of the following situations occur in a candidate orchestration path: the required input field cannot be obtained, the writing tool does not record the status query tool identifier, the writing tool does not record the business record query tool identifier, or the compensation is marked as yes but the compensation tool identifier is not recorded; delete the candidate orchestration path. For the remaining candidate orchestration paths, the number of pending status evidence records, the number of writing tools, and the total number of tools are compared in turn, and the candidate orchestration path with the smallest values in each category is selected as the orchestration execution chain. To orchestrate the execution chain, generate a business chain identifier and record the calling order of each tool, the source of the input fields, the business state before the call, the expected state changes, and the associated tool identifier; For each write tool, read the business object identifier, field name, field value, field update time, and status query tool identifier from the status evidence record that provides the field values before the call for that write tool, and form a baseline status item; combine all the baseline status items of a write tool to form a baseline business status version.
5. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S4, the current business state version is generated, and tools in the orchestration execution chain are invoked based on the comparison result between it and the baseline business state version, as follows: The tools are invoked sequentially according to the calling order in the orchestration execution chain; For status query tools, the field values they return are provided to the subsequent tool that uses those field values; For the writing tool, before sending the call request, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and form the current status item; all the current status items of a writing tool are combined to form the current business status version; When the field values and field update times of all current status items are equal to the field values and field update times of the corresponding baseline status items, it is determined that the current business status version is consistent with the baseline business status version; read the call parameters of the current writing tool, convert the input field values recorded in the orchestration execution chain into parameter values that conform to the corresponding parameter value format, and fill the converted parameter values into the corresponding input parameters; when the tool capability record contains a business chain identifier parameter name, fill the business chain identifier into the input parameter corresponding to that business chain identifier parameter name; The current writing tool is invoked according to the input parameter values, and the interface response is read from the call result based on the returned field name; a tool call record is generated for this tool call, which includes the business chain identifier, tool identifier, input parameters, call start time, interface response, and call end time; When the business chain identifier parameter name is not recorded in the tool capability record, the business chain identifier is only recorded in the tool call record; When the current business status version is inconsistent with the baseline business status version, stop calling the current write tool, update the corresponding status evidence record with the current field value and the current field update time, and return to S3 to regenerate the orchestration execution chain of the unexecuted part; The write tools that have already been confirmed to be completed will no longer be included in the regenerated orchestration execution chain.
6. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S5, the execution results of the verification and writing tool are as follows, based on the actual business status: When the writing tool returns a normal interface response, it calls the status query tool for each expected change item to read the actual field value corresponding to the expected change field name, and combines all the read actual field values to form the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as confirmed as completed. When the connection call ends and the writing tool does not return an interface response, the status query tool in each expected change item is called to read the actual field value corresponding to the expected change field name, and all the read actual field values are combined to form the actual business status; when all actual field values are equal to the corresponding expected change field values, the current writing tool is marked as having a missing response but has completed execution, and the writing tool is prohibited from being called again under the same business chain identifier. When all actual field values in the actual business status are not equal to the corresponding expected change field values, the business record query tool of the current writing tool is invoked; if the tool capability record of the current writing tool contains the business chain identifier parameter name, the business chain identifier is input into the business record query tool; if the tool capability record does not contain the business chain identifier parameter name, the business object identifier that matches the applicable object type of each expected change item is read from the target business object set, and the business object identifier and the target completion time are input into the business record query tool. Based on the results returned by the business record query tool, determine whether the current writing tool has already generated a business record; When no business record is found, the status query tool in each baseline status item is called in turn to reread the current field value and current field update time corresponding to the same business object identifier and the same field name, and then the current business status version is regenerated. When the regenerated current business status version is consistent with the baseline business status version, the current write tool is called again; after the second call, the status query tool in each expected change item is called to reread the actual field value corresponding to the expected change field name, and the actual business status is updated with the reread actual field value. When all the actual field values after the update are equal to the corresponding expected change field values, mark the current write tool as confirmed and completed; When all the actual field values after the update are not equal to the corresponding expected change field values, return to S3 to regenerate the orchestration execution chain for the part that has not yet been executed; When at least one of the updated actual field values is equal to the corresponding expected change field value, and at least one is not equal to the corresponding expected change field value, the current writing tool is marked as partially formed. When the regenerated current business state version is inconsistent with the baseline business state version, the current write tool will no longer be called, and the process will return to S3 to regenerate the orchestration execution chain of the unexecuted part. When a business record is found but none of the actual field values have reached the expected change field values, the current writing tool will be marked as a business record that has been formed but is incomplete. When at least one actual field value in the actual business state reaches the expected change field value, and at least one actual field value does not reach the expected change field value, the current writing tool is marked as a partial state formation. For writing tools where business records have been formed but the status is incomplete or partially formed, the compensation tool can be called when the compensation mark is set to "yes", and the status query tool in the baseline status item can be called after compensation. When the compensated field values are equal to the field values in the corresponding baseline status items, return to S3 to regenerate the orchestration execution chain for the unexecuted portion; If the compensable flag is set to "No", or if the compensated field value is not restored to the field value in the baseline status item, the execution of subsequent tools will be stopped and an abnormal execution record will be generated. The abnormal execution record includes the business chain identifier, tool identifier, time of abnormal occurrence, interface response, actual business status, and compensation result.
7. The intelligent logistics agent tool orchestration method according to claim 1, characterized in that: In S6, a confirmation execution record is generated based on the execution result of the writing tool, and the skill call data and tool call data are updated as follows: When all write tools in the orchestration execution chain are marked as either confirmed completion or missing response but completed execution, the status query tool corresponding to each completion status item in the target business status is invoked to read the actual field value corresponding to the target field name. When all actual field values are equal to the corresponding target field values, the target business status is determined to have been formed, and a confirmation execution record is generated. The confirmation execution record includes the logistics service request, target skill identifier, business chain identifier, number of model call tokens, tool call order, interface response, actual business status, status verification result, compensation result, call start time, and call end time. Update the number of calls, number of completions, and average processing time for the target skill based on the confirmed execution records, and update the number of calls, number of confirmed completions, number of times the response was missing but the execution was completed, number of compensations, and average call time for each tool; Write the field update times generated during this confirmation process into the corresponding historical status evidence record; for the same business object identifier, the same field name, and the same status query tool identifier, extract the distinct field update times from the updated historical status evidence record, arrange the field update times in chronological order, calculate the time interval between two adjacent field update times, and update the median of each time interval as the evidence update cycle; when there are fewer than two distinct field update times, keep the original evidence update cycle unchanged. Write the skill call data, tool call data, model call token count, and abnormal execution records into the corresponding statistical records of the data dashboard.
8. A smart logistics agent tool orchestration system, used with the smart logistics agent tool orchestration method according to any one of claims 1 to 7, characterized in that, It includes a request processing module, an evidence generation module, an orchestration module, a call control module, a result verification module, and a data update module. The request processing module is used to determine the target skill record, the target business object set, the target completion time, and the target business status based on the logistics service request. The evidence generation module is used to call the status query tool to generate a set of business status evidence. The orchestration module is used to generate an orchestration execution chain and a baseline business state version based on the target business state and the business state evidence set. The call control module is used to generate the current business status version, and calls the write tool when the current business status version is consistent with the baseline business status version; The result verification module is used to mark the execution results of the tool according to the actual business status, and to perform re-call, compensation processing and rearrangement. The data update module is used to generate confirmation execution records, update skill call data, tool call data, and evidence update cycle, and write the update results to the corresponding statistical records in the data dashboard.
Citation Information
Patent Citations
Multi-agent collaboration method, device and equipment based on large language model and medium
CN118551751A