An AI generation task-oriented parameter reuse frequency counting method and system

CN122986244APending Publication Date: 2026-10-27宝宝巴士股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610889278.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

用户可以在任务列表中查看到每条任务的历史记录,但系统缺乏对同一参数组合在多个任务间的复用行为进行系统性追踪与统计分析的能力,无法适配平台规模化用户运维、精细化运营管控需求

Benefits of technology

[0017]本发明的有益效果在于:对成功完成的当前AI生成任务会生成两组差异化的哈希指纹,第一哈希指纹基于模型参数字符串生成,能够识别全参数无修改的纯抽卡重试行为,第二哈希指纹基于剔除提示词的模型参数字符串生成,能够识别仅修改提示词的微调试探索行为,无需人工对比,即可区分用户微调试的探索行为与随机概率式的抽卡行为,满足平台规模化用户运维、精细化运营管控需求。在进行参数复用频次统计时,针对不同哈希指纹分别采用乒乓链式计数算法,在同源哈希指纹的链路下,提取最大的第一字段值自增后赋值给当前AI生成任务,并同步批零清零其他历史AI生成任务,在AI生成场景下能够对同一参数组合在多个任务间的复用行为进行系统性追踪与分析,既完整留存全量的历史AI生成任务,保障历史可溯源,又避免计数堆叠、视觉冗余等问题,便于后续对用户的可视化展示,优化用户体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986244A_ABST
    Figure CN122986244A_ABST
Patent Text Reader

Abstract

The application relates to a parameter reuse frequency counting method and system for an AI generation task, wherein when the current AI generation task is successfully completed, the model parameter string of the current AI generation task and the model parameter string after removing the prompt word are subjected to hash calculation, the obtained first hash fingerprint and second hash fingerprint are matched with historical AI generation tasks respectively, a first target task set and a second target task set are obtained, the field value of a first reuse counting field of the current AI generation task and the field value of a second reuse counting field of the current AI generation task are calculated through a ping-pong chain counting algorithm, and parameter reuse frequency counting is completed. Therefore, the application can systematically track and analyze the reuse behavior of the same parameter combination among multiple tasks in the AI generation scene, and meets the platform scale user operation and maintenance, and the fine operation and control requirement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and system for statistical analysis of parameter reuse frequency for AI generation tasks. Background Technology

[0002] With the rapid development of AI-generated technologies, AI-based image and video generation services have been widely used on various internet platforms. Users submit task requests containing prompts and model parameters, and the cloud-based AI computing power cluster schedules computing power to generate and return the task results.

[0003] In real-world applications, users often need to make multiple attempts and retries to achieve satisfactory results. They may fine-tune prompts or submit the same generation task repeatedly without changing any parameters, hoping to obtain the desired result in a single retrieval. This type of retrieval behavior is a common "random card-drawing" generation behavior in AI generation tasks, and the number of times the same parameter combination is repeatedly generated becomes an important indicator of the effectiveness of the generation strategy.

[0004] Currently, existing AI-generated task management systems typically only record the task's creation time, execution status, and final result, managing and displaying information at the individual task level. Users can view the historical records of each task in the task list, but the system lacks the ability to systematically track and statistically analyze the reuse of the same parameter combinations across multiple tasks, failing to meet the platform's needs for large-scale user maintenance and refined operational control. Summary of the Invention

[0005] The technical problem to be solved by this invention is: This invention provides a method and system for statistical analysis of parameter reuse frequency for AI generation tasks, which can systematically track and analyze the reuse behavior of the same parameter combination in multiple tasks in AI generation scenarios, thereby meeting the needs of large-scale user operation and maintenance and refined operation and management of the platform.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for statistical analysis of parameter reuse frequency for AI generation tasks, comprising: When the current AI generation task is successfully completed, the model parameter string of the current AI generation task is obtained, the model parameter string is hashed to obtain the first hash fingerprint, and the prompt words in the model parameter string are removed to obtain the removed model parameter string. The removed model parameter string is hashed to obtain the second hash fingerprint. The first hash fingerprint and the second hash fingerprint are respectively matched with historical AI-generated tasks to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; The ping-pong chain counting algorithm is used to extract the largest first field value from the first reuse count field values ​​in the first target task set. The largest first field value is incremented by 1 and used as the field value of the first reuse count field for the current AI generation task. At the same time, the field values ​​of the first reuse count field for historical AI generation tasks in the first target task set are batch-reset to zero. Simultaneously, the largest second field value from the second reuse count field values ​​is extracted from the second target task set. The largest second field value is incremented by 1 and used as the field value of the second reuse count field for the current AI generation task. At the same time, the field values ​​of the second reuse count field for historical AI generation tasks in the second target task set are batch-reset to zero, thus completing the parameter reuse frequency statistics.

[0007] The beneficial effects of this invention are as follows: For each successfully completed AI generation task, two differentiated hash fingerprints are generated. The first hash fingerprint, generated based on the model parameter string, can identify pure card-drawing retry behavior with no parameter modifications. The second hash fingerprint, generated based on the model parameter string after removing prompt words, can identify micro-debugging exploration behavior with only prompt words modified. Without manual comparison, it can distinguish between user micro-debugging exploration behavior and random probability-based card-drawing behavior, meeting the platform's needs for large-scale user operation and maintenance and refined operational management. When counting parameter reuse frequency, a ping-pong chain counting algorithm is used for different hash fingerprints. Under the same hash fingerprint chain, the largest first field value is extracted, incremented, and assigned to the current AI generation task, while simultaneously clearing other historical AI generation tasks. In AI generation scenarios, it can systematically track and analyze the reuse behavior of the same parameter combination across multiple tasks, completely retaining all historical AI generation tasks to ensure historical traceability, while avoiding problems such as count stacking and visual redundancy, facilitating subsequent visualization for users and optimizing user experience.

[0008] Optionally, obtaining the model parameter string of the current AI-generated task and performing a hash calculation on the model parameter string includes: Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task. Match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not, terminate the parameter reuse frequency statistics.

[0009] As described above, a two-layer pre-validation logic is implemented to balance the accuracy of frequency statistics with the utilization of system resources. Parameter reuse frequency statistics are only performed on the current AI generation tasks corresponding to AI vendors listed in the vendor whitelist, enabling tiered control over AI vendors. This can filter out invalid generation tasks from testing vendors and non-standard vendors. Furthermore, parameter reuse frequency statistics are only performed on model parameter strings containing Uniform Resource Locators (URIs). Relying on URIs, pure text generation tasks without reference resources can be filtered, saving computational resources and reducing system read / write pressure.

[0010] Optionally, obtaining the first target task set matching the first hash fingerprint and the second target task set matching the second hash fingerprint includes: Obtain the current model name and current task ID of the current AI-generated task; Historical AI-generated tasks with the same name as the current model are selected from the first target task set and the second target task set, respectively, to obtain the first target task set and the second target task set after filtering; Remove historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set; Get the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time get the second historical task status of all historical AI-generated tasks in the second target task set after removal. The first set of historical AI-generated tasks with the status of failure is filtered out from the first set of target tasks to obtain the final first set of target tasks. Similarly, the second set of historical AI-generated tasks with the status of failure is filtered out from the second set of target tasks to obtain the final second set of target tasks.

[0011] As described above, filtering out historical AI-generated tasks with the same name as the current model can avoid mismatches between different models and those with the same hash fingerprint, ensuring that parameter reuse frequency statistics are only effective within the same model. Removing historical AI-generated tasks with the same ID as the current task avoids logical errors in parameter reuse frequency statistics during matching. Filtering out historical AI-generated tasks with failed status ensures that all AI-generated tasks participating in parameter reuse frequency statistics are valid user retry behaviors. By combining model name, task ID, and task status as triple filtering constraints, effective and homogeneous AI-generated tasks can be accurately purified, improving the accuracy of parameter reuse frequency statistics.

[0012] Optionally, before extracting the largest first field value from the field values ​​of the first reuse count field in the first target task set using the ping-pong chain counting algorithm, the following steps are included: Obtain the user ID bound to the current AI generation task, acquire a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The completion of parameter reuse frequency statistics includes: Actively release the Redis distributed lock.

[0013] As described above, a Redis distributed lock is acquired using the user ID as the lock dimension. Parameter reuse frequency statistics are then performed within this Redis distributed lock, rather than using a globally unified lock. Parameter reuse frequency statistics among different users can be executed in parallel without reducing the overall task processing throughput of the platform. Furthermore, the Redis distributed lock approach ensures that when multiple AI generation tasks from the same source are submitted consecutively by the same user within milliseconds, parameter reuse frequency statistics and database updates are executed serially. This solves the data contention problem caused by parallel queries and modifications of multiple tasks under a distributed asynchronous architecture, adapting to high-concurrency business scenarios with peak periods of batch generation and high-frequency retries.

[0014] Optionally, the parameter reuse frequency statistics within the Redis distributed lock include: Obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds a first threshold, and if so, actively release the Redis distributed lock.

[0015] As described above, Redis distributed locks that have been in use for a duration exceeding the first threshold will be actively released to prevent issues such as service outages, network terminal failures, or other sudden anomalies from causing Redis distributed locks to fail to be released or to result in permanent deadlocks, thereby improving the stability of the platform.

[0016] Secondly, the present invention provides a parameter reuse frequency statistics system for AI generation tasks, comprising: The hash fingerprint calculation module is used to obtain the model parameter string of the current AI generation task when the current AI generation task is successfully completed, perform hash calculation on the model parameter string to obtain the first hash fingerprint, remove the prompt words in the model parameter string to obtain the removed model parameter string, and perform hash calculation on the removed model parameter string to obtain the second hash fingerprint. The matching module is used to match the first hash fingerprint and the second hash fingerprint with historical AI-generated tasks respectively, to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; The frequency statistics module is used to extract the largest first field value from the first reuse count field values ​​in the first target task set using a ping-pong chain counting algorithm, increment the largest first field value by 1 and use it as the field value of the first reuse count field for the current AI generation task, and simultaneously batch reset the field values ​​of the first reuse count field for historical AI generation tasks in the first target task set to zero. Simultaneously, it extracts the largest second field value from the second reuse count field values ​​in the second target task set, increments the largest second field value by 1 and uses it as the field value of the second reuse count field for the current AI generation task, and simultaneously batch resets the field values ​​of the second reuse count field for historical AI generation tasks in the second target task set to zero, thus completing the parameter reuse frequency statistics.

[0017] The beneficial effects of this invention are as follows: For each successfully completed AI generation task, two differentiated hash fingerprints are generated. The first hash fingerprint, generated based on the model parameter string, can identify pure card-drawing retry behavior with no parameter modifications. The second hash fingerprint, generated based on the model parameter string after removing prompt words, can identify micro-debugging exploration behavior with only prompt words modified. Without manual comparison, it can distinguish between user micro-debugging exploration behavior and random probability-based card-drawing behavior, meeting the platform's needs for large-scale user operation and maintenance and refined operational management. When counting parameter reuse frequency, a ping-pong chain counting algorithm is used for different hash fingerprints. Under the same hash fingerprint chain, the largest first field value is extracted, incremented, and assigned to the current AI generation task, while simultaneously clearing other historical AI generation tasks. In AI generation scenarios, it can systematically track and analyze the reuse behavior of the same parameter combination across multiple tasks, completely retaining all historical AI generation tasks to ensure historical traceability, while avoiding problems such as count stacking and visual redundancy, facilitating subsequent visualization for users and optimizing user experience.

[0018] Optionally, the hash fingerprint calculation module specifically comprises: Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task. Match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not, terminate the parameter reuse frequency statistics.

[0019] As described above, a two-layer pre-validation logic is implemented to balance the accuracy of frequency statistics with the utilization of system resources. Parameter reuse frequency statistics are only performed on the current AI generation tasks corresponding to AI vendors listed in the vendor whitelist, enabling tiered control over AI vendors. This can filter out invalid generation tasks from testing vendors and non-standard vendors. Furthermore, parameter reuse frequency statistics are only performed on model parameter strings containing Uniform Resource Locators (URIs). Relying on URIs, pure text generation tasks without reference resources can be filtered, saving computational resources and reducing system read / write pressure.

[0020] Optionally, the matching module specifically comprises: Obtain the current model name and current task ID of the current AI-generated task; Historical AI-generated tasks with the same name as the current model are selected from the first target task set and the second target task set, respectively, to obtain the first target task set and the second target task set after filtering; Remove historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set; Get the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time get the second historical task status of all historical AI-generated tasks in the second target task set after removal. The first set of historical AI-generated tasks with the status of failure is filtered out from the first set of target tasks to obtain the final first set of target tasks. Similarly, the second set of historical AI-generated tasks with the status of failure is filtered out from the second set of target tasks to obtain the final second set of target tasks.

[0021] As described above, filtering out historical AI-generated tasks with the same name as the current model can avoid mismatches between different models and those with the same hash fingerprint, ensuring that parameter reuse frequency statistics are only effective within the same model. Removing historical AI-generated tasks with the same ID as the current task avoids logical errors in parameter reuse frequency statistics during matching. Filtering out historical AI-generated tasks with failed status ensures that all AI-generated tasks participating in parameter reuse frequency statistics are valid user retry behaviors. By combining model name, task ID, and task status as triple filtering constraints, effective and homogeneous AI-generated tasks can be accurately purified, improving the accuracy of parameter reuse frequency statistics.

[0022] Optionally, the frequency statistics module is located in the distributed lock module, and the distributed lock module specifically comprises: Obtain the user ID bound to the current AI generation task, acquire a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The frequency statistics module specifically includes: Actively release the Redis distributed lock.

[0023] As described above, a Redis distributed lock is acquired using the user ID as the lock dimension. Parameter reuse frequency statistics are then performed within this Redis distributed lock, rather than using a globally unified lock. Parameter reuse frequency statistics among different users can be executed in parallel without reducing the overall task processing throughput of the platform. Furthermore, the Redis distributed lock approach ensures that when multiple AI generation tasks from the same source are submitted consecutively by the same user within milliseconds, parameter reuse frequency statistics and database updates are executed serially. This solves the data contention problem caused by parallel queries and modifications of multiple tasks under a distributed asynchronous architecture, adapting to high-concurrency business scenarios with peak periods of batch generation and high-frequency retries.

[0024] Optionally, the distributed lock module includes: The judgment module is used to obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds a first threshold, and if so, actively release the Redis distributed lock.

[0025] As described above, Redis distributed locks that have been in use for a duration exceeding the first threshold will be actively released to prevent issues such as service outages, network terminal failures, or other sudden anomalies from causing Redis distributed locks to fail to be released or to result in permanent deadlocks, thereby improving the stability of the platform. Attached Figure Description

[0026] Figure 1 This is a flowchart of a parameter reuse frequency statistics method for AI generation tasks provided in this embodiment; Figure 2 This is a schematic diagram of the overall process of a parameter reuse frequency statistics method for AI generation tasks provided in this embodiment; Figure 3 This is a schematic diagram of the structure of a parameter reuse frequency statistics system for AI generation tasks provided in this embodiment.

[0027] [Explanation of Labels in the Attached Image] 1. A parameter reuse frequency statistics system for AI generation tasks; 2. Hash fingerprint calculation module; 21. Verification module; 3. Matching module; 4. Distributed Lock Module; 41. Frequency Statistics Module; 42. Judgment Module. Detailed Implementation

[0028] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.

[0029] Example 1 Please refer to Figures 1 to 2 This invention provides a method for statistical analysis of parameter reuse frequency for AI generation tasks, comprising the following steps: S1. When the current AI generation task is successfully completed, obtain the model parameter string of the current AI generation task, perform hash calculation on the model parameter string to obtain the first hash fingerprint, and remove the prompt words in the model parameter string to obtain the removed model parameter string. Perform hash calculation on the removed model parameter string to obtain the second hash fingerprint. In this embodiment, only the parameter reuse frequency of successfully completed AI generation tasks is counted, such as... Figure 2 As shown, when the current AI generation task is successfully completed, the model parameter string for the current AI human generation task is obtained. The model parameter string refers to all configuration parameters, including: prompt words, a list of reference image URLs, model name, resolution, scale, style parameters, and other configuration information related to the generation strategy. A hash calculation is performed on the model parameter string to obtain the first hash fingerprint. Simultaneously, prompt words are removed from the model parameter string, and a hash calculation is performed on the remaining model parameter string to obtain the second hash fingerprint.

[0030] That is, the first hash fingerprint is used to identify pure card-drawing retry behavior with no modification to any parameters, and the second hash fingerprint is used to identify micro-debugging exploration behavior with only modification of the prompt words.

[0031] At this point, step S1, which involves obtaining the model parameter string of the current AI-generated task and performing a hash calculation on the model parameter string, includes: S11. Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task, match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not contain it, terminate the parameter reuse frequency statistics.

[0032] In this embodiment, as Figure 2As shown, a two-layer pre-validation logic is set up to match the AI ​​vendor identifier of the current AI generation task with the vendor whitelist. If the match fails, the parameter reuse frequency statistics are terminated. The vendor whitelist is pre-built. If the match is successful, it is further determined whether the model parameter string contains a Uniform Resource Locator (URL). If it does not contain a URL, it means that it is a plain text generation task without reference resource class, which has no statistical significance. Therefore, the parameter reuse frequency statistics are terminated. Otherwise, if it contains a URL, the two-layer hash calculation is performed.

[0033] To avoid confusion between AI vendor identifiers and model names, Table 1 is provided for differentiation.

[0034] Table 1. Comparison of AI Vendor Identifiers and Model Names

[0035] S2. Match the first hash fingerprint and the second hash fingerprint with historical AI-generated tasks respectively to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; In this embodiment, as Figure 2 As shown, the first hash fingerprint and the second hash fingerprint are matched with the historical AI generation tasks respectively. The historical AI generation tasks refer to the successfully completed historical AI generation tasks, and each successfully completed historical AI generation task is recorded with the corresponding first hash fingerprint and second hash fingerprint.

[0036] At this point, obtaining the first target task set matching the first hash fingerprint and the second target task set matching the second hash fingerprint in step S2 includes: S21. Obtain the current model name and current task ID of the current AI-generated task; S22. Select historical AI-generated tasks with the same name as the current model from the first target task set and the second target task set respectively, to obtain the first target task set and the second target task set after filtering; S23. Remove the historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set. S24. Obtain the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time obtain the second historical task status of all historical AI-generated tasks in the second target task set after removal. S25. Filter the historical AI generation tasks with the first historical task status of failure from the first target task set after removal to obtain the final first target task set. Filter the historical AI generation tasks with the second historical task status of failure from the second target task set after removal to obtain the final second target task set.

[0037] In this embodiment, as Figure 2 As shown, Figure 2 As shown, the process involves obtaining the current model name and current task ID of the current AI generation task, where the task ID is unique. Historical AI generation tasks with the same name as the current model are selected from the first target task set, resulting in a filtered first target task set. Simultaneously, historical AI generation tasks with the same name as the current model are selected from the second target task set, resulting in a filtered second target task set. Historical AI generation tasks with the same task ID as the current model are removed from both the filtered first and filtered second target task sets, resulting in a removed first target task set and a removed second target task set. Historical AI generation tasks with a failed first historical task status are filtered from the removed first target task set, resulting in the final first target task set. Similarly, historical AI generation tasks with a failed second historical task status are filtered from the removed second target task set, resulting in the final second target task set.

[0038] That is, it superimposes the triple filtering constraints of model name, task ID, and task status.

[0039] S3. Using a ping-pong chain counting algorithm, extract the largest first field value from the first reuse count field values ​​in the first target task set. Increment the largest first field value by 1 and use it as the field value of the first reuse count field for the current AI generation task. Simultaneously, batch reset the field values ​​of the first reuse count field for historical AI generation tasks in the first target task set to zero. At the same time, extract the largest second field value from the second reuse count field values ​​in the second target task set. Increment the largest second field value by 1 and use it as the field value of the second reuse count field for the current AI generation task. Simultaneously reset the field values ​​of the second reuse count field for historical AI generation tasks in the second target task set to zero, thus completing the parameter reuse frequency statistics.

[0040] In this embodiment, as Figure 2As shown, the largest first field value in the first reuse count field is extracted from the first target task set using a ping-pong chain counting algorithm. This largest first field value is incremented by 1 and used as the field value of the first reuse count field for the current AI-generated task. Simultaneously, the field values ​​of the first reuse count field for historical AI-generated tasks in the first target task set are batch-reset to zero. Therefore, the field value of the first reuse count field for the current AI-generated task represents the parameter reuse frequency statistics for pure card-drawing retry behavior with no parameter modifications. Similarly, the largest second field value in the second reuse count field is extracted from the second target task set. This largest second field value is incremented by 1 and used as the field value of the second reuse count field for the current AI-generated task. Simultaneously, the field values ​​of the second reuse count field for historical AI-generated tasks in the second target task set are batch-reset to zero. Therefore, the field value of the second reuse count field for the current AI-generated task represents the parameter reuse frequency statistics for micro-debugging exploration behavior with only modified prompts.

[0041] In addition to batch resetting the value of the first reuse count field of historical AI-generated tasks in the first target task set to zero, the following methods can also be used: 1. Remain unchanged, only update the field value of the first reuse count field of the current AI generation task; 2. Time decay: The field value of the first reuse count field of the historical AI-generated task is multiplied by a decay coefficient based on the time interval. 3. A unified scheme is adopted, which unifies the field value of the first reuse count field of all historical AI-generated tasks with the field value of the first reuse count field of the current AI-generated task.

[0042] At this point, before step S3, which involves extracting the largest first field value from the first target task set using the ping-pong chain counting algorithm, includes: S31. Obtain the user ID bound to the current AI generation task, obtain a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The completion of parameter reuse frequency statistics includes: S32. Actively release the Redis distributed lock.

[0043] At this point, the parameter reuse frequency statistics in the Redis distributed lock mentioned in step S31 include: S311. Obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds the first threshold, and if so, actively release the Redis distributed lock.

[0044] In this embodiment, as Figure 2 As shown, before performing parameter reuse frequency statistics, a Redis distributed lock is acquired based on the user ID bound to the current AI generation task. That is, each user ID has its own exclusive Redis distributed lock. Parameter reuse frequency statistics are performed within the Redis distributed lock, and these statistics are executed serially with the database update. After completing the parameter reuse frequency statistics, the Redis distributed lock is actively released. The current duration of the Redis distributed lock is then obtained. If the current duration exceeds a first threshold, the lock is actively released to prevent permanent deadlocks caused by service outages, network outages, or other sudden anomalies. The first threshold can be set according to the actual situation.

[0045] Furthermore, in this embodiment, the updates to the first hash fingerprint, the second hash fingerprint, the field values ​​of the first reuse count field, and the field values ​​of the second reuse count field are not executed synchronously in the main process of the AI ​​platform callback, but are executed asynchronously through a message queue. Specifically, when the AI ​​generation task is completed, the system main process only performs minimal state updates, updating the task status to success, recording the generation result, etc., and then sending a parameter reuse frequency statistics message to the Redis queue for execution by an independent consumer process.

[0046] Example 2 Please refer to Figure 3 The present invention provides a parameter reuse frequency statistics system 1 for AI generation tasks, including: hash fingerprint calculation module 2, matching module 3, distributed lock module 4, frequency statistics module 41, and judgment module 42.

[0047] The hash fingerprint calculation module 2 is used to obtain the model parameter string of the current AI generation task when the current AI generation task is successfully completed, perform hash calculation on the model parameter string to obtain the first hash fingerprint, remove the prompt words in the model parameter string to obtain the removed model parameter string, and perform hash calculation on the removed model parameter string to obtain the second hash fingerprint. Matching module 3 is used to match the first hash fingerprint and the second hash fingerprint with historical AI-generated tasks respectively, to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; The frequency statistics module 41 is used to extract the largest first field value from the first reuse count field values ​​in the first target task set using a ping-pong chain counting algorithm, increment the largest first field value by 1 and use it as the field value of the first reuse count field of the current AI generation task, and simultaneously batch reset the field values ​​of the first reuse count field of historical AI generation tasks in the first target task set to zero. At the same time, it extracts the largest second field value from the second reuse count field values ​​in the second target task set, increments the largest second field value by 1 and uses it as the field value of the second reuse count field of the current AI generation task, and simultaneously batch reset the field values ​​of the second reuse count field of historical AI generation tasks in the second target task set to zero, thus completing the parameter reuse frequency statistics.

[0048] Specifically, the hash fingerprint calculation module 2 is as follows: Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task. Match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not, terminate the parameter reuse frequency statistics.

[0049] Specifically, the matching module 3 is as follows: Obtain the current model name and current task ID of the current AI-generated task; Historical AI-generated tasks with the same name as the current model are selected from the first target task set and the second target task set, respectively, to obtain the first target task set and the second target task set after filtering; Remove historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set; Get the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time get the second historical task status of all historical AI-generated tasks in the second target task set after removal. The first set of historical AI-generated tasks with the status of failure is filtered out from the first set of target tasks to obtain the final first set of target tasks. Similarly, the second set of historical AI-generated tasks with the status of failure is filtered out from the second set of target tasks to obtain the final second set of target tasks.

[0050] Specifically, the frequency statistics module 41 is located in the distribution lock module 4, and the distribution lock module 4 is specifically: Obtain the user ID bound to the current AI generation task, acquire a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The frequency statistics module 41 is specifically: Actively release the Redis distributed lock.

[0051] Specifically, the distributed lock module includes: The judgment module 42 is used to obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds the first threshold, and if so, actively release the Redis distributed lock.

[0052] Since the systems / devices described in the above embodiments of the present invention are systems / devices used to implement the methods of the above embodiments of the present invention, those skilled in the art can understand the specific structure and modifications of the systems / devices based on the methods described in the above embodiments of the present invention, and therefore will not be repeated here. All systems / devices used in the methods of the above embodiments of the present invention fall within the scope of protection of the present invention.

[0053] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0054] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.

[0055] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.

[0056] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0057] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, then this invention should also include these modifications and variations.

Claims

1. A method for statistically analyzing the frequency of parameter reuse in AI generation tasks, characterized in that, include: When the current AI generation task is successfully completed, the model parameter string of the current AI generation task is obtained, the model parameter string is hashed to obtain the first hash fingerprint, and the prompt words in the model parameter string are removed to obtain the removed model parameter string. The removed model parameter string is hashed to obtain the second hash fingerprint. The first hash fingerprint and the second hash fingerprint are respectively matched with historical AI-generated tasks to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; The ping-pong chain counting algorithm is used to extract the largest first field value from the first reuse count field values ​​in the first target task set. The largest first field value is incremented by 1 and used as the field value of the first reuse count field for the current AI generation task. At the same time, the field values ​​of the first reuse count field for historical AI generation tasks in the first target task set are batch-reset to zero. Simultaneously, the largest second field value from the second reuse count field values ​​is extracted from the second target task set. The largest second field value is incremented by 1 and used as the field value of the second reuse count field for the current AI generation task. At the same time, the field values ​​of the second reuse count field for historical AI generation tasks in the second target task set are batch-reset to zero, thus completing the parameter reuse frequency statistics.

2. The parameter reuse frequency statistics method for AI generation tasks as described in claim 1, characterized in that, The step of obtaining the model parameter string of the current AI-generated task and performing a hash calculation on the model parameter string includes: Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task. Match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not, terminate the parameter reuse frequency statistics.

3. The parameter reuse frequency statistics method for AI generation tasks as described in claim 1, characterized in that, The process of obtaining the first target task set matching the first hash fingerprint and the second target task set matching the second hash fingerprint includes: Obtain the current model name and current task ID of the current AI-generated task; Historical AI-generated tasks with the same name as the current model are selected from the first target task set and the second target task set, respectively, to obtain the first target task set and the second target task set after filtering; Remove historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set; Get the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time get the second historical task status of all historical AI-generated tasks in the second target task set after removal. The first set of historical AI-generated tasks with the status of failure is filtered out from the first set of target tasks to obtain the final first set of target tasks. Similarly, the second set of historical AI-generated tasks with the status of failure is filtered out from the second set of target tasks to obtain the final second set of target tasks.

4. The parameter reuse frequency statistics method for AI generation tasks as described in claim 1, characterized in that, Before extracting the largest first field value from the first target task set using the ping-pong chain counting algorithm, the process includes: Obtain the user ID bound to the current AI generation task, acquire a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The completion of parameter reuse frequency statistics includes: Actively release the Redis distributed lock.

5. The parameter reuse frequency statistics method for AI generation tasks as described in claim 4, characterized in that, The parameter reuse frequency statistics within the Redis distributed lock include: Obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds a first threshold, and if so, actively release the Redis distributed lock.

6. A parameter reuse frequency statistics system for AI generation tasks, characterized in that, include: The hash fingerprint calculation module is used to obtain the model parameter string of the current AI generation task when the current AI generation task is successfully completed, perform hash calculation on the model parameter string to obtain the first hash fingerprint, remove the prompt words in the model parameter string to obtain the removed model parameter string, and perform hash calculation on the removed model parameter string to obtain the second hash fingerprint. The matching module is used to match the first hash fingerprint and the second hash fingerprint with historical AI-generated tasks respectively, to obtain a first target task set that matches the first hash fingerprint and a second target task set that matches the second hash fingerprint; The frequency statistics module is used to extract the largest first field value from the first reuse count field values ​​in the first target task set using a ping-pong chain counting algorithm, increment the largest first field value by 1 and use it as the field value of the first reuse count field for the current AI generation task, and simultaneously batch reset the field values ​​of the first reuse count field for historical AI generation tasks in the first target task set to zero. Simultaneously, it extracts the largest second field value from the second reuse count field values ​​in the second target task set, increments the largest second field value by 1 and uses it as the field value of the second reuse count field for the current AI generation task, and simultaneously batch resets the field values ​​of the second reuse count field for historical AI generation tasks in the second target task set to zero, thus completing the parameter reuse frequency statistics.

7. A parameter reuse frequency statistics system for AI generation tasks as described in claim 6, characterized in that, The hash fingerprint calculation module is specifically as follows: Obtain the AI ​​vendor identifier and model parameter string of the current AI generation task. Match the AI ​​vendor identifier with the vendor whitelist. If the match fails, terminate the parameter reuse frequency statistics. If the match succeeds, determine whether the model parameter string contains a Uniform Resource Locator. If it does, perform a hash calculation on the model parameter string. If it does not, terminate the parameter reuse frequency statistics.

8. A parameter reuse frequency statistics system for AI generation tasks as described in claim 6, characterized in that, The matching module is specifically: Obtain the current model name and current task ID of the current AI-generated task; Historical AI-generated tasks with the same name as the current model are selected from the first target task set and the second target task set, respectively, to obtain the first target task set and the second target task set after filtering; Remove historical AI-generated tasks with the same ID as the current task from the filtered first target task set and the filtered second target task set to obtain the removed first target task set and the removed second target task set; Get the first historical task status of all historical AI-generated tasks in the first target task set after removal, and at the same time get the second historical task status of all historical AI-generated tasks in the second target task set after removal. The first set of historical AI-generated tasks with the status of failure is filtered out from the first set of target tasks to obtain the final first set of target tasks. Similarly, the second set of historical AI-generated tasks with the status of failure is filtered out from the second set of target tasks to obtain the final second set of target tasks.

9. A parameter reuse frequency statistics system for AI generation tasks as described in claim 6, characterized in that, The frequency statistics module is located within the distributed lock module, which specifically comprises: Obtain the user ID bound to the current AI generation task, acquire a Redis distributed lock using the user ID as the lock dimension, and perform parameter reuse frequency statistics within the Redis distributed lock; The frequency statistics module specifically includes: Actively release the Redis distributed lock.

10. A parameter reuse frequency statistics system for AI generation tasks as described in claim 6, characterized in that, The distributed lock module includes: The judgment module is used to obtain the current duration of the Redis distributed lock, determine whether the current duration exceeds a first threshold, and if so, actively release the Redis distributed lock.