Method and device for automatically generating purchase order

By introducing agent technology Agent in the procurement process, and automatically generating purchase orders using large language models and prompt word engineering, the high cost and low efficiency problems caused by manual dependence in the existing technology are solved, and more efficient and accurate purchase order generation is achieved.

CN119557433APending Publication Date: 2025-03-04ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411488765.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the prior art, the generation of purchase orders depends on manual consultation and operation, resulting in high labor costs, cumbersome processes, low efficiency and prone to errors.

Method used

By designing a conversational full-process procurement assistant, the agent technology Agent interacts with users and automatically generates purchase orders. Agents include scheduling agents, executing agents, and inspecting agents, using large language models and prompt word engineering to generate procurement order elements, including procurement targets, categories, budgets and background summary.

Benefits of technology

It improves the efficiency and accuracy of purchasing order generation, reduces labor costs, simplifies the process, and improves the overall efficiency of the procurement process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557433A_ABST
    Figure CN119557433A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and a device for automatically generating a purchase order. In the embodiment of the invention, information input by a user is acquired; according to the user input information, purchase order elements are determined, the purchase order elements are generated through different execution agents, and large language models corresponding to different prompt word projects are set in the different execution agents; obtaining all purchase order elements for generating the purchase order; and generating a purchase order according to all the purchase order elements. Through the method, the generation efficiency and accuracy of the purchase order can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a method and device for automatically generating a purchase order. Background Art

[0002] Procurement is an indispensable part of enterprise operation. In the traditional enterprise procurement method, procurement needs correspond to specific purchase orders, and purchase orders are a very important part of the procurement process.

[0003] In the prior art, the generation of purchase orders often relies on manual consultation and operation. Specifically, the purchase order is first consulted by manual customer service. Through multiple rounds of dialogue and communication between the user and the manual customer service, the manual customer service gradually refines the user's needs, manually confirms various elements in the purchase order, and then generates the purchase order through manual operation. The above method has high labor costs, and because the procurement process is relatively complex, the threshold requirements for manual customer service are high. The manual customer service must be familiar with various procurement objects, procurement categories, prices and other elements, and be familiar with the preparation of various purchase orders. The above method has a cumbersome process, resulting in low overall efficiency, and when a large number of purchase orders are manually prepared, not only are errors prone to occur, but the labor cost is also relatively high.

[0004] To sum up, how to improve the efficiency and accuracy of purchase order generation is a problem that needs to be solved at present. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for automatically generating a purchase order. The agent can automatically generate a purchase order through interaction with a user, thereby improving the generation efficiency and accuracy of the purchase order.

[0006] In a first aspect, an embodiment of the present invention provides a method for automatically generating a purchase order, the method comprising:

[0007] Get user input information;

[0008] Determining purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents;

[0009] Get all purchase order elements for generating purchase orders;

[0010] A purchase order is generated based on all the purchase order elements.

[0011] Optionally, the method further includes:

[0012] A corresponding execution agent is determined according to the user input information.

[0013] Optionally, determining purchase order elements according to the user input information specifically includes:

[0014] generating feedback information through the execution agent;

[0015] Generate purchase order elements based on the user input information and the feedback information.

[0016] Optionally, the execution agent includes a dialogue execution agent and a tool call execution agent, wherein the dialogue execution agent includes a target identification execution agent and a background summary execution agent, and the tool call execution agent includes a category identification execution agent and a budget extraction execution agent.

[0017] Optionally, in response to the execution agent being the subject identification execution agent, determining the purchase order elements according to the user input information specifically includes:

[0018] generating first feedback information by executing the target identification agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0019] A procurement target is determined based on at least one piece of the user input information and at least one piece of the first feedback information.

[0020] Optionally, in response to the execution agent being a category identification execution agent, determining the purchase order elements according to the user input information specifically includes:

[0021] generating second feedback information through the category identification execution agent, wherein each piece of user input information corresponds to at least one piece of second feedback information, and a classification model is also set in the category identification execution agent;

[0022] A purchasing category is determined according to at least one piece of the user input information and at least one piece of the second feedback information.

[0023] Optionally, in response to the execution agent being a budget extraction execution agent, determining the purchase order elements according to the user input information specifically includes:

[0024] generating third feedback information through the budget extraction execution agent, wherein each piece of user input information corresponds to at least one piece of third feedback information, and a retrieval model is also set in the budget extraction execution agent;

[0025] A procurement budget is determined according to at least one piece of the user input information and at least one piece of the third feedback information.

[0026] Optionally, in response to the execution agent being a background summary execution agent, determining the purchase order elements according to the user input information specifically includes:

[0027] generating fourth feedback information by the background summary execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0028] A background summary is determined according to at least one piece of the user input information and at least one piece of the fourth feedback information.

[0029] Optionally, the method further includes:

[0030] Acquiring the user input information and the feedback information;

[0031] A corresponding execution agent is re-determined according to the user input information and the feedback information.

[0032] In a second aspect, an embodiment of the present invention provides a device for automatically generating a purchase order, the device comprising:

[0033] An acquisition unit, used for acquiring user input information;

[0034] A determination unit, configured to determine purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents;

[0035] The acquisition unit is also used to acquire all purchase order elements for generating a purchase order;

[0036] A generating unit is used to generate a purchase order according to all the purchase order elements.

[0037] Optionally, the determining unit is further configured to:

[0038] A corresponding execution agent is determined according to the user input information.

[0039] Optionally, the determining unit is specifically configured to:

[0040] generating feedback information by the execution agent;

[0041] Generate purchase order elements based on the user input information and the feedback information.

[0042] Optionally, the execution agent includes a dialogue execution agent and a tool call execution agent, wherein the dialogue execution agent includes a target identification execution agent and a background summary execution agent, and the tool call execution agent includes a category identification execution agent and a budget extraction execution agent.

[0043] Optionally, in response to the execution agent being a target identification execution agent, the determination unit is specifically configured to: generate first feedback information through the target identification execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0044] A procurement target is determined based on at least one piece of the user input information and at least one piece of the first feedback information.

[0045] Optionally, in response to the execution agent being a category identification execution agent, the determination unit is specifically configured to:

[0046] generating second feedback information through the category identification execution agent, wherein each piece of user input information corresponds to at least one piece of second feedback information, and a classification model is also set in the category identification execution agent;

[0047] A purchasing category is determined according to at least one piece of the user input information and at least one piece of the second feedback information.

[0048] Optionally, in response to the execution agent being a budget extraction execution agent, the determination unit is specifically configured to:

[0049] generating third feedback information through the budget extraction execution agent, wherein each piece of user input information corresponds to at least one piece of third feedback information, and a retrieval model is also set in the budget extraction execution agent;

[0050] A procurement budget is determined according to at least one piece of the user input information and at least one piece of the third feedback information.

[0051] Optionally, in response to the execution agent being a background summary execution agent, the determining unit is specifically configured to:

[0052] generating fourth feedback information by the background summary execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0053] A background summary is determined according to at least one piece of the user input information and at least one piece of the fourth feedback information.

[0054] Optionally, the acquisition unit is further used for:

[0055] Acquiring the user input information and the feedback information;

[0056] The determining unit is further used to: re-determine the corresponding execution agent according to the user input information and the feedback information.

[0057] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in the first aspect or any possible embodiment of the first aspect.

[0058] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement a method as described in the first aspect or any possible embodiment of the first aspect.

[0059] In the embodiment of the present invention, by obtaining user input information; determining purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and different execution agents are provided with large language models corresponding to different prompt word projects; obtaining all purchase order elements for generating the purchase order; and generating the purchase order according to all the purchase order elements. The above method can improve the generation efficiency and accuracy of the purchase order. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0061] Figure 1 It is a schematic diagram of an Agent structure in an embodiment of the present invention;

[0062] Figure 2 is a flow chart of a method for automatically generating a purchase order in an embodiment of the present invention;

[0063] Figure 3 is a flow chart of another method for automatically generating a purchase order in an embodiment of the present invention;

[0064] Figure 4 It is a schematic diagram of a device for automatically generating a purchase order in an embodiment of the present invention;

[0065] Figure 5 is a schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.

[0067] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.

[0068] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".

[0069] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.

[0070] In the prior art, the generation of purchase orders often relies on manual consultation and operation. Specifically, the purchase order is first consulted by manual customer service. Through multiple rounds of dialogue and communication between the user and the manual customer service, the manual customer service gradually refines the user's needs, manually confirms various elements in the purchase order, and then generates the purchase order through manual operation. The above method has high labor costs, and because the procurement process is relatively complex, the threshold requirements for manual customer service are high. The manual customer service must be familiar with various procurement objects, procurement categories, and prices, and be familiar with the preparation of various purchase orders. The above method has a cumbersome process, resulting in low overall efficiency. When manually preparing a large number of purchase orders, it is not only easy to make mistakes, but also the labor cost is relatively high. Therefore, how to improve the efficiency and accuracy of generating purchase orders is a problem that needs to be solved at present.

[0071] In order to solve the above problems, in the embodiment of the present invention, a conversational full-process procurement assistant is designed. The conversational full-process procurement assistant is an agent technology Agent. The Agent is an autonomous software or hardware entity that can perceive the environment, make decisions and execute to achieve specific goals. The Agent usually has a certain degree of intelligence and can self-learn and adapt in a dynamic environment. The structural diagram of the Agent is shown in the figure. Figure 1As shown, the Agent includes a scheduling Agent 101, an execution Agent 102, and an inspection Agent 103, wherein the scheduling Agent, the execution Agent, and the inspection Agent correspond to different responsibilities, wherein the scheduling Agent determines task information according to the acquired user input information, and then schedules the execution Agent for the user according to the task information, wherein the execution Agent includes a dialogue execution agent 1021 and a tool call execution agent 1022, wherein the dialogue execution agent 1021 includes a target identification execution agent 10211 and a background summary execution agent 10212, and the tool call execution agent 1021 includes a target identification execution agent 10211 and a background summary execution agent 10212. 022 includes a category identification execution agent 10221 and a budget extraction execution agent 10222, the subject identification execution agent 10211 is used to identify the procurement subject, the background summary execution agent 10212 is used to generate the background summary of the procurement, the category identification execution agent 10221 is used to determine the procurement category, specifically, the category identification execution agent 10221 calls the tool function to determine the procurement category, and receives the return result of the tool function; the budget extraction execution agent 10222 is used to determine the procurement budget, specifically, the category identification execution agent 10221 calls the tool function to determine the procurement budget, and receives the return result of the tool function.

[0072] In a possible implementation, after completing the task assigned by the scheduling agent, the execution agent sends the execution result to the execution agent, and the execution agent re-determines the task information based on the user's new input information and assigns the next execution agent to the user, and so on, until the execution agent obtains all the procurement elements for generating a purchase order.

[0073] In a possible implementation, the checking agent is used to check the interaction information (i.e., dialogue) between the user and different execution agents, identify the specific intention of the user, and determine whether the current execution agent can complete the user's needs. If the current execution agent is capable of handling the user's needs, the current execution agent is re-run or continues to run; if the current execution agent cannot handle the user's needs, the checking agent transmits information to the scheduling agent, and the scheduling agent re-assigns an execution agent to the user.

[0074] In the embodiment of the present invention, the scheduling agent, the execution agent and the inspection agent are mainly constructed by using the text generation capability of the large language model (LLM) in combination with different prompt engineering. The large language model is a deep learning model based on the transformer architecture, which can process and generate natural language text. It is usually trained on a large amount of text data, has the ability to understand and generate language, and is widely used in dialogue systems, text generation and other natural language processing tasks. The prompt engineering is a method for optimizing and customizing the output of a language model. By providing clear and specific prompt words for the language model, the language model can be guided to generate text that meets specific requirements. The prompt engineering is widely used in various generative tasks, such as text creation, code generation, question-answering systems, etc.

[0075] In the embodiment of the present invention, the Agent can communicate with the user in an automated and intelligent manner, thereby efficiently and conveniently generating a relatively accurate purchase order.

[0076] In the embodiment of the present invention, based on the above-mentioned Agent, a method for automatically generating a purchase order is proposed. Specifically, a flow chart of the method for automatically generating a purchase order is shown in FIG. Figure 2 As shown, the method includes:

[0077] Step S201: Obtain user input information.

[0078] Specifically, the execution Agent obtains user input information, wherein the execution Agent is called by the scheduling Agent according to the current task, and different tasks correspond to different execution Agents.

[0079] Step S202: Determine purchase order elements based on the user input information.

[0080] The purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents.

[0081] Specifically, feedback information is generated by the execution agent; and purchase order elements are generated according to the user input information and the feedback information.

[0082] In a possible implementation, since the execution agent includes a target identification execution agent, a background summary execution agent, a category identification execution agent, and a budget extraction execution agent, the purchase order elements are determined according to the user input information in the following four cases, as follows:

[0083] Case 1: In response to the execution agent being the target, an execution agent is identified.

[0084] Determining the purchase order elements according to the user input information specifically includes: generating first feedback information through the target identification execution agent, wherein each user input information corresponds to at least one first feedback information; determining the purchase target according to at least one user input information and at least one first feedback information.

[0085] Specifically, a large language model is set in the target identification execution agent. After receiving the user input information, the target identification execution agent generates first feedback information according to the large language model. The target identification execution agent determines the procurement target according to at least one piece of the user input information and at least one piece of the first feedback information.

[0086] In the embodiment of the present invention, the procurement target is a relatively broad target. In order to guide the user to determine a reasonable and compliant specific target, the target identification execution agent needs to determine a target that can be directly purchased. For example, "college cooperation project" is too broad as a procurement target, "medium-roasted washed coffee beans" is too detailed as a procurement target, and "event venue rental" is a suitable procurement target. In order to determine a more suitable procurement target, the large language model in the target identification execution agent is carefully designed using appropriate prompt word engineering when constructing it, taking into account multiple boundary conditions, thereby ensuring that the target identification execution agent can determine a more reasonable procurement target.

[0087] For example, assuming that the user's input information is "I need a supplier of Chinese-English translation, please find that buyer", the target identification execution agent will feedback to the user after thinking about it, the information is "The purchase target you need is [translation service]", and further, because the user is required to confirm the feedback result of the target identification execution agent, it can output "The purchase target you need is [translation service], do you agree?"; after receiving the user's confirmation information "Approval", the subsequent purchase category can be confirmed, and "The purchase target has been confirmed as [translation service]" can be sent to the scheduling agent for storage. This is only an exemplary explanation.

[0088] In a possible implementation, the large language model may use a qwen-max model as a basis, or may use other models as a basis, which is not limited here.

[0089] Case 2: In response to the execution agent being a category identification execution agent.

[0090] The determining of purchase order elements according to the user input information specifically includes: generating second feedback information through the category identification execution agent, wherein each user input information corresponds to at least one second feedback information, and a classification model is also set in the category identification execution agent; determining a purchase category according to at least one user input information and at least one second feedback information.

[0091] Specifically, a large language model and a classification model are set in the category identification execution agent. After receiving the user input information, the category identification execution agent generates second feedback information according to the large language model. The category identification execution agent determines the procurement category according to at least one piece of the user input information and at least one piece of the second feedback information.

[0092] In one possible implementation, the category identification execution agent first determines whether the procurement subject is a tangible object or an abstract item or service, and then determines the category of the procurement subject; if the procurement subject is a tangible object, it can be matched from the procurement commodity library first, and if the procurement subject is matched, the information in the procurement commodity library is recorded; if the procurement subject is non-physical (i.e., an abstract item or service), the above-mentioned matching process from the procurement commodity library is directly skipped.

[0093] In an embodiment of the present invention, the category identification execution agent is used to classify the procurement subject, and the classification model is called by using the function call capability of the large language model. The classification model can be generated after fine-tuning based on the open source model Struct BERT (Bidirectional Encoder Representations from Transformers), and the classification model has the ability to make category judgments based on the name of the procurement subject; the category identification execution agent can call the classification model to determine the procurement category corresponding to the procurement subject, wherein the BERT model is also a large language model, which understands the text through bidirectional context, so that the BERT model can be used to implement a variety of natural language processing tasks such as question answering, text classification, and named entity recognition.

[0094] For example, after confirming the purchase target according to the previous round of interaction with the user, the category identification execution agent outputs "The purchase category described in the translation service is being queried for you, please wait" after thinking, and then calls the tool function to determine the purchase category, and sends the purchase category to the user for confirmation, and sends it to the scheduling agent for storage; when sending the purchase category to the user here, a text category and / or category code can be sent. For example, the text category is non-physical, and the category code is 0141. It is determined according to the actual situation. This is only an exemplary description.

[0095] In a possible implementation, the BERT model may also be referred to as a tool function.

[0096] Case three: in response to the execution agent being a budget extraction execution agent.

[0097] Determining the purchase order elements according to the user input information specifically includes: generating third feedback information through the budget extraction execution agent, wherein each user input information corresponds to at least one third feedback information, and a retrieval model is also set in the budget extraction execution agent; determining the purchase budget according to at least one user input information and at least one third feedback information.

[0098] Specifically, the budget extraction execution agent sets a large language model and a retrieval model. After receiving user input information, the budget extraction execution agent generates third feedback information according to the large language model. The budget extraction execution agent determines the procurement budget according to at least one piece of user input information and at least one piece of the third feedback information.

[0099] In an embodiment of the present invention, the budget extraction execution agent is used to classify the procurement objects, and the function call capability of the large language model is used to call the retrieval model. The retrieval model can be generated based on the bge-small open source model, wherein the bge-small open source model is one of the Embedding models. The Embedding is a method of mapping entities to fixed-size vectors, and its purpose is to capture the semantics or implicit relationships between entities so that the distance or angle can represent the similarity in the vector space. The bge-small open source model is only an exemplary description and is determined according to the actual situation.

[0100] In a possible implementation, the budget extraction execution agent first extracts the budget from the historical conversation, and returns the result if the extraction is successful; if the historical conversation does not contain budget information, the budget extraction agent will send a query message to the user, and if the user can provide budget information, the budget provided by the user is obtained as the result; if the user fails to provide budget information, a vector search is performed from a pre-built historical purchase order database based on the historical conversation information and the information of the purchase target, and the amounts of several historical purchase orders that are relatively similar to the current purchase target are returned and provided to the user for reference; wherein, the historical purchase order database is generated by periodically constructing and building a T+1 task using the bge-small open source model, and the T+1 task cycle is based on 1 day, that is, the historical purchase database is updated every other day, which is only an exemplary description here, and T can also be 1 hour, 1 week, 1 month, etc., which is determined according to actual conditions.

[0101] For example, after confirming the procurement category based on the previous round of interaction with the user, the budget extraction execution agent outputs "What is the budget you have set for this translation service?" after thinking about it. If the user enters "XX yuan" at this time, the budget extraction execution agent determines the procurement budget according to the user's needs; if the user enters "Any recommendations?" at this time, the budget extraction execution agent needs to call a tool function to determine the recommended procurement budget, and then send the recommended procurement budget to the user; for example, the budget extraction execution agent outputs "Based on past procurement cases, the budget for translation services is approximately xxx yuan. Do you think this budget level is appropriate?" after thinking about it. After receiving the user's confirmation information, the budget of xxx yuan is sent to the scheduling agent for storage. This is only an exemplary explanation.

[0102] In the embodiment of the present invention, the budget extraction execution agent may also be referred to as a budget identification execution agent, and the Embedding model may also be referred to as a tool function.

[0103] Case 4: In response to the execution agent being a background summary execution agent.

[0104] Determining purchase order elements according to the user input information specifically includes: generating fourth feedback information through the background summary execution agent, wherein each user input information corresponds to at least one first feedback information; determining the background summary according to at least one user input information and at least one fourth feedback information.

[0105] Specifically, the background summary execution agent first asks the user whether he has any additional details about the procurement project through a dialogue with the user, and then summarizes the historical dialogue information to generate the title and background information of the purchase order.

[0106] In a possible implementation, the above four situations are executed sequentially or out of order. Specifically, the execution order of the execution Agent is determined according to the calling order of the scheduling Agent.

[0107] Step S203: Obtain all purchase order elements for generating a purchase order.

[0108] In the embodiment of the present invention, the scheduling agent obtains the purchase order elements fed back by each execution agent, for example, the scheduling agent obtains the purchase target, purchase category, purchase budget and background summary.

[0109] In a possible implementation, the total purchase order elements may include other elements in addition to the purchase object, the purchase category, the purchase budget and the background summary. The specific elements are determined according to the actual situation, and different execution agents can be set for the other elements.

[0110] Step S204: Generate a purchase order based on all the purchase order elements.

[0111] In a possible implementation, the scheduling agent may use all the purchase order elements as input parameters, call an existing purchase order generation interface, and generate a purchase order.

[0112] In the embodiment of the present invention, both the scheduling agent and the execution agent can obtain user input information. If the user input information is the user's initial input information, the scheduling agent schedules the corresponding execution agent according to the user input information, that is, after step S201, other steps are included, specifically as follows: Figure 3 As shown, specifically including:

[0113] Step S205: Determine a corresponding execution agent according to the user input information.

[0114] Specifically, after determining to execute the proxy, the user input information is obtained again, and the purchase order elements are determined according to the input information obtained again.

[0115] In the embodiment of the present invention, in addition to the processing flow of the scheduling agent and the execution agent, the designed checking agent can check the dialogue between each execution agent and the user, that is, the execution agent obtains the user input information and the feedback information; and re-determines the corresponding execution agent according to the user input information and the feedback information.

[0116] In a possible implementation, the inspection agent first identifies the user's intention and divides the user's intention into the following four categories, as follows:

[0117] The first category, the dialogue between the user and the execution agent is in the normal flow.

[0118] For example, the user replies to the budget extraction execution agent with budget information. At this time, the inspection agent does not interfere with the current process, and directly transmits the user's reply to the budget extraction execution agent.

[0119] The second category is that the user is not satisfied with the result of the task currently being processed by the Agent.

[0120] For example, the user is in the target identification stage, but the procurement target extracted by the target identification execution agent does not meet the user's expectations. The user wants to modify the result. The checking agent determines that the current target identification execution agent can process the user's request. It only needs to re-run the target identification execution agent without notifying the agent.

[0121] The third category is that the user has made a new request, and the current execution Agent cannot process the user's new request, so task jump is required.

[0122] For example, during the budget extraction phase, the user proposes to modify the name of the procurement object, but the budget extraction execution agent does not have the ability to modify the name of the procurement object. Therefore, the inspection agent needs to inform the scheduling agent to restart the object identification process.

[0123] The fourth category: the user proposes the termination process.

[0124] Specifically, after the inspection agent determines the termination intention, all processes are terminated directly through the scheduling agent.

[0125] In the embodiment of the present invention, based on the large language model technology and agent framework, natural language processing (NLP) technologies such as BERT and embedding are integrated to identify the user's intention during the interaction process, call different execution agents to respond to user instructions, and use human-computer conversation to assist users in generating purchase orders, which is accurate, efficient and highly flexible.

[0126] In a possible implementation, it is possible to set up only an execution agent without setting up an inspection agent and a scheduling agent, and to adopt a fixed process arrangement method to build a fixed process for generating a purchase order. Under the fixed process, all execution agents can only run in a specified order, for example, the order set is target identification, category identification, budget extraction, and background summary generation; the above fixed process solution has poor flexibility, and each execution agent is relatively independent, but cannot be scheduled at will; for example, if the user requires to modify the budget in the background summary link, the execution order can only start from target identification and re-run the entire process; while in the case of setting up an inspection agent and a scheduling agent, a flexible scheduling method is adopted, for example, if the user requires to modify the budget in the background summary link, it only needs to return to the budget extraction link, and then continue downward; the efficiency of not setting up an inspection agent and a scheduling agent is relatively low compared to the solution with a scheduling agent, but it is still better than the existing method of manually generating purchase orders.

[0127] In an embodiment of the present invention, a device for automatically generating a purchase order is provided. Figure 4As shown, it specifically includes: an acquisition unit 401, a determination unit 402 and a generation unit 403; wherein the acquisition unit 401 is used to acquire user input information; the determination unit 402 is used to determine the purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents; the acquisition unit 402 is also used to acquire all purchase order elements for generating a purchase order; the generation unit 403 is used to generate a purchase order according to all the purchase order elements.

[0128] Furthermore, the determining unit is further configured to:

[0129] A corresponding execution agent is determined according to the user input information.

[0130] Furthermore, the determining unit is specifically configured to:

[0131] generating feedback information through the execution agent;

[0132] Generate purchase order elements based on the user input information and the feedback information.

[0133] Furthermore, the execution agent includes a dialogue execution agent and a tool call execution agent, wherein the dialogue execution agent includes a target identification execution agent and a background summary execution agent, and the tool call execution agent includes a category identification execution agent and a budget extraction execution agent.

[0134] Further, in response to the execution agent being a target identification execution agent, the determination unit is specifically configured to: generate first feedback information through the target identification execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0135] A procurement target is determined based on at least one piece of the user input information and at least one piece of the first feedback information.

[0136] Further, in response to the execution agent being a category identification execution agent, the determination unit is specifically configured to:

[0137] generating second feedback information through the category identification execution agent, wherein each piece of user input information corresponds to at least one piece of second feedback information, and a classification model is also set in the category identification execution agent;

[0138] A purchasing category is determined according to at least one piece of the user input information and at least one piece of the second feedback information.

[0139] Further, in response to the execution agent being a budget extraction execution agent, the determination unit is specifically configured to:

[0140] generating third feedback information through the budget extraction execution agent, wherein each piece of user input information corresponds to at least one piece of third feedback information, and a retrieval model is also set in the budget extraction execution agent;

[0141] A procurement budget is determined according to at least one piece of the user input information and at least one piece of the third feedback information.

[0142] Further, in response to the execution agent being a background summary execution agent, the determination unit is specifically configured to:

[0143] generating fourth feedback information by the background summary execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information;

[0144] A background summary is determined according to at least one piece of the user input information and at least one piece of the fourth feedback information.

[0145] Furthermore, the acquisition unit is also used for:

[0146] Acquiring the user input information and the feedback information;

[0147] The determining unit is further used to: re-determine the corresponding execution agent according to the user input information and the feedback information.

[0148] Figure 5 Schematic diagram of the structure of the electronic device in the embodiment of the present invention. Figure 5 As shown, it includes a general computer hardware structure, which at least includes a processor 501 and a memory 502. The processor 501 and the memory 502 are connected via a bus 503. The memory 502 is suitable for storing instructions or programs executable by the processor 501. The processor 501 can be an independent microprocessor or a collection of one or more microprocessors. Thus, the processor 501 executes the instructions stored in the memory 502, thereby executing the method flow of the embodiment of the present invention as described above to realize the processing of data and the control of other devices. The bus 503 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to the display controller 504 and the display device and the input / output (I / O) device 505. The input / output (I / O) device 505 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, the input / output device 505 is connected to the system through an input / output (I / O) controller 506.

[0149] Among them, the instructions stored in the memory 502 are executed by at least one processor 501 to achieve: obtaining user input information; determining purchase order elements based on the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents; obtaining all purchase order elements for generating a purchase order; and generating a purchase order based on all purchase order elements.

[0150] Specifically, the electronic device includes: one or more processors 501 and a memory 502, Figure 5 Take a processor 501 as an example. The processor 501 and the memory 502 may be connected via a bus or other means. Figure 5 In the example, the bus connection is used. The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 501 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 502, that is, the above-mentioned method for determining the automatic generation of the purchase order is realized.

[0151] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] One or more modules are stored in the memory 502, and when executed by one or more processors 501, the method for automatically generating a purchase order in any of the above method embodiments is executed.

[0153] As will be appreciated by those skilled in the art, various aspects of the embodiments of the present invention may be implemented as a system, method or computer program product. Therefore, various aspects of the embodiments of the present invention may take the form of a complete hardware implementation, a complete software implementation (including firmware, resident software, microcode, etc.), or an implementation that combines software aspects with hardware aspects, which may generally be referred to herein as a "circuit," "module," or "system." In addition, various aspects of the embodiments of the present invention may take the form of a computer program product implemented in one or more computer-readable media having a computer-readable program code implemented thereon.

[0154] Any combination of one or more computer-readable media can be utilized. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, (but not limited to) electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or apparatuses, or any suitable combination of the foregoing. More specific examples (non-exhaustive enumeration) of computer-readable storage media will include the following: an electrical connection with one or more wires, a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of an embodiment of the present invention, a computer-readable storage medium can be any tangible medium that can contain or store a program used by an instruction execution system, device or apparatus or a program used in conjunction with an instruction execution system, device or apparatus.

[0155] A computer readable signal medium may include a propagated digital signal having a computer readable program code implemented therein, such as in baseband or as part of a carrier wave. Such propagated signals may take any of a variety of forms, including but not limited to electromagnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any of the following computer readable media: not a computer readable storage medium, and may communicate, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or apparatus.

[0156] Program code embodied on a computer readable medium may be transmitted using any appropriate medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0157] The computer program code for performing operations for various aspects of the embodiments of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, Smalltalk, C++, etc., and conventional process programming languages ​​such as "C" programming language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer as a stand-alone software package; partially on the user's computer and partially on a remote computer; or completely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using the Internet of an Internet service provider).

[0158] The flowchart legend and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present invention described above describe various aspects of the embodiment of the present invention.It will be understood that each block of the flowchart legend and / or block diagram and the combination of the blocks in the flowchart legend and / or block diagram can be implemented by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that the instructions (executed by the processor of the computer or other programmable data processing device) create a device for implementing the function / action specified in the flowchart and / or block diagram block or block.

[0159] These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing device, or other apparatus to operate in a particular manner, so that the instructions stored in the computer-readable medium produce an article of manufacture including instructions for implementing the functions / actions specified in the flowchart and / or block diagram blocks or blocks.

[0160] The computer program instructions may also be loaded onto a computer, other programmable data processing device or other apparatus so that a series of operable steps are performed on the computer, other programmable device or other apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions / actions specified in the flowchart and / or block diagram block or blocks.

[0161] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. Users' refusal to process personal information other than the necessary information required for basic functions will not affect the user's use of basic functions.

Claims

1. A method for automatically generating a purchase order, characterized in that: The method comprises: Get user input information; Determining purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents; Get all purchase order elements for generating purchase orders; A purchase order is generated based on all the purchase order elements.

2. The method according to claim 1, characterized in that The method further comprises: A corresponding execution agent is determined according to the user input information.

3. The method according to claim 1, characterized in that Determining the purchase order elements according to the user input information specifically includes: generating feedback information through the execution agent; Generate purchase order elements based on the user input information and the feedback information.

4. The method according to claim 1, characterized in that The execution agent includes a dialog execution agent and a tool call execution agent, wherein the dialog execution agent includes a target identification execution agent and a background summary execution agent, and the tool call execution agent includes a category identification execution agent and a budget extraction execution agent.

5. The method according to claim 4, characterized in that In response to the execution agent being the subject of the identification of the execution agent, determining the purchase order elements according to the user input information specifically includes: generating first feedback information by executing the target identification agent, wherein each piece of user input information corresponds to at least one piece of first feedback information; A procurement target is determined based on at least one piece of the user input information and at least one piece of the first feedback information.

6. The method according to claim 4, characterized in that In response to the execution agent being a category identification execution agent, determining the purchase order elements according to the user input information specifically includes: generating second feedback information through the category identification execution agent, wherein each piece of user input information corresponds to at least one piece of second feedback information, and a classification model is also set in the category identification execution agent; A purchasing category is determined according to at least one piece of the user input information and at least one piece of the second feedback information.

7. The method according to claim 4, characterized in that In response to the execution agent being a budget extraction execution agent, determining the purchase order elements according to the user input information specifically includes: generating third feedback information through the budget extraction execution agent, wherein each piece of user input information corresponds to at least one piece of third feedback information, and a retrieval model is also set in the budget extraction execution agent; A procurement budget is determined according to at least one piece of the user input information and at least one piece of the third feedback information.

8. The method according to claim 4, characterized in that In response to the execution agent being a background summary execution agent, determining the purchase order elements according to the user input information specifically includes: generating fourth feedback information by the background summary execution agent, wherein each piece of user input information corresponds to at least one piece of first feedback information; A background summary is determined according to at least one piece of the user input information and at least one piece of the fourth feedback information.

9. The method according to claim 3, characterized in that: The method further comprises: Acquiring the user input information and the feedback information; A corresponding execution agent is re-determined according to the user input information and the feedback information.

10. A device for automatically generating a purchase order, characterized in that: The device comprises: An acquisition unit, used for acquiring user input information; A determination unit, configured to determine purchase order elements according to the user input information, wherein the purchase order elements are generated by different execution agents, and large language models corresponding to different prompt word projects are set in different execution agents; The acquisition unit is also used to acquire all purchase order elements for generating a purchase order; A generating unit is used to generate a purchase order according to all the purchase order elements.

11. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.