Service text generation method and apparatus, electronic device, and readable storage medium

By matching the target large language model in the preset large language model library, the problem of low generation flexibility of business text generation is solved, and fast, stable and flexible business text generation is achieved, adapting to the unified docking and network fluctuations of different large language model manufacturers.

WO2025138462A1PCT designated stage expired Publication Date: 2025-07-03SHENZHEN MINGYUAN CLOUD TECHNOLOGY CO LTD

Patent Information

Application Number
PCT/CN2024/083602
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-26
Filing Date
2024-03-25
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the prior art, the generation flexibility of business text generation is low, and faces the problems of incompatibility of text definitions, interface protocols and text entry and exit parameters of different large language model manufacturers, and network fluctuations and abnormal responses lead to a long generation time.

Method used

By matching the target large language model in the preset large language model library, using text index information and template information to quickly locate appropriate candidate models, generate target business text, support unified docking and flexible configuration of multi-vendor models, and provide alternate model switching mechanisms to deal with network instability.

Benefits of technology

It realizes the rapid and automatic generation of target business text, reduces development and docking costs, improves generation flexibility and adaptability, and ensures the stability and security of business text generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083602_03072025_PF_FP_ABST
    Figure CN2024083602_03072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a service text generation method and apparatus, an electronic device, and a readable storage medium. The service text generation method comprises: acquiring a service text generation request inputted for a service to be generated, wherein the service text generation request carrying text request information; matching a corresponding target large language model for the text request information in a preset large language model library; and generating a target service text of said service by means of the target large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Business text generation method, device, electronic device and readable storage medium

[0001] This application claims priority to Chinese patent application No. 202311800691.9 filed on December 26, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and computer-readable storage medium for generating business text. Background Art

[0003] With the continuous development of science and technology, the amount of text information is also growing rapidly over time. At the same time, the requirements for business text are getting higher and higher. To meet business needs, LLM (Large Language Model) is also widely used in various businesses. Among them, LLM can be driven by deep learning algorithms to generate business text that meets business needs.

[0004] At present, business demanders usually access the large language models provided by manufacturers with large language model services through specific interfaces and corresponding usage methods. However, the large language models provided by different large language model manufacturers often have incompatibilities in text definitions, interface protocols, and text input and output parameters. At the same time, when using the service, business demanders will face various unstable problems such as network traffic, network fluctuations, and abnormal responses, which will cause business demanders to spend a lot of time to generate business texts that meet their needs. Therefore, the current business text generation has low flexibility. Technical issues

[0005] The main purpose of this application is to provide a business text generation method, device, electronic device and readable storage medium, aiming to solve the technical problem of low generation flexibility in business text generation. Technical Solutions

[0006] To achieve the above objectives, the present application provides a method for generating a business document, the method comprising:

[0007] Obtaining a service text generation request for a service input to be generated, wherein the service text generation request carries text request information;

[0008] Matching the text request information with a corresponding target large language model in a preset large language model library;

[0009] The target business text of the business to be generated is generated by using the target large language model.

[0010] In one embodiment, the text request information includes text index information and text template information, and the step of matching the text request information with a corresponding target large language model in a preset large language model library includes:

[0011] According to the text index information, query the preset large language model library to obtain at least one candidate large language model;

[0012] Inputting the text template information into each of the candidate large language models to obtain at least one business text template;

[0013] The target large language model is selected from the candidate large language models by detecting the content matching degree between each of the service text templates and the service to be generated.

[0014] In one embodiment, the target service text includes a target prompt word, and the step of generating the target service text for the service to be generated by using the target large language model includes:

[0015] generating a service prompt word template for the service to be generated by using the target large language model;

[0016] The target prompt word is obtained by inserting a service element matching the service to be generated into the service prompt word template.

[0017] In one embodiment, the step of generating the service prompt word template for the to-be-generated service by using the target large language model includes:

[0018] Using the prompt word template output by the target large language model as the service prompt word template for the service to be generated; or

[0019] According to the service type of the service to be generated, the prompt word template output by the target large language model is adjusted to obtain the service prompt word template of the service to be generated.

[0020] In one embodiment, before the step of generating the service prompt word template of the to-be-generated service by using the target large language model, the service text generation method further includes:

[0021] generating a candidate template of a service prompt word for the service to be generated by using the target large language model;

[0022] Detecting whether the candidate template for the business prompt word has passed security authentication;

[0023] If yes, the business prompt word candidate template is used as the prompt word template output by the target large language model;

[0024] If not, the business prompt word candidate template is processed to obtain the prompt word template output by the target large language model.

[0025] In one embodiment, after the step of generating the target service text of the to-be-generated service using the target large language model, the service text generation method further includes:

[0026] Sending the target service text to a service generation terminal that generates the service to be generated;

[0027] Detecting whether text response information fed back by the service generating end based on the target service text is received;

[0028] If not, an alarm mark is performed on the target service text.

[0029] In one embodiment, after the step of generating the target service text of the to-be-generated service using the target large language model, the service text generation method further includes:

[0030] Detecting the switching status of the target large language model according to the target business text;

[0031] When it is detected that the target large language model needs to be switched, obtaining a backup large language model corresponding to the target large language model;

[0032] Generate a service text for the service to be generated by using the backup large language model.

[0033] To achieve the above-mentioned purpose, the present application further provides a business text generation device, the business text generation device comprising:

[0034] An acquisition module, configured to acquire a service text generation request for a service input to be generated, wherein the service text generation request carries text request information;

[0035] A matching module, configured to match the text request information with a corresponding target large language model in a preset large language model library;

[0036] A generation module is used to generate a target business text of the business to be generated by using the target large language model.

[0037] In one embodiment, the text request information includes text index information and text template information, and the matching module is further configured to:

[0038] According to the text index information, query the preset large language model library to obtain at least one candidate large language model;

[0039] Inputting the text template information into each of the candidate large language models to obtain at least one business text template;

[0040] The target large language model is selected from the candidate large language models by detecting the content matching degree between each of the service text templates and the service to be generated.

[0041] In one embodiment, the target business text includes a target prompt word, and the matching module is further configured to:

[0042] generating a service prompt word template for the service to be generated by using the target large language model;

[0043] The target prompt word is obtained by inserting a service element matching the service to be generated into the service prompt word template.

[0044] In one embodiment, the matching module is further configured to:

[0045] Using the prompt word template output by the target large language model as the service prompt word template for the service to be generated; or

[0046] According to the service type of the service to be generated, the prompt word template output by the target large language model is adjusted to obtain the service prompt word template of the service to be generated.

[0047] In one embodiment, the business text generating device is further configured to:

[0048] generating a candidate template of a service prompt word for the service to be generated by using the target large language model;

[0049] Detecting whether the candidate template for the business prompt word has passed security authentication;

[0050] If yes, the business prompt word candidate template is used as the prompt word template output by the target large language model;

[0051] If not, the business prompt word candidate template is processed to obtain the prompt word template output by the target large language model.

[0052] In one embodiment, the business text generating device is further configured to:

[0053] Sending the target service text to a service generation terminal that generates the service to be generated;

[0054] Detecting whether text response information fed back by the service generating end based on the target service text is received;

[0055] If not, an alarm mark is performed on the target service text.

[0056] In one embodiment, the business text generating device is further configured to:

[0057] Detecting the switching status of the target large language model according to the target business text;

[0058] When it is detected that the target large language model needs to be switched, obtaining a backup large language model corresponding to the target large language model;

[0059] Generate a service text for the service to be generated by using the backup large language model.

[0060] The present application also provides an electronic device, which includes: a memory, a processor, and a business text generation program stored in the memory and executable on the processor, wherein the business text generation program is configured to implement the steps of the above-mentioned business text generation method.

[0061] The present application also provides a computer-readable storage medium, comprising a computer program, which implements the steps of the above-mentioned business text generation method when executed by a processor. Beneficial effects

[0062] The present application provides a method, apparatus, electronic device, and computer-readable storage medium for generating business text, comprising: obtaining a business text generation request for a business to be generated, wherein the business text generation request carries text request information; matching the text request information with a corresponding target large language model in a preset large language model library; and generating a target business text for the business to be generated using the target large language model. After the business text generation request is input for the business to be generated, the target large language model can be directly matched in the preset large language model library based on the text request information carried in the business text generation request. That is, during the process of matching the business text generation request with the target large language model, the target large language model that provides the business text for the business to be generated can be directly matched in the preset large language model library. This enables the ability for different large language models in the preset large language model library to uniformly connect to the business text generation request for the business to be generated. Ultimately, the target business text for the business to be generated can be generated using the target large language model. That is, the target business text can be quickly and automatically generated after the business text generation request is input, rather than requiring a significant amount of time to select a target large language model before generating the business text. Therefore, the problem that the large language models provided by different large language model manufacturers often have incompatibilities in text definitions, interface protocols, and text input and output parameters is overcome. At the same time, when the business demand side uses the service, it will face various unstable problems such as network traffic, network fluctuations and abnormal responses, which will lead to the business demand side needing to spend a lot of time to generate business texts that meet the needs. Therefore, the generation flexibility of business texts is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0065] FIG1 is a flow chart of a method for generating a business document according to a first embodiment of the present invention;

[0066] FIG2 is a schematic diagram of the architecture of a business text generation system of the business text generation method provided in Example 1 of the present application;

[0067] FIG3 is a timing diagram of generating a target business text according to the business text generating method provided in Example 1 of the present application;

[0068] FIG4 is a flow chart of a method for generating a business document according to a second embodiment of the present application;

[0069] FIG5 is a timing diagram of information interaction between a client and a server of a text generation method provided in Example 2 of the present application;

[0070] FIG6 is a schematic diagram of the module structure of the business text generation device provided in Example 3 of the present application;

[0071] FIG7 is a schematic diagram of the device structure of the hardware operating environment involved in the business text generation method in an embodiment of the present application. Modes for Carrying Out the Invention

[0072] To make the above-mentioned purposes, features, and advantages of the present application more clearly understood, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.

[0073] Example 1

[0074] First, it should be noted that when business users currently use large language models provided by large language model providers, the following problems arise: 1) Since large language models on the market are provided by different vendors, each with unique interfaces and usage methods, business products face high docking costs and complex technical integration challenges when integrating large language models from different vendors. Therefore, a unified service that integrates the interfaces of large language models from multiple vendors has become an innovative technology urgently needed in the industry, resulting in high application complexity. 2) When integrating large model languages ​​from different vendors, various incompatibilities in data definitions, interface protocols, and data input and output parameters may arise. At the same time, various instability issues such as network traffic, network fluctuations, and abnormal responses may also arise. Therefore, implementing a large language model that adapts to different application environments and provides unified services is an urgent problem to be solved in the industry. 3) For business products, flexible selection and dynamic configuration of appropriate large language models can improve the product application experience. However, this requires the system to build a scalable and changeable configuration center, which will undoubtedly increase system development and maintenance costs. Therefore, the current generation flexibility of business text is low.

[0075] Embodiment 1 of the present application provides a method for generating a business document. Referring to FIG. 1 , the method for generating a business document includes:

[0076] Step S10, obtaining a service text generation request for the service input to be generated, wherein the service text generation request carries text request information;

[0077] Step S20, matching the text request information with a corresponding target large language model in a preset large language model library;

[0078] Step S30: generating a target business text of the business to be generated by using the target large language model.

[0079] In this embodiment, it should be noted that the business text generation method of the embodiment of the present application is applied to the business text generation system, and the business text generation system is deployed on the business text generation device. The business text device can be a server, a personal PC or a computer and other electronic devices. For example, in one practicable manner, referring to Figure 2, Figure 2 is an architectural diagram of the business text generation system. The business text generation system includes an application layer, a proxy gateway layer, a business gateway layer, a storage layer and Devops, etc., wherein the application layer can specifically include Go, Java, Php, Python, Node, JS and TS, etc., the proxy gateway layer can specifically include DDOS&WAF security, SLB, APISix gateway, Nginx cluster and Ingress, etc., the business gateway layer can include client BFF business gateway and server MIP open gateway, etc., the application service layer can specifically include key management, application templates , Prompt preprocessing, sensitive words, content review, Hook alarm, LLM management, LLM disaster recovery, Apollo configuration center, ETCD, log service and permission control, etc. The storage layer includes distributed Redis, Mysql and RocketMq self-built, Devops includes Mars, GitLab, Jarvis and K8S, etc. In the business text generation system, there are the following entity concepts: 1) Product: the product that each business department is responsible for, and the minimum granularity is the product line with business coding; 2) Classification: At the product level, different modules may apply different AI capabilities. Different modules can be positioned in AI classification to distinguish application ownership for easy management; 3) Application: Business text can be managed, including the application name, icon, description and large language model required for configuration display; 4) Application configuration is specifically responsible for rendering json data of the page at the product level.

[0080] In addition, it should be noted that the business text generation system can provide more open services, such as providing functional comparisons, data comparisons, performance comparisons, and price comparisons of large language models from various manufacturers, providing a unified open interface, and using a set of keys to easily connect to any large language model, as well as providing detailed open data for statistical reports, data analysis, and model training. The business text generation system can also provide more flexible configurations, such as supporting business products to select different large language models and call parameters according to different scenarios, supporting business products to select appropriate call limits according to different environments, and supporting more accurate business evaluations through the business text generation system, such as supporting multi-model evaluation mechanisms for various custom business texts, and It supports business evaluators to make objective evaluations without knowing the specific model. The business to be generated is used to represent the business waiting for business text generation, which can be specifically text-related product business. The business text generation request is used to trigger the matching of the large language model. The preset large language model library pre-stores multiple large language models. Different large language models are connected to the business to be generated through a unified interface. The business texts generated by different large language models for the business to be generated can be the same or different. The target large language model is used to represent the large language model that can provide the most suitable business text for the business to be generated. The target business text is used to represent the business text that meets user needs. The text request information is used to represent the user's text request needs, which can be specifically a business identifier or business content, etc.

[0081] As an example, steps S10 to S30 include: obtaining a business text generation request carrying text request information for the business input to be generated; using the text request information as an index, matching the corresponding target large language model in the preset large language model library; and outputting the target business text of the business to be generated through the target large language model.

[0082] It can be understood that compared with the existing technology, by integrating large language models provided by different manufacturers through a unified interface, after receiving a business text generation request, the corresponding target large language model can be directly queried in the preset large language model library based on the text request information carried by the business text generation request, thereby having the following advantages: 1) By integrating the large language model interfaces of multiple manufacturers, seamless calling and use of services from different manufacturers is achieved, so that the generated business can select the most suitable large language model service according to the needs of the business scenario without being restricted by the choice of a single manufacturer; 2) The technical service supports flexible configuration, allowing business products to customize the calling parameters of the large language model according to specific needs and scenarios. This flexibility allows business products to customize language processing functions according to different application scenarios and requirements, thereby better meeting user needs; 3) By integrating and encapsulating the large language model interfaces of multiple manufacturers, the development cost and time cost of business products when connecting to large language models from different manufacturers are significantly reduced. This advantage of reducing connection costs provides strong support for the rapid deployment and expansion of business products; 4) Introducing business experts to evaluate the business accuracy of multiple models provides a more objective and accurate evaluation mechanism for optimizing and selecting more suitable large language models.

[0083] The text request information includes text index information and text template information, and the step of matching the text request information with a corresponding target large language model in a preset large language model library includes:

[0084] Step A10: querying the preset large language model library to obtain at least one candidate large language model based on the text index information;

[0085] Step A20: inputting the text template information into each of the candidate large language models to obtain at least one business text template;

[0086] Step A30 : selecting the target large language model from the candidate large language models by detecting the matching degree between the service text templates and the content of the service to be generated.

[0087] In this embodiment, it should be noted that since the business texts of the final requirements of different businesses to be generated have commonalities in content and form, when selecting the target large language model, the text index information and text template information carried by the business text generation request can be used to quickly locate the candidate large language model for generating content that meets the requirements of the business to be generated, so that the selection of the target large language model can be completed through the content matching between the business text template and the business to be generated. Among them, the text index information is used to index the candidate large language model, and the candidate large language model refers to a collection of large language models waiting to be selected as the target large language model. The text template information is used to generate a business text template, and the business text template is used to represent the fixed content that matches the business to be generated. The content matching degree can be calculated using a specific field similarity algorithm. After obtaining the similarity between the business text template and the business to be generated, it is mapped to the content matching degree, which can be 70%, 80% or 90%, etc.

[0088] As an example, steps A10 to A30 include: using the text index information as an index, querying in a preset large language model library to obtain at least one candidate large language model; obtaining at least one business text template by inputting the text template information into each of the candidate large language models respectively; for any of the business text templates, calculating the field similarity between the business text template and the business to be generated based on a preset field similarity algorithm, mapping the field similarity to the content matching degree between the business text template and the business to be generated, sorting the content matching degrees, and taking the large language model with the highest content matching degree as the target large language model.

[0089] The target service text includes a target prompt word, and the step of generating the target service text of the service to be generated by using the target large language model includes:

[0090] Step B10, generating a service prompt word template for the service to be generated by using the target large language model;

[0091] Step B20: inserting a service element matching the service to be generated into the service prompt word template to obtain the target prompt word.

[0092] In this embodiment, it should be noted that the target prompt word is used to represent the prompt word that meets the user's business needs, and the business element is used to represent the elements related to the business scenario of the business to be generated, which can be specifically the name of the holiday, nationality, style, etc. The business prompt template refers to the template content other than the prompt word. For example, in one feasible method, the business prompt word template can be specifically "You are an experienced, professional and imaginative holiday greeting planning expert. I will provide you with a [holiday name] and [nationality description]. Please create a holiday greeting for this holiday. The holiday name is "__". Please start creating a "__" style greeting within 20 words based on the [above description], and finally output "__". The business elements can be Spring Festival, funny style and 500 words in sequence to obtain a complete business prompt word.

[0093] As an example, steps B10 to B20 include: outputting a service prompt word template for the service to be generated based on the target large language model; obtaining a service element matching the service to be generated, inserting the service element into the service prompt word template, and obtaining the target prompt word.

[0094] In another feasible manner, blind testing of different large language models can also be performed based on text index information. That is, after the user inputs text index information, a business prompt word template for the business to be generated is generated based on the text index information, so that different large language models are first scored in accordance with the specific business scenario based on the text index information, and then based on the scores of different large language models, the large language model with the highest score is selected as the target large language model for the business to be generated, thereby achieving the purpose of obtaining a large language model that matches the business scenario of the business to be generated based on the scenario adaptation situation when the type of large language model deployed by the business text generation system is unknown. Therefore, while improving the generation flexibility of business text generation, the generation adaptability of business text generation is also improved.

[0095] The step of generating a service prompt word template for the service to be generated by using the target large language model includes:

[0096] Step C10: using the prompt word template output by the target large language model as the service prompt word template of the service to be generated; or

[0097] Step C20 : adjusting the prompt word template output by the target large language model according to the service type of the service to be generated, to obtain a service prompt word template for the service to be generated.

[0098] In this embodiment, it should be noted that when generating a business prompt word template, the attached content is different for different business types, that is, some types of business do not have attached content, while some types of business do. For example, assuming that the business to be generated is to create a business prompt word template for the Spring Festival, since the Spring Festival is a special festival, the business to be generated has no attached content. Suppose that the business to be generated is to create a business prompt word template for Halloween, since many regions have Halloween and Halloween customs vary in different regions, the business to be generated has attached content, and the attached content can be "Region A". Therefore, there are two different ways to obtain the business prompt word template for the business to be generated.

[0099] As an example, steps C10 to C20 include: using the prompt word template output by the target large language model as the service prompt word template for the service to be generated; or,

[0100] Obtain the business type of the business to be generated. If the business to be generated is the first type of business to be generated, use the prompt word template output by the target large language model as the business prompt word template of the business to be generated. If the business to be generated is the second type of business to be generated, use the prompt word template output by the target large language model as the business prompt word template.

[0101] Before the step of generating the service prompt word template of the to-be-generated service by using the target large language model, the service text generation method further includes:

[0102] Step D10, generating a candidate template of a service prompt word for the service to be generated by using the target large language model;

[0103] Step D20, detecting whether the candidate template of the service prompt word has passed security authentication;

[0104] Step D30: If yes, use the business prompt word candidate template as the prompt word template output by the target large language model;

[0105] If not, in step D40 , the business prompt word candidate template is processed to obtain the prompt word template output by the target large language model.

[0106] In this embodiment, it should be noted that in addition to configuring different prompt word applications for different business products according to their application scenarios, the core check is configured into the template to realize dynamic pre-processing prompt words, and ultimately realize flexible configuration and free switching of LLM. In addition, through the authority system, for different products, different application modules, different application scenarios, and different application configurations, visualization independence, scenario independence, and data independence can be achieved. In addition, in order to ensure data privacy and security, double data review can be performed based on the local sensitive word library and the cloud content library to ensure the security and controllability of the input + output content. That is, when facing abnormal security requests, the interception and blocking mechanism will be triggered. Therefore, after the target large language model outputs the business prompt word template for the business to be generated, the business prompt word candidate template will be security authenticated to ensure that the final prompt word template meets the security authentication requirements.

[0107] As an example, steps D10 to D40 include: outputting a business prompt word candidate template for the business to be generated through the target large language model; detecting whether the business prompt word candidate template has passed security authentication; if it is detected that the business prompt word candidate template has passed security authentication, using the business prompt word candidate template as the prompt word template output by the target large language model; if it is detected that the business prompt word candidate template has not passed security authentication, performing security processing on the business prompt word candidate template to obtain the prompt word template output by the target large language model.

[0108] In one practicable manner, referring to FIG3 , FIG3 is a timing diagram showing the generation of the target business text, wherein the application layer includes a client and a server, and the client and the server can interact with each other for internal business, the client can display the interface, interact with the user, and interact with the AI, etc., the server can receive events and process business, etc., and information can be exchanged between the application layer and the service layer. When the client interacts with the service layer BFF interface, the chatTicket can be carried to request an AI session and can interact with the user. When the server interacts with the MIP open interface of the service layer, template data, chatTicket, event callback response, and user data can be obtained, etc. In addition to the client BFF interface and MIP In addition to open interfaces, it also has the capabilities of sensitive word interception, user risk control processing (including user bans, etc.), model preprocessing (prompt words), general LLM model switching, streaming interaction, business integration callback, user data retention, risk control data management (input, violation and sensitive libraries, etc.), user data management (input or output) and resource data management (time and cost, etc.). The service layer can interact with the infrastructure layer for data and streaming responses. The infrastructure layer includes the Gateway internal gateway, internal application authorization, Alibaba Cloud content review, application data statistics (number of uses and tokens used, etc.) and third-party platforms. Among them, third-party platforms can specifically include Tencent Hunyuan, Baidu Wenxin Yiyan, ChatGLM and Huawei Pangu.

[0109] An embodiment of the present application provides a method for generating business text, comprising: obtaining a business text generation request for a business to be generated, wherein the business text generation request carries text request information; matching the text request information with a corresponding target large language model in a preset large language model library; and generating a target business text for the business to be generated using the target large language model. After the business text generation request is input for the business to be generated, the target large language model can be directly matched in the preset large language model library based on the text request information carried in the business text generation request. That is, during the process of connecting the business text generation request with the target large language model, the target large language model that provides the business text for the business to be generated can be directly matched in the preset large language model library. This enables the ability for different large language models in the preset large language model library to uniformly connect to the business text generation request for the business to be generated. Ultimately, the target business text for the business to be generated can be generated using the target large language model. That is, the target business text can be quickly and automatically generated after the business text generation request is input, rather than requiring a significant amount of time to select a target large language model before generating the business text. Therefore, the problem that the large language models provided by different large language model manufacturers often have incompatibilities in text definitions, interface protocols, and text input and output parameters is overcome. At the same time, when the business demand side uses the service, it will face various unstable problems such as network traffic, network fluctuations and abnormal responses, which will lead to the business demand side needing to spend a lot of time to generate business texts that meet the needs. Therefore, the generation flexibility of business texts is improved.

[0110] Example 2

[0111] Based on the first embodiment of the present application, in another embodiment of the present application, the same or similar content as the above-mentioned embodiment 1 can be referred to the above introduction and will not be repeated hereafter. On this basis, please refer to Figure 4. After the step of generating the target business text of the business to be generated by the target large language model, the business text generation method further includes:

[0112] Step E10, sending the target service text to the service generation terminal that generates the service to be generated;

[0113] Step E20, detecting whether text response information based on the target service text feedback from the service generating end is received;

[0114] Step E30: If not, then mark the target service text as an alarm.

[0115] In this embodiment, it should be noted that during the information interaction between the business generation end and the business text generation system, there may be a situation where the information fails to respond in a timely manner. After the target business text is generated, corresponding processing can be performed based on the information response reception situation. After the business generation end feeds back the text response information, the business process of generating the target business text is terminated by default, and the text response information is used to respond to the text reception situation.

[0116] As an example, steps E10 to E30: determine the business generation end of the business to be generated, and send the target business text to the business generation end; detect whether the text response information based on the target business text feedback from the business generation end is received; if the text response information based on the target business text feedback from the business generation end is not received, then mark the target business text with an alarm. For example, in one feasible method, after the target business text is marked with an alarm, the user can know through the visual interface of the business text generation system that the target business text has not been received by the business generation end.

[0117] Wherein, after the step of generating the target business text of the to-be-generated business by using the target large language model, the business text generation method further includes:

[0118] Step F10: detecting the switching status of the target large language model according to the target business text;

[0119] Step F20: when it is detected that the target large language model needs to be switched, obtaining a backup large language model corresponding to the target large language model;

[0120] Step F30 : generating a service text for the service to be generated by using the backup large language model.

[0121] In this embodiment, it should be noted that the embodiment of the present application also provides an LLM switching and disaster recovery mechanism. By modifying the LLMs corresponding to different application templates, free switching of LLMs can be achieved, and seamless docking with various manufacturers can be achieved. When an uncontrollable network disaster occurs in a certain LLM, it will automatically retry and switch to the backup LLM to ensure the availability of the service. For example, in an implementable method, applications in different products can initiate business text generation requests at the business generation end. The public service center uses different model channels at the scheduling layer to continue business text generation requests based on different application configurations. Under normal circumstances, the configured LLM will be used to go through the corresponding channel. When an abnormality occurs in a certain channel, the channel will be closed and an alarm will be triggered. For a period of time, all requests for the channel will go through the backup channel.

[0122] In addition, it should be noted that the backup large language model refers to a large language model that has the same function as the target large language model and is waiting to be switched for use. The detection of whether the target large language model is switched can be based on the analysis results of the text content of the target business text. For example, in one feasible method, assuming that the target business text is missing, it is characterized that the target business text needs to be switched to a large language model.

[0123] As an example, steps F10 to F30 include: detecting the switching status of the target large language model based on the target business text; when it is detected that the target large language model needs to be switched, obtaining a backup large language model corresponding to the target large language model; and outputting the business text for the business to be generated through the backup large language model.

[0124] In one practicable manner, referring to FIG5 , FIG5 is a timing diagram showing information interaction between a client and a server, wherein the interaction logic includes client template display and interaction between business applications and AI, and the interacting parties may include a business client, a business server, a platform MIP, and an AIGC server. The specific interaction logic can be referred to the diagram and will not be described here.

[0125] The embodiment of the present application provides a text alarm marking method. That is, the target business text is sent to the business generation end that generates the business to be generated; it is detected whether the text response information fed back by the business generation end based on the target business text is received; if not, the target business text is marked as an alarm. After generating the target business text, the embodiment of the present application first sends the target business text to the business generation end of the business to be generated, and detects in real time whether the business generation end feeds back text response information to the business text generation system based on the target business text. If no response information is received, the target business text is marked as an alarm, thus laying the foundation for improving the security of the target business text.

[0126] Example 3

[0127] The present application also provides a business text generation device, referring to FIG6 , which includes:

[0128] An acquisition module 101 is configured to acquire a service text generation request for a service input to be generated, wherein the service text generation request carries text request information;

[0129] A matching module 102 is configured to match the text request information with a corresponding target large language model in a preset large language model library;

[0130] The generating module 103 is configured to generate a target service text of the service to be generated by using the target large language model.

[0131] In one embodiment, the text request information includes text index information and text template information, and the matching module 102 is further configured to:

[0132] According to the text index information, query the preset large language model library to obtain at least one candidate large language model;

[0133] Inputting the text template information into each of the candidate large language models to obtain at least one business text template;

[0134] The target large language model is selected from the candidate large language models by detecting the content matching degree between each of the service text templates and the service to be generated.

[0135] In one embodiment, the target business text includes a target prompt word, and the matching module 102 is further configured to:

[0136] generating a service prompt word template for the service to be generated by using the target large language model;

[0137] The target prompt word is obtained by inserting a service element matching the service to be generated into the service prompt word template.

[0138] In one embodiment, the matching module 102 is further configured to:

[0139] Using the prompt word template output by the target large language model as the service prompt word template for the service to be generated; or

[0140] According to the service type of the service to be generated, the prompt word template output by the target large language model is adjusted to obtain the service prompt word template of the service to be generated.

[0141] In one embodiment, the business text generating device is further configured to:

[0142] generating a candidate template of a service prompt word for the service to be generated by using the target large language model;

[0143] Detecting whether the candidate template for the business prompt word has passed security authentication;

[0144] If yes, the business prompt word candidate template is used as the prompt word template output by the target large language model;

[0145] If not, the business prompt word candidate template is processed to obtain the prompt word template output by the target large language model.

[0146] In one embodiment, the business text generating device is further configured to:

[0147] Sending the target service text to a service generation terminal that generates the service to be generated;

[0148] Detecting whether text response information fed back by the service generating end based on the target service text is received;

[0149] If not, an alarm mark is performed on the target service text.

[0150] In one embodiment, the business text generating device is further configured to:

[0151] Detecting the switching status of the target large language model according to the target business text;

[0152] When it is detected that the target large language model needs to be switched, obtaining a backup large language model corresponding to the target large language model;

[0153] Generate a service text for the service to be generated by using the backup large language model.

[0154] The business text generation device provided in this application, employing the business text generation method of the first or second embodiment, can address the technical issue of low flexibility in business text generation. Compared to the prior art, the beneficial effects of the business text generation device provided in this embodiment are the same as those of the business text generation method provided in the above embodiment. Other technical features of the business text generation device are the same as those disclosed in the above embodiment and are not further elaborated here.

[0155] Example 4

[0156] An embodiment of the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the business text generation method in the above-mentioned embodiment one.

[0157] Reference is now made to FIG7 , which illustrates a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG7 is merely an example and should not limit the functionality or scope of use of the embodiments of the present disclosure.

[0158] As shown in Figure 7, an electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and text required for the operation of the electronic device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication devices 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange text. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0159] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0160] The electronic device provided in this application utilizes the business text generation method of the above-described embodiment to resolve the technical problem of low flexibility in business text generation. Compared to the prior art, the beneficial effects of the electronic device provided in the embodiment of this application are the same as those of the business text generation method provided in the above-described embodiment, and the other technical features of the electronic device are the same as those disclosed in the method of the above-described embodiment, and are not further described here.

[0161] It should be understood that various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in an appropriate manner.

[0162] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0163] Example 5

[0164] An embodiment of the present application provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the business text generation method in the above-mentioned embodiment 1.

[0165] The computer-readable storage medium provided in the embodiments of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0166] The computer-readable storage medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0167] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: obtains a business text generation request for the business input to be generated, wherein the business text generation request carries text request information; matches the corresponding target large language model for the text request information in a preset large language model library; and generates the target business text of the business to be generated through the target large language model.

[0168] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and Go, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely 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 entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0169] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0170] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0171] The computer-readable storage medium provided in this application stores computer-readable program instructions for executing the aforementioned method for generating business documents. This computer-readable storage medium can address the technical issue of low flexibility in generating business documents. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this embodiment of the application are similar to those of the method for generating business documents provided in the first or second embodiment above, and are not further elaborated here.

[0172] Example 6

[0173] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned business text generation method when executed by a processor.

[0174] The computer program product provided in this application can solve the technical problem of low flexibility in generating business documents. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this application are the same as the beneficial effects of the business document generation method provided in the first or second embodiments above, and will not be repeated here.

[0175] The above are merely optional embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A method for generating business texts, wherein, The business text generation method includes: Obtaining a business text generation request for the business input to be generated, where the business text generation request carries text request information; Matching a corresponding target large language model for the text request information in a preset large language model library; Generating a target business text for the business to be generated through the target large language model.

2. The service text generation method according to claim 1, wherein, The text request information includes text index information and text template information. The step of matching a corresponding target large language model for the text request information in the preset large language model library includes: Querying at least one candidate large language model in the preset large language model library according to the text index information; Inputting the text template information into each of the candidate large language models to obtain at least one business text template; Selecting the target large language model from each of the candidate large language models by detecting the content matching degree between each business text template and the business to be generated.

3. The service text generation method according to claim 2, wherein The target business text includes target prompt words. The step of generating a target business text for the business to be generated through the target large language model includes: Generating a business prompt word template for the business to be generated through the target large language model; Inserting business elements matching the business to be generated into the business prompt word template to obtain the target prompt words.

4. The service text generation method according to claim 3, wherein, The step of generating a business prompt word template for the business to be generated through the target large language model includes: Using the prompt word template output by the target large language model as the business prompt word template for the business to be generated; or, Adjusting the prompt word template output by the target large language model according to the business type of the business to be generated to obtain the business prompt word template for the business to be generated.

5. The service text generation method according to claim 3, wherein Before the step of generating a business prompt word template for the business to be generated through the target large language model, the business text generation method further includes: Generating a business prompt word candidate template for the business to be generated through the target large language model; Detecting whether the business prompt word candidate template passes security authentication; If so, using the business prompt word candidate template as the prompt word template output by the target large language model; If not, processing the business prompt word candidate template to obtain the prompt word template output by the target large language model.

6. The service text generation method according to claim 1, wherein, After the step of generating a target business text for the business to be generated through the target large language model, the business text generation method further includes: Sending the target business text to the business generation end that generates the business to be generated; Detecting whether text response information feedback by the business generation end based on the target business text is received; If not, performing an alarm mark on the target business text.

7. The service text generation method according to claim 1, wherein After the step of generating a target business text for the business to be generated through the target large language model, the business text generation method further includes: Detecting the switching situation of the target large language model according to the target business text; When it is detected that the target large language model needs to be switched, obtaining the standby large language model corresponding to the target large language model. Generate service text for the to-be-generated service through the backup large language model.

8. A business text generation device, wherein, The service text generation device includes: An acquisition module, configured to acquire a service text generation request input for the to-be-generated service, where the service text generation request carries text request information; A matching module, configured to match a corresponding target large language model for the text request information in a preset large language model library; A generation module, configured to generate a target service text for the to-be-generated service through the target large language model.

9. An electronic device, wherein, The electronic device includes: a memory, a processor, and a service text generation program stored on the memory and executable on the processor, where the service text generation program is configured to implement the steps of the service text generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein, A service text generation program is stored on the computer-readable storage medium, and when the service text generation program is executed by a processor, the steps of the service text generation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Text processing method and device, electronic equipment and storage medium

    CN116127003A

  • Knowledge base query method and device, electronic equipment and storage medium

    CN116737879A

  • Prompt template generation method and device, computer equipment and storage medium

    CN116738956A

  • Service label set updating method and device, medium and electronic equipment

    CN116894188A

  • Image-text dialogue method, electronic equipment, storage medium and program product

    CN117076624A

Cited By

  • VPN (Virtual Private Network) rapid auto-negotiation connection method and device

    CN120675907A

  • Business problem processing method and device, electronic equipment and computer program product

    CN121561041A

  • A method, device, and medium for generating transcripts based on a large model

    CN122676834A