A data processing method and apparatus based on a large model

CN119168085BActive Publication Date: 2026-09-01BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411120587.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2026-09-01
Estimated Expiration
2044-08-15

AI Technical Summary

Benefits of technology

[0017]本发明实施例提供的基于大模型的数据处理方法,针对每一功能,配置有通过调用大语言模型实现该功能的软件单元。软件单元分为原始单元和扩展单元,扩展单元与全部或部分原始单元对应。通过调用目标软件单元实现目标大语言模型对输入参数进行数据处理。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168085B_ABST
    Figure CN119168085B_ABST
Patent Text Reader

Abstract

This invention provides a data processing method and apparatus based on a large language model, relating to the field of artificial intelligence technology. For each function, a software unit is configured to implement that function by calling a large language model. Some or all of the original units and their corresponding extended units correspond one-to-one. The original units and their corresponding extended units perform the same function but receive different input parameters. During the implementation of the target function, the input parameters are obtained. For the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is called for data processing. If the identifier of the target extended unit is obtained, the target extended unit is called for data processing. The data processing result is then obtained. The solution provided by this invention enables data processing through a large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a data processing method and apparatus based on a large model. Background Technology

[0002] With the development of artificial intelligence, the technology of using generative large language models for processing is becoming increasingly widespread. Because large language models have strong data processing and analysis capabilities, they are playing an increasingly important role in the data processing process.

[0003] Therefore, a method is needed to process data by calling a large language model. Summary of the Invention

[0004] The purpose of this invention is to provide a data processing method and apparatus based on a large model, so as to realize data processing through a large language model. The specific technical solution is as follows: In a first aspect of the present invention, a data processing method based on a large model is provided. For each function, a software unit is configured to implement the function by calling a large language model. The software unit includes a primary unit and an extended unit, with some or all of the primary units and extended units corresponding one-to-one. The primary unit and the corresponding extended unit implement the same function but have different input parameters. In the process of implementing the target function, the method includes: Get the input parameters; The target software unit corresponding to the target function is invoked, and the input parameters are processed by the target large language model corresponding to the target function. Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is invoked for data processing; if the identifier of the target extended unit is obtained, the target extended unit is invoked for data processing. The target extended unit corresponds to the original unit. Obtain the data processing results.

[0005] In one embodiment of the present invention, before invoking the target software unit corresponding to the target function and processing the input parameters using the target large language model corresponding to the target function, the method further includes: The preset role assignment function is invoked to assign the different semantic contents contained in the input parameters to different roles within the prompt words in the target large language model.

[0006] In one embodiment of the present invention, the input parameters are input by calling a simple interactive function, without including data output format for limiting the large language model and / or without including input / output examples. In this case, the input parameters are directly input into the target large language model, and the input / output examples include: sample prompt words input into the large language model and sample output results obtained by the large language model after processing the sample prompt words.

[0007] In one embodiment of the present invention, for each function, the software unit corresponding to the function includes a production result verification unit, and after the input parameters are processed by the target large language model corresponding to the target function, the system further includes: Obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The production result verification unit corresponding to the target function is invoked to check whether the output result conforms to the target format. If it does not meet the requirements, the input parameters are reprocessed using the target large language model corresponding to the target function, and the process returns to the step of obtaining the output result of the target large language model corresponding to the target function after processing the input parameters.

[0008] In one embodiment of the present invention, for each function, the software unit corresponding to that function includes a result post-processing unit, and after the input parameters are processed by the target large language model corresponding to the target function, the unit further includes: Obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The target large language model corresponding to the target function is called to generate a result post-processing unit, which analyzes the output result and extracts the key content in the output result. The key content is the content in the output result that best represents the meaning of the output result. If extraction fails, the input parameters are reprocessed using the target large language model corresponding to the target function, and the process returns to the step of obtaining the output result of the target large language model corresponding to the target function after processing the input parameters.

[0009] In a second aspect of the present invention, a data processing apparatus based on a large model is also provided. For each function, a software unit is configured to implement the function by calling a large language model. The software unit includes a primary unit and an extended unit, with some or all of the primary units and extended units corresponding one-to-one. The primary unit and the corresponding extended unit implement the same function but have different input parameters. In the process of implementing the target function, the apparatus includes: The parameter acquisition module is used to acquire input parameters; The first data processing module is used to call the target software unit corresponding to the target function, and to process the input parameters through the target large language model corresponding to the target function. Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is called for data processing; if the identifier of the target extended unit is obtained, the target extended unit is called for data processing. The target extended unit corresponds to the original unit. The results acquisition module is used to obtain the data processing results.

[0010] In one embodiment of the present invention, the apparatus further includes: The classification module is used to call a preset role assignment function to assign different semantic contents contained in the input parameters to different roles within the prompt words in the target large language model.

[0011] In one embodiment of the present invention, the input parameters are input by calling a simple interactive function, without including data output format for limiting the large language model and / or without including input / output examples. In this case, the input parameters are directly input into the target large language model, and the input / output examples include: sample prompt words input into the large language model and sample output results obtained by the large language model after processing the sample prompt words.

[0012] In one embodiment of the present invention, for each function, the software unit corresponding to the function includes a production result verification unit, and the device further includes: The first result acquisition module is used to obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The format detection module is used to call the production result verification unit corresponding to the target function to detect whether the output result conforms to the target format. The second data processing module is used to reprocess the input parameters through the target large language model corresponding to the target function if the format detection module determines that the output result does not conform to the target format, and then return to trigger the execution of the first result acquisition module.

[0013] In one embodiment of the present invention, for each function, the software unit corresponding to the function includes a result post-processing unit, and the apparatus further includes: The second result acquisition module is used to obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The key point extraction module is used to call the target large language model corresponding to the target function to generate the result post-processing unit, analyze the output result, and extract the key content in the output result. The key content is the content in the output result that best represents the meaning of the output result. The third data processing module is used to re-invoke the target software unit corresponding to the target function if the extraction fails in the key extraction module, and process the input parameters through the target large language model corresponding to the target function.

[0014] In a third aspect of the present invention, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus. Memory, used to store computer programs; When a processor executes a program stored in memory, it implements any of the steps described in the first aspect.

[0015] In a fourth aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements the steps of any of the methods described in the first aspect.

[0016] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the steps described in the first aspect above.

[0017] The data processing method based on a large model provided in this invention configures a software unit for each function, which implements the function by calling a large language model. The software unit is divided into original units and extended units, with the extended units corresponding to all or part of the original units. The target large language model processes the input parameters by calling the target software unit.

[0018] Furthermore, during data processing, the identification of the target extended unit can control whether the original unit or the extended unit is used to implement its corresponding function. This allows for flexible control over the software units used in data processing, improving program flexibility and facilitating the upgrading and updating of the original unit. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0020] Figure 1 A flowchart illustrating the first data processing method based on a large model provided in an embodiment of the present invention; Figure 2 A flowchart illustrating the second data processing method based on a large model provided in an embodiment of the present invention; Figure 3 A flowchart illustrating the third data processing method based on a large model provided in this embodiment of the invention; Figure 4 A flowchart illustrating the fourth data processing method based on a large model provided in this embodiment of the invention; Figure 5 A flowchart illustrating the fifth data processing method based on a large model provided in this embodiment of the invention; Figure 6 A flowchart illustrating the sixth data processing method based on a large model provided in this embodiment of the invention; Figure 7 A schematic diagram of the structure of a data processing device based on a large model provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.

[0022] To enable data processing using large language models, embodiments of the present invention provide a data processing method and apparatus based on large models.

[0023] In related technologies, to facilitate the use of large language models, the complete program for calling the large language model to perform data processing is often encapsulated. Users only need to call the encapsulated, fixed program, pass in fixed parameters, and then the program will automatically call the large language model to perform data processing based on the passed parameters and obtain the output results.

[0024] The encapsulated program can perform different functions, each corresponding to a software unit that implements that function. To ensure the stability of the encapsulated program, the parameters passed to each software unit are restricted, and the passed parameters must meet these restrictions, resulting in low flexibility in the data processing process.

[0025] In order to realize data processing through a large language model and solve the problems existing in related technologies, for each function, a software unit is configured to implement the function by calling the large language model. The software unit includes a primary unit and an extension unit. Some or all of the primary units and extension units correspond one-to-one. The primary unit and the corresponding extension unit implement the same processing, but the input parameters are different.

[0026] For each function, the configured raw unit may include an input parameter input unit for obtaining input parameters, a prompt word generation unit for combining input parameters with a preset prompt word template to obtain prompt words, and a large model interface calling unit for calling the interface of the large language model to input prompt words into the large language model for data processing, etc.

[0027] For any original unit, a corresponding extended unit can be configured. This extended unit can be an update or extension of the original unit. Both implement the same functionality; for example, the extended unit corresponding to the original input parameter input unit still performs the function of obtaining input parameters. The extended unit corresponding to the original prompt word generation unit still performs the function of combining input parameters with a preset prompt word template to obtain prompt words. The original large model interface call unit still performs the function of calling the large language model's interface to input prompt words into the large language model for data processing.

[0028] The difference lies in the parameters passed in. For example, the original unit requires two parameters, while its corresponding extended unit requires three. Alternatively, the original unit requires two mandatory parameters and two optional parameters, while the extended unit requires three mandatory parameters and two optional parameters. Or, the original unit requires parameters of type 'a' and 'b', while the extended unit requires parameters of type 'a' and 'c', for example, 'a' for time, 'b' for position coordinates, and 'c' for height.

[0029] See Figure 1 This is a flowchart illustrating the first data processing method based on a large model provided in an embodiment of the present invention. In the process of achieving the target function, it includes the following steps S101-S103.

[0030] S101: Obtain input parameters.

[0031] The above-mentioned input parameters are the parameters to be input into the large model, and the input parameters can be manually entered by the user.

[0032] Alternatively, in the case of interaction between virtual characters, the input parameter can be the latest output session of another virtual character.

[0033] Specifically, the input parameters can be content manually entered by the user, the full text of the latest conversation output by another virtual character, or key content extracted from the full text.

[0034] In addition, when applied to virtual world scenarios, the input parameters can also include information about the virtual scene in which the virtual character is located, such as the time information, weather information, and information about virtual objects contained in the scene.

[0035] S102: Call the target software unit corresponding to the above target function, and process the above input parameters through the target large language model corresponding to the above target function.

[0036] Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is invoked for data processing; if the identifier of the target extended unit is obtained, the target extended unit is invoked for data processing.

[0037] The aforementioned target extension unit corresponds to the original unit.

[0038] In one embodiment of the present invention, during the implementation of the target function, classes from the program of the software unit corresponding to the target function are imported. Theoretically, classes from each original unit will be imported.

[0039] Additionally, depending on the actual requirements, when importing the class of the target extension unit, the identifier of the target extension unit will be passed in. Since the newly passed target extension unit has higher priority, it can replace the original unit corresponding to the target extension unit. Therefore, during the implementation of the target functionality, the target extension unit will replace the original unit to complete the data processing.

[0040] S103: Obtain the data processing results.

[0041] As can be seen from the above, in this embodiment of the invention, for each function, a software unit is configured to implement the function by calling a large language model. The software unit is divided into original units and extended units, with the extended units corresponding to all or part of the original units. The target large language model processes the input parameters by calling the target software unit.

[0042] Furthermore, during data processing, the identification of the target extended unit can control whether the original unit or the extended unit is used to implement its corresponding function. This allows for flexible control over the software units used in data processing, improving program flexibility and facilitating the upgrading and updating of the original unit.

[0043] In another embodiment of the present invention, a prompt word template corresponding to the large language model is pre-configured, and the prompt word template is combined with the above-mentioned input parameters as prompt words for inputting into the large language model.

[0044] Specifically, prompts are the data input into a large language model and processed by it. Prompts are obtained by combining input parameters with a prompt template. Different large language models use different prompt templates.

[0045] For example, the function of a large language model is to suggest activities to a user by combining the current weather conditions with information provided by the user. The prompt template could be: "Please plan your activity itinerary based on the input information and the current weather. The input information is:" The underlined part is where the input parameters are entered.

[0046] The prompt word template contains input and output examples of the corresponding large language model.

[0047] The above input-output example includes: the sample prompt words input to the large language model, and the sample output results obtained by the large language model after processing the sample prompt words.

[0048] For example, an input / output example could be: "Here is an input / output example. You can imitate the output of this example. If the input prompt is 'The weather is nice today,' the output could be 'Let's go for a walk today.'"

[0049] Among them, "The weather is nice today" is the sample prompt word, and "Let's go for a walk today" is the sample output result.

[0050] In addition, the prompt word template also includes a format for restricting the data output of large language models, such as "Please output the results in JSON format".

[0051] To ensure that the prompt words input into a large language model meet its input requirements, prompt word templates often have restrictions on the data output format to guarantee that the output results meet the requirements. Furthermore, input-output examples are added to guide the large language model in mimicking these examples to produce results. However, due to the strict format requirements of the prompt word templates, modifying the template format or adding new information often proves ineffective because the newly added content is overwritten by existing content. This makes it difficult to replace the input-output examples and data output format.

[0052] To address this issue, in another embodiment of the present invention, the input parameters are input by calling the simple_chat function, which does not include data output format for limiting the large language model and / or does not include input / output examples. In this case, the input parameters are directly input into the target large language model.

[0053] The above input-output example includes: the sample prompt words of the input large language model and the sample output results obtained by the large language model after processing the sample prompt words.

[0054] As can be seen from the above, by calling the simple interactive function, simple input parameters can be directly input without limiting the data output format and / or input / output examples of the large language model, and these input parameters can be directly fed into the large language model for subsequent processing. This allows the input parameters to be input flexibly without being restricted by prompt word templates, thus meeting different functional requirements.

[0055] The prompts in a large language model contain a lot of information. If they are directly input into the large language model, it may be difficult for the large language model to understand the specific meaning of the information, resulting in difficulty in outputting the accurate results required by the embodiments of the present invention.

[0056] For this reason, see Figure 2 This is a flowchart illustrating the second data processing method based on a large model provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 1 In contrast, step S104 is included before step S102.

[0057] S104: Call the preset role assignment function to assign the different semantic contents contained in the above input parameters to different roles within the prompt words in the target large language model to be input.

[0058] Specifically, the aforementioned roles can include user, content, system, etc. In this embodiment of the invention, the input parameters are categorized and assigned to different roles within the prompt words. This pre-classifies input parameters with different semantic meanings, making it easier for the large language model to quickly extract key points from the prompt words, thereby improving the accuracy of the large language model's output.

[0059] In this embodiment of the invention, a semantic analysis model can be invoked to perform semantic analysis on the input parameters, or other semantic analysis algorithms can be used for semantic analysis. This embodiment of the invention does not impose any restrictions on this.

[0060] As can be seen from the above, in this embodiment of the invention, before inputting the input parameters into the large language model, the input parameters are first subjected to semantic analysis, and the input parameters are divided into different roles in the prompt words. This enables the large language model to process the classified data, which helps the large language model to quickly determine the key content in the prompt words, thereby improving the accuracy of the semantic analysis results.

[0061] See Figure 3 This is a flowchart illustrating the third data processing method based on a large model provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 1 Compared to the embodiment shown, the steps S105-S107 are included after step S102 described above.

[0062] S105: Obtain the output result of the target large language model corresponding to the target function after processing the above input parameters.

[0063] S106: Call the production result verification unit corresponding to the above target function to check whether the above output result conforms to the target format.

[0064] The target format mentioned above refers to the format that the output of the pre-configured target function should conform to.

[0065] For example, the target format described above divides the output into different points, each numbered with a number. For instance, an output conforming to the target format would be "1, xxx 2, yyy", etc.

[0066] Alternatively, the word count of the target format cannot exceed the preset word count; the output results are divided into different key points, and the different key points are divided into different paragraphs, etc.

[0067] It should be noted that, in order to ensure that the large model outputs results in the target format, you can add statements to the target candidate prompt word template to indicate the target format, such as "You need to keep the number of words in the output result within 100 words", so that the generated candidate words contain statements indicating the target format, thereby instructing the large model to output results in the target format.

[0068] However, the output of a large model may not conform to the target format, and therefore the output will not meet the requirements. Therefore, in order to ensure that the output of the large model is a normal result that meets the requirements, step S105 can be executed after obtaining the output to check whether the output conforms to the target format.

[0069] If the format conforms to the target format, proceed to step S103 and use the output as the data processing result. If the format does not conform to the target format, proceed to step S107.

[0070] S107: Reprocess the input parameters using the target large language model corresponding to the target function.

[0071] Then return to step S105.

[0072] As can be seen from the above, in this embodiment of the invention, after obtaining the output result of the target large-scale model, the output result of the target large-scale model is also verified to determine whether it conforms to the target format, and a detection result is generated. This achieves the detection of the output result, ensuring that the output result meets the requirements. If the output result does not meet the requirements, the target large-scale language model can be called again for data processing. Utilizing the randomness of the target large-scale language model, the next output result may meet the requirements, thereby improving the success rate of data processing.

[0073] See Figure 4 This is a flowchart illustrating the fourth data processing method based on a large model provided in this embodiment of the invention, which is consistent with the aforementioned... Figure 1 Compared to the embodiment shown, the steps S102 above are further included in steps S108-S110.

[0074] S108: Obtain the output result of the target large language model corresponding to the target function after processing the above input parameters.

[0075] S109: Call the target large language model corresponding to the above target function to generate the result post-processing unit, analyze the above output results, and extract the key content in the above output results.

[0076] The key points mentioned above are the contents of the output results that best represent the meaning of the output results.

[0077] Because the output of a large target model may contain a large amount of data with low information content, it can be difficult for users or other virtual characters to quickly identify the key points in the output and respond promptly.

[0078] Therefore, in this embodiment of the invention, the target large model can be invoked to generate a post-processing unit to analyze the output results and extract key content from the output results.

[0079] In one embodiment of the present invention, the output result can be input into a large model for extracting key content, instructing the large model to extract the key content. In this case, the prompt word input to the large model can be "Please extract the key content of the following content, specifically: xxx", where xxx is the aforementioned output result.

[0080] In another embodiment of the present invention, key content in the above output results can also be extracted by semantic analysis algorithms outside of large models.

[0081] If the key content is successfully extracted, proceed to step S103 and use the key content as the data processing result. If the key content extraction fails, proceed to step S110.

[0082] S110: Reprocess the input parameters using the target large language model corresponding to the target function.

[0083] Then return to step S108.

[0084] As can be seen from the above, in this embodiment of the invention, after obtaining the output of the target large model, key content is analyzed and extracted from the output, thereby reducing the low-information portion of the output and facilitating rapid response based on the high-information content. Furthermore, by extracting key content, unexpected or useless information in the output can be removed, improving overall production efficiency and facilitating subsequent processing. It also allows for rapid analysis of low-volume key content in case of errors during subsequent function implementation, enabling quick error localization. If key content extraction fails, the target large language model can be re-invoked for data processing. Utilizing the randomness of the target large language model, the next output may meet the requirements, thus improving the success rate of data processing.

[0085] See Figure 5 This is a flowchart illustrating the fifth data processing method based on a large model provided in this embodiment of the invention.

[0086] The input parameters passed in the figure are preprocessed by the input parameter preprocessing unit. This input parameter preprocessing unit corresponds to a new input parameter preprocessing unit. During data processing, the identifier of the new input parameter preprocessing unit is passed in, which can replace the original input parameter preprocessing unit with the new input parameter preprocessing unit.

[0087] The preprocessed input parameters can then be combined with the prompt word template to obtain the prompt words. After that, the LLM (Large Language Model) is called to get the output. The output is then processed by the large model's output result verification unit, the large model's output result post-processing unit, and the human feedback unit to obtain the final result.

[0088] The large model production result verification unit is used to implement the aforementioned step S106. The large model generation result post-processing unit is used to implement the aforementioned step S108.

[0089] The human feedback unit is used to guide the learning of the large language model based on human feedback. Each human feedback unit corresponds to a new human feedback unit; during data processing, inputting the identifier of the human feedback unit allows the original human feedback unit to be replaced with the new one.

[0090] The example shown in the figure is a replacement of the input parameter preprocessing unit and the human feedback unit. However, the figure is only an example, and users can choose the software units to be replaced according to their needs. This embodiment of the invention does not limit this.

[0091] See Figure 6 This is a flowchart illustrating the sixth data processing method based on a large model provided in this embodiment of the invention.

[0092] The content shown in the figure is the same as the aforementioned Figure 5 Similar, the only difference being that the new input parameter preprocessing unit and the new human feedback unit are not shown.

[0093] The part enclosed in the rectangle in the diagram applies to the aforementioned process of re-executing when the output does not meet the requirements.

[0094] Corresponding to the aforementioned data processing method based on large models, this embodiment of the invention also provides a data processing device based on large models.

[0095] See Figure 7 This is a schematic diagram of a data processing device based on a large model provided in an embodiment of the present invention. For each function, a software unit is configured to implement the function by calling a large language model. The software unit includes a primary unit and an extended unit. Some or all of the primary units and extended units correspond one-to-one. The primary unit and the corresponding extended unit implement the same function, but the input parameters are different. In the process of implementing the target function, the device includes: The parameter acquisition module 701 is used to acquire input parameters; The first data processing module 702 is used to call the target software unit corresponding to the target function, and to process the input parameters through the target large language model corresponding to the target function. Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is called for data processing; if the identifier of the target extended unit is obtained, the target extended unit is called for data processing. The target extended unit corresponds to the original unit. The result acquisition module 703 is used to obtain the data processing results.

[0096] As can be seen from the above, in this embodiment of the invention, for each function, a software unit is configured to implement the function by calling a large language model. The software unit is divided into original units and extended units, with the extended units corresponding to all or part of the original units. The target large language model processes the input parameters by calling the target software unit.

[0097] Furthermore, during data processing, the identification of the target extended unit can control whether the original unit or the extended unit is used to implement its corresponding function. This allows for flexible control over the software units used in data processing, improving program flexibility and facilitating the upgrading and updating of the original unit.

[0098] In one embodiment of the present invention, the apparatus further includes: The classification module is used to call a preset role assignment function to assign different semantic contents contained in the input parameters to different roles within the prompt words in the target large language model.

[0099] As can be seen from the above, in this embodiment of the invention, before inputting the input parameters into the large language model, the input parameters are first subjected to semantic analysis, and the input parameters are divided into different roles in the prompt words. This enables the large language model to process the classified data, which helps the large language model to quickly determine the key content in the prompt words, thereby improving the accuracy of the semantic analysis results.

[0100] In one embodiment of the present invention, the input parameters are input by calling a simple interactive function, without including data output format for limiting the large language model and / or without including input / output examples. In this case, the input parameters are directly input into the target large language model, and the input / output examples include: sample prompt words input into the large language model and sample output results obtained by the large language model after processing the sample prompt words.

[0101] As can be seen from the above, by calling the simple interactive function, simple input parameters can be directly input without limiting the data output format and / or input / output examples of the large language model, and these input parameters can be directly fed into the large language model for subsequent processing. This allows the input parameters to be input flexibly without being restricted by prompt word templates, thus meeting different functional requirements.

[0102] In one embodiment of the present invention, for each function, the software unit corresponding to the function includes a production result verification unit, and the device further includes: The first result acquisition module is used to obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The format detection module is used to call the production result verification unit corresponding to the target function to detect whether the output result conforms to the target format. The second data processing module is used to reprocess the input parameters through the target large language model corresponding to the target function if the format detection module determines that the output result does not conform to the target format, and then return to trigger the execution of the first result acquisition module.

[0103] As can be seen from the above, in this embodiment of the invention, after obtaining the output result of the target large-scale model, the output result of the target large-scale model is also verified to determine whether it conforms to the target format, and a detection result is generated. This achieves the detection of the output result, ensuring that the output result meets the requirements. If the output result does not meet the requirements, the target large-scale language model can be called again for data processing. Utilizing the randomness of the target large-scale language model, the next output result may meet the requirements, thereby improving the success rate of data processing.

[0104] In one embodiment of the present invention, for each function, the software unit corresponding to the function includes a result post-processing unit, and the apparatus further includes: The second result acquisition module is used to obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The key point extraction module is used to call the target large language model corresponding to the target function to generate the result post-processing unit, analyze the output result, and extract the key content in the output result. The key content is the content in the output result that best represents the meaning of the output result. The third data processing module is used to re-invoke the target software unit corresponding to the target function if the extraction fails in the key extraction module, and process the input parameters through the target large language model corresponding to the target function.

[0105] As can be seen from the above, in this embodiment of the invention, after obtaining the output of the target large model, key content is analyzed and extracted from the output, thereby reducing the low-information portion of the output and facilitating rapid response based on the high-information content. Furthermore, by extracting key content, unexpected or useless information in the output can be removed, improving overall production efficiency and facilitating subsequent processing. It also allows for rapid analysis of low-volume key content in case of errors during subsequent function implementation, enabling quick error localization. If key content extraction fails, the target large language model can be re-invoked for data processing. Utilizing the randomness of the target large language model, the next output may meet the requirements, thus improving the success rate of data processing.

[0106] This invention also provides an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804. Memory 803 is used to store computer programs; The processor 801, when executing the program stored in the memory 803, implements the aforementioned data processing method based on a large model.

[0107] When performing large-model-based data processing using the electronic device provided in this embodiment of the invention, each function is configured with a software unit that implements the function by calling the large language model. The software unit is divided into original units and extended units, with the extended units corresponding to all or part of the original units. The target large language model processes the input parameters by calling the target software unit.

[0108] Furthermore, during data processing, the identification of the target extended unit can control whether the original unit or the extended unit is used to implement its corresponding function. This allows for flexible control over the software units used in data processing, improving program flexibility and facilitating the upgrading and updating of the original unit.

[0109] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0110] The communication interface is used for communication between the aforementioned terminal and other devices.

[0111] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0112] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0113] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the large model-based data processing methods described in the above embodiments.

[0114] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the large model-based data processing methods described in the above embodiments.

[0115] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0116] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0117] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0118] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A data processing method based on a large model, characterized in that, For each function, a software unit is configured to implement the function by calling a large language model. The software unit includes a primary unit and extended units, with some or all of the primary units and extended units corresponding one-to-one. The primary unit and its corresponding extended unit implement the same function, but the input parameters are different. In implementing the target function, the method includes: Get the input parameters; The target software unit corresponding to the target function is invoked, and the input parameters are processed by the target large language model corresponding to the target function. Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is invoked for data processing; if the identifier of the target extended unit is obtained, the target extended unit is invoked for data processing. The target extended unit corresponds to the original unit. Obtain the data processing results.

2. The method according to claim 1, characterized in that, Before invoking the target software unit corresponding to the target function and processing the input parameters using the target large language model corresponding to the target function, the method further includes: The preset role assignment function is invoked to assign the different semantic contents contained in the input parameters to different roles within the prompt words in the target large language model.

3. The method according to claim 1, characterized in that, The input parameters are input by calling a simple interactive function and do not contain data output format restrictions for the large language model and / or do not contain input / output examples. In this case, the input parameters are directly input into the target large language model. The input / output examples include: sample prompt words for inputting the large language model and sample output results obtained by the large language model after processing the sample prompt words.

4. The method according to any one of claims 1-3, characterized in that, For each function, the corresponding software unit includes a production result verification unit. After processing the input parameters using the target large language model corresponding to the target function, the unit further includes: Obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The production result verification unit corresponding to the target function is invoked to check whether the output result conforms to the target format. If it does not meet the requirements, the input parameters are reprocessed using the target large language model corresponding to the target function, and the process returns to the step of obtaining the output result of the target large language model corresponding to the target function after processing the input parameters.

5. The method according to any one of claims 1-3, characterized in that, For each function, the corresponding software unit includes a result post-processing unit. After the input parameters are processed by the target large language model corresponding to the target function, the unit further includes: Obtain the output result of the target large language model corresponding to the target function after processing the input parameters; The target large language model corresponding to the target function is called to generate a result post-processing unit, which analyzes the output result and extracts the key content in the output result. The key content is the content in the output result that best represents the meaning of the output result. If extraction fails, the input parameters are reprocessed using the target large language model corresponding to the target function, and the process returns to the step of obtaining the output result of the target large language model corresponding to the target function after processing the input parameters.

6. A data processing device based on a large model, characterized in that, For each function, a software unit is configured to implement the function by calling a large language model. The software unit includes a primary unit and extended units, with some or all of the primary units and extended units corresponding one-to-one. The primary unit and its corresponding extended unit implement the same function, but the input parameters are different. In the process of implementing the target function, the device includes: The parameter acquisition module is used to acquire input parameters; The first data processing module is used to call the target software unit corresponding to the target function, and to process the input parameters through the target large language model corresponding to the target function. Specifically, for the original unit in the target software unit, if the identifier of the target extended unit is not obtained, the original unit is called for data processing; if the identifier of the target extended unit is obtained, the target extended unit is called for data processing. The target extended unit corresponds to the original unit. The results acquisition module is used to obtain the data processing results.

7. The apparatus according to claim 6, characterized in that, The device further includes: The classification module is used to call a preset role assignment function to assign different semantic contents contained in the input parameters to different roles within the prompt words in the target large language model.

8. The apparatus according to claim 6, characterized in that, The input parameters are input by calling a simple interactive function and do not contain data output format restrictions for the large language model and / or do not contain input / output examples. In this case, the input parameters are directly input into the target large language model. The input / output examples include: sample prompt words for inputting the large language model and sample output results obtained by the large language model after processing the sample prompt words.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data processing method and device based on large language model

    CN119168084A