Task processing method and device, electronic equipment and storage medium

By coding and caching optimization of target prompt information, the problem of large language models being computationally expensive when processing long prompt information is solved, and the efficiency of task processing and user experience are improved.

CN119294355APending Publication Date: 2025-01-10APOLLO INTELLIGENT CONNECTIVITY (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411322466.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

When the existing large language model processes long prompt information, the calculation amount of key-value pairs is large, resulting in low task processing efficiency and affecting user experience.

Method used

By encoding and cutting the target prompt information, multiple target encoding blocks are obtained, and their key-value pairs are directly obtained or calculated based on the cache key-value pairs and these encoding blocks in the cache space, thereby improving efficiency.

Benefits of technology

Through coding cutting and caching optimization, the efficiency of task processing results is improved, unnecessary calculations are reduced, and user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294355A_ABST
    Figure CN119294355A_ABST
Patent Text Reader

Abstract

The invention provides a task processing method and device and electronic equipment, and relates to the technical field of computers, artificial intelligence and the like. According to the specific implementation scheme, a code of target prompt information is cut, a plurality of target code blocks are obtained, and the target prompt information comprises target scene information and a target task; obtaining key value pairs of the plurality of target coding blocks based on cache key value pairs in a cache space and the plurality of target coding blocks; and obtaining a processing result of the target task based on the key value pairs of the plurality of target coding blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to technical fields such as computers and artificial intelligence, and in particular to a task processing method. Background Art

[0002] In the prior art, when a large language model obtains a task processing result based on the prompt information of the task, it is necessary to first calculate the key-value pairs of the prompt information, and then analyze the key-value pairs of the prompt information to obtain the task processing result. In the case where the prompt information is very long, the large language model calculates the key-value pairs of the prompt information with a large amount of calculation, resulting in a long time to calculate the key-value pairs of the prompt information, thereby affecting the efficiency of obtaining the task processing result and a poor user experience. Therefore, how to improve the efficiency of obtaining the task processing result becomes a problem that needs to be solved. Summary of the invention

[0003] The present disclosure provides a task processing method, apparatus, device and storage medium.

[0004] According to one aspect of the present disclosure, a task processing method is provided, comprising:

[0005] Cutting the encoding of the target prompt information to obtain a plurality of target encoding blocks, wherein the target prompt information includes target scene information and target task;

[0006] Based on the cache key-value pairs in the cache space and the multiple target coding blocks, obtaining key-value pairs of the multiple target coding blocks;

[0007] Based on the key-value pairs of the multiple target coding blocks, a processing result of the target task is obtained.

[0008] According to another aspect of the present disclosure, there is provided a task processing device, comprising:

[0009] A coding cutting module, used for cutting the coding of the target prompt information to obtain a plurality of target coding blocks, wherein the target prompt information includes target scene information and target task;

[0010] A key-value pair analysis module, configured to obtain key-value pairs of the plurality of target coding blocks based on the cache key-value pairs in the cache space and the plurality of target coding blocks;

[0011] The task processing module is used to obtain the processing result of the target task based on the key-value pairs of the multiple target coding blocks.

[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] 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 to enable the at least one processor to execute any method in the embodiments of the present disclosure.

[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.

[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description.

[0019] By adopting the method provided in this embodiment, multiple target coding blocks are obtained by cutting the encoding of the target prompt information, and then the key-value pairs of multiple target coding blocks are obtained based on the cache key-value pairs in the cache space and the multiple target coding blocks, and finally the processing result of the target task is obtained based on the key-value pairs of the multiple target coding blocks. In this way, at least some of the multiple target coding blocks may directly obtain the key-value pairs from the cache space without calculating the key-value pairs of these target coding blocks, which improves the efficiency of obtaining the key-value pairs of the multiple target coding blocks, and further improves the efficiency of obtaining the task processing results. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0021] Figure 1 is a schematic flow chart of a task processing method according to an embodiment of the present application;

[0022] Figure 2 is a schematic flowchart of a process of obtaining key-value pairs of multiple target coding blocks according to an embodiment of the present application;

[0023] Figure 3 is a schematic flowchart of processing of obtaining key-value pairs based on the first model analysis according to an embodiment of the present application;

[0024] Figure 4 is a schematic flow chart of a task processing method according to another embodiment of the present application;

[0025] Figure 5 is a schematic block diagram of a task processing device according to an embodiment of the present application;

[0026] Figure 6 It is a block diagram of an electronic device used to implement the task processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0028] Figure 1 is a schematic flow chart of a task processing method proposed in an embodiment of the present disclosure, including:

[0029] S110, cutting the coding of the target prompt information to obtain a plurality of target coding blocks, wherein the target prompt information includes target scene information and target task;

[0030] S120, obtaining key-value pairs of the multiple target coding blocks based on the cache key-value pairs in the cache space and the multiple target coding blocks;

[0031] S130. Obtain a processing result of the target task based on the key-value pairs of the multiple target coding blocks.

[0032] The task processing method of the embodiment of the present disclosure can be executed by an electronic device. The electronic device can be a terminal or a server. Exemplarily, the electronic device can be a terminal device with computing capabilities, and the terminal device can be set in a target vehicle, and the target vehicle can be an autonomous driving vehicle or a non-autonomous driving vehicle. Exemplarily, the electronic device can be a server in the cloud; the server can be a single server, or can be at least one server in a server cluster, or can be a server of a distributed system (or can be called a computing node).

[0033] By adopting the method provided in this embodiment, multiple target coding blocks are obtained by cutting the encoding of the target prompt information, and then the key-value pairs of multiple target coding blocks are obtained based on the cache key-value pairs in the cache space and the multiple target coding blocks, and finally the processing result of the target task is obtained based on the key-value pairs of the multiple target coding blocks. In this way, at least some of the multiple target coding blocks may directly obtain the key-value pairs from the cache space without calculating the key-value pairs of these target coding blocks, which improves the efficiency of obtaining the key-value pairs of the multiple target coding blocks, and further improves the efficiency of obtaining the task processing results.

[0034] In one embodiment, the encoding of the target prompt information is cut to obtain a plurality of target coding blocks, including: generating the target prompt information based on the target scene information and the target task; obtaining the encoding of the target prompt information based on the target prompt information; and cutting the encoding of the target prompt information to obtain the plurality of target coding blocks.

[0035] The method of acquiring the target task may include one of the following: when the user inputs voice information, converting the voice information into text information and using the converted text information as the target task; when the user inputs text information, directly using the text information input by the user as the target task.

[0036] The target scene information may be determined by: determining the target scene information based on one or more candidate scene information.

[0037] Any candidate scenario information may be configured before the user inputs the target task. For example, any candidate scenario information may include at least one of the following: content defining the role, content defining the operation to be performed, content defining the capability, etc. For example, the content defining the role may be "You are an in-vehicle intelligent host"; the content defining the operation to be performed may be "After the user inputs the target task, you will parse the target task and perform the operation. Without the need for context understanding, help me determine whether there are spelling errors in the target task entered by the user, and whether the target task is related to various functions in the control cabin"; the content defining the capability may be "Your capabilities include in-car navigation, playing multimedia content (random playback when the instructions are unclear), various hardware in the control cabin (seat massage, seat heating, seat ventilation, ambient light, steering wheel heating, sunroof, dialing by name), and querying various life information (weather, flights, lottery, etc.)". It can be understood that this is only an exemplary description. In actual applications, the content defining the role, the content defining the operation to be performed, the content defining the capability, etc. can be set according to actual conditions, and this application does not limit it.

[0038] Optionally, when there are multiple candidate scene information, determining the target scene information based on one or more candidate scene information may include: determining candidate scene information matching the target task from multiple candidate scene information; and using the candidate scene information matching the target task as the target scene information. The multiple candidate scene information may be pre-configured according to actual conditions.

[0039] The step of determining the candidate scene information that matches the target task from a plurality of candidate scene information may include: inputting the target task into an intent analysis model to obtain a target intent vector output by the intent analysis model; and taking the candidate scene information corresponding to the candidate intent vector that is most similar to the target intent vector in the semantic library as the candidate scene information that matches the target task. Among them, the correspondence between the semantic library, the candidate intent vector and the candidate scene information may be pre-configured according to actual conditions, and the intent analysis model may be obtained by training based on a large language model. The training method of the large language model is not limited in this application.

[0040] It is understandable that the method for determining the candidate intent vector in the semantic library that is most similar to the target intent vector may be to use the candidate intent in the semantic library with the smallest distance to the target intent vector as the candidate intent vector that is most similar to the target intent vector. The distance may be one of the following: cosine distance, Euclidean distance, Manhattan distance, etc.

[0041] Optionally, when the number of candidate scene information is one, determining the target scene information based on one or more candidate scene information may be: using the candidate application scene information as the target scene information.

[0042] The generating of the target prompt information based on the target scene information and the target task may include: sorting the target scene information and the target task based on a first specified order; and using the sorted target scene information and the target task as the target prompt information. The first specified order includes one of the following: the target scene information order is before the target task; the target scene information order is after the target task. In a preferred example, the first specified order is that the target scene information order is before the target task.

[0043] The encoding of the target prompt information obtained based on the target prompt information may include: splitting the target prompt information into multiple units, and using the mark corresponding to each of the multiple units as the encoding of the target prompt information. Among them, any unit can be one of a single character, a word, a punctuation mark, etc., and the mark corresponding to the arbitrary unit can be the number corresponding to any unit in the vocabulary. The vocabulary can be pre-set. The mark corresponding to each unit can also be called a token.

[0044] The described cutting of the encoding of the target prompt information to obtain a plurality of target coding blocks may include: cutting the encoding of the target prompt information in a second specified order and in a specified size to obtain a plurality of target coding blocks. The specified size may refer to the number of codes contained in each target coding block, that is, the number of codes contained in different target coding blocks in the plurality of target coding blocks is the same and equal to the specified size. The second specified order is related to the order of the encoding of the target prompt information. For example, the second specified order may include one of the following: from left to right, from high to low, etc. For example, when the order of the encoding of the target prompt information is left-right ordering, the second specified order may be from left to right; when the order of the encoding of the target prompt information is up-down ordering, the second specified order may be from top to bottom. It can be understood that this is only an exemplary description, and the second specified order can be set according to actual conditions.

[0045] In this way, the encoding of the target prompt information is cut into multiple target encoding blocks, and each target encoding block can be analyzed in the subsequent analysis process. In this way, it is possible to analyze whether each target encoding block can obtain a cache key-value pair from the cache space, instead of using the encoding of the entire target prompt information to determine whether a cache key-value pair can be obtained from the cache space. This reduces the granularity of obtaining the cache key-value pair from the cache space, thereby increasing the probability that the target encoding block matches the corresponding key-value pair in the cache space.

[0046] In one embodiment, the obtaining of the key-value pairs of the multiple target coding blocks based on the cache key-value pairs in the cache space and the multiple target coding blocks includes one of the following: when it is determined that a matching cache coding block exists in the cache space for the current target coding block, extracting from the cache space a cache key-value pair associated with the cache coding block that matches the current target coding block, and using the cache key-value pair as the key-value pair of the current target coding block; when it is determined that a matching cache coding block does not exist in the cache space for the current target coding block, inputting the current target coding block into a first model to obtain a key-value pair output by the first model, and using the key-value pair output by the first model as the key-value pair of the current target coding block.

[0047] Among them, the key-value pair consists of two parts: key (Key) and value (Value). Key is used to represent the self-attention weight, and Value is used to represent the self-attention value.

[0048] The first model can be obtained by training according to actual needs, and the training process is not limited in this application. For example, the first model can be obtained by training based on a self-attention model.

[0049] The process of determining whether there is a matching cache coding block in the cache space for the current target coding block may include one of the following: when the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is found in the cache space, determining that there is a matching cache coding block in the cache space for the current target coding block; when the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is not found in the cache space, determining that there is no matching cache coding block in the cache space for the current target coding block; when the current target coding block is not the first target coding block among the multiple target coding blocks and there is no matching cache coding block in the cache space for the previous target coding block In the case of a coding block, it is determined that there is no matching cache coding block for the current target coding block in the cache space; when the current target coding block is not the first target coding block among multiple target coding blocks, there is a matching cache coding block for the previous target coding block in the cache space, and a cache coding block matching the current target coding block is found in the cache space, it is determined that there is a matching cache coding block for the current target coding block in the cache space; when the current target coding block is not the first target coding block among multiple target coding blocks, there is a matching cache coding block for the previous target coding block in the cache space, and a cache coding block matching the current target coding block is not found in the cache space, it is determined that there is no matching cache coding block for the current target coding block in the cache space.

[0050] Here, when the current analysis process is the first analysis process, the multiple target coding blocks are all unanalyzed target coding blocks, and therefore, the current target coding block is the first target coding block among the multiple target coding blocks (i.e., all target coding blocks). When the current analysis process is not the first analysis process, there are one or more analyzed target coding blocks and one or more unanalyzed target coding blocks among the multiple target coding blocks, and therefore, the current target coding block is the first unanalyzed target coding block among the one or more unanalyzed target coding blocks, and is not the first target coding block among all target coding blocks; the current target coding block will have a previous target coding block, and the previous target coding block is the target coding block extracted by the previous analysis process, i.e., the last analyzed target coding block among the one or more analyzed target coding blocks.

[0051] In a case where the current target coding block is the first target coding block among multiple target coding blocks, determining whether a cache coding block matching the current target coding block is found in the cache space may include one of the following: in a case where a cache coding block identical to the current target coding block is found in the first cache coding block of any cache coding block sequence of one or more cache coding block sequences in the cache space, determining that a cache coding block matching the current target coding block is found in the cache space; in a case where a cache coding block identical to the current target coding block is not found in the first cache coding block of each cache coding block sequence of one or more cache coding block sequences in the cache space, determining that a cache coding block matching the current target coding block is not found in the cache space.

[0052] In a case where the current target coding block is not the first target coding block among the multiple target coding blocks, determining whether there is a matching cache coding block for the current target coding block in the cache space may include:

[0053] Determine whether there is a matching cached code block for the previous target code block in the cache space;

[0054] In a case where a previous target coding block does not have a matching cache coding block in the cache space, determining that a current target coding block does not have a matching cache coding block in the cache space;

[0055] In the case where a matching cached coding block exists in the cache space for the previous target coding block, it is determined whether a cached coding block matching the current target coding block is found in the cache space; if a cached coding block matching the current target coding block is found in the cache space, it is determined that a matching cached coding block exists in the cache space for the current target coding block; if a cached coding block matching the current target coding block is not found in the cache space, it is determined that no matching cached coding block exists in the cache space for the current target coding block.

[0056] It is understandable that if it is determined that the current target coding block has no matching cache coding block in the cache space, it is determined that one or more unanalyzed target coding blocks among the multiple target coding blocks have no matching cache coding block in the cache space. That is, when the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is not found in the cache space, it is determined that one or more unanalyzed target coding blocks among the multiple target coding blocks do not have a matching cache coding block in the cache space; when the current target coding block is not the first target coding block among the multiple target coding blocks and a previous target coding block does not have a matching cache coding block in the cache space, it is determined that one or more unanalyzed target coding blocks among the multiple target coding blocks do not have a matching cache coding block in the cache space; when the current target coding block is not the first target coding block among the multiple target coding blocks, the previous target coding block has a matching cache coding block in the cache space, and a cache coding block matching the current target coding block is not found in the cache space, it is determined that one or more unanalyzed target coding blocks among the multiple target coding blocks do not have a matching cache coding block in the cache space.

[0057] In the case where the current target coding block is not the first target coding block among multiple target coding blocks, the method of determining whether a cache coding block matching the current target coding block is found in the cache space may include: determining that a cache coding block matching the current target coding block is found in the cache space when the cache coding block at the first position of any cache coding block sequence in one or more cache coding block sequences in the cache space is the same as the current target coding block; and determining that a cache coding block matching the current target coding block is not found in the cache space when the cache coding block at the first position of each cache coding block sequence in one or more cache coding block sequences in the cache space is different from the current target coding block. The first position of the cache coding block sequence is the same as the position of the current target coding block in the multiple target coding blocks. For example, if the position of the current target coding block in the multiple target coding blocks is the position corresponding to sequence 2, the first position of the cache coding block sequence is the position corresponding to sequence 2 in the cache coding block sequence.

[0058] Combination Figure 2 , an exemplary description is given of a process of obtaining key-value pairs of the multiple target coding blocks based on the cache key-value pairs in the cache space and the multiple target coding blocks, which may include:

[0059] Step 201: During the current analysis process, determine whether there are unanalyzed target coding blocks among the multiple target coding blocks. If there are one or more unanalyzed target coding blocks, execute step 202; if there are no unanalyzed target coding blocks, determine the key-value pairs of each target coding block in the multiple target coding blocks and end the process.

[0060] Step 202: Based on the order of one or more unanalyzed target coding blocks, extract the first unanalyzed target coding block as the current target coding block.

[0061] Step 203, determine whether the current target coding block is the first target coding block among multiple target coding blocks, if not the first target coding block, execute step 204, if it is the first target coding block, execute step 205.

[0062] Step 204 , determining whether there is a matching cached coding block for the previous target coding block of the current target coding block in the cache space; if so, executing step 205 ; if not, executing step 207 .

[0063] Step 205: Determine whether the current target coding block has a matching cache coding block in the cache space. If it is determined that the current target coding block has a matching cache coding block in the cache space, execute step 206; if it is determined that the current target coding block does not have a matching cache coding block in the cache space, execute step 207.

[0064] Step 206: extract the cache key-value pair associated with the cache code block matching the current target code block from the cache space, use the cache key-value pair as the key-value pair of the current target code block, and return to execute step 201.

[0065] Step 207: input the current target coding block into the first model to obtain the key-value pair output by the first model, use the key-value pair output by the first model as the key-value pair of the current target coding block, and return to execute step 201.

[0066] In one case, the cache space may be the only storage space.

[0067] In this case, the processing of step 205 can be: determine whether there is a matching cached coding block in the storage space for the current target coding block, and if it is determined that there is a matching cached coding block in the storage space for the current target coding block, execute step 206; if it is determined that there is no matching cached coding block in the storage space for the current target coding block, execute step 207.

[0068] The processing of step 206 may be: extracting from the storage space the cache key-value pair associated with the cached coding block that matches the current target coding block.

[0069] In one case, the cache space may include a first storage space and a second storage space. The first storage space is used to store cache code blocks with high usage frequency and cache key-value pairs associated with the cache code blocks. The second storage space is used to store cache code blocks with low usage frequency and cache key-value pairs associated with the cache code blocks.

[0070] In this case, the processing of step 205 may include: determining whether there is a matching cached coding block for the current target coding block in the first storage space, and executing step 206 if it is determined that there is a matching cached coding block for the current target coding block in the first storage space; determining whether there is a matching cached coding block for the current target coding block in the second storage space if there is no matching cached coding block in the first storage space, and executing step 206 if it is determined that there is a matching cached coding block for the current target coding block in the second storage space; and executing step 207 if it is determined that there is no matching cached coding block for the current target coding block in both the first storage space and the second storage space.

[0071] Correspondingly, if it is determined that there is a matching cache coding block in the first storage space for the current target coding block, step 206 is executed, then step 206 can be: extracting the cache key-value pair associated with the cache coding block matching the current target coding block from the first storage space, using the cache key-value pair as the key-value pair of the current target coding block, and returning to execute step 201.

[0072] If it is determined that there is a matching cached coding block for the current target coding block in the second storage space, step 206 is executed, then step 206 can be: extracting the cache key-value pair associated with the cached coding block matching the current target coding block from the second storage space, using the cache key-value pair as the key-value pair of the current target coding block, and returning to execute step 201.

[0073] Here, the cache code blocks and cache key-value pairs stored in the first storage space may be preconfigured, and / or may be historical target code blocks obtained during the analysis and processing of historical prompt information and key-value pairs associated with the multiple historical target code blocks.

[0074] When the cache code block and the cache key-value pair are preconfigured in the first storage space, the processing result of the candidate task associated with the cache key-value pair of the cache code block may also be associated and stored in the first storage space.

[0075] The process of storing the historical target coding blocks obtained in the process of analyzing and processing the historical prompt information and the key-value pairs associated with the multiple historical target coding blocks in the first storage space may include: using the historical target coding blocks obtained in the process of analyzing and processing the historical prompt information as a cache coding block sequence, using the key-value pairs of the historical target coding blocks as cache key-value pairs associated with the cache coding blocks in the cache coding block sequence, and using the processing results of the historical target tasks corresponding to the historical prompt information as the processing results of the candidate tasks associated with the cache key-value pairs of the cache coding blocks; associating the processing results of the cache coding block sequence, the cache key-value pairs associated with each cache coding block in the cache coding block sequence, and the cache key-value pairs of the multiple cache coding blocks and storing them in the first storage space.

[0076] Furthermore, the content stored in the first storage space can also be updated according to the strategy, and the specific update process may include: when the number of cache coding block sequences in the first storage space is greater than a first number threshold, determining the usage frequency of the cache key-value pairs associated with each cache coding block sequence in the multiple cache coding block sequences in the first storage space; when there are one or more cache key-value pairs associated with the first cache coding block sequences in the multiple cache coding block sequences and the usage frequency is less than the first frequency threshold, moving one or more first cache coding block sequences, the cache key-value pairs associated with the one or more first cache coding block sequences, and the processing results of the candidate tasks associated with the one or more first cache coding block sequences to the second cache space.

[0077] The content stored in the second storage space can also be updated according to the policy. The specific update process may include: when the number of one or more first cache coding block sequences in the second cache space is greater than a second number threshold, determining the usage frequency of cache key-value pairs associated with one or more first cache coding block sequences in the second cache space; when the usage frequency of cache key-value pairs associated with one or more second cache coding block sequences in one or more first cache coding block sequences is less than the second frequency threshold, deleting the one or more second cache coding block sequences, the cache key-value pairs associated with the one or more second cache coding block sequences, and the processing results of the candidate tasks associated with the one or more second cache coding block sequences.

[0078] Among them, the first quantity threshold and the second quantity threshold can be configured according to actual conditions without being limited; the first frequency threshold and the second frequency threshold can be configured according to actual conditions without being limited.

[0079] In this way, when the current target coding block is the first target coding block among multiple target coding blocks, based on whether a cache coding block matching the current target coding block is found in the cache space, it can be determined whether the current target coding block has a matching cache coding block in the cache space; when the current target coding block is not the first target coding block among multiple target coding blocks, based on whether a cache coding block matching the current target coding block is found in the cache space and whether the previous target coding block has a matching cache coding block in the cache space, it can be determined whether the current target coding block has a matching cache coding block in the cache space. In this way, it can be more accurately determined whether the current target coding block has a matching cache coding block.

[0080] By adopting the above scheme, it is possible to determine in turn whether there is a matching cache key-value pair for the current target coding block in the cache space. As long as there is a matching cache coding block for the current target coding block in the cache space, the cache key-value pair associated with the cache coding block is directly extracted from the cache space. Only when the current target coding block cannot extract the corresponding cache key-value pair from the cache space, the first model is used to infer the key-value pair of the current target coding block. This avoids the problem of low efficiency caused by using models to reason or analyze multiple target coding blocks one by one, improves the efficiency of obtaining the key-value pairs of the multiple target coding blocks, and further improves the efficiency of obtaining the task processing results.

[0081] In some embodiments, the step of inputting the current target coding block into the first model to obtain a key-value pair output by the first model includes one of the following: when the current target coding block is the first target coding block among multiple target coding blocks, inputting the current target coding block into the first model to obtain the key-value pair output by the first model and the predicted coding probability corresponding to the current target coding block; when the current target coding block is not the first target coding block among multiple target coding blocks, inputting the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block into the first model to obtain the key-value pair output by the first model and the predicted coding probability corresponding to the current target coding block.

[0082] The predicted coding probability corresponding to the current target coding block may be: the probability value of the first predicted coding after each preset coding in the preset coding table corresponding to the preset vocabulary table is the current target coding block as the predicted coding probability corresponding to the current target coding block. The predicted coding probability corresponding to the current target coding block may be called logits (logical value).

[0083] The preset word list and the preset code table corresponding to the preset word list can be set according to actual conditions. For example, if the preset word list includes 100,000 words, the length of the preset code table corresponding to the preset word list is 100,000 and each preset code in the preset code table corresponds to each word in the preset word list.

[0084] The key-value pairs of the analyzed target coding blocks among the multiple target coding blocks may be: key-value pairs of one or more analyzed target coding blocks before the current target coding block in sequence.

[0085] The function of the first model is to analyze and reason the current input content to be analyzed, and obtain the key-value pairs of the current target coding block and the predicted coding probability corresponding to the current target coding block. Wherein, when the current target coding block is the first target coding block among multiple target coding blocks, the current input content to be analyzed is the current target coding block; when the current target coding block is not the first target coding block among multiple target coding blocks, the current input content to be analyzed includes the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block.

[0086] In some possible examples, the first model may be composed of a multi-head self-attention layer, a fully connected layer, etc., wherein the fully connected layer can also be called a fully connected neural network layer. In combination with the composition structure of the first model, an exemplary description of performing any analysis and reasoning processing on the first model may include: inputting the current input content to be analyzed into the multi-head self-attention layer of the first model, and obtaining the key-value pair of the current target coding block in the current input content to be analyzed output by the multi-head self-attention layer; inputting the current input content to be analyzed into the fully connected layer of the first model, and obtaining the predicted coding probability corresponding to the current target coding block output by the fully connected layer.

[0087] Combination Figure 3 , an exemplary description of a process of inputting the current target coding block into the first model to obtain a key-value pair output by the first model may include:

[0088] Step 301, determine whether the current target coding block is the first target coding block among multiple target coding blocks. If the current target coding block is the first target coding block, execute step 302; if the current target coding block is not the first target coding block, execute step 303.

[0089] Step 302: input the current target coding block into the first model, obtain the key-value pair output by the first model and the predicted coding probability corresponding to the current target coding block, and end the processing of the current target coding block.

[0090] Step 303: input the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block into the first model, obtain the key-value pairs output by the first model and the predicted coding probability corresponding to the current target coding block, and end the processing of the current target coding block.

[0091] In one example, when the cache space includes only one storage space, after obtaining the key-value pairs output by the first model, the method includes: using the key-value pairs output by the first model as cache key-value pairs, and storing them in the only storage space.

[0092] In an example, when the cache space includes a first storage space and a second storage space, after obtaining the key-value pair output by the first model, the method includes: using the key-value pair output by the first model as a cache key-value pair and storing it in the first storage space.

[0093] It should be noted that the above descriptions of storing cache key-value pairs and their associated contents in the first storage space or the only storage space are the same as those in the aforementioned embodiment, and thus will not be repeated.

[0094] In this way, when the current target coding block is the first target coding block among multiple target coding blocks, the current target coding block is input into the first model to obtain the key-value pair output by the first model and the predicted coding probability corresponding to the current target coding block; when the current target coding block is not the first target coding block among multiple target coding blocks, the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block are input into the first model to obtain the key-value pairs output by the first model and the predicted coding probability corresponding to the current target coding block. In this way, the key-value pairs of the target coding blocks in the previous order can be considered when the model calculates the key-value pairs of the current target coding block, thereby improving the accuracy of the key-value pairs of the current target coding block output by the model.

[0095] In one embodiment, the key-value pairs of the multiple target coding blocks are used to obtain the processing result of the target task, including: when the key-value pair of at least one target coding block among the multiple target coding blocks is the key-value pair output by the first model, input information is generated based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks and the key-value pairs of each target coding block among the multiple target coding blocks; and the input information is input into the second model to obtain the processing result of the target task output by the second model.

[0096] The method for judging whether there is at least one target coding block among multiple target coding blocks whose key-value pair is the key-value pair output by the first model may be: judging whether the key-value pair of the last target coding block among multiple target coding blocks is the key-value pair output by the first model. This is because, if it is determined that there is no matching cache coding block in the cache space for a certain target coding block, it can be determined that one or more unanalyzed target coding blocks after the target coding block do not have matching cache coding blocks in the cache space. In this case, it is necessary to input one or more unanalyzed target coding blocks into the first model in sequence to obtain the key-value pairs of one or more unanalyzed target coding blocks output by the first model in sequence. That is to say, in the case where there is no matching cache coding block in the cache space for any of the target coding blocks, the key-value pair of the last target coding block in the target coding block must be output by the first model. In other words, in the case where the key-value pair of at least one target coding block among the multiple target coding blocks is the key-value pair output by the first model, the first model will definitely output the key-value pair of the last coding block among the multiple coding blocks and the predicted coding probability corresponding to the last target coding block.

[0097] The generating of input information based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks and the key-value pairs of each target coding block among the multiple target coding blocks may include: determining a first predicted coding based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks; and using the first predicted coding and the key-value pairs of each target coding block among the multiple target coding blocks as the input information.

[0098] Among them, based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks, the first predicted coding is determined, which can be to use the predicted coding with the highest probability among the predicted coding probabilities corresponding to the last target coding block as the first predicted coding.

[0099] The second model may be obtained by training based on a large language model, and the present application does not limit the training process of the large language model.

[0100] The function of the second model is to analyze and infer the input information of the key-value pairs of the first prediction code and each target code block in the multiple target code blocks to obtain the processing result of the target task.

[0101] In some possible examples, the possible processing of the second model may include: inputting input information including the first predicted code and key-value pairs of each target code block in the multiple target code blocks into the second model, and the second model performing multiple iterations or loop processing until the processing result of the target task is obtained.

[0102] Wherein, the second model performing any iteration or loop processing may include: analyzing or reasoning the current information to be predicted to obtain the prediction code and key-value pair after this analysis or reasoning. Wherein, when the iteration or loop processing performed by the second model is the first iteration or loop processing, the current information to be predicted is the input information; when the iteration or loop processing performed by the second model is not the first iteration or loop processing, the current information to be predicted is the prediction code and key-value pair obtained by the previous loop processing of the second model.

[0103] Furthermore, the second model may be composed of a multi-head self-attention layer and a fully connected layer. The second model performs analysis or reasoning on the current information to be predicted at any iteration or loop, and obtains the specific processing of the prediction code and key-value pair after this analysis or reasoning, which may include: inputting the current information to be predicted into the multi-head self-attention layer of the second model, obtaining the key-value pair of the prediction code contained in the current information to be predicted output by the multi-head self-attention layer, and using the key-value pair of the prediction code contained in the current information to be predicted as the key-value pair after this analysis or reasoning; inputting the current information to be predicted into the fully connected layer of the second model, obtaining the prediction code probability obtained by this loop processing output by the fully connected layer, and obtaining the prediction code after this analysis or reasoning based on the prediction code probability obtained by this loop processing.

[0104] Optionally, the number of iterations or loops performed by the second model can be configured according to actual conditions.

[0105] Optionally, the number of times the second model performs iterative or loop processing is related to whether the predicted code after any analysis or reasoning is a preset end code. For example, when the predicted code of a certain analysis or reasoning is a preset end code, the second model can end the iterative or loop processing.

[0106] After obtaining the processing result of the target task, the method further includes: associating the key-value pairs of the obtained multiple target coding blocks, the processing result of the target task, and the multiple target coding blocks and storing them in the first storage space or the only storage space. The specific storage method is the same as the above embodiment and will not be repeated here.

[0107] In this way, when the key-value pair of at least one target coding block among the multiple target coding blocks is the key-value pair output by the first model, the input information generated based on the predicted coding probability corresponding to the last target coding and the key-value pair of each target coding block among the multiple target coding blocks is input into the second model to obtain the processing result of the target task output by the second model. The processing result of the target task can be obtained more accurately.

[0108] In one embodiment, obtaining the processing result of the target task based on the key-value pairs of the multiple target coding blocks includes: when the key-value pairs of each target coding block in the multiple target coding blocks are the cache key-value pairs extracted from the cache space, extracting the processing result of the candidate task associated with the key-value pairs of each target coding block in the multiple target coding blocks from the cache space, and using the processing result of the candidate task as the processing result of the target task.

[0109] To determine whether the key-value pair of each target coding block in the multiple target coding blocks is the cache key-value pair extracted from the cache space, it can be to determine whether the key-value pair of the last target coding block in the multiple target coding blocks is the cache key-value pair extracted from the cache space. This is because multiple target coding blocks are sequentially extracted and it is determined whether there is a matching cache key-value pair in the cache space, where as long as there is a target coding block that does not have a matching cache coding block in the cache space, all unanalyzed target coding blocks after the target coding block will no longer obtain the key-value pair associated with the matching cache coding block from the cache space. On the contrary, if the last target coding block has a matching cache coding block in the cache space, it means that all target coding blocks have matching cache coding blocks in the cache space. Therefore, to determine whether the key-value pair of each target coding block in the multiple target coding blocks is the cache key-value pair extracted from the cache space, it can be determined only by determining whether the key-value pair of the last target coding block in the multiple target coding blocks is the cache key-value pair extracted from the cache space.

[0110] The extracting from the cache space the processing results of the candidate tasks associated with the key-value pairs of each target coding block in the multiple target coding blocks may include: based on each cache key-value pair associated with the cache coding block that matches the key-value pair of each target coding block in the multiple target coding blocks, extracting from the cache space the processing results of the candidate tasks associated with each cache key-value pair.

[0111] In this way, when the key-value pairs of each target coding block in the plurality of target coding blocks are the cache key-value pairs extracted from the cache space, the processing result of the target task is extracted from the cache space. It is not necessary to calculate the processing result of the target task, thereby improving the efficiency of obtaining the processing result of the target task.

[0112] Combination Figure 4 The above implementation is exemplarily described as follows:

[0113] Step 401: Generate the target prompt information based on the target scene information and the target task; and obtain the encoding of the target prompt information based on the target prompt information.

[0114] Step 402: Cut the target prompt information code to obtain multiple target code blocks. Figure 4 In the figure, for simplicity, multiple target coding blocks are represented as chunk-1, chunk-2, chunk-3, ... chunk-n.

[0115] Step 403, determine whether the current target coding block has a matching cache coding block in the cache space; if it is determined that the current target coding block has a matching cache coding block in the cache space, execute step 404; if it is determined that the current target coding block does not have a matching cache coding block in the cache space, execute step 405.

[0116] Step 404 , extracting from the cache space a cache key-value pair associated with the cache code block that matches the current target code block, using the cache key-value pair as the key-value pair of the current target code block, and executing step 406 .

[0117] Step 405: input the current target coding block into the first model, obtain the key-value pair output by the first model and the predicted coding probability corresponding to the current target coding block, and use the key-value pair output by the first model as the key-value pair of the current target coding block.

[0118] In an example, taking the cache space including only one storage space as an example, after executing step 405, it may also include taking the key-value pairs output by the first model as cache key-value pairs and storing them in the only storage space.

[0119] Step 406, determine whether the current target coding block is the last target coding block; if the current target coding block is not the last target coding block, take the next target coding block as the current coding block and return to execute step 403; if the current target coding block is the last target coding block and the key-value pair of the last target coding block is the key-value pair output by the first model, execute step 407.

[0120] In addition, it may also include: when the current target coding block is the last target coding block and the key-value pair of the last target coding block is the cache key-value pair extracted from the cache space, extracting the processing result of the candidate task associated with the key-value pair of each target coding block in the multiple target coding blocks from the cache space, outputting the processing result of the candidate task as the processing result of the target task, and the process ends.

[0121] Step 407: Generate input information based on the predicted coding probability corresponding to the last target coding and the key-value pairs of each target coding block in the multiple target coding blocks; input the input information into the second model to obtain the processing result of the target task output by the second model.

[0122] The present disclosure also provides a task processing device, such as Figure 5 As shown, including:

[0123] A coding cutting module 501 is used to cut the coding of the target prompt information to obtain multiple target coding blocks, wherein the target prompt information includes target scene information and target task;

[0124] A key-value pair analysis module 502, configured to obtain key-value pairs of the plurality of target coding blocks based on the cache key-value pairs in the cache space and the plurality of target coding blocks;

[0125] The task processing module 503 is used to obtain the processing result of the target task based on the key-value pairs of the multiple target coding blocks.

[0126] The key-value pair analysis module is used to perform one of the following:

[0127] When it is determined that there is a matching cached code block for the current target code block in the cache space, extracting a cache key-value pair associated with the cached code block matching the current target code block from the cache space, and using the cache key-value pair as the key-value pair of the current target code block;

[0128] When it is determined that there is no matching cache coding block for the current target coding block in the cache space, the current target coding block is input into a first model to obtain a key-value pair output by the first model, and the key-value pair output by the first model is used as the key-value pair of the current target coding block.

[0129] The key-value pair analysis module is used to perform one of the following:

[0130] In a case where the current target coding block is the first target coding block among the multiple target coding blocks, inputting the current target coding block into a first model to obtain a key-value pair output by the first model and a predicted coding probability corresponding to the current target coding block;

[0131] In the case that the current target coding block is not the first target coding block among the multiple target coding blocks, the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block are input into a first model to obtain the key-value pairs output by the first model and the predicted coding probability corresponding to the current target coding block.

[0132] The key-value pair analysis module is used to perform one of the following:

[0133] When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block has a matching cache coding block in the cache space;

[0134] When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is not found in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space;

[0135] When the current target coding block is not the first target coding block among the multiple target coding blocks and a previous target coding block does not have a matching cache coding block in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space;

[0136] In a case where the current target coding block is not the first target coding block among the multiple target coding blocks, a matching cache coding block exists in the cache space for the previous target coding block, and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block exists in the cache space for a matching cache coding block;

[0137] When the current target coding block is not the first target coding block among the multiple target coding blocks, the previous target coding block has a matching cache coding block in the cache space, and a cache coding block matching the current target coding block is not found in the cache space, it is determined that the current target coding block has no matching cache coding block in the cache space.

[0138] The task processing module is used to generate input information based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks and the key-value pairs of each target coding block among the multiple target coding blocks, when the key-value pair of at least one target coding block among the multiple target coding blocks is the key-value pair output by the first model; input the input information into the second model to obtain the processing result of the target task output by the second model.

[0139] The task processing module is used to extract the processing results of candidate tasks associated with the key-value pairs of each target coding block in the multiple target coding blocks from the cache space when the key-value pairs of each target coding block in the multiple target coding blocks are the cache key-value pairs extracted from the cache space, and use the processing results of the candidate tasks as the processing results of the target task.

[0140] The coding cutting module is used to generate the target prompt information based on the target scene information and the target task; obtain the coding of the target prompt information based on the target prompt information; and cut the coding of the target prompt information to obtain the multiple target coding blocks.

[0141] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

[0142] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0143] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0144] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0145] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 804. An input / output (I / O) interface 605 is also connected to the bus 804.

[0146] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0147] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the above method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).

[0148] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0149] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0150] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0151] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0152] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0153] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0154] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0155] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A task processing method, comprising: Cutting the encoding of the target prompt information to obtain a plurality of target encoding blocks, wherein the target prompt information includes target scene information and target task; Based on the cache key-value pairs in the cache space and the multiple target coding blocks, obtaining key-value pairs of the multiple target coding blocks; Based on the key-value pairs of the multiple target coding blocks, a processing result of the target task is obtained.

2. The method according to claim 1, wherein: The obtaining the key-value pairs of the multiple target coding blocks based on the cache key-value pairs in the cache space and the multiple target coding blocks includes one of the following: When it is determined that there is a matching cached code block for the current target code block in the cache space, extracting a cache key-value pair associated with the cached code block matching the current target code block from the cache space, and using the cache key-value pair as the key-value pair of the current target code block; When it is determined that there is no matching cache coding block for the current target coding block in the cache space, the current target coding block is input into a first model to obtain a key-value pair output by the first model, and the key-value pair output by the first model is used as the key-value pair of the current target coding block.

3. The method according to claim 2, wherein: The step of inputting the current target coding block into the first model to obtain a key-value pair output by the first model includes one of the following: In a case where the current target coding block is the first target coding block among the multiple target coding blocks, inputting the current target coding block into a first model to obtain a key-value pair output by the first model and a predicted coding probability corresponding to the current target coding block; In the case that the current target coding block is not the first target coding block among the multiple target coding blocks, the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block are input into a first model to obtain the key-value pairs output by the first model and the predicted coding probability corresponding to the current target coding block.

4. The method according to claim 2 or 3, further comprising one of the following: When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block has a matching cache coding block in the cache space; When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is not found in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space; When the current target coding block is not the first target coding block among the multiple target coding blocks and a previous target coding block does not have a matching cache coding block in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space; In a case where the current target coding block is not the first target coding block among the multiple target coding blocks, a matching cache coding block exists in the cache space for the previous target coding block, and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block exists in the cache space for a matching cache coding block; When the current target coding block is not the first target coding block among the multiple target coding blocks, the previous target coding block has a matching cache coding block in the cache space, and a cache coding block matching the current target coding block is not found in the cache space, it is determined that the current target coding block has no matching cache coding block in the cache space.

5. The method according to claim 2 or 3, wherein: The obtaining the processing result of the target task based on the key-value pairs of the multiple target coding blocks includes: In a case where the key-value pair of at least one target coding block among the multiple target coding blocks is a key-value pair output by the first model, generating input information based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks and the key-value pair of each target coding block among the multiple target coding blocks; The input information is input into a second model to obtain a processing result of the target task output by the second model.

6. The method according to claim 2, wherein: The obtaining the processing result of the target task based on the key-value pairs of the multiple target coding blocks includes: In a case where the key-value pair of each target coding block in the multiple target coding blocks is the cache key-value pair extracted from the cache space, the processing result of the candidate task associated with the key-value pair of each target coding block in the multiple target coding blocks is extracted from the cache space, and the processing result of the candidate task is used as the processing result of the target task.

7. The method according to claim 1, wherein: The coding of the target prompt information is cut to obtain multiple target coding blocks, including: Based on the target scene information and the target task, generating the target prompt information; Based on the target prompt information, obtaining a code of the target prompt information; The encoding of the target prompt information is cut to obtain the multiple target encoding blocks.

8. A task processing device, comprising: A coding cutting module, used for cutting the coding of the target prompt information to obtain a plurality of target coding blocks, wherein the target prompt information includes target scene information and target task; A key-value pair analysis module, configured to obtain key-value pairs of the plurality of target coding blocks based on the cache key-value pairs in the cache space and the plurality of target coding blocks; The task processing module is used to obtain the processing result of the target task based on the key-value pairs of the multiple target coding blocks.

9. The device according to claim 8, wherein: The key-value pair analysis module is used to perform one of the following: When it is determined that there is a matching cached code block for the current target code block in the cache space, extracting a cache key-value pair associated with the cached code block matching the current target code block from the cache space, and using the cache key-value pair as the key-value pair of the current target code block; When it is determined that there is no matching cache coding block for the current target coding block in the cache space, the current target coding block is input into a first model to obtain a key-value pair output by the first model, and the key-value pair output by the first model is used as the key-value pair of the current target coding block.

10. The device according to claim 9, wherein: The key-value pair analysis module is used to perform one of the following: In a case where the current target coding block is the first target coding block among the multiple target coding blocks, inputting the current target coding block into a first model to obtain a key-value pair output by the first model and a predicted coding probability corresponding to the current target coding block; In the case that the current target coding block is not the first target coding block among the multiple target coding blocks, the key-value pairs of the analyzed target coding blocks among the multiple target coding blocks and the current target coding block are input into a first model to obtain the key-value pairs output by the first model and the predicted coding probability corresponding to the current target coding block.

11. The apparatus according to claim 9 or 10, wherein the key-value pair analysis module is configured to perform one of the following: When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block has a matching cache coding block in the cache space; When the current target coding block is the first target coding block among the multiple target coding blocks and a cache coding block matching the current target coding block is not found in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space; When the current target coding block is not the first target coding block among the multiple target coding blocks and a previous target coding block does not have a matching cache coding block in the cache space, determining that the current target coding block does not have a matching cache coding block in the cache space; In a case where the current target coding block is not the first target coding block among the multiple target coding blocks, a matching cache coding block exists in the cache space for the previous target coding block, and a cache coding block matching the current target coding block is found in the cache space, determining that the current target coding block exists in the cache space for a matching cache coding block; When the current target coding block is not the first target coding block among the multiple target coding blocks, the previous target coding block has a matching cache coding block in the cache space, and a cache coding block matching the current target coding block is not found in the cache space, it is determined that the current target coding block has no matching cache coding block in the cache space.

12. The device according to claim 9 or 10, wherein: The task processing module is configured to generate input information based on the predicted coding probability corresponding to the last target coding block among the multiple target coding blocks and the key-value pairs of each target coding block among the multiple target coding blocks, when the key-value pair of at least one target coding block among the multiple target coding blocks is the key-value pair output by the first model; The input information is input into a second model to obtain a processing result of the target task output by the second model.

13. The device according to claim 9, wherein: The task processing module is used to extract the processing results of candidate tasks associated with the key-value pairs of each target coding block in the multiple target coding blocks from the cache space when the key-value pairs of each target coding block in the multiple target coding blocks are the cache key-value pairs extracted from the cache space, and use the processing results of the candidate tasks as the processing results of the target task.

14. The device according to claim 8, wherein: The coding cutting module is used to generate the target prompt information based on the target scene information and the target task; Based on the target prompt information, obtaining a code of the target prompt information; The encoding of the target prompt information is cut to obtain the multiple target encoding blocks.

15. An electronic device, comprising: at least one processor; as well as 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 to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.