Content generation method and related equipment
By intelligently scheduling AI models to process user requests, the problem of isolated functions in existing tools is solved, enabling efficient and low-cost content generation and improving user experience.
Patent Information
- Application Number
- CN202511466992.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-02-06
AI Technical Summary
Existing AI translation or AI writing tools are isolated in function, unable to handle multiple needs, require manual operation by users, are inefficient and costly, and ordinary staff spend a lot of time and effort to create high-quality content, resulting in a poor experience.
By acquiring user requests, determining the request type, performing permission and resource verification, parsing the content to be processed, extracting features, scheduling the corresponding AI model for processing, generating target content, and realizing intelligent scheduling of different AI models.
Optimize processing efficiency, reduce costs, improve user experience, enhance response quality and speed, and adapt to different types of requests.
Smart Images

Figure CN121479080A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a content generation method and related equipment. Background Technology
[0002] While some standalone AI translation or writing tools exist, they are typically isolated, unable to handle diverse needs, require manual user operation, and are inefficient and costly. In terms of content creation, producing original, high-quality SEO articles, product details, and similar content requires specialized knowledge and significant time investment, making it time-consuming, laborious, and providing a poor user experience for ordinary staff.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main objective of this application is to propose a content generation method and related equipment to achieve intelligent scheduling of different AI models, which is beneficial for handling different types of requests, optimizing processing efficiency, reducing costs, and improving user experience.
[0005] To achieve the above objectives, one aspect of this application proposes a content generation method, the method comprising: Obtain user requests and determine the type of the user requests, which includes content generation type and translation type. In response to the user request, perform permission and resource verification based on the type of the user request; If the verification passes, the user request is parsed to obtain the content to be processed; Extract the features of the content to be processed, including text length, content type, and processing scenario; Based on the type of the user request and the characteristics of the content to be processed, the corresponding AI model is scheduled to process the content to be processed and generate the target content.
[0006] In some embodiments, the step of performing permission and resource verification based on the type of the user request in response to the user request includes: If the type of the user request is the content generation type, in response to the user request, perform generation function permission and resource permission verification; If the user request is of the translation type, in response to the user request, a translation function permission verification is performed.
[0007] In some embodiments, the step of scheduling a corresponding AI model to process the content to be processed and generate target content based on the type of the user request and the characteristics of the content to be processed includes: Obtain a first threshold, where the first threshold is the user text length threshold; If the user request is of the translation type and the text length is less than or equal to the first threshold, then the first AI translation model is scheduled to process the content to be processed and generate the target content. If the user request is of the translation type and the text length is greater than the first threshold, then the second AI translation model is scheduled to process the content to be processed and generate the target content.
[0008] In some embodiments, the content generation request includes an article generation request and a content rewriting request. The step of scheduling a corresponding AI model to process the content to be processed and generate target content based on the type of the user request and the characteristics of the content to be processed includes: If the user request is a content rewriting request, then the URL of the content rewriting request is obtained, and the second AI generation model is scheduled to perform webpage collection and content rewriting based on the URL to obtain the target content; If the user request is an article generation request, then the keywords of the article generation request are obtained, and the first AI generation model is scheduled to perform online search and content generation based on the keywords to obtain the target content; Obtain the second threshold, which is the AI text length threshold; If the user request is an article generation request and the length of the target content is less than the second threshold, the third AI generation model is scheduled to perform streaming expansion of the target content and update the target content.
[0009] In some embodiments, parsing the user request to obtain the content to be processed includes: Parse the text field and rich text field requested by the user; Extract the plain text information from the rich text field; The text field and the plain text information are combined to form a string list, which is then used as the content to be processed.
[0010] In some embodiments, the method further includes: Obtain the rich text format and website language version requested by the user; The target content is then filled back into the rich text format to obtain the target format content; Save the target format content to the website's language version.
[0011] In some embodiments, the method further includes: Based on the target content, the AI model is invoked to generate image prompts; Based on the image prompts, an image generation model is invoked to generate accompanying images; Save the accompanying image to the website's resource library and associate it with the target content.
[0012] To achieve the above objectives, another aspect of this application provides a content generation apparatus, the apparatus comprising: The request acquisition module is used to acquire user requests and determine the type of the user requests. The types of user requests include content generation type and translation type. The user requests include content generation requests and translation requests. The verification module is used to respond to the user request and perform permission and resource verification based on the type of the user request; The parsing module is used to parse the user request to obtain the content to be processed if the verification passes. The feature extraction module is used to extract features of the content to be processed, including text length, content type, and processing scenario. The generation module is used to schedule the corresponding AI model to process the content to be processed based on the type of the user request and the characteristics of the content to be processed, and generate the target content.
[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0015] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.
[0016] The embodiments of this application include at least the following beneficial effects: This application provides a content generation method, apparatus, electronic device, storage medium, and program product. This solution obtains user requests and determines the type of user requests; responds to user requests and performs permission and resource verification based on the type of user requests; if the verification passes, the user request is parsed to obtain the content to be processed; extracting the features of the content to be processed is beneficial for accurate AI model scheduling, matching the corresponding processing flow, and improving response quality and speed; according to the type of user request and the features of the content to be processed, the corresponding AI model is scheduled to process the content to be processed and generate target content, realizing intelligent scheduling of different AI models, which is beneficial for dealing with different types of requests, optimizing processing efficiency, reducing costs, and improving user experience. Attached Figure Description
[0017] Figure 1 This is a flowchart of the content generation method provided in the embodiments of this application; Figure 2 yes Figure 1 The flowchart of step S105 in the process; Figure 3 This is the rich text filling step of the content generation method provided in the embodiments of this application; Figure 4 This refers to the image association step in the content generation method provided in the embodiments of this application; Figure 5 This is a schematic diagram of the overall system architecture when the content generation method provided in this application is applied to a website content streaming generation and intelligent translation system with multi-AI model collaboration; Figure 6 This is a technical flowchart illustrating the application of the content generation method provided in this application to a multi-AI model collaborative website content streaming generation and intelligent translation system. Figure 7 This is a flowchart of a user translating a category page, provided in an embodiment of this application; Figure 8 This is a flowchart of a user generating an SEO intelligent article, provided in an embodiment of this application; Figure 9 This is a flowchart of a user performing webpage collection and rewriting provided in an embodiment of this application; Figure 10 This is a flowchart illustrating the process of creating batch AI writing tasks by a user, as provided in an embodiment of this application. Figure 11 This is a schematic diagram of the structure of the content generation apparatus provided in the embodiments of this application; Figure 12 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0019] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0020] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0022] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0023] 1) SEO (Search Engine Optimization) is a series of techniques and strategies used to make a website rank higher in the natural search results of search engines, thereby obtaining more targeted traffic.
[0024] While some standalone AI translation or writing tools exist, they are typically isolated, unable to handle diverse needs, require manual user operation, and are inefficient and costly. In terms of content creation, producing original, high-quality SEO articles, product details, and similar content requires specialized knowledge and significant time investment, making it time-consuming, laborious, and providing a poor user experience for ordinary staff.
[0025] In summary, the technical problems existing in the relevant technologies need to be improved.
[0026] In view of this, this application provides a content generation method and related equipment. This method obtains user requests and determines the type of the user request; responds to the user request by performing permission and resource verification based on the type of the user request; if the verification passes, the user request is parsed to obtain the content to be processed; features of the content to be processed are extracted, which facilitates accurate AI model scheduling, matching corresponding processing flows, and improving response quality and speed; according to the type of the user request and the features of the content to be processed, the corresponding AI model is scheduled to process the content to be processed, generating target content. This achieves intelligent scheduling of different AI models, which is beneficial for handling different types of requests, optimizing processing efficiency, reducing costs, and improving user experience. The content generation method provided in this application relates to the field of artificial intelligence technology. The content generation method provided in this application can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited thereto; the server may be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server may also be a node server in a blockchain network; the software may be an application that implements content generation methods, but is not limited to the above forms.
[0027] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0028] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0029] Figure 1 This is an optional flowchart of the content generation method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S105.
[0030] Step S101: Obtain the user request and determine the type of the user request.
[0031] Specifically, the types of user requests include content generation and translation. User requests include content generation requests and translation requests. Content generation requests include article generation requests and content rewriting requests.
[0032] In some embodiments, users submit a translation request after selecting the target language and category page.
[0033] Optionally, the user enters keywords and selects generation options before submitting an article generation request.
[0034] In other embodiments, the user enters the URL of the article to be collected, selects whether to generate TDK (title, description, keywords) and a summary at the same time, and then submits a content rewriting request.
[0035] Step S102: In response to the user request, perform permission and resource verification based on the type of the user request.
[0036] In some embodiments, if the user request is of the content generation type, in response to the user request, the generation function permission and resource permission verification are performed.
[0037] Optionally, if the user request is for translation, the system will perform a translation function permission check in response to the user request.
[0038] In this embodiment, in response to a user request, permission and resource verification is performed based on the type of the user request, which is conducive to the rational use of resources and improves the effectiveness and security of the request.
[0039] Step S103: If the verification passes, the user request is parsed to obtain the content to be processed.
[0040] In some embodiments, the text field and rich text field requested by the user are parsed; the plain text information of the rich text field is extracted; a string list is constructed by combining the text field and the plain text information, and the string list is used as the content to be processed.
[0041] Optionally, if the user request only includes text fields, then the text fields are compiled into a list of strings, and the list of strings is used as the content to be processed.
[0042] Furthermore, the content to be processed undergoes format and semantic checks to remove empty, invalid, and unreasonable fields.
[0043] In this embodiment, if the verification passes, the user request is parsed to obtain the content to be processed, which can accurately extract the required content, reduce the probability of error processing, and help remove irrelevant information and format the input.
[0044] Step S104: Extract features of the content to be processed.
[0045] Specifically, the characteristics of the content to be processed include text length, content type, and processing scenario.
[0046] In some embodiments, the text length, content type, and processing scenario of the content to be processed are extracted.
[0047] In this embodiment, extracting features of the content to be processed is beneficial for accurate subsequent AI model scheduling, matching the corresponding processing flow, and improving response quality and speed.
[0048] Step S105: Based on the type of user request and the characteristics of the content to be processed, schedule the corresponding AI model to process the content to be processed and generate the target content.
[0049] In some embodiments, a first threshold is obtained; if the user request is of the translation type and the text length is less than or equal to the first threshold, a first AI translation model is scheduled to process the content to be processed and generate target content; if the user request is of the translation type and the text length is greater than the first threshold, a second AI translation model is scheduled to process the content to be processed and generate target content.
[0050] Optionally, if the user request is a content rewriting request, the URL of the content rewriting request is obtained, and the second AI generation model is scheduled to perform webpage collection and content rewriting based on the URL to obtain the target content; if the user request is an article generation request, the keywords of the article generation request are obtained, and the first AI generation model is scheduled to perform online search and content generation based on the keywords to obtain the target content.
[0051] Furthermore, a second threshold is obtained; if the user request type is an article generation request and the length of the target content is less than the second threshold, the third AI generation model is scheduled to perform streaming expansion of the target content and update the target content.
[0052] The process involves creating an asynchronous task and returning a task identifier to the user; storing the user's request parameters and the task identifier in a cache and starting an asynchronous thread to call the AI model; periodically polling the server for the processing results based on the task identifier; and storing the results in a cache and updating the task status after asynchronous processing is complete, so that the user can poll for them.
[0053] Optionally, the rich text format and website language version requested by the user are obtained; the target content is populated back into the rich text format to obtain the target format content; and the target format content is saved to the website language version.
[0054] In some embodiments, an AI model is invoked to generate image prompts based on the target content; an image generation model is invoked to generate accompanying images based on the image prompts; and the accompanying images are saved to the website resource library and associated with the target content.
[0055] In this embodiment, based on the type of user request and the characteristics of the content to be processed, the corresponding AI model is scheduled to process the content to be processed and generate the target content. This achieves intelligent scheduling of different AI models, which is beneficial for dealing with different types of requests, optimizing processing efficiency, reducing costs, and improving user experience.
[0056] Steps S101 to S105 as illustrated in this embodiment involve: obtaining a user request and determining its type; responding to the user request by performing permission and resource verification based on its type; parsing the user request to obtain the content to be processed if the verification passes; extracting features of the content to be processed, which facilitates accurate AI model scheduling, matching appropriate processing flows, and improving response quality and speed; and scheduling the corresponding AI model to process the content to be processed based on the type of the user request and the features of the content to be processed, generating target content, and achieving intelligent scheduling of different AI models, which helps to cope with different types of requests, optimize processing efficiency, reduce costs, and improve user experience.
[0057] Please see Figure 2 In some embodiments, step S105 may include, but is not limited to, steps S201 to S207: Step S201: Obtain the first threshold.
[0058] Specifically, the first threshold is the user text length threshold.
[0059] In step S201 of some embodiments, a user text length threshold is obtained.
[0060] Optionally, the first threshold is 4096 tokens.
[0061] In step S202, if the user request is for translation and the text length is less than or equal to the first threshold, the first AI translation model is scheduled to process the content to be processed and generate the target content.
[0062] In step S202 of some embodiments, it is determined whether the type of the user request is a translation type, and if so, it is determined whether the text length is less than or equal to a first threshold.
[0063] Understandably, if the user request is for translation and the text length is less than or equal to the first threshold, the model with the advantage of translating less content will be scheduled to process the content to be processed and generate the target content.
[0064] Optionally, the first AI translation model is the GPT-3.5 model.
[0065] Step S203: If the user request is for translation and the text length is greater than the first threshold, then the second AI translation model is scheduled to process the content to be processed and generate the target content.
[0066] In step S203 of some embodiments, if the user request is of the translation type and the text length is less than or equal to a first threshold, then the model that has the advantage of translating longer content is scheduled to process the content to be processed and generate the target content.
[0067] Optionally, the second AI translation model is the Google Cloud Translation V3 model.
[0068] Step S204: If the user request type is a content rewriting request, then obtain the URL of the content rewriting request, and schedule the second AI generation model to perform webpage collection and content rewriting based on the URL to obtain the target content; In step S204 of some embodiments, if the user request is a content rewriting request, the URL of the content rewriting request input by the user is obtained, and the second AI generation model is scheduled to collect web pages and rewrite content based on the URL and user requirements (title, description, keywords and summary) to obtain the target content.
[0069] Step S205: If the user request type is an article generation request, then obtain the keywords of the article generation request, and schedule the first AI generation model to perform online search and content generation based on the keywords to obtain the target content.
[0070] In step S205 of some embodiments, if the type of user request is an article generation request, then the keywords entered by the user in the article generation request are obtained.
[0071] Step S206: Obtain the second threshold.
[0072] Specifically, the second threshold is the AI text length threshold, which is used to determine whether the target content needs to be expanded.
[0073] Step S207: If the user request type is an article generation request and the length of the target content is less than the second threshold, the third AI generation model is scheduled to perform streaming expansion of the target content and update the target content.
[0074] Understandably, if the target content is smaller than the text length threshold, the target content needs to be expanded, and the expanded content is used as the target content.
[0075] In this embodiment, based on the type of user request and the characteristics of the content to be processed, the corresponding AI model is scheduled to process the content to be processed, generate the target content, and then expand it, thereby realizing the intelligent scheduling of multiple different AI models.
[0076] Please see Figure 3 In some embodiments, the content generation method provided in this application further includes a rich text filling step, which may include, but is not limited to, steps S301 to S303: Step S301: Obtain the rich text format and website language version requested by the user.
[0077] In step S301 of some embodiments, rich text format data is obtained, and the website language version set by the user is obtained.
[0078] Step S302: Fill the target content back into the rich text format to obtain the target format content.
[0079] In step S302 of some embodiments, the target content is backfilled into the rich text format using a JavaScript library (such as Quill, TinyMCE, etc.) to obtain the target format content.
[0080] Step S303: Save the target format content to the website's language version.
[0081] In step S303 of some embodiments, it is determined whether the target format content is the same as the website language version. If they are the same, the target format content is saved to the website language version. If they are different, the target format content is converted and saved to the website language version.
[0082] Understandably, this embodiment does not disrupt the page style when processing rich text formats, and the translation results are better for continuous text scattered across multiple HTML nodes.
[0083] Please see Figure 4 In some embodiments, the content generation method provided in this application further includes an image association step, which may include, but is not limited to, steps S401 to S403: Step S401: Based on the target content, call the AI model to generate image prompts.
[0084] In step S401 of some embodiments, an AI model is invoked to analyze the topic, keywords, context, etc. of the target content to obtain the elements in the target content that need to be visualized.
[0085] Step S402: Based on the image prompts, call the image generation model to generate an accompanying image.
[0086] In step S402 of some embodiments, an image generation model is invoked to generate an image based on the prompt word.
[0087] Optionally, the generated image can be cropped and processed to meet the requirements for illustration.
[0088] Step S403: Save the accompanying image to the website resource library and associate it with the target content.
[0089] In step S403 of some embodiments, the generated image is saved to the website's resource library and associated with the target content.
[0090] Figure 5 This is a schematic diagram of the overall system architecture when the content generation method provided in this application is applied to a multi-AI model collaborative website content streaming generation and intelligent translation system. Figure 6 This is a technical flowchart illustrating the application of the content generation method provided in this application to a multi-AI model collaborative website content streaming generation and intelligent translation system. Figure 6 The methods may include, but are not limited to, the following steps: Step 1: The user requests article generation / intelligent translation.
[0091] Optionally, in response to a user's content generation or translation request, permission and resource verification are performed, wherein the content generation request verifies the generation function permission and resource permission, and the translation request verifies the translation function permission. Step 2: The management system performs task scheduling and permission verification.
[0092] Step 3, content processing and distribution.
[0093] If the verification passes, the content to be processed is parsed. For rich text content, its plain text information is extracted for subsequent translation. Based on the characteristics of the content to be processed, the corresponding AI model is intelligently scheduled for processing. These characteristics include text length, content type, and processing scenario. The process involves creating an asynchronous task and returning a task identifier to the user; storing the user's request parameters and the task identifier in a cache and starting an asynchronous thread to call the AI model; periodically polling the server for the processing results based on the task identifier; and storing the results in a cache and updating the task status after asynchronous processing is complete, so that the user can poll for them.
[0094] Step 4: The AI translation model group (GPT-3.5 / Google Translate, etc.) performs rich text extraction and backfilling.
[0095] Specifically, the first AI translation model is the GPT-3.5 model, and the first threshold is 4096 tokens; the second AI translation model is the Google Cloud Translation V3 model.
[0096] Optionally, the scheduled AI model can be invoked to process the content to be processed, generating the target content or translation results.
[0097] Specifically, if the content to be processed is plain text to be translated and its length is less than or equal to the first threshold, the first AI translation model is scheduled to process it; if the content to be processed is plain text to be translated and its length is greater than the first threshold, the second AI translation model is scheduled to process it.
[0098] Step 5: The AI-generated model group (Doubao / GLM, etc.) expands the content and optimizes SEO.
[0099] Optionally, for content generation requests, the generated content is returned to the user terminal in a streaming manner using a server push event SSE long connection; Specifically, if the content to be processed is an article generation request based on keywords, the first AI generation model is scheduled to perform online search and content generation; if the content to be processed is a content rewriting request based on a URL, the second AI generation model is scheduled to perform webpage collection and content rewriting.
[0100] Furthermore, if the number of characters in the generated content is less than the second threshold, the third AI generation model is further scheduled to perform streaming expansion on the generated content; the third AI generation model is the GLM-4-Flash streaming model.
[0101] Step 6: Store the processing results in the database / cache.
[0102] The completed target content or plain text translation results are then populated back into a rich text format and saved to the website's language version selected by the user.
[0103] Step 7: The result is returned to the user via SSE push or polling.
[0104] Optionally, an AI model can be invoked to generate titles, descriptions, and keyword tags based on keywords; the generated titles, descriptions, and keyword tags can then be populated into the corresponding configuration items of website category pages, articles, or products.
[0105] Furthermore, based on the generated article content, an AI model is invoked to generate image prompts; based on the image prompts, an image generation model is invoked to generate accompanying images; the accompanying images are saved to the website resource library and associated with the corresponding articles.
[0106] Specifically, Example 1: Taking a user translating a category page as an example, the process is as follows: Figure 7 As shown.
[0107] After selecting the target language and category page, the user submits a request. The system first verifies whether the user's site version has translation permissions and whether the current number of translated characters exceeds the limit. If the verification passes, the system parses all modules under the category page, iterating through each field that needs translation (such as the content of text modules, the alt description of image modules, etc.). For each field value, if it is rich text (such as content from a UE editor), the Jsoup library is used to parse the HTML, extracting all plain text nodes to form a list of strings to be translated.
[0108] The system determines the total length of all text in the string list. If the total length is ≤ 4096 tokens, a request is constructed to call the GPT-3.5 API for translation; if the total length is > 4096 tokens, the Google Cloud Translation V3 API is called for translation. After translation, the system re-inserts the translated text list into the corresponding positions of the HTML nodes in their original order, thus generating a rich text string that retains the original style but whose content has been translated. Finally, the system copies the translated entire category page data to the user-selected language version, completing the translation.
[0109] Example 2: Taking a user-generated SEO intelligent article as an example, the process is as follows: Figure 8 As shown.
[0110] After the user enters keywords and selects a generation option, the system immediately creates an asynchronous task and returns the task key to the front end. The back end uses the `CompletableFuture.runAsync()` method to asynchronously call the DOUBAO online search model (MODEL_DOUBAO_PRO_32K_BOT_SEARCH_ENGINE). After receiving the key, the front end starts a poller that queries the server for the task result corresponding to the key every 1.5 seconds.
[0111] Once the Doubao model returns the initial article content, the system caches it and updates the task status. If the content is less than 1200 words, the system initiates an SSE long-connection request to expand the article using the GLM-4-Flash streaming model. The server pushes the expanded content fragments to the front end multiple times via the SSE connection, and the front end renders them in real-time with a "typewriter" effect. After all content is generated, if the user selects smart image matching, the system continues to asynchronously call the GLM model to generate image prompts, then calls the CogView-3-plus model to generate images, and finally saves the images to the resource library and associates them with the article.
[0112] Example 3: Taking user-initiated webpage scraping and rewriting as an example, the process is as follows: Figure 9 As shown.
[0113] Users enter the URL of the article to be collected and choose whether to generate TDK (title, description, keywords) and abstract at the same time.
[0114] Upon receiving a request, the system first verifies the user's permissions (e.g., whether the site version supports AI functionality, whether there are still available characters, etc.). If the verification passes, the system immediately creates an asynchronous rewrite task and returns its unique identifier key to the frontend. The frontend then initiates a polling mechanism, querying the server for the task's result every 1.5 seconds.
[0115] In the backend, the system starts an asynchronous thread, first calling the DOUBAO webpage parsing model (MODEL_DOUBAO_PRO_32K_BOT_WEB_PAGE). This model accesses the URL provided by the user, crawls the main content of the webpage, and rewrites it based on its semantics to generate an original article with a similarity of less than 10%. After the rewriting is complete, the system stores the generated article content and the summary extracted from the content (if selected by the user) in the cache, and updates the task status to "success".
[0116] Once the frontend detects a successful task through polling, it retrieves the rewritten article content from the cache and renders it in the editing box for users to view, edit, or publish directly. This entire process, through asynchronous and decoupled mechanisms, effectively avoids operation failures due to network request timeouts, improving functionality stability and user experience.
[0117] Example 4: Taking the creation of batch AI writing tasks by users as an example, the process is as follows: Figure 10 As shown.
[0118] In the article management backend, users can select "AI Batch Writing" under the "Batch Creation" function. Users first choose the task type ("SEO Smart Article" or "Webpage Collection and Rewriting"). If "SEO Smart Article" is selected, users need to enter multiple keywords (they can enter them manually or obtain AI-recommended keywords through the "Smart Keyword Generation" function); if "Webpage Collection and Rewriting" is selected, multiple valid article URLs need to be entered.
[0119] Next, the user configures the publishing settings, including: selecting a unified category for all generated articles, setting the publishing time (immediate or scheduled), and deciding whether to generate accompanying images and title tags (TDK). After completing the settings, the user submits a request to create a batch task.
[0120] After receiving the request in the background, the system does not generate all articles synchronously. Instead, it first creates a main batch task record and creates a subtask for each keyword or each URL. All subtasks are initially in the "pending" state.
[0121] The system processes these subtasks asynchronously through a task scheduling system. For each subtask, the processing logic is exactly the same as the single-article generation process (see Examples 2 and 3), including calling the corresponding AI model, streaming output, and intelligent image matching. After each article is generated and published, the status of the corresponding subtask is updated to "success" or "failure".
[0122] The beneficial effects of this invention are as follows: 1. Multi-model intelligent collaboration: By formulating clear scheduling rules, the advantages of different AI models are fully utilized (such as GPT-3.5's high cost-effectiveness and Google Translate's proficiency in long texts), optimizing costs while ensuring effectiveness.
[0123] 2. Enhanced Streaming Experience: Employing SSE technology enables real-time streaming of generated content, transforming passive waiting into active reception, significantly reducing the perceived waiting time for users and avoiding request timeouts.
[0124] 3. Deep website integration: Seamlessly embeds AI capabilities into the management process of the website building backend, supports the processing of various website elements such as columns, articles, products, TDK, rich text, etc., and provides batch operation and scheduled publishing functions, which greatly improves the operational efficiency of website owners.
[0125] 4. Rich Text Friendly Processing: By extracting plain text, translating it, and then backfilling it, the original page style and format are effectively preserved, solving the style disorder problem that may be caused by directly translating HTML.
[0126] Please see Figure 11 This application also provides a content generation apparatus that can implement the above-described method. The apparatus includes: The request acquisition module 1101 is used to acquire user requests and determine the type of user requests. The types of user requests include content generation type and translation type. User requests include content generation requests and translation requests. Verification module 1102 is used to respond to user requests and perform permission and resource verification based on the type of user request; The parsing module 1103 is used to parse the user request to obtain the content to be processed if the verification passes. Feature extraction module 1104 is used to extract features of the content to be processed, including text length, content type and processing scenario; The generation module 1105 is used to schedule the corresponding AI model to process the content to be processed based on the type of user request and the characteristics of the content to be processed, and generate the target content.
[0127] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0128] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0129] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0130] Please see Figure 12 , Figure 12 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1201 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1202 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1202 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1202 and is called and executed by the processor 1201 using the methods described in the embodiments of this application. The input / output interface 1203 is used to implement information input and output; The communication interface 1204 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1205 transmits information between various components of the device (e.g., processor 1201, memory 1202, input / output interface 1203, and communication interface 1204); The processor 1201, memory 1202, input / output interface 1203 and communication interface 1204 are connected to each other within the device via bus 1205.
[0131] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0132] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0133] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0134] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0135] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0136] The content generation method, apparatus, electronic device, storage medium, and program product provided in this application embodiment obtain user requests and determine the type of user requests; respond to user requests and perform permission and resource verification based on the type of user requests; if the verification passes, parse the user request to obtain content to be processed; extract the features of the content to be processed, which is beneficial for accurate AI model scheduling, matching the corresponding processing flow, and improving response quality and speed; according to the type of user requests and the features of the content to be processed, schedule the corresponding AI model to process the content to be processed and generate target content, realizing intelligent scheduling of different AI models, which is beneficial for dealing with different types of requests, optimizing processing efficiency, reducing costs, and improving user experience.
[0137] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0138] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0139] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0141] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0142] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0143] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0144] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0145] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0146] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0147] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A content generation method, characterized in that, The method includes the following steps: Obtain user requests and determine the type of the user requests, which includes content generation type and translation type. In response to the user request, perform permission and resource verification based on the type of the user request; If the verification passes, the user request is parsed to obtain the content to be processed; Extract the features of the content to be processed, including text length, content type, and processing scenario; Based on the type of the user request and the characteristics of the content to be processed, the corresponding AI model is scheduled to process the content to be processed and generate the target content.
2. The method according to claim 1, characterized in that, The step of responding to the user request and performing permission and resource verification based on the type of the user request includes: If the type of the user request is the content generation type, in response to the user request, perform generation function permission and resource permission verification; If the user request is of the translation type, in response to the user request, a translation function permission verification is performed.
3. The method according to claim 1, characterized in that, The step of scheduling a corresponding AI model to process the content to be processed based on the type of the user request and the characteristics of the content to be processed, and generating target content, includes: Obtain a first threshold, where the first threshold is the user text length threshold; If the user request is of the translation type and the text length is less than or equal to the first threshold, then the first AI translation model is scheduled to process the content to be processed and generate the target content. If the user request is of the translation type and the text length is greater than the first threshold, then the second AI translation model is scheduled to process the content to be processed and generate the target content.
4. The method according to claim 1, characterized in that, The content generation request includes article generation requests and content rewriting requests. The step of scheduling a corresponding AI model to process the content to be processed and generate target content, based on the type of the user request and the characteristics of the content to be processed, includes: If the user request is a content rewriting request, then the URL of the content rewriting request is obtained, and the second AI generation model is scheduled to perform webpage collection and content rewriting based on the URL to obtain the target content; If the user request is an article generation request, then the keywords of the article generation request are obtained, and the first AI generation model is scheduled to perform online search and content generation based on the keywords to obtain the target content; Obtain the second threshold, which is the AI text length threshold; If the user request is an article generation request and the length of the target content is less than the second threshold, the third AI generation model is scheduled to perform streaming expansion of the target content and update the target content.
5. The method according to claim 1, characterized in that, The process of parsing the user request to obtain the content to be processed includes: Parse the text field and rich text field requested by the user; Extract the plain text information from the rich text field; The text field and the plain text information are combined to form a string list, which is then used as the content to be processed.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the rich text format and website language version requested by the user; The target content is then filled back into the rich text format to obtain the target format content; Save the target format content to the website's language version.
7. A content generation device, characterized in that, The device includes: The request acquisition module is used to acquire user requests and determine the type of the user requests. The types of user requests include content generation type and translation type. The user requests include content generation requests and translation requests. The verification module is used to respond to the user request and perform permission and resource verification based on the type of the user request; The parsing module is used to parse the user request to obtain the content to be processed if the verification passes. The feature extraction module is used to extract features of the content to be processed, including text length, content type, and processing scenario. The generation module is used to schedule the corresponding AI model to process the content to be processed based on the type of the user request and the characteristics of the content to be processed, and generate the target content.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.