A question-answering method, device, equipment and storage medium for a large intelligent question-answering model

By building and dividing the memory area of ​​data container blocks on the target device, the load pressure and memory fragmentation problems caused by memory allocation and recycling in private large models are solved, and memory usage and model processing efficiency are improved.

CN119473633BActive Publication Date: 2025-04-08HANGZHOU NEWGRAND TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510046158.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-08
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

In the data interaction of private big models, the memory allocation and recycling of text data leads to excessive load pressure and generates a large amount of memory fragmentation, reducing memory usage.

Method used

By building data container blocks on the target device and dividing them into memory areas, setting up shared data areas, temporary data areas, data response areas and secondary data response areas, reasonably allocating memory resources to avoid frequent memory allocation and recycling.

Benefits of technology

It improves memory usage, reduces memory fragmentation, reduces system load, and thus improves the processing efficiency of the intelligent Q&A big model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473633B_ABST
    Figure CN119473633B_ABST
Patent Text Reader

Abstract

The present invention discloses a question-answering method, device, equipment and storage medium of a large intelligent question-answering model. The question-answering method of the large intelligent question-answering model includes: constructing at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the large intelligent question-answering model; dividing the memory area of ​​the data container block to generate a data storage area, a data response area and a secondary data response area; responding to the input request data of the large intelligent question-answering model based on the data container block, and returning the response data of the input request data. Through the above technical solution, the utilization rate of the memory is improved, thereby improving the processing efficiency of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a question-answering method, device, equipment and storage medium for a large intelligent question-answering model. Background Art

[0002] With the development of artificial intelligence, more and more private large models are generated when building artificial intelligence applications in various industries. Using large models as the base, they are enhanced through RAG (Retrieval-Augmented Generation, a technology that combines information retrieval and generation) to realize the construction of intelligent question-answering large models.

[0003] However, in the data interaction of private models, most of the interactions are texts and text paragraphs, and a large amount of memory allocation and recycling is performed in the memory, resulting in excessive load pressure and generating a large amount of memory fragments in the memory, reducing memory utilization. Summary of the invention

[0004] The present invention provides a question-answering method, device, equipment and storage medium for a large intelligent question-answering model to improve memory usage.

[0005] According to one aspect of the present invention, a question-answering method of an intelligent question-answering large model is provided, the method comprising:

[0006] Constructing at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question-answering large model; wherein the target device refers to the device running the intelligent question-answering large model;

[0007] Dividing the data container block into memory areas to generate a data storage area, a data response area, and a secondary data response area; wherein the data storage area is divided into a shared data area and a temporary data area, the shared data area is a public area of ​​all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs;

[0008] The input request data of the intelligent question and answer big model is responded to based on the data container block, and the response data of the input request data is returned.

[0009] According to another aspect of the present invention, a question-answering device of an intelligent question-answering large model is provided, the device comprising:

[0010] A container block construction module, used to construct at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer large model; wherein the target device refers to the device running the intelligent question and answer large model;

[0011] A container block partitioning module is used to partition the memory area of ​​the data container block to generate a data storage area, a data response area and a secondary data response area; wherein the data storage area is divided into a shared data area and a temporary data area, the shared data area is a public area of ​​all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs;

[0012] The request response module is used to respond to the input request data of the intelligent question and answer large model based on the data container block, and return the response data of the input request data.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

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

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the question-answering method of the intelligent question-answering big model described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the question-answering method of the intelligent question-answering big model described in any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, it implements the question-answering method of the intelligent question-answering big model described in any embodiment of the present invention.

[0019] The technical solution of the embodiment of the present invention constructs a data container block on the target device, partitions the data container block in memory, sets a data village area including a shared data area and a temporary data area, as well as a response data area and a secondary response area, and reasonably allocates memory resources to avoid frequent memory allocation and recycling, thereby improving memory utilization and further improving model processing efficiency.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flowchart of a question-answering method of an intelligent question-answering large model provided according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of a question-answering method of an intelligent question-answering large model provided according to Embodiment 2 of the present invention;

[0024] Figure 3 is a flowchart of a question-answering method of an intelligent question-answering large model provided according to Embodiment 3 of the present invention;

[0025] Figure 4 2 is a schematic diagram of the structure of a question-answering device of an intelligent question-answering large model provided according to a fourth embodiment of the present invention;

[0026] Figure 5 It is a structural schematic diagram of an electronic device for implementing the question-answering method of the intelligent question-answering large model of an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Embodiment 1

[0030] Figure 1 A flowchart of a question-answering method of an intelligent question-answering big model is provided for the first embodiment of the present invention. This embodiment is applicable to the case of interacting with the intelligent question-answering big model. The method can be executed by a question-answering device of the intelligent question-answering big model. The question-answering device of the intelligent question-answering big model can be implemented in the form of hardware and / or software. The question-answering device of the intelligent question-answering big model can be configured in various general-purpose computing devices, such as a server device integrated with a big model. Figure 1 As shown, the method includes:

[0031] S110. Construct at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer large model.

[0032] Among them, the target device may refer to a device running the intelligent question-answering large model.

[0033] The sub-model may refer to a private large model associated with the intelligent question-answering large model, which is used to provide private model services. It should be noted that different private large models provide different private model services, and the type of private large model associated with the intelligent question-answering large model may indicate the question-answering technology field supported by the intelligent question-answering large model. The knowledge base of the sub-model may store professional knowledge of the industry or technology field involved in it.

[0034] Specifically, a data container block can be constructed based on the physical resources of the device running the intelligent question and answer big model and the knowledge base of the sub-model associated with the intelligent question and answer big model.

[0035] S120 , dividing the data container block into memory areas to generate a data storage area, a data response area, and a secondary data response area.

[0036] Among them, the data storage area can be divided into a shared data area and a temporary data area. The shared data area can be a public area for all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs. The data response area can be used to store the response data returned by the intelligent question and answer big model to the user, that is, the data that the intelligent question and answer big model replies to the user. The secondary data response area can be used to store the response data that needs to be interacted with the secondary intelligent question and answer big model. That is, when the intelligent question and answer big model returns the response data for the user's request for the first time, it is necessary to perform intelligent question and answer interaction again based on the response data. At this time, the response data can be stored in the secondary data response area as request data, so as to issue a question and answer request to the intelligent question and answer big model again.

[0037] Optionally, in an embodiment of the present invention, the data storage area can be used to store the user's input request data, the data response area can be used to store the response data to the input request data returned by the intelligent question and answer model, and there can be a mapping relationship between the input request data in the data storage area and the response data of the input request data in the data response area, that is, if it is determined that there is an index reference to the input request data in the data storage area (the index can be used to characterize whether a mapping relationship exists), the response data of the input request data can be determined in the data response area according to the mapping relationship and returned.

[0038] It should be noted that, in the embodiment of the present invention, when the memory area of ​​the data container block is divided, it can be divided according to a preset memory ratio, for example, according to a 1:6:3 allocation method, the memory of the data container block is respectively allocated to the data storage area, the data response area, and the secondary data response area in proportion. And each area in the data container block stores data as the smallest unit in the text data, for example, each area stores data in a token format.

[0039] Optionally, in an embodiment of the present invention, the data response area can be divided into at least two storage partitions; wherein the memory size range of the data stored in each storage partition is different; when the data response area receives response data, the response data is stored in the storage partition of the corresponding memory size range according to the data size of the response data; if there is insufficient memory in any storage partition, memory calls from the remaining storage partitions are given priority; if the memory of the data response area is insufficient, historical response data with the earliest storage time and no mapping relationship with the data storage area is cleared first.

[0040] By partitioning and storing the dynamic data response area, the data storage efficiency and the memory utilization of the data response area are improved.

[0041] S130. Respond to the input request data of the intelligent question and answer big model based on the data container block, and return response data of the input request data.

[0042] Specifically, when a user sends a question and answer request to the intelligent question and answer big model, the intelligent question and answer big model receives the user's input request data and can assign a thread to respond to and process the input request data. The thread can randomly select an unoccupied data container block, respond to the input request data, and bind the data container block to the input request data. At this time, the data container block is in an occupied state and cannot be called by other threads.

[0043] The technical solution of the embodiment of the present invention constructs a data container block on the target device, partitions the data container block in memory, sets a data village area including a shared data area and a temporary data area, as well as a response data area and a secondary response area, and reasonably allocates memory resources to avoid frequent memory allocation and recycling, thereby improving memory utilization and further improving model processing efficiency.

[0044] Embodiment 2

[0045] Figure 2 This is a flowchart of a question-answering method of an intelligent question-answering big model provided in the second embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for responding to the input request data of the intelligent question-answering big model based on the data container block and returning the response data of the input request data. It should be noted that for the undetailed parts of the embodiment of the present invention, please refer to the relevant descriptions of other embodiments, which will not be repeated here. Figure 2 As shown, the method includes:

[0046] S210. Construct at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer large model.

[0047] S220 , dividing the data container block into memory areas to generate a data storage area, a data response area, and a secondary data response area.

[0048] S230: When input request data is received, the shared data area is first traversed to determine whether there is historical request data identical to the input request data in the shared data area.

[0049] Specifically, when the data container block receives the user's input request data, the data container block will perform word segmentation on the input request data and represent the input request data in the smallest unit format in the text data; for the input request data after word segmentation, the shared data area in the data container block will be traversed first to determine whether there is historical request data identical to the input request data in the shared data area. It should be noted that after traversing the shared data area, if it is determined that the degree of match between the input request data after word segmentation and a certain historical request data in the shared data area reaches a preset matching threshold, it indicates that there is historical request data identical to the input request data in the shared data area; if the preset matching threshold is not reached, it indicates that there is no historical request data identical to the input request data in the shared data area. Optionally, the matching threshold can be adaptively set according to those skilled in the art.

[0050] S240: If the same historical request data does not exist in the shared data area, traverse the temporary data area to determine whether there is the same historical request data as the input request data in the temporary data area.

[0051] Specifically, if there is no historical request data identical to the user's input request data in the shared data area, then the input request data after word segmentation continues to traverse the temporary data area of ​​the data container block to determine whether there is historical request data identical to the input request data in the temporary data area. It should be noted that after traversing the temporary data area, if it is determined that the degree of matching between the input request data after word segmentation and a certain historical request data in the temporary data area reaches a preset matching threshold, it indicates that there is historical request data identical to the input request data in the temporary data area; if the preset matching threshold is not reached, it indicates that there is no historical request data identical to the input request data in the temporary data area. Optionally, the matching threshold can be adaptively set according to those skilled in the art.

[0052] S250. If the same historical request data does not exist in the temporary data area, the input request data is placed in the temporary data area; the input request data is responded to through the sub-model, and the response data of the input request data is returned; at the same time, the response data is stored in the data response area, and a mapping relationship between the response data and the input request data is established.

[0053] Specifically, if it is determined that there is no historical request data identical to the input request data in the temporary data area, the input request data is stored in the temporary data area; and the input request data is processed by artificial intelligence recognition through the sub-model associated with the intelligent question and answer model, and the response data corresponding to the input request is output; and the response data is stored in the data response area of ​​the data container block to which the temporary data area belongs; and at the same time, a mapping relationship between the response data and the input request data is established.

[0054] Optionally, in an embodiment of the present invention, if the same historical request data exists in the shared data area, the response data in which the historical request data has a mapping relationship with the data response area is returned; and the hit count label of the historical request data is updated in the shared data area; if the label value of the hit count label of the historical request data does not reach the preset label value within the current response cycle, the historical request data is moved to the temporary data area. It should be noted that the shared data area records the input request data that users frequently ask, and the temporary data area records the input request data that is not easily asked by users. Optionally, the cycle duration of the response cycle and the preset label value can be adaptively set according to technicians in this field.

[0055] If the same historical request data exists in the temporary data area, the response data with a mapping relationship between the historical request data and the data response area is returned; and the hit count label of the historical request data is updated in the temporary data area (the specific update method can add 1 to the label value of the hit count label); if the label value of the hit count label of the historical request data reaches the preset label value in the current response cycle, the historical request data is moved to the shared data area. It should be noted that the label value of the hit count label of the historical request data in the shared data area and the temporary data area will be updated with the response cycle, that is, the label value in the current response cycle will be initialized to 0 in the next response cycle.

[0056] By setting a shared data area and a temporary data area, and dynamically adjusting the shared data area and the temporary data area, frequent memory allocation and recovery are avoided, and the operating pressure of the target device is reduced.

[0057] Optionally, in an embodiment of the present invention, if the memory of the shared data area is insufficient, the historical request data with the smallest tag value of the hit count tag in the shared data area within the current response cycle is moved to the temporary data area of ​​the data container block to which the shared data area belongs; if the memory of the temporary data area is insufficient, the historical request data with the oldest storage time in the temporary data area is cleared.

[0058] By dynamically cleaning the shared data area and the temporary data area, memory overflow of the data container block is avoided, and the stable operation of the data container block is ensured, thereby improving the stability of the large model operation.

[0059] The technical solution of the embodiment of the present invention, by constructing a memory allocation strategy, setting a shared data area shared by data blocks and a temporary data area private to data blocks, selectively performs long-term storage and short-term storage on input request data, and establishes a mapping relationship between a data storage area and a data response area, thereby avoiding frequent release and creation of memory, reducing memory fragmentation, and improving the memory allocation efficiency in high concurrency scenarios, thereby improving the processing efficiency of the model.

[0060] Embodiment 3

[0061] Figure 3 This is a flowchart of a question-answering method of an intelligent question-answering big model provided in the third embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for building at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question-answering big model. It should be noted that for the undetailed parts of the embodiment of the present invention, please refer to the relevant descriptions of other embodiments, which will not be repeated here. Figure 3As shown, the method includes:

[0062] S310, traversing the knowledge bases of all sub-models, taking the memory of the data field with the largest memory occupancy as the target memory, and determining the container memory of the data container to be constructed according to the target memory.

[0063] S320: Determine the number of data container blocks in the data container to be constructed according to the number of CPU cores of the target device.

[0064] S330: Determine a container block memory of the data container block according to the container memory and the number of data container blocks.

[0065] In an embodiment of the present invention, the knowledge base of all sub-models associated with the intelligent question-answering large model is obtained to traverse, determine the memory of the data field content with the largest memory occupancy as the target memory, and determine the container memory of the data container to be constructed based on the target memory. Exemplarily, after the memory size of the target memory is expanded four times, it is used as the container memory of the data container to be constructed, thereby avoiding the risk of data container memory overflow caused by the response data returned by the sub-model. The number of data container blocks in the data container can be based on the number of CPU cores of the target device. For example, the number of data container blocks can be twice the number of CPU cores of the target device. The size of each data container block can be determined based on the number of data container blocks and the container memory of the data container. For example, the size of the data container block is determined by dividing the total size of the data container memory by the number of data container blocks.

[0066] After determining the container memory, number of data container blocks, and size of data container blocks of the data container, the minimum running memory required for the operation of the intelligent question-answering model can be determined by determining the maximum number of requests and the default running memory consumed by each request thread, and the target device can be restarted according to the minimum running memory to ensure the stable operation of the intelligent question-answering model, and the data container can be created in the memory of the target device according to the parameters of the data container during the restart of the target device to complete the initialization of the data container. Optionally, the maximum number of requests can be determined by dividing 70% of the physical memory of the target device by the container memory.

[0067] S340 , dividing the data container block into memory areas to generate a data storage area, a data response area, and a secondary data response area.

[0068] S350. Respond to the input request data of the intelligent question and answer big model based on the data container block, and return the response data of the input request data.

[0069] The technical solution of the embodiment of the present invention creates a data container through the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer big model, so that the data container can run stably in the device environment of the target device, thereby improving the stability of the operation of the intelligent question and answer big model.

[0070] Embodiment 4

[0071] Figure 4 This is a schematic diagram of the structure of a question-answering device of a large intelligent question-answering model provided in Embodiment 4 of the present invention. Figure 4 As shown, the device comprises:

[0072] The container block construction module 410 is used to construct at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer large model; wherein the target device refers to the device running the intelligent question and answer large model;

[0073] The container block partitioning module 420 is used to partition the memory area of ​​the data container block to generate a data storage area, a data response area and a secondary data response area; wherein the data storage area is divided into a shared data area and a temporary data area, the shared data area is a public area of ​​all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs;

[0074] The request response module 430 is used to respond to the input request data of the intelligent question and answer large model based on the data container block, and return the response data of the input request data.

[0075] The technical solution of the embodiment of the present invention constructs a data container block on the target device, partitions the data container block in memory, sets a data village area including a shared data area and a temporary data area, as well as a response data area and a secondary response area, and reasonably allocates memory resources to avoid frequent memory allocation and recycling, thereby improving memory utilization and further improving model processing efficiency.

[0076] Optionally, the request response module 430 includes:

[0077] A first traversal unit is used for, when receiving input request data, first traversing the shared data area to determine whether there is historical request data identical to the input request data in the shared data area;

[0078] A second traversal unit is used for traversing the temporary data area to determine whether there is historical request data identical to the input request data in the temporary data area if the same historical request data does not exist in the shared data area;

[0079] The request response unit is used to place the input request data into the temporary data area if the same historical request data does not exist in the temporary data area; respond to the input request data through the sub-model and return the response data of the input request data; store the response data in the data response area at the same time, and establish a mapping relationship between the response data and the input request data.

[0080] Optionally, the request response module 430 further includes:

[0081] A response area hit unit, for returning response data having a mapping relationship between the historical request data and the data response area if the same historical request data exists in the shared data area; and updating a hit count label of the historical request data in the shared data area; and moving the historical request data to a temporary data area if the label value of the hit count label of the historical request data does not reach a preset label value within the current response cycle;

[0082] A temporary area hit unit is used to return the response data in the data response area that has a mapping relationship between the historical request data and the historical request data if the same historical request data exists in the temporary data area; and to update the hit count label of the historical request data in the temporary data area; if the label value of the hit count label of the historical request data reaches a preset label value within the current response cycle, the historical request data is moved to the shared data area.

[0083] Optionally, the request response module 430 also includes: a data block update unit, which is used to move the historical request data with the smallest tag value of the hit count tag in the shared data area within the current response cycle to the temporary data area if the memory in the shared data area is insufficient; if the memory in the temporary data area is insufficient, clear the historical request data with the earliest time stored in the temporary data area.

[0084] Optionally, the container block division module 420 may also be specifically used for:

[0085] The data response area is divided into at least two storage partitions; wherein the memory size range of the data stored in each storage partition is different; when the data response area receives response data, the response data is stored in the storage partition of the corresponding memory size range according to the data size of the response data; if there is insufficient memory in any storage partition, memory calls are made from the remaining storage partitions first; if the memory in the data response area is insufficient, historical response data with the earliest storage time and no mapping relationship with the data storage area is cleared first.

[0086] Optionally, the container block building module 410 includes:

[0087] A container memory determination unit, used to traverse the knowledge base of all sub-models, take the memory of the data field with the largest memory usage as the target memory, and determine the container memory of the data container to be constructed according to the target memory;

[0088] A quantity determination unit, used to determine the number of data container blocks in the data container to be constructed according to the number of CPU cores of the target device;

[0089] The container block memory determining unit is used to determine the container block memory of the data container block according to the container memory and the number of data container blocks.

[0090] The question-answering device of the intelligent question-answering big model provided in the embodiment of the present invention can execute the question-answering method of the intelligent question-answering big model provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0091] Embodiment 5

[0092] Figure 5 A schematic diagram of the structure of an electronic device 510 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0093] like Figure 5 As shown, the electronic device 510 includes at least one processor 511, and a memory connected to the at least one processor 511 in communication, such as a read-only memory (ROM) 512, a random access memory (RAM) 513, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 511 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 512 or the computer program loaded from the storage unit 518 to the random access memory (RAM) 513. In the RAM 513, various programs and data required for the operation of the electronic device 510 can also be stored. The processor 511, the ROM 512, and the RAM 513 are connected to each other via a bus 514. An input / output (I / O) interface 515 is also connected to the bus 514.

[0094] A number of components in the electronic device 510 are connected to the I / O interface 515, including: an input unit 516, such as a keyboard, a mouse, etc.; an output unit 517, such as various types of displays, speakers, etc.; a storage unit 518, such as a disk, an optical disk, etc.; and a communication unit 519, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 519 allows the electronic device 510 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0095] The processor 511 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 511 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 511 executes the various methods and processes described above, such as the question-answering method of the intelligent question-answering large model.

[0096] In some embodiments, the question-answering method of the intelligent question-answering large model may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 518. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 510 via the ROM 512 and / or the communication unit 519. When the computer program is loaded into the RAM 513 and executed by the processor 511, one or more steps of the question-answering method of the intelligent question-answering large model described above may be performed. Alternatively, in other embodiments, the processor 511 may be configured to execute the question-answering method of the intelligent question-answering large model in any other appropriate manner (e.g., by means of firmware).

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

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

[0099] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. 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.

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

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

[0102] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

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

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

Claims

1. A question-answering method for a large intelligent question-answering model, characterized in that: include: Constructing at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question-answering large model; wherein the target device refers to the device running the intelligent question-answering large model; Dividing the data container block into memory areas to generate a data storage area, a data response area, and a secondary data response area; wherein the data storage area is divided into a shared data area and a temporary data area, the shared data area is a public area of ​​all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs; Respond to the input request data of the intelligent question and answer big model based on the data container block, and return the response data of the input request data; Wherein, responding to the input request data of the intelligent question and answer big model based on the data container block and returning the response data of the input request data includes: When receiving input request data, the shared data area is first traversed to determine whether there is historical request data identical to the input request data in the shared data area; If the same historical request data does not exist in the shared data area, traverse the temporary data area to determine whether there is the same historical request data as the input request data in the temporary data area; If the same historical request data exists in the shared data area, the response data with a mapping relationship between the historical request data and the data response area is returned; and the hit count label of the historical request data is updated in the shared data area; if the label value of the hit count label of the historical request data does not reach the preset label value within the current response cycle, the historical request data is moved to the temporary data area; If the same historical request data exists in the temporary data area, the response data with a mapping relationship between the historical request data and the data response area is returned; and the hit count label of the historical request data is updated in the temporary data area; if within the current response cycle, the label value of the hit count label of the historical request data reaches the preset label value, the historical request data is moved to the shared data area.

2. The method according to claim 1, characterized in that Responding to the input request data of the intelligent question and answer big model based on the data container block and returning the response data of the input request data also includes: If the same historical request data does not exist in the temporary data area, the input request data is placed in the temporary data area; the input request data is responded to through the sub-model, and the response data of the input request data is returned; at the same time, the response data is stored in the data response area, and a mapping relationship between the response data and the input request data is established.

3. The method according to claim 2, characterized in that Also includes: If the memory in the shared data area is insufficient, the historical request data with the smallest tag value of the hit count tag in the shared data area within the current response cycle is moved to the temporary data area; If the memory in the temporary data area is insufficient, the oldest historical request data stored in the temporary data area will be cleared.

4. The method according to claim 1, characterized in that Also includes: Divide the data response area into at least two storage partitions; wherein the memory size range of the data stored in each storage partition is different; When the data response area receives response data, the response data is stored in a storage partition of the corresponding memory size range according to the data size of the response data; if any storage partition has insufficient memory, memory calls from the remaining storage partitions are prioritized; if the data response area has insufficient memory, historical response data with the earliest storage time and no mapping relationship with the data storage area is prioritized for clearing.

5. The method according to claim 1, characterized in that At least one data container block is constructed based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question-answering large model, including: Traversing the knowledge bases of all sub-models, taking the memory of the data field with the largest memory usage as the target memory, and determining the container memory of the data container to be constructed according to the target memory; Determine the number of data container blocks in the data container to be constructed according to the number of CPU cores of the target device; A container block memory of the data container block is determined according to the container memory and the number of data container blocks.

6. A question-answering device of a large intelligent question-answering model, characterized in that: include: A container block construction module, used to construct at least one data container block based on the physical resources of the target device and the knowledge base of the sub-model associated with the intelligent question and answer large model; wherein the target device refers to the device running the intelligent question and answer large model; A container block partitioning module is used to partition the memory area of ​​the data container block to generate a data storage area, a data response area and a secondary data response area; wherein the data storage area is divided into a shared data area and a temporary data area, the shared data area is a public area of ​​all data container blocks, and the temporary data area can only be accessed by the data container block to which it belongs; A request response module, used to respond to the input request data of the intelligent question and answer large model based on the data container block, and return response data of the input request data; Wherein, the request response module includes: A first traversal unit is used for, when receiving input request data, first traversing the shared data area to determine whether there is historical request data identical to the input request data in the shared data area; A second traversal unit is used for traversing the temporary data area to determine whether there is historical request data identical to the input request data in the temporary data area if the same historical request data does not exist in the shared data area; A response area hit unit, for returning response data having a mapping relationship between the historical request data and the data response area if the same historical request data exists in the shared data area; and updating a hit count label of the historical request data in the shared data area; and moving the historical request data to a temporary data area if the label value of the hit count label of the historical request data does not reach a preset label value within the current response cycle; A temporary area hit unit is used to return the response data in the data response area that has a mapping relationship between the historical request data and the historical request data if the same historical request data exists in the temporary data area; and to update the hit count label of the historical request data in the temporary data area; if the label value of the hit count label of the historical request data reaches a preset label value within the current response cycle, the historical request data is moved to the shared data area.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the question-answering method of the intelligent question-answering large model described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the question-answering method of the intelligent question-answering large model described in any one of claims 1 to 5 when executed.

9. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the question-answering method of the intelligent question-answering large model described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Personalized intelligent voice interaction method and device based on container technology

    CN110288993A

  • Region based directory scheme to adapt to large cache sizes

    CN111684425A