Content generation method and device, electronic equipment, readable storage medium and computer program product

By using a pre-built question-and-answer database and a content generation model based on the cache mechanism in content generation, the problem of low processing efficiency of users' unanticipated intention data is solved, and efficient and highly adaptable content generation is achieved.

CN119940544APending Publication Date: 2025-05-06BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510025239.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, it is difficult to efficiently process intention data that users have not expected when generating content, resulting in insufficient content generation efficiency and adaptability.

Method used

Through a pre-built question and answer database and a content generation model based on the cache mechanism, combined with the caching mechanism and a question and answer vector database, efficient content generation is achieved.

Benefits of technology

It improves the efficiency and adaptability of content generation, reduces the time for content generation with the same user intentions, and enhances the ability to respond quickly to user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940544A_ABST
    Figure CN119940544A_ABST
Patent Text Reader

Abstract

The invention provides a content generation method and device, electronic equipment, a readable storage medium and a computer program product, and relates to the field of artificial intelligence, in particular to the field of intelligent generation. According to the implementation scheme, the method comprises the steps of obtaining user intention data corresponding to user request information based on the user request information; in response to determining that first question and answer content corresponding to the user intention data is stored in a question and answer database, outputting the first question and answer content; and in response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database, obtaining second question and answer content based on the user intention data by utilizing a content generation model based on a cache mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, in particular to the field of intelligent generation, and specifically to a content generation method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0002] With the continuous development of computer technology, a huge amount of content has been generated on the Internet, and the way content is generated is also undergoing tremendous changes; natural language processing technology enables computers to understand and generate natural language, thereby realizing the automatic generation of content; machine learning can identify user needs by analyzing large amounts of data, thereby generating content that meets specific needs.

[0003] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions. Summary of the invention

[0004] The present disclosure provides a content generation method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of the present disclosure, a content generation method is provided, including: based on user request information, obtaining user intent data corresponding to the user request information; in response to determining that first question and answer content corresponding to the user intent data is stored in a question and answer database, outputting the first question and answer content; and in response to determining that the first question and answer content corresponding to the user intent data does not exist in the question and answer database, obtaining second question and answer content based on the user intent data using a content generation model based on a caching mechanism.

[0006] According to a second aspect of the present disclosure, a content generation device is provided, including: an intention data acquisition module, for obtaining user intention data corresponding to the user request information based on the user request information; a first question and answer content generation module, for outputting the first question and answer content in response to determining that the first question and answer content corresponding to the user intention data is stored in the question and answer database; and a second question and answer content generation module, for obtaining the second question and answer content based on the user intention data by using a content generation model based on a caching mechanism in response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database.

[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned content generation method.

[0008] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor implements the content generation method as described above.

[0009] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned content generation method when executed by a processor.

[0010] According to one or more embodiments of the present disclosure, an efficient content generation method and device are provided through a pre-built question and answer database and a question and answer content caching mechanism based on a content generation model of a caching mechanism.

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

[0012] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0014] Figure 2 A flow chart of a content generation method according to an embodiment of the present disclosure is shown;

[0015] Figure 3 Shown according to Figure 2 The flowchart of step S206 in which the second question-answer content is generated by using the content generation model based on the cache mechanism;

[0016] Figure 4 A block diagram of a content generating device according to an embodiment of the present disclosure is shown;

[0017] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

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

[0019] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0020] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0021] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0022] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0023] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the content generation method to be performed.

[0024] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0025] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0026] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to generate content. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0027] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0028] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0029] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0030] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0031] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0032] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0033] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0034] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0035] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0036] Figure 2 2 is a flowchart showing a content generation method 200 according to an embodiment of the present disclosure. Figure 2 As shown, the content generation method may include: step S202, based on user request information, obtaining user intention data corresponding to the user request information; step S204, in response to determining that the question and answer database stores first question and answer content corresponding to the user intention data, outputting the first question and answer content; and step S206, in response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database, obtaining second question and answer content based on the user intention data using a content generation model based on a caching mechanism.

[0037] In some embodiments, the user request information includes question information input by the user, associative word information associated with the user input information, and can also be text prompt word information input by the user during the interaction with the model; the user request information is a query involving a broad topic, and the corresponding generated content may also be tens of thousands. The user can adjust the prompt words according to needs to adapt to different scenarios and tasks. If the user has specific requirements for the format of the generated content, it can be clearly stated in the prompt words, such as "Please output five poems related to the twenty-four solar terms"; the prompt word information and associative word information can guide the model to generate specific outputs, helping users to obtain required content more efficiently.

[0038] For example, when the user inputs "My elbow hurts, what acupoints are there?", the location of the Shenming acupoint on the arm is shown to the user, and at the same time, through associative words, the user is shown information on how to relieve arm pain by pressing the Shenming acupoint.

[0039] In some embodiments, in the method of obtaining user intention data corresponding to the user request information based on the user request information, the user intention data can be obtained by using rules of dictionary templates, by matching past logs, and by using an intention recognition model based on a large model.

[0040] For example, when the user inputs information such as "high-speed rail trains from Beijing to Shanghai", it can be converted into the search terms [location] to [location] [high-speed rail] train, and then the search terms are matched through the knowledge graph; when the user enters "what concerts are there in Beijing tomorrow", it is converted into the search terms [location] [time] [question words] [keywords], and then the search terms are matched through the knowledge graph to generate corresponding user intent data.

[0041] In the content generation method according to the embodiment of the present disclosure, through the question-and-answer content storage mechanism and combined with the content generation model based on the cache mechanism, the content generation time for the same user intention is reduced, thereby improving the efficiency and adaptability of content generation.

[0042] Figure 3 Shown according to Figure 2 The flowchart 300 of using the content generation model based on the cache mechanism to generate the second question and answer content in step S206 shown in FIG. Figure 3 As shown, the use of a content generation model based on a cache mechanism to obtain a second question and answer content based on the user intention data includes: step S302, in response to determining that there is a cache identifier corresponding to the user intention data in the cache, outputting the second question and answer content corresponding to the cache identifier, and applying positive feedback to the value of a hit mark of the cache identifier, wherein the hit mark is used to indicate whether the cache identifier corresponds to the user intention data; and step S304, in response to determining that there is no cache identifier corresponding to the user intention data in the cache, obtaining the second question and answer content corresponding to the user intention data based on a question and answer vector database, wherein the question and answer vector database includes question and answer vectors corresponding to the question and answer content.

[0043] It should be noted that the cache identifier is used to uniquely identify a question and answer vector. The corresponding question and answer vector can be quickly retrieved through the cache identifier, thereby improving the speed and efficiency of accessing the question and answer vector. The implementation of the cache identifier and the question and answer vector pair depends on the structural implementation of the data dictionary. For example, a hash function can be used to construct the correspondence between the cache identifier and the question and answer vector.

[0044] Exemplarily, applying positive feedback to the value of the hit tag of the cache identifier may be, in response to determining that there is a cache identifier corresponding to the user intention data in the cache, adding one to the value of the hit tag of the cache identifier.

[0045] In this embodiment, the content generation model based on the cache mechanism stores the obtained question and answer content in the cache to reduce the time of generating question and answer content with the same user intention, thereby improving the efficiency of question and answer content generation.

[0046] In some embodiments, the method of using a content generation model based on a cache mechanism to obtain the second question-and-answer content based on the user intent data further includes recording log information of each cache access, including the requested key, operation type (read, write), operation result (hit, miss), etc. By analyzing the log information, the cache hit rate can be intuitively understood, and the cache hit rate can be used to guide cache management.

[0047] In some embodiments, obtaining the second question and answer content corresponding to the user intention data based on the question and answer vector database includes: obtaining a user intention vector corresponding to the user intention data based on the user intention data; calculating the similarity between the user intention vector and each question and answer vector in the vector database; and outputting the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold.

[0048] In this embodiment, the calculation method of the similarity between the user intention vector and each question and answer vector in the vector database includes Euclidean distance calculation method, cosine similarity and algorithm, and Pearson correlation coefficient calculation method, etc., and an appropriate similarity calculation method can be selected according to different application scenarios.

[0049] In this embodiment, the matching of question and answer content and user intention is achieved by similarity calculation and setting an appropriate similarity threshold, thereby improving the adaptability of question and answer content generation.

[0050] In some embodiments, obtaining the second question and answer content corresponding to the user intention data based on the question and answer vector database also includes: storing cache content corresponding to the question and answer vector that meets the set similarity threshold, wherein the cache content includes the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold, the cache identifier corresponding to the second question and answer content, and a hit mark of the cache identifier corresponding to the second question and answer content.

[0051] In some implementations, storing the cache content corresponding to the question and answer vector that meets the set similarity threshold also includes setting an initial value of a hit mark of the cache identifier corresponding to the second question and answer content. Exemplarily, in this embodiment, the initial value of the hit mark of the cache identifier corresponding to the second question and answer content can be set to zero.

[0052] In some embodiments, the similarity threshold refers to the minimum threshold set in the similarity comparison, which is used to determine the similarity between the user intention vector and the question-answer vector. When setting the similarity threshold, the application scenario needs to be comprehensively considered to ensure the accuracy of the comparison result; illustratively, the text similarity threshold is set in the range of [0.8-0.9]. When the similarity of two texts exceeds the set threshold, they can be considered similar; the image similarity threshold is set in the range of [0.6-0.7].

[0053] In this embodiment, by storing the retrieved question and answer content and the corresponding cache identifier in the cache, faster question and answer content generation is provided in response to user request information with the same user intention.

[0054] In some implementations, the content generation method further includes clearing cached content.

[0055] As the number of user calls increases, the data in the cache continues to accumulate. Too much cached data will cause more question and answer content to be traversed when matching content, resulting in reduced content generation efficiency.

[0056] In this embodiment, by cleaning up invalid data in the cache, storage pressure is effectively reduced, and the matching time of question and answer content is reduced.

[0057] In some embodiments, the clearing of cache content includes at least one of the following: clearing the cache content corresponding to the cache identifier whose hit tag value is zero within a set time period; in response to determining that the remaining storage space in the cache is less than a set threshold, clearing the cache content corresponding to the cache identifier whose hit tag value is less than the set threshold; and in response to determining that the cache content has an expiration tag, clearing the cache content that does not meet the expiration date, wherein the expiration tag is the expiration date of the cache content.

[0058] In this embodiment, which is exemplary but not restrictive, when the remaining storage space of the cache is less than 20% of the total storage space of the cache, the cache content corresponding to the cache identifier whose hit tag value is less than 3 is cleared; it can also be that when the remaining storage space of the cache is less than 20% of the total storage space of the cache, the hit tags are sorted, and the cache contents corresponding to the cache identifiers corresponding to the top 5 hit tags in reverse order are cleared.

[0059] For example, when the user inputs information such as “What is Tyndall information”, it is identified as a non-timeliness requirement, and the corresponding cached content does not have a timeliness tag; when the user inputs “What concerts are there in Beijing today”, [today] is identified as timeliness requirement information, and the corresponding cached content has a timeliness tag.

[0060] In this embodiment, cache management is performed based on the calling status of cache content, the timeliness of cache content, and the remaining storage space in the cache, thereby improving the accuracy of question and answer content cache management and the timeliness of cache content.

[0061] In some embodiments, the clearing of the cached content that does not meet the time limit includes: obtaining the date on which the user request information is sent; and clearing the cached content in response to determining that the date corresponding to the time limit tag is before the date on which the user request information is sent.

[0062] In this embodiment, in response to a request from a user, the timeliness of the cache is determined, and out-of-time cache content is promptly cleared to improve the storage efficiency of the cache, thereby improving the efficiency of question and answer content matching.

[0063] In some implementations, a fixed cache cleaning time can be set to regularly clean up the question and answer content in the cache that does not meet the time limit. For example, the question and answer content in the cache whose expiration date is earlier than the current date can be cleaned up at 0:00 every Monday.

[0064] In some embodiments, the question and answer database includes at least one of the following databases: a temporary question and answer database, a short-term question and answer database, and a permanent question and answer database.

[0065] In some embodiments, the question and answer database is composed of question and answer results obtained based on user search terms using a large model, and the user search terms are search terms that meet the set order in the search rankings. The question and answer results are classified according to the timeliness of the search terms, and the question and answer results corresponding to search terms with no timeliness are stored in the permanent question and answer database; the question and answer results corresponding to search terms with a timeliness of more than one day and less than one week are stored in the short-term question and answer database; and the question and answer results corresponding to search terms with a timeliness of less than one day are stored in the temporary question and answer database. It should be noted that the above question and answer database corresponding to the question and answer results determined according to timeliness is only an exemplary description and is not restrictive. During implementation, a suitable corresponding relationship can be set according to the specific application scenario.

[0066] In this embodiment, the question and answer database is divided into a temporary question and answer database, a short-term question and answer database, and a permanent question and answer database according to the timeliness of the question and answer content. By judging the timeliness label, the scope of question and answer content retrieval is narrowed, thereby improving the efficiency of question and answer content matching.

[0067] Figure 4 4 is a block diagram showing a content generation device 400 according to an embodiment of the present disclosure. Figure 4 As shown, the content generating device 400 includes: an intention data acquiring module S402, for obtaining user intention data corresponding to the user request information based on the user request information; a first question and answer content generating module S404, for outputting the first question and answer content in response to determining that the first question and answer content corresponding to the user intention data is stored in the question and answer database; and a second question and answer content generating module S406, for obtaining the second question and answer content based on the user intention data by using a content generating model based on a caching mechanism in response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database.

[0068] It should be noted that Figure 4 The various modules of the apparatus 400 shown in FIG. 4 can be used in conjunction with the reference Figure 2The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 400 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

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

[0070] refer to Figure 5 , a block diagram of an electronic device 500 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, 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, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0071] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0072] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the electronic device 500. The input unit 506 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

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

[0074] 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.

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

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

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

[0078] The systems and techniques described herein can 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 can 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), the Internet, and a blockchain network.

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

[0080] 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 this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0081] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A content generation method, comprising: Based on the user request information, obtaining user intention data corresponding to the user request information; In response to determining that a first question and answer content corresponding to the user intention data is stored in the question and answer database, outputting the first question and answer content; as well as In response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database, a second question and answer content is obtained based on the user intention data using a content generation model based on a cache mechanism.

2. The content generation method according to claim 1, wherein: The obtaining of the second question-and-answer content based on the user intention data by using the content generation model based on the cache mechanism includes: In response to determining that there is a cache identifier corresponding to the user intention data in the cache, outputting the second question-and-answer content corresponding to the cache identifier, and applying positive feedback to the value of a hit tag of the cache identifier, wherein the hit tag is used to indicate whether the cache identifier corresponds to the user intention data; and In response to determining that there is no cache identifier corresponding to the user intent data in the cache, the second question and answer content corresponding to the user intent data is obtained based on a question and answer vector database, wherein the question and answer vector database includes question and answer vectors corresponding to the question and answer content.

3. The content generation method according to claim 2, wherein: The obtaining the second question and answer content corresponding to the user intention data based on the question and answer vector database includes: Based on the user intention data, obtaining a user intention vector corresponding to the user intention data; Calculating the similarity between the user intention vector and each question-answer vector in the vector database; and Output the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold.

4. The content generation method according to claim 3, wherein: The obtaining the second question and answer content corresponding to the user intention data based on the question and answer vector database further includes: The cache content corresponding to the question and answer vector that meets the set similarity threshold is stored, wherein the cache content includes the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold, the cache identifier corresponding to the second question and answer content, and a hit mark of the cache identifier corresponding to the second question and answer content.

5. The content generation method according to claim 4, wherein: The method also includes cleaning the cache content.

6. The content generation method according to claim 5, wherein: The cleaning of cache content includes at least one of the following: Cleaning up the cache content corresponding to the cache identifier whose hit flag value is zero within a set time period; In response to determining that the available storage space of the cache is less than a set threshold, clearing the cache content corresponding to the cache identifier whose value of the hit mark is less than the set threshold; as well as In response to determining that the cache content has an expiration tag, the cache content that does not meet the expiration date is cleared, wherein the expiration tag is the expiration expiration date of the cache content.

7. The content generation method according to claim 6, wherein: The clearing of the cached content that does not meet the time limit includes: Obtain the date on which the user request information is sent; and In response to determining that the date corresponding to the expiration tag is before the date on which the user request information is sent, the cache content is cleared.

8. The content generation method according to claim 1, wherein: The question and answer database includes at least one of the following databases: a temporary question and answer database, a short-term question and answer database, and a permanent question and answer database.

9. A content generating device, comprising: An intention data acquisition module, used to obtain user intention data corresponding to the user request information based on the user request information; A first question and answer content generating module, configured to output the first question and answer content in response to determining that the question and answer database stores the first question and answer content corresponding to the user intention data; as well as The second question and answer content generation module is used to obtain the second question and answer content based on the user intention data by using a content generation model based on a cache mechanism in response to determining that the first question and answer content corresponding to the user intention data does not exist in the question and answer database.

10. The content generating device according to claim 9, wherein the second content generating module further comprises: a first submodule, configured to, in response to determining that a cache identifier corresponding to the user intention data exists in the cache, output the second question-and-answer content corresponding to the cache identifier, and apply positive feedback to the value of a hit tag of the cache identifier, wherein the hit tag is used to indicate whether the cache identifier corresponds to the user intention data; and The second submodule is used to obtain the second question and answer content corresponding to the user intention data based on a question and answer vector database in response to determining that there is no cache identifier corresponding to the user intention data in the cache, wherein the question and answer vector database includes question and answer vectors corresponding to the question and answer content.

11. The content generating device according to claim 10, wherein: The second submodule further includes: A first unit is used to obtain a user intention vector corresponding to the user intention data based on the user intention data; A second unit is used to calculate the similarity between the user intention vector and each question-answer vector in the vector database; and The third unit is used to output the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold.

12. The content generating device according to claim 11, wherein: The second submodule also includes: The fourth unit is used to store the cache content corresponding to the question and answer vector that meets the set similarity threshold, wherein the cache content includes the second question and answer content corresponding to the question and answer vector that meets the set similarity threshold, the cache identifier corresponding to the second question and answer content, and the hit mark of the cache identifier corresponding to the second question and answer content.

13. The content generating device according to claim 12, wherein: The second submodule also includes a fifth unit, which is used to clean up the cache content.

14. The content generating device according to claim 13, wherein: The fifth unit further includes at least one of the following units: A first subunit is used to clean up the cache content corresponding to the cache identifier whose hit mark value is zero within a set time period; In response to determining that the available storage space of the cache is less than a set threshold, clearing the cache content corresponding to the cache identifier whose value of the hit mark is less than the set threshold; as well as The second subunit is configured to, in response to determining that the cache content has an expiration tag, clean up the cache content that does not meet the expiration date, wherein the expiration tag is an expiration date of the cache content.

15. The content generating device according to claim 14, wherein: The third subunit further comprises: A unit for obtaining a date when the user request information is sent; and A unit for clearing the cache content in response to determining that the date corresponding to the expiration tag is before the date on which the user request information is sent.

16. The content generating device according to claim 9, wherein: The question and answer database includes at least one of the following databases: a temporary question and answer database, a short-term question and answer database, and a permanent question and answer database.

17. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

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

19. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.