Information updating method and device, equipment and storage medium

By compressing historical dialogue content information, the problem of limited dialogue content processing in multiple rounds of interaction is solved, effective compression of dialogue content and efficient processing of models is achieved, and reference value of semantic analysis is ensured.

CN119783684APending Publication Date: 2025-04-08BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311279762.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, the conversation content that the model can process is limited each time, resulting in the total length of the historical conversation content in multiple rounds of interactions that may exceed the upper limit of the length that the model can process, resulting in the model being unable to effectively process the information entered by the user.

Method used

By judging whether the historical dialogue content information meets the compression conditions, it is determined to retain the dialogue content information and the dialogue content information to be compressed, and to compress the compressed dialogue content information, obtain the compressed dialogue content information, and update the historical dialogue content information.

Benefits of technology

The total length of historical dialogue content information is reduced, and the length of dialogue content in prompt information exceeds the upper limit that the model can process, ensuring that the model can effectively process the information input by users, and retain dialogue content with greater reference value for convenient semantic analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783684A_ABST
    Figure CN119783684A_ABST
Patent Text Reader

Abstract

The invention provides an information updating method and device, equipment and a storage medium. The dialogue content in historical dialogue content information can be compressed. The information updating method comprises the steps that in response to the situation that historical dialogue content information meets a compression condition, reserved dialogue content information and to-be-compressed dialogue content information are determined from the historical dialogue content information, and the historical dialogue content information comprises interaction information of multiple rounds of interaction with a first model; content compression is conducted on the to-be-compressed dialogue content information, compressed dialogue content information is obtained, and the total length of the compressed dialogue content information is smaller than that of the to-be-compressed dialogue content information; and updating the historical dialogue content information according to the reserved dialogue content information and the compressed dialogue content information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an information updating method, device, equipment and storage medium. Background Art

[0002] Currently, users can interact with the language model (LM) in one or more rounds. Each round of interaction can include two processes: the user inputs information and the model gives a reply. The language model is a model with natural language processing (NLP) capabilities. The language model can parse the information input by the user and give corresponding reply information based on the content of the user input.

[0003] In order to realize the function of multiple rounds of interaction, the historical conversation content can be stored. The historical conversation content includes the information input by the user and the reply information given by the model. In this way, after obtaining the new information input by the user, the historical conversation content and the new input information can be sent to the language model. The language model can give a reply based on the historical conversation content and the new input information.

[0004] However, the amount of conversation the model can handle at a time is limited. Summary of the invention

[0005] In order to solve the problems of the prior art, the present application provides an information updating method, apparatus, device and storage medium.

[0006] In a first aspect, the present application provides an information updating method, the method comprising:

[0007] In response to the historical conversation content information satisfying a compression condition, determining the retained conversation content information and the conversation content information to be compressed from the historical conversation content information, wherein the historical conversation content information includes interaction information of multiple rounds of interactions with the first model;

[0008] Compressing the conversation content information to be compressed to obtain compressed conversation content information, wherein the total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed;

[0009] The historical conversation content information is updated according to the retained conversation content information and the compressed conversation content information.

[0010] In some possible implementations, the compression condition includes a capacity compression condition, and the method further includes:

[0011] Obtaining the total length of the historical conversation content information;

[0012] In response to the total length of the historical conversation content information exceeding a first length threshold, it is determined that the historical conversation content meets the capacity compression condition.

[0013] In some possible implementations, the compression condition includes a time compression condition, and the method further includes:

[0014] Obtaining a retention time interval of the historical conversation content information, wherein the retention time interval is a time interval from the earliest occurrence time of the conversation content in the historical conversation content to the current time;

[0015] In response to the length of the retention time interval exceeding a first time threshold, it is determined that the historical conversation content meets the time compression condition.

[0016] In some possible implementations, determining the retained conversation content and the to-be-compressed conversation content information from the historical conversation content information includes:

[0017] Determining target conversation content from the historical conversation content information;

[0018] Determine the conversation content that occurs earlier than the target conversation content as the conversation content in the conversation content information to be compressed;

[0019] Determine the conversation content that occurs no earlier than the target conversation content as the conversation content in the retained conversation content information;

[0020] The time interval from the occurrence time of the target conversation content to the current time is less than a second time threshold, and / or the total length of the conversation content in the historical conversation content information that occurs earlier than the target conversation content is less than a second length threshold.

[0021] In some possible implementations, compressing the conversation content information to be compressed to obtain compressed conversation content information includes:

[0022] Sending the conversation content information to be compressed to the second model;

[0023] Obtain the compressed conversation content information fed back by the second model.

[0024] In some possible implementations, the total length of the compressed conversation content information is not greater than a third length threshold, and obtaining the compressed conversation content information fed back by the second model includes:

[0025] Obtaining first intermediate dialogue content information fed back by the second model;

[0026] In response to the total length of the first intermediate conversation content information being not greater than the third length threshold, determining the first intermediate conversation content information as the compressed conversation content information;

[0027] In response to the total length of the first intermediate conversation content information being greater than the third length threshold, the first intermediate conversation content information is sent to the second model, and second intermediate conversation content information fed back by the second model is obtained; and in response to the total length of the second intermediate conversation content information being not greater than the third length threshold, the second intermediate conversation content information is determined as the compressed conversation content information.

[0028] In some possible implementations, before determining the retained conversation content information and the to-be-compressed conversation content information, the method further includes:

[0029] In response to obtaining the target user input information, determining whether the historical conversation content meets the compression condition;

[0030] After updating the historical conversation content information, the method further includes:

[0031] Generate prompt information according to the target user input information and historical conversation content information;

[0032] The prompt information is sent to the first model, and target reply information returned by the first model is received.

[0033] In some possible implementations, the method further includes:

[0034] Determining a compression length according to the length of the user input information;

[0035] The total length of the compressed conversation content information is not greater than the compression length, and the total length of the prompt information is not greater than a model length threshold, and the model length threshold is a maximum length of a conversation that can be processed by the first model.

[0036] In some possible implementations, the method further includes:

[0037] The historical conversation content information is updated, wherein the updated historical conversation content information includes the compressed conversation content information, the retained conversation content information, the target user input information, and the target reply information.

[0038] In some possible implementations, the conversation content set to be compressed includes the conversation content of the first i rounds in the historical conversation content information, each round of the conversation content includes user input information and corresponding reply information, and i is a positive integer; or,

[0039] The conversation content set to be compressed includes the conversation content of the first j rounds in the historical conversation content information and the user input information in the conversation content of the j+1th round, where j is a positive integer; or

[0040] The conversation content set to be compressed includes the conversation content of the first k rounds in the historical conversation content information and the reply information in the conversation content of the k+1th round, where k is a positive integer.

[0041] In some possible implementations, the historical conversation content information further includes description information, where the description information is used to describe the conversation content in the historical conversation content information.

[0042] In a second aspect, the present application provides an information updating device, the device comprising:

[0043] a determining unit, configured to determine, in response to the historical conversation content information satisfying a compression condition, the retained conversation content information and the to-be-compressed conversation content information from the historical conversation content information, wherein the historical conversation content information includes interaction information of multiple rounds of interaction with the first model;

[0044] A compression unit, configured to compress the conversation content information to be compressed to obtain compressed conversation content information, wherein the total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed;

[0045] An updating unit is used to update the historical conversation content information according to the retained conversation content information and the compressed conversation content information.

[0046] In some possible implementations, the compression condition includes a capacity compression condition. The determination unit is specifically configured to obtain the total length of the historical conversation content information; and in response to the total length of the historical conversation content information exceeding a first length threshold, determine that the historical conversation content meets the capacity compression condition.

[0047] In some possible implementations, the compression condition includes a time compression condition. The determining unit is specifically configured to obtain a retention time interval of the historical conversation content information, where the retention time interval is a time interval from the earliest occurrence time of the conversation content in the historical conversation content to the current time; in response to the length of the retention time interval exceeding a first time threshold, determine that the historical conversation content meets the time compression condition.

[0048] In some possible implementations, the determination unit is specifically used to determine the target conversation content from the historical conversation content information; determine the conversation content that occurred earlier than the target conversation content as the conversation content in the conversation content information to be compressed; determine the conversation content that occurred no earlier than the target conversation content as the conversation content in the retained conversation content information; wherein the time interval from the occurrence time of the target conversation content to the current time is less than a second time threshold, and / or the total length of the conversation content in the historical conversation content information that occurred earlier than the target conversation content is less than a second length threshold.

[0049] In some possible implementations, the compression unit is specifically configured to send the conversation content information to be compressed to the second model; and obtain the compressed conversation content information fed back by the second model.

[0050] In some possible implementations, the total length of the compressed conversation content information is not greater than a third length threshold, and the compression unit is specifically used to obtain first intermediate conversation content information fed back by the second model; in response to the total length of the first intermediate conversation content information being not greater than the third length threshold, determining the first intermediate conversation content information as the compressed conversation content information; in response to the total length of the first intermediate conversation content information being greater than the third length threshold, sending the first intermediate conversation content information to the second model, obtaining second intermediate conversation content information fed back by the second model, and in response to the total length of the second intermediate conversation content information being not greater than the third length threshold, determining the second intermediate conversation content information as the compressed conversation content information.

[0051] In some possible implementations, the determining unit is specifically configured to determine whether the historical conversation content meets the compression condition in response to obtaining the target user input information. The device further includes a generating unit, a sending unit, and a receiving unit, wherein the generating unit is configured to generate prompt information according to the target user input information and the historical conversation content information; the sending unit is configured to send the prompt information to the first model; and the receiving unit is configured to receive the target reply information returned by the first model.

[0052] In some possible implementations, the compression unit is further used to determine the compression length based on the length of the user input information; the total length of the compressed conversation content information is not greater than the compression length, and the total length of the prompt information is not greater than a model length threshold, and the model length threshold is the maximum length of the conversation that the first model can handle.

[0053] In some possible implementations, the updating unit is further used to update the historical conversation content information, and the updated historical conversation content information includes the compressed conversation content information, the retained conversation content information, the target user input information, and the target reply information.

[0054] In some possible implementations, the set of conversation contents to be compressed includes the conversation contents of the first i rounds in the historical conversation content information, each round of the conversation content includes user input information and corresponding reply information, and i is a positive integer; or, the set of conversation contents to be compressed includes the conversation contents of the first j rounds in the historical conversation content information and the user input information in the conversation content of the j+1th round, and j is a positive integer; or, the set of conversation contents to be compressed includes the conversation contents of the first k rounds in the historical conversation content information and the reply information in the conversation content of the k+1th round, and k is a positive integer.

[0055] In some possible implementations, the historical conversation content information further includes description information, where the description information is used to describe the conversation content in the historical conversation content information.

[0056] In a third aspect, the present application provides an electronic device, including:

[0057] one or more processors;

[0058] a storage device having one or more programs stored thereon,

[0059] When the one or more programs are executed by the one or more processors, the one or more processors implement any method described in the first aspect.

[0060] In a fourth aspect, the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, any method described in the first aspect is implemented.

[0061] In a fifth aspect, the present application provides a computer program product, which, when executed on a device, enables the device to execute the method described in the first aspect.

[0062] The present application provides an information updating method, device, equipment and storage medium, which can compress the conversation content in the historical conversation content information. Specifically, when the historical conversation content information meets the compression condition, the retained conversation content information and the conversation content information to be compressed can be determined from the historical conversation content information. Among them, the historical conversation content information includes the interactive content of multiple rounds of interaction between the user and the first model. The retained conversation content information and the conversation content information to be compressed can respectively include the interactive content of at least one round of interaction between the user and the first model. Then, the conversation content information to be compressed can be compressed to obtain the compressed compressed conversation content information. The total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed. Then, the historical conversation content information can be updated according to the retained conversation content information and the compressed conversation content. In this way, compressing the conversation content information to be compressed can reduce the total length of the historical conversation content information. Therefore, the total length of the prompt information carrying the historical conversation content information is also compressed, which can prevent the length of the conversation content in the prompt information from exceeding the upper limit of the length of the conversation content that can be processed by the first model. Furthermore, the historical conversation content information is split into retained conversation content information and conversation content to be compressed, and the retained conversation content is not compressed, so that conversation content with greater reference value can be retained, which facilitates semantic analysis by the first model. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0064] Figure 1 A flowchart of an information updating method provided in an embodiment of the present application;

[0065] Figure 2 A schematic diagram of an information updating device provided in an embodiment of the present application;

[0066] Figure 3 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.

[0068] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0069] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0070] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different objects, devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0071] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0072] In order to provide users with the ability to have multiple rounds of dialogue, the historical dialogue content between the user and the model can be stored. After obtaining the new information input by the user, the new information and the historical dialogue content can be sent to the model. In this way, the model can refer to the historical dialogue content to process the new information input, so as to give a better answer. In the above process, the information sent by the user to the model can be called question information or user input information, and the information fed back by the model can be called answer information.

[0073] In some scenarios, a storage (memory) space may be divided in a server (or server cluster) for storing historical conversation content. After obtaining the user input information, the user input information may be stored in the memory. After obtaining the reply information given by the model to the user input information, the reply information may be stored in the memory. In an embodiment of the present application, the user input information and the reply given by the model may be referred to as a round of interaction or a round of conversation dialogue. The interactive content of a round of interaction includes the information input by the user and the reply information given by the model in this round of interaction, and the interactive content may also be referred to as conversation content. Optionally, if the user has multiple rounds of interaction with the model, the interactive content of the multiple rounds of interaction may be included in the memory. Accordingly, the information composed of the interactive content of the above multiple rounds of interaction may be referred to as historical conversation content information.

[0074] In actual scenarios, the amount of information that a model can process is limited. Therefore, if a user interacts with the model for multiple rounds, the total length of the conversation content in the memory may exceed the upper limit of the length that the model can process. In this way, the model may not be able to process the information input by the user.

[0075] To this end, in some implementations, the conversation content stored in the memory may be compressed. The total length of the conversation content stored in the memory is compressed to below the upper limit of the length that the model can handle, so that the model can use the information in the memory and the information input by the user as much as possible for processing.

[0076] For example, in some possible implementations, an upper limit on the length of the historical conversation content information may be set. After the total length of the conversation content in the historical conversation content information reaches the upper limit, the historical conversation content information may be compressed.

[0077] However, information will be lost in the process of compressing the conversation content. Therefore, compressing the conversation content in the historical conversation content information may lose key information in the historical conversation content. The loss of key information will affect the model's response to the user's input information.

[0078] In order to solve the problems of the prior art, an embodiment of the present application provides an information updating method, which is described in detail below in conjunction with the drawings in the specification.

[0079] See also Figure 1 , Figure 1An information interaction diagram of an information updating method provided in an embodiment of the present application, the embodiment of the present application can be applied to application scenarios in which a user and a model perform multiple rounds of interaction. Among them, the information updating method can be executed by an information updating device. The information updating device can be implemented by software. Optionally, the above-mentioned model can be a model with NLP function. In the embodiment of the present application, the model can be referred to as a first model.

[0080] Optionally, the information updating device may be integrated with a storage module or be associated with a storage module. The storage module is used to store historical conversation content information.

[0081] Optionally, the information updating device can be integrated into the user's client. The client can be an application client or a web client of the IM software. If the client is a software client of the IM software, the client can be integrated into a personal computer (PC) or a mobile terminal. If the information updating device is integrated into the client, the information updating device can communicate with the target model of the server so as to send the conversation content information to be compressed to the server. Alternatively, the information updating device can also be integrated into the server. The server can be the server of the IM software, which is used to provide corresponding services for the client of the IM software. Optionally, the information updating device can be integrated with a module for managing historical conversation content information on the server. For ease of introduction, the following description is made by taking the information updating device integrated into the server as an example.

[0082] like Figure 1 As shown, the method specifically comprises the following steps:

[0083] S101: In response to historical conversation content information satisfying a compression condition, determining retained conversation content information and conversation content information to be compressed from historical conversation content.

[0084] In an embodiment of the present application, in order to prevent the length of the conversation content in the prompt information from exceeding the upper limit of the length of the first model, the historical conversation content information can be compressed. Before compressing the historical conversation content information, it can be first determined whether the historical conversation content information meets the compression condition. If the historical conversation content information meets the compression condition, the historical conversation content information can be compressed. If the historical conversation content information does not meet the compression condition, the historical conversation content information may not be compressed.

[0085] In an embodiment of the present application, the judgment based on the compression condition can be triggered by information input by the user. The information input by the user is the content of the conversation between the user and the first model. That is, when the user wants to have a conversation with the first model, the user can enter question information on the client and send the question information to the server through the client. After obtaining the question information, the server can determine whether the historical conversation content information meets the compression condition. That is to say, the information update method provided in the embodiment of the present application can be triggered based on user input information.

[0086] Alternatively, the judgment of the compression condition may also be triggered based on other methods. For example, after the model gives the reply information, the historical conversation content information may be updated according to the user input information and the reply information, and then it is judged whether the historical conversation content information meets the compression condition. For another example, a polling mechanism may be set in the server. The polling mechanism is used to periodically judge whether the historical conversation content information meets the compression condition.

[0087] In some possible implementations, the compression condition may include a capacity compression condition and / or a time compression condition, which are described below respectively.

[0088] First, the capacity compression conditions are introduced.

[0089] As described above, the length of the conversation content that a model with NLP capabilities can process at one time is limited. Therefore, if the length of the conversation content input to the first model exceeds the upper limit of the length of the conversation content that the first model can process, the first model may not be able to process the conversation content. Therefore, when compressing the historical conversation content information, it can be determined whether the total length of the historical conversation content information exceeds the preset length threshold.

[0090] Specifically, the total length of the historical conversation content information can be counted first. The total length of the historical conversation content information can be the sum of the lengths of all the contents in the historical conversation content information. All the contents in the historical conversation content information include the information sent by the user to the first model and the reply information given by the first model during the historical process. Optionally, the historical conversation content information can also include description information. The description information is used to describe the conversation content in the historical conversation content information. For example, the description information can be used to describe the order of the conversations in the historical conversation content information, the time when the conversations occurred, and other information. Optionally, when counting the total length of the historical conversation content information, the length of the description information can be calculated, or the length of the description information can be not calculated.

[0091] After determining the total length of the historical conversation content information, the total length of the historical conversation content information can be compared with the first length threshold. If the total length of the historical conversation content information is greater than the first length threshold, it means that the historical conversation content is too much, and the first model may not be able to process the historical conversation content information. In this way, it can be determined that the historical conversation content information meets the capacity compression condition, so that part of the conversation content in the historical conversation content information is compressed so that the first model can process it.

[0092] The first length threshold is a pre-set length threshold. Optionally, the first length threshold can be determined according to relevant parameters of the first model. For example, the upper limit of the conversation length that the first model can handle can be obtained in advance, and the length less than the upper limit is determined as the first length threshold. Alternatively, in some other possible implementations, the first length threshold can also be adjusted according to actual conditions. For example, the first length threshold can be determined according to the length of the user input information.

[0093] In actual scenarios, the upper limit of the conversation content that the model can process can be represented by the number of words. In other words, the number of words that the first model can process is limited. Accordingly, the first length threshold can be the number of words. If the total number of words in the historical conversation content information reaches the first length threshold, it means that the historical conversation content information meets the capacity compression condition.

[0094] In an embodiment of the present application, the first model is a model with NLP function. The information input to the first model is natural language. Accordingly, the standard for measuring the amount of information that the first model can process can be a standard related to natural language such as "words". However, for the information updating device, it does not have the ability to process natural language information. Accordingly, the information updating device may count the total length of the historical conversation content information based on the number of identifiers (tokens). In this way, when judging whether the historical conversation content information meets the capacity compression condition, the conversion between identifiers and words can be performed. Specifically, the number of identifiers of the historical conversation content information can be counted first. Then, the number of identifiers of the historical conversation content information can be multiplied by the preset weight, and the product obtained can be regarded as the number of words in the historical conversation content information. Among them, the preset weight is a pre-set correction parameter used to correct the difference between the number of identifiers and the number of words.

[0095] The capacity compression conditions are introduced above. The time compression conditions are introduced below.

[0096] In the embodiment of the present application, the user can have multiple rounds of interaction with the first model, and the historical conversation content information can store historical conversations with the first model. However, the reference value provided by the historical conversation content may gradually decrease over time. In other words, the longer the conversation time is from the current time, the lower the reference value it can provide.

[0097] For example, if the user has multiple rounds of interactions with the first model on topic A, then as the conversation progresses, the user's conversation with the first model may become more in-depth. In this way, the reference value of the user's earliest conversation with the first model will be reduced accordingly. For another example, if the user first has multiple rounds of interactions with the first model on topic B, and then has one or more rounds of interactions with the first model on topic C. Then when processing user input information, the reference value of the conversation content related to topic A may be lower.

[0098] It can be seen that as time goes by, the value of the historical conversation content between the user and the first model may decrease. Accordingly, in the embodiment of the present application, the conversation content can be compressed according to the time when the conversation content was conducted.

[0099] When judging whether the historical conversation content information meets the compression condition, the judgment can be made according to the time compression condition. If the historical conversation content information meets the time compression condition, it means that there are conversation contents in the historical conversation content information that occurred long before the current time. In this way, the conversation contents that occurred long before the current time can be compressed to reduce the data sent to the first model.

[0100] Specifically, during the process of the user's conversation with the first model, the time of each conversation can be recorded. When determining whether the historical conversation content information meets the time compression condition, the retention time interval of the historical conversation content information can be first obtained. The retention time interval of the historical conversation content information is the time interval from the earliest occurrence time of the conversation content in the historical conversation content to the current time. In other words, the retention time interval is the longest time that the conversation content in the historical conversation content information is retained.

[0101] Next, the retention time interval can be compared with the first time threshold. If the retention time interval is longer than the first time threshold, it means that there are conversation contents in the historical conversation content information that occurred long before the current time. These conversation contents may not provide sufficient reference value in the process of processing user input information. Therefore, it can be determined that the target model meets the time compression condition, so that the historical conversation content information is compressed.

[0102] The capacity compression condition and the time compression condition are introduced above. In some possible implementations, the judgment can be made according to one of the capacity compression condition and the time compression condition. In some other possible implementations, the judgment can also be made in combination with the capacity compression condition and the time compression condition. Specifically, if the historical conversation content information meets any one of the capacity compression condition and the time compression condition, the historical conversation content information can be compressed.

[0103] After determining that the historical conversation content information meets the compression condition, the retained conversation content information and the conversation content information to be compressed can be determined from the historical conversation content information. The retained conversation content information includes at least one round of conversation content between the user and the first model. The conversation content information to be compressed includes at least one round of conversation content between the user and the first model. In addition, the conversation content included in the retained conversation content information is different from the conversation content included in the conversation content information to be compressed. Optionally, the historical conversation content information can be divided into the retained conversation content information and the conversation content information to be compressed.

[0104] In an embodiment of the present application, the conversation content can be divided into sessions. Each session represents an input from a user or a model. That is, the information input by the user can be referred to as a session of conversation content, and the reply information given by the model can also be referred to as a session of conversation content. In addition, a relatively complete conversation between a user and a model can also be referred to as a round of conversation or a round of interaction. The above-mentioned "relatively complete" means that a round of conversation includes a session of conversation content input by the user and a session of conversation content given by the model. That is to say, in the process of interaction between the user and the model, the user can have multiple rounds of conversations with the model, and each round of conversation content includes two sections of conversation content, namely the information input by the user and the reply information given by the model.

[0105] In some possible implementations, the retained conversation content information and the to-be-compressed conversation content information may be determined in units of words. That is, the historical conversation content information may be split into multiple words, and then a portion of the words may be determined as the retained conversation content information, and another portion of the words may be determined as the to-be-compressed conversation content information.

[0106] Alternatively, in some other possible implementations, the retained conversation content information and the conversation content information to be compressed may be determined in units of one conversation section. If the division is performed in units of one conversation section, the retained conversation content information may include one or more complete rounds of interaction content and one incomplete round of interaction content. The above-mentioned one incomplete round of conversation content may be information input by the user or reply information given by the model. In this way, compared with the division in units of words, the division in units of one conversation section can retain more valuable information.

[0107] Alternatively, the division may be performed in rounds. That is, when determining the retained conversation content information and the conversation content information to be compressed, a round of conversation may be regarded as a whole for division. Then the retained conversation content information may include a complete round or round of conversation content, and the conversation content information to be compressed may include a complete round or multiple rounds of conversation content. In this way, the content of a round of conversation will not be segmented, resulting in part of the conversation content being compressed while the other part of the conversation content is not compressed. In this way, the compression effect can be further improved. That is, the conversation content set to be compressed may include the conversation content of the first i rounds in the historical conversation content information, and each round of conversation content includes user input information and corresponding reply information. Alternatively, the conversation content set to be compressed may include the conversation content of the first j rounds in the historical conversation content information and the user input information in the conversation content of the j+1th round. Alternatively, the conversation content set to be compressed may include the conversation content of the first k rounds in the historical conversation content information and the reply information in the conversation content of the k+1th round. Wherein, the above i, j and k are all positive integers.

[0108] As the name implies, the conversation content included in the retained conversation content information can be retained, and the conversation content in the to-be-compressed conversation content information can be compressed. That is, after determining that the historical conversation content information needs to be compressed, the conversation content information that needs to be compressed and the conversation content information that does not need to be compressed can be divided from the historical conversation content information.

[0109] As described above, the reference value provided by historical conversation content may gradually decrease over time. Therefore, when compressing historical conversation content information, the conversation content with an earlier occurrence time can be compressed first. In other words, the occurrence time of the conversation content in the retained conversation content information can be later than the occurrence time of the conversation content in the conversation content information to be compressed. In this way, the conversation content that occurred recently is retained, and the conversation content that occurred farther away is compressed, which can not only compress the historical conversation content information, but also retain the valuable conversation content in the historical conversation content information.

[0110] Specifically, a time threshold for dividing the retained conversation content information and the conversation content information to be compressed can be preset. For ease of introduction, the time threshold can be referred to as a second time threshold. Optionally, the second time threshold and the first time threshold can be the same time threshold or different time thresholds.

[0111] The second time threshold is used to divide the retained conversation content information and the conversation content information to be compressed. The time interval from the occurrence time of the conversation content in the retained conversation content information to the current time is less than the second time threshold. The time interval from the occurrence time of the conversation content in the conversation content information to be compressed to the current time is not less than the second time threshold.

[0112] Optionally, the target conversation content can be determined from the historical conversation content information. The time interval between the occurrence time of the target conversation content and the current time is less than the second time threshold. Moreover, the time interval between the occurrence time of the conversation content before the target conversation content and the current time is not less than the second time threshold. After determining the target conversation content, the conversation content in the historical conversation content information that occurs earlier than the target conversation content can be determined as the conversation content in the conversation content information to be compressed. The conversation content in the historical conversation content information that occurs not earlier than the target conversation content is determined as the conversation content in the retained conversation content information.

[0113] In some possible implementations, the conversation content information and the conversation content information to be compressed may also be retained according to the length of the conversation content.

[0114] Specifically, a second length threshold may be obtained. Then, the retained conversation content information and the conversation content information to be compressed are determined according to the second length threshold. The second length threshold is less than the first length threshold. The total length of the conversation content in the retained conversation content information is less than the second length threshold. Accordingly, the information updating device may select the conversation content with the earliest occurrence time and a total length less than the second length threshold from the historical conversation content information, and determine these conversation contents as the conversation contents in the retained conversation content information.

[0115] Optionally, the information updating device may first determine the target conversation content according to the second length threshold, and then determine the conversation content in the historical conversation content information that occurs no earlier than the target conversation content as the conversation content in the retained conversation content information.

[0116] Accordingly, when determining the target conversation content according to the second length threshold, the information updating device can traverse in order from the last to the first occurrence time. Specifically, the information updating device can determine whether the total length of the conversation content whose occurrence time is not earlier than the Nth conversation content is less than the second length threshold (N is a positive integer greater than 1). If it is less than, determine whether the total length of the conversation content whose occurrence time is not earlier than the N+1th conversation content is less than the second length threshold. If it is greater, determine the N-1th conversation content as the target conversation content. Among them, the occurrence time of the N+1th conversation content is earlier than the occurrence time of the Nth conversation content, and the occurrence time of the N-1th conversation content is later than the occurrence time of the Nth conversation content.

[0117] Similar to the aforementioned compression condition, in some possible implementations, the retained conversation content information and the conversation content information to be compressed may also be determined by comprehensively considering the length and time. That is, the time interval from the occurrence time of the conversation content in the retained conversation content information to the present time may be less than the second time threshold, and the total length of the conversation content in the retained conversation content information may be less than the second length threshold. Accordingly, the time interval from the occurrence time of the target conversation content to the present time is less than the second time threshold, and the total length of the conversation content in the historical conversation content information that occurs earlier than the target conversation content is less than the second length threshold.

[0118] In some possible implementations, the second length threshold may be adjusted according to actual conditions. For an introduction to this part, please refer to the following, which will not be repeated here.

[0119] S102: Compress the conversation content information to be compressed to obtain compressed conversation content information.

[0120] After the conversation content information to be compressed is determined, the conversation content information to be compressed can be compressed to obtain compressed conversation content information. The compressed conversation content information is the compressed conversation content information to be compressed.

[0121] In the embodiment of the present application, the total length of the historical conversation content information can be reduced by compressing the conversation content information to be compressed. In particular, the compression performed on the conversation content information to be compressed is content compression, not file compression in the traditional sense. For example, the content compression performed on the conversation content information to be compressed can be understood as extracting the content from the conversation content information to be compressed, rather than compressing the conversation content information to be compressed from the original format into the format of a compressed file. Optionally, the compressed conversation content information can be regarded as summary information of the conversation content information to be compressed.

[0122] In some possible implementations, the conversation content information to be compressed may be compressed by a model. In the embodiment of the present application, the model used to compress the conversation content information to be compressed may be referred to as a second model.

[0123] Optionally, the second model may be a model with NLP capabilities. When compressing the conversation content information to be compressed, the conversation content information to be compressed may be sent to the second model. The second model may summarize the conversation content information to be compressed to obtain the compressed conversation content information. When sending the conversation content information to be compressed to the second model, the information updating device may generate prompt information and send the conversation content information to be compressed to the second model via the prompt information.

[0124] Optionally, the second model may be the same model as the first model, or may be a different model.

[0125] In the embodiment of the present application, compressing the conversation content information to be compressed is to reduce the amount of data sent to the first model. In order to ensure the effect of data compression, in some possible implementations, an upper limit of the total length of the compressed conversation content information can be preset. In the embodiment of the present application, the upper limit can be referred to as a third length threshold or a compressed length. In other words, the total length of the compressed conversation content information is not greater than the third length threshold.

[0126] Accordingly, when compressing the conversation content information to be compressed, the third length threshold may be sent to the second model. For example, the information updating device may generate instruction information for instructing to compress the conversation content information to be compressed into text whose total length is not greater than the third length threshold.

[0127] Optionally, the conversation content information to be compressed may be compressed multiple times. For example, the information updating device may send the conversation content information to be compressed to the second model. The second model may obtain the first intermediate conversation content information by compressing the conversation content information to be compressed for the first time. After obtaining the first intermediate conversation content information fed back by the second model, it may be determined whether the total length of the first intermediate conversation content information is greater than a third length threshold.

[0128] If the total length of the first intermediate conversation content information is not greater than the third length threshold, the first intermediate conversation content information may be determined as compressed conversation content information.

[0129] If the total length of the first intermediate conversation content information is greater than the third length threshold, compression can continue. Accordingly, the information updating device can send the first intermediate conversation content information to the second model. The second model can compress the first intermediate conversation content information and feed back the second intermediate conversation content information to the information updating device.

[0130] Next, it can be determined whether the total length of the second intermediate conversation content information is greater than a third length threshold. If the total length of the second intermediate conversation content information is less than the third length threshold, the second intermediate conversation content information can be determined as a compressed conversation content information. If the total length of the second intermediate conversation content information is not less than the third length threshold, the second intermediate conversation content information can be sent to the second model for the next compression. In this way, through multiple compressions, it can be ensured that the total length of the compressed conversation content information is less than the third length threshold.

[0131] Since the conversation length that the first model can process has an upper limit, in actual scenarios, the storage space corresponding to the historical conversation content information can be determined according to the upper limit of the conversation length that the first model can process. Accordingly, after obtaining the compressed conversation content information, the historical conversation content information can be updated according to the compressed conversation content information and the retained conversation content information.

[0132] Specifically, the updated historical conversation content information may include the retained conversation content information and the compressed conversation content information. In this way, when updating the historical conversation content information after compressing the conversation content information to be compressed, it can be ensured that the total length of the historical conversation content information does not exceed the upper limit of the conversation length that can be processed by the first model, thereby preventing the total length of the historical conversation content information from exceeding the size of the storage space corresponding to the historical conversation content information.

[0133] Alternatively, in some other possible implementations, the historical conversation content information may be updated after the model gives a reply. The specific introduction can be found below and will not be repeated here.

[0134] S103: updating the historical conversation content information set according to the retained conversation content information and the compressed conversation content information.

[0135] After the compressed conversation content information is obtained, the historical conversation content information can be updated according to the retained conversation content information and the compressed conversation content information. The updated historical conversation content information includes the retained conversation content information and the compressed conversation content information. For example, if the historical conversation content information is stored on the server side, the conversation content information to be compressed originally stored on the server side can be replaced with the compressed conversation content information.

[0136] The present application provides an information updating method, which can compress the conversation content in the historical conversation content information. Specifically, when the historical conversation content information meets the compression condition, the retained conversation content information and the conversation content information to be compressed can be determined from the historical conversation content information. Among them, the historical conversation content information includes the interactive content of multiple rounds of interaction between the user and the first model. The retained conversation content information and the conversation content information to be compressed can respectively include the interactive content of at least one round of interaction between the user and the first model. Then, the conversation content information to be compressed can be compressed to obtain the compressed compressed conversation content information. The total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed. Then, the historical conversation content information can be updated according to the retained conversation content information and the compressed conversation content. In this way, compressing the conversation content information to be compressed can reduce the total length of the historical conversation content information. Therefore, the total length of the prompt information carrying the historical conversation content information is also compressed, which can prevent the length of the conversation content in the prompt information from exceeding the upper limit of the length of the conversation content that can be processed by the first model. Furthermore, the historical conversation content information is split into retained conversation content information and conversation content to be compressed, and the retained conversation content is not compressed, so that conversation content with greater reference value can be retained, which facilitates semantic analysis by the first model.

[0137] In some possible implementations, the updated historical conversation content information can be used to generate prompt information. In an embodiment of the present application, the prompt information includes the updated historical conversation content information and user input information. The user input information is input by the user and is used to inquire about the information of the first model. Since the set of conversation information to be compressed is compressed, the data carried by the prompt information will not exceed the upper limit of the data amount that the first model can process and can be processed by the first model. Optionally, the prompt information can be prompt information.

[0139] In the embodiment of the present application, the purpose of compressing the conversation content is to prevent the amount of data input into the first model from exceeding the upper limit of the amount of data that the first model can process. To this end, the total length of the conversation content carried by the prompt information can be limited. Specifically, assuming that the maximum length of the conversation that the first model can process is the model length threshold of the first model. Then the total length of the conversation content carried by the prompt information may not be greater than the model length threshold.

[0140] Optionally, if the prompt information includes the retained conversation content information and the compressed conversation content information, the sum of the total length of the retained conversation content information and the total length of the compressed conversation content information may be controlled to be no greater than the model length threshold. In some possible implementations, the upper limit of the total length of the retained conversation content information and the upper limit of the total length of the compressed conversation content information may be preset.

[0141] In some possible implementations, the user may input a lot of information, and the length of the information input by the user is long. Thus, even if the dialog information to be compressed is compressed, the amount of data carried by the prompt information may exceed the upper limit of the amount of data that can be processed by the first model due to the long length of the information input by the user.

[0142] To solve the above problem, if the prompt information also includes user input information, the sum of the total length of the user input information, the retained conversation content information and the total length of the compressed conversation content information can be controlled not to be greater than the model length threshold.

[0143] In actual scenarios, the total length of the retained conversation content information may be preset (e.g., the aforementioned second length threshold). Accordingly, before compressing the conversation content information to be compressed, the upper limit of the total length of the compressed conversation content information may be calculated based on the length of the user input information. In other words, the aforementioned third length threshold (or compressed length) may be determined based on the length of the user input information.

[0144] Specifically, the model length threshold can be subtracted from the user input information. The result of the subtraction is the total length of the retained conversation content information and the total length of the compressed conversation content information. If the upper limit of the total length of the retained conversation content is preset, the result of the subtraction can be subtracted from the upper limit of the total length of the retained conversation content. The result of the second subtraction is the compressed length. In this way, since the total length of the compressed conversation information is less than the compressed length, and the total length of the retained conversation information is less than the upper limit of the total length of the retained conversation content, the sum of the total length of the compressed conversation content, the total length of the retained conversation content and the length of the user input information is less than the model length threshold.

[0145] In this way, even if the user input information is long, the compression strength of the dialogue information to be compressed can be adaptively adjusted, thereby adaptively adjusting the length of the compressed dialogue information to ensure that the amount of data carried by the prompt information does not exceed the upper limit of the amount of data that the target model can process.

[0146] After obtaining the prompt information, the information updating device may send the prompt information to the first model. After obtaining the prompt information, the first model may process the prompt information to obtain reply information corresponding to the user input information. Then, the first model may send reply information to the information updating device. According to the reply information, the information updating device may perform subsequent operations. For example, if the user input information is a natural language description of the user's intention, the reply information may be used to instruct the information updating device (or other devices on the server side) to perform corresponding data processing operations according to the user's intention. Accordingly, after obtaining the reply information, the corresponding data processing operations may be performed according to the reply information.

[0147] After obtaining the reply information fed back by the first model, it can be considered that the interaction between the current round of users and the first model is temporarily completed. In this way, the interaction content between the current round of users and the first model can be added to the historical conversation content information. The interaction content between the current round of users and the first model includes user input information and reply information.

[0148] Optionally, the historical conversation content information can be updated according to the retained conversation content information, compressed conversation content information, user input information and reply information. The updated historical conversation content information includes the retained conversation content information, compressed conversation content information, user input information and reply information.

[0149] Based on an information updating method provided by the above method embodiment, the embodiment of the present application further provides an information updating device, which will be described below in conjunction with the accompanying drawings.

[0150] See also Figure 2 As shown in FIG. 1 , this figure is a schematic diagram of the structure of an information updating device provided in an embodiment of the present application. Figure 2As shown, the information updating device 200 includes:

[0151] A determination unit 210, configured to determine, in response to the historical conversation content information satisfying a compression condition, the retained conversation content information and the to-be-compressed conversation content information from the historical conversation content information, wherein the historical conversation content information includes interaction information of multiple rounds of interaction with the first model;

[0152] A compression unit 220, configured to compress the conversation content information to be compressed to obtain compressed conversation content information, wherein the total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed;

[0153] The updating unit 230 is configured to update the historical conversation content information according to the retained conversation content information and the compressed conversation content information.

[0154] In some possible implementations, the compression condition includes a capacity compression condition. The determination unit 210 is specifically configured to obtain the total length of the historical conversation content information; in response to the total length of the historical conversation content information exceeding a first length threshold, determine that the historical conversation content meets the capacity compression condition.

[0155] In some possible implementations, the compression condition includes a time compression condition. The determining unit 210 is specifically configured to obtain a retention time interval of the historical conversation content information, where the retention time interval is a time interval from the earliest occurrence time of the conversation content in the historical conversation content to the current time; in response to the length of the retention time interval exceeding a first time threshold, determine that the historical conversation content meets the time compression condition.

[0156] In some possible implementations, the determination unit 210 is specifically used to determine the target conversation content from the historical conversation content information; determine the conversation content that occurred earlier than the target conversation content as the conversation content in the conversation content information to be compressed; determine the conversation content that occurred no earlier than the target conversation content as the conversation content in the retained conversation content information; wherein the time interval from the occurrence time of the target conversation content to the current time is less than a second time threshold, and / or the total length of the conversation content in the historical conversation content information that occurred earlier than the target conversation content is less than a second length threshold.

[0157] In some possible implementations, the compression unit 220 is specifically configured to send the conversation content information to be compressed to the second model; and obtain the compressed conversation content information fed back by the second model.

[0158] In some possible implementations, the total length of the compressed conversation content information is not greater than a third length threshold, and the compression unit 220 is specifically configured to obtain first intermediate conversation content information fed back by the second model; in response to the total length of the first intermediate conversation content information being not greater than the third length threshold, determine the first intermediate conversation content information as the compressed conversation content information; in response to the total length of the first intermediate conversation content information being greater than the third length threshold, send the first intermediate conversation content information to the second model, obtain second intermediate conversation content information fed back by the second model, and in response to the total length of the second intermediate conversation content information being not greater than the third length threshold, determine the second intermediate conversation content information as the compressed conversation content information.

[0159] In some possible implementations, the determining unit 210 is specifically configured to determine whether the historical conversation content meets the compression condition in response to obtaining the target user input information. The device further includes a generating unit, a sending unit, and a receiving unit, wherein the generating unit is configured to generate prompt information according to the target user input information and the historical conversation content information; the sending unit is configured to send the prompt information to the first model; and the receiving unit is configured to receive the target reply information returned by the first model.

[0160] In some possible implementations, the compression unit 220 is further used to determine the compression length based on the length of the user input information; the total length of the compressed conversation content information is not greater than the compression length, and the total length of the prompt information is not greater than a model length threshold, and the model length threshold is the maximum length of the conversation that the first model can handle.

[0161] In some possible implementations, the updating unit 230 is further used to update the historical conversation content information, and the updated historical conversation content information includes the compressed conversation content information, the retained conversation content information, the target user input information and the target reply information.

[0162] In some possible implementations, the set of conversation contents to be compressed includes the conversation contents of the first i rounds in the historical conversation content information, each round of the conversation content includes user input information and corresponding reply information, and i is a positive integer; or, the set of conversation contents to be compressed includes the conversation contents of the first j rounds in the historical conversation content information and the user input information in the conversation content of the j+1th round, and j is a positive integer; or, the set of conversation contents to be compressed includes the conversation contents of the first k rounds in the historical conversation content information and the reply information in the conversation content of the k+1th round, and k is a positive integer.

[0163] In some possible implementations, the historical conversation content information further includes description information, where the description information is used to describe the conversation content in the historical conversation content information.

[0164] Based on an information updating method provided in the above method embodiment, the present application also provides an electronic device, comprising: one or more processors; a storage device, on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the information updating method as described in any of the above embodiments.

[0165] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device 300 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs (televisions), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0166] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0167] Typically, the following devices may be connected to the I / O interface 305: input devices 308 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0168] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0169] The electronic device provided in the embodiment of the present application and the information updating method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0170] Based on an information updating method provided by the above method embodiment, an embodiment of the present application provides a computer storage medium on which a computer program is stored, wherein when the program is executed by a processor, the information updating method as described in any of the above embodiments is implemented.

[0171] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0172] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

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

[0174] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the information updating method.

[0175] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

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

[0177] The units involved in the embodiments described in this application may be implemented by software or hardware. The name of a unit / module does not limit the unit itself in some cases. For example, a voice data acquisition module may also be described as a "data acquisition module".

[0178] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0179] In the context of the present application, 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.

[0180] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0181] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0182] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0183] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An information updating method, characterized in that: The method comprises: In response to the historical conversation content information satisfying a compression condition, determining the retained conversation content information and the conversation content information to be compressed from the historical conversation content information, wherein the historical conversation content information includes interaction information of multiple rounds of interactions with the first model; Compressing the conversation content information to be compressed to obtain compressed conversation content information, wherein the total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed; The historical conversation content information is updated according to the retained conversation content information and the compressed conversation content information.

2. The method according to claim 1, characterized in that The compression condition includes a capacity compression condition, and the method further includes: Obtaining the total length of the historical conversation content information; In response to the total length of the historical conversation content information exceeding a first length threshold, it is determined that the historical conversation content meets the capacity compression condition.

3. The method according to claim 1, characterized in that The compression condition includes a time compression condition, and the method further includes: Obtaining a retention time interval of the historical conversation content information, wherein the retention time interval is a time interval from the earliest occurrence time of the conversation content in the historical conversation content to the current time; In response to the length of the retention time interval exceeding a first time threshold, it is determined that the historical conversation content meets the time compression condition.

4. The method according to claim 1, characterized in that The step of determining the retained conversation content and the conversation content information to be compressed from the historical conversation content information includes: Determining target conversation content from the historical conversation content information; Determine the conversation content that occurs earlier than the target conversation content as the conversation content in the conversation content information to be compressed; Determine the conversation content that occurs no earlier than the target conversation content as the conversation content in the retained conversation content information; The time interval from the occurrence time of the target conversation content to the current time is less than a second time threshold, and / or the total length of the conversation content in the historical conversation content information that occurs earlier than the target conversation content is less than a second length threshold.

5. The method according to claim 1, characterized in that The compressing the conversation content information to be compressed to obtain the compressed conversation content information comprises: Sending the conversation content information to be compressed to the second model; Obtain the compressed conversation content information fed back by the second model.

6. The method according to claim 5, characterized in that The total length of the compressed conversation content information is no greater than a third length threshold, and the obtaining of the compressed conversation content information fed back by the second model includes: Obtaining first intermediate dialogue content information fed back by the second model; In response to the total length of the first intermediate conversation content information being not greater than the third length threshold, determining the first intermediate conversation content information as the compressed conversation content information; In response to the total length of the first intermediate conversation content information being greater than the third length threshold, the first intermediate conversation content information is sent to the second model, and second intermediate conversation content information fed back by the second model is obtained; and in response to the total length of the second intermediate conversation content information being not greater than the third length threshold, the second intermediate conversation content information is determined as the compressed conversation content information.

7. The method according to any one of claims 1 to 6, characterized in that: Before determining the retained conversation content information and the to-be-compressed conversation content information, the method further includes: In response to obtaining the target user input information, determining whether the historical conversation content meets the compression condition; After updating the historical conversation content information, the method further includes: Generate prompt information according to the target user input information and historical conversation content information; The prompt information is sent to the first model, and target reply information returned by the first model is received.

8. The method according to claim 7, characterized in that The method further comprises: Determining a compression length according to the length of the user input information; The total length of the compressed conversation content information is not greater than the compression length, and the total length of the prompt information is not greater than the model length threshold, where the model length threshold is the maximum length of the conversation that the first model can process.

9. The method according to claim 7, characterized in that: The method further comprises: The historical conversation content information is updated, wherein the updated historical conversation content information includes the compressed conversation content information, the retained conversation content information, the target user input information, and the target reply information.

10. The method according to claim 7, characterized in that The conversation content set to be compressed includes the conversation content of the first i rounds in the historical conversation content information, and each round of the conversation content includes user input information and corresponding reply information, and i is a positive integer; or, The conversation content set to be compressed includes the conversation content of the first j rounds in the historical conversation content information and the user input information in the conversation content of the j+1th round, where j is a positive integer; or, The conversation content set to be compressed includes the conversation content of the first k rounds in the historical conversation content information and the reply information in the conversation content of the k+1th round, where k is a positive integer.

11. The method according to claim 1, characterized in that: The historical conversation content information also includes description information, and the description information is used to describe the conversation content in the historical conversation content information.

12. An information updating device, characterized in that: The device comprises: a determining unit, configured to determine, in response to the historical conversation content information satisfying a compression condition, the retained conversation content information and the to-be-compressed conversation content information from the historical conversation content information, wherein the historical conversation content information includes interaction information of multiple rounds of interaction with the first model; A compression unit, configured to compress the conversation content information to be compressed to obtain compressed conversation content information, wherein the total length of the compressed conversation content information is less than the total length of the conversation content information to be compressed; An updating unit is used to update the historical conversation content information according to the retained conversation content information and the compressed conversation content information.

13. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 11.

14. A computer readable medium, characterized in that A computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Cited By

  • Large model session compression method and device, equipment, storage medium and product

    CN121389975A