An AI review multi-channel concurrent convergence method, system and storage medium
Patent Information
- Application Number
- CN202611296268.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-10-23
AI Technical Summary
[0007]本发明提供一种AI复核多通道并发收敛方法、系统及存储介质,解决多通道AI异步回调并发场景下任务集合更新不一致的问题
应用服务器先根据通道判定结果及任务集合键数量预判并决策目标业务状态;再将该决策结果与任务标识移除操作一并写入单条结构化查询语言更新语句,由数据库在同一事务中原子完成集合元素移除与状态字段写入,由数据库引擎的行锁机制保证多个并发回调对该行的修改串行化执行,使得各回调对任务集合的修改结果与回调完成的先后顺序一致,不会出现先完成的回调被后完成的回调覆盖的情形,消除了现有技术“读取-修改-写回”流程中存在的并发竞态窗口,有效避免了并发更新丢失问题,从而保证了任务集合更新的一致性。
Smart Images

Figure CN122964083A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing, and in particular relates to an AI-based multi-channel concurrent convergence method, system, and storage medium. Background Technology
[0002] In AI-based automated review systems, a multi-channel parallel analysis strategy is typically employed to improve the accuracy and robustness of analysis results. For example, in vehicle monitoring and intelligent driving assistance systems, multi-source data such as video, sensor data, and event logs generated during vehicle operation are usually stored and processed as electronic evidence (hereinafter referred to as "evidence objects") used for traffic accident determination, driving behavior analysis, or insurance claims. To accurately determine whether an evidence object contains a specific event (such as a collision, illegal lane change, or fatigued driving), the system relies on multiple AI analysis algorithms to perform concurrent analysis on the same evidence object. Each AI algorithm acts as an independent analysis channel, and after completing its analysis, returns the result to the main business system via an asynchronous callback mechanism. Specifically, when a vehicle collision occurs, the on-board terminal uploads video clips, acceleration data, GPS trajectory, etc., within a preset time period before and after the collision to the cloud review platform. The review platform simultaneously dispatches analysis tasks to multiple AI analysis engines for the evidence (e.g., the target detection engine is used to identify pedestrians or vehicles in the video, the behavior analysis engine is used to determine whether the driving operation is compliant, and the damage assessment engine is used to estimate the severity of the collision). The processing time of each AI analysis engine is different (usually from seconds to minutes), and their callback messages highly overlap in time, forming a typical concurrent callback scenario.
[0003] In such systems, the main business system typically maintains a set of tasks associated with the evidence object (e.g., a column in a database table storing identifiers of all incomplete callback tasks) to track the progress of all analysis tasks. When a single callback arrives, the existing approach is usually as follows: the application server first queries the database and reads the current complete set of tasks for the evidence object, then removes the task identifier corresponding to the current callback from the set in local memory, writes the modified new set of tasks back to the database, and finally checks if the written-back set is empty. If it is empty, it determines that all analysis tasks are complete and updates the business status of the evidence object to "analysis complete." This non-atomic processing flow has the following drawbacks in concurrent callback scenarios: (1) When two or more callbacks arrive concurrently, they each perform a read operation to obtain the same task set; then, they each remove different task identifiers locally and perform write-back operations one after another. Since the database cannot detect the memory modification of the application layer, the write-back executed later will directly overwrite the write-back result executed earlier, causing the removal operation of the callback task completed earlier to be lost, so that the task set always retains the task identifier that has been processed, causing the system to wait indefinitely or time out.
[0004] (2) Existing technologies lack a mandatory protection mechanism for the final state of business. When the evidence object has entered the final state, if the system receives a historical callback again due to network delay, message retry, or other reasons, the existing process will still perform the complete read-modify-write operation and may update the task set status or business result field to the intermediate state based on the expired result, thereby overwriting the solidified manual decision or final analysis conclusion, resulting in irreversible data logic errors.
[0005] (3) Since the write-back operation may be overwritten by concurrency, the data state on which the empty judgment is based on the set after the write-back may not be the final consistent real state of the system; concurrency conflicts may cause the empty judgment to never be triggered, or to be triggered incorrectly when all completion conditions are not met, so that the system state machine cannot converge stably to the expected final state, which directly affects whether the accident review conclusion can be generated in a timely manner.
[0006] (4) All callback requests (including duplicate, expired or business-unnecessary requests) must enter the database read and write path, which not only exacerbates database lock contention and resource consumption, but also increases the probability of concurrent conflicts caused by the lack of pre-checking. Summary of the Invention
[0007] This invention provides a method, system, and storage medium for AI verification of multi-channel concurrent convergence, which solves the problem of inconsistent task set updates in multi-channel AI asynchronous callback concurrent scenarios.
[0008] The basic solution provided by this invention is: an AI review multi-channel concurrent convergence method, which includes the following steps: S1: In response to the AI review trigger command for the target evidence object, generate multiple analysis tasks associated with the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database, wherein the task set field is bound to the record primary key of the target evidence object; S2: Respond to the callback message returned by the analysis channel, parse the callback message to obtain the target task identifier and the channel judgment result; S3: Construct a single structured query language update statement based on the target task identifier; S4: Execute the Structured Query Language update statement, obtain the execution result, and determine the task completion status based on the execution result.
[0009] Preferably, S3 includes: S3-1) Based on the channel determination result and the number of keys in the task set before removal, predict whether the task set will be empty after removal, and decide the target business status based on the prediction result. S3-2) Construct a Structured Query Language (SMQ) update statement, which, when executed, atomically completes the following update operations within the same database transaction: (a) Call the collection element removal function to remove the target task identifier; (b) Write the target business status decided by S3-1 into the audit / status field.
[0010] More preferably, the Structured Query Language update statement includes a SET clause, which is used to define the update operation on the target evidence object.
[0011] More preferably, the structured query language update statement includes a SET clause and a WHERE condition; the WHERE condition is used to locate the target evidence object based on the record primary key and determine whether the current task identifier still exists in the task set. If the current task identifier has been removed by other concurrent callbacks, the WHERE condition is determined not to be met, and the number of rows affected by the update statement is 0.
[0012] Preferably, it also includes a pre-interception step: Before constructing the Structured Query Language update statement, the application server first verifies the existence, business validity, and final state of the target evidence object. If the target evidence object does not exist or the business identifier is invalid, the callback message is discarded directly, and the Structured Query Language update is not triggered.
[0013] More preferably, when the application server checks the finality of the evidence object's state, if the current state already belongs to the preset finality set, the callback message is directly discarded and the subsequent database update path is not entered; The preset final state set includes the status of completed manual review, rejected status, and invalid evidence status.
[0014] More preferably, the execution result includes the number of rows affected by the Structured Query Language update statement; the strategy for determining the task completion status based on the execution result is: When the number of affected rows is 1, it indicates that the WHERE condition matched successfully, the current task identifier was successfully removed, and the status field was successfully updated; the application server then performs subsequent processing based on the target business status decided in S3-1: If the target business status of the S3-1 decision is "processing", the system will continue to wait for callbacks from other channels. If the target business status of S3-1 decision is "analysis completed", the system determines that all analysis tasks of the target evidence object have been completed, solidifies the analysis completed status, and can write back the extended processing type to further trigger the subsequent review conclusion generation process. If the target business status of S3-1 decision is "AI analysis completed + invalid", the system will immediately solidify the invalid final state and trigger invalid linkage processes such as alarm status and tagging to confirm that the review process of the evidence object has ended. If the target business status of the S3-1 decision is "unprocessed", the system will roll back the business status of the evidence object to unprocessed, and the scheduling task will rescan and issue a new analysis task. When the number of affected rows is 0, it means that the WHERE condition is not met, the system idempotency ends, the callback message is discarded directly, and no external linkage is triggered.
[0015] Preferably, the channel determination result includes valid results, invalid results, and failure results; in step S3, the decision-making strategy for the target service status of the target evidence object is: (1) If the channel determination result is invalid, regardless of whether the task set is empty after removing the current task identifier, the application server will immediately decide the target business status as "AI analysis completed + invalid" and fix it. (2) If the channel determination result is a valid result, the application server will determine whether there are any other pending tasks in the current task set besides the current callback task identifier; If it is determined that the task set will be empty after removal, the target business status will be decided as "analysis completed". If the target business status is still not empty after removal, then keep the target business status as "processing". (3) If the channel determination result is failure and the error code indicates a retryable error, the application server determines that the task set will be empty after removing the current task identifier, and then decides the target business status as "unprocessed" so that the system can schedule the task to rescan and issue a new analysis task.
[0016] It also includes an AI-based multi-channel concurrent convergence system, comprising: The task generation and mapping module is configured to generate multiple analysis tasks associated with the target evidence object in response to an AI review trigger command for the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database, wherein the task set field is bound to the record primary key of the target evidence object; The callback parsing module is configured to respond to the callback message returned by the analysis channel, and parse the callback message to obtain the target task identifier and the channel judgment result; The update statement construction module is configured to construct a single structured query language update statement based on the target task identifier; The statement execution and result determination module is configured to execute the structured query language update statement, obtain the execution result, and determine the task completion status based on the execution result.
[0017] It also includes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements all the steps of the AI verification multi-channel concurrent convergence method.
[0018] The principles and advantages of this invention are as follows: The application server first predicts and decides the target business status based on the channel determination result and the number of task set keys. Then, it writes the decision result and the task identifier removal operation into a single structured query language update statement. The database atomically completes the removal of set elements and the writing of status fields in the same transaction. The row locking mechanism of the database engine ensures that the modification of the row by multiple concurrent callbacks is executed serially, so that the modification results of each callback to the task set are consistent with the order of completion of the callbacks. There will be no situation where the callback completed earlier is overwritten by the callback completed later. This eliminates the concurrent race window that exists in the existing "read-modify-write back" process, effectively avoids the problem of concurrent update loss, and thus ensures the consistency of task set updates.
[0019] Preferably, a state exclusion condition is set, which is based on the current business state of the target evidence object. When the current business state belongs to a preset final state set, the state exclusion condition takes effect, preventing the update operation from modifying the target evidence object on the application side, thereby avoiding the final state from being overwritten by subsequent concurrent callbacks.
[0020] Preferably, the number of rows affected by the structured query language update statement returned by the database is used as the criterion for determining whether the atomic update is effective. Combined with the prediction result of whether the task set will be empty before writing to the database, the convergence or idempotent termination is driven, ensuring the accuracy and reliability of the convergence signal.
[0021] Preferably, the existence and business validity of the target evidence object are verified in the application server memory. When the target evidence object does not exist or its business identifier is invalid, the callback message is discarded directly without triggering the construction and execution of the structured query language update statement. This intercepts invalid requests outside the database update path, reduces database row lock contention and resource consumption, and improves the overall system throughput. Attached Figure Description
[0022] Figure 1 This is a flowchart of the present invention; Figure 2 This is a diagram illustrating the relationship between multi-channel task delivery and callback in this invention. Figure 3 This is a flowchart of the atomic task removal process of the present invention. Detailed Implementation
[0023] The following detailed description illustrates the specific implementation method: The specific implementation process is as follows: Example 1 See Figures 1 to 3 A method for AI-based multi-channel concurrent convergence verification includes the following steps: S1: In response to the AI review trigger command for the target evidence object, generate multiple analysis tasks associated with the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database. The task set field is bound to the primary key of the record of the target evidence object, and the data type of the task set field is a structured data type that supports atomic set operations. The data type of the task set field is either JSON or an array type that matches the set element removal function described below.
[0024] This embodiment uses evidence related to vehicle violations or school bus safety as an example. Specifically, when a vehicle violation or school bus violation is triggered, the vehicle terminal uploads multiple video files (e.g., H.264 video streams with channel numbers 10 to 15) within a preset time period before and after the event as evidence to the cloud-based review platform. After receiving the evidence, the cloud-based review platform, in response to the AI review trigger command, generates analysis tasks for the multiple valid video channels (e.g., channel 10, channel 11, and channel 12) contained in the evidence according to a preset strategy. The unique task identifiers for the three analysis tasks are "task_001", "task_002", and "task_003", respectively. The system writes these task identifiers as keys into the task set field (e.g., field name ai_task_ids) of the evidence object record in the database. The initial value for each key is set to 0 (to indicate the number of retries). The final value of this field is a JSON object {"task_001":0, "task_002":0, "task_003":0}, and is bound to the primary key "evidence_123" of the evidence object record. The data type of this task set field is JSON, matching the JSON_REMOVE function used subsequently.
[0025] S2: Responds to the callback message returned by the analysis channel, parses the callback message to obtain the target task identifier and the channel judgment result.
[0026] Parsing callback messages involves the following sub-steps: Extract structured data from the callback message body according to the agreed communication protocol; Extract the target task identifier and channel determination result from the extracted structured data according to the agreed field names; The extracted field values are converted into data types used internally by the system and their format is validated.
[0027] The channel determination result is determined by each analysis channel based on its own analysis execution, and includes valid results, invalid results, and failure results. A valid result indicates that the analysis channel successfully completed the analysis task and the confidence level of the algorithm output reached a preset threshold, enabling a clear business judgment conclusion. An invalid result indicates that the analysis channel could not draw a valid conclusion due to data quality not meeting the analysis conditions, algorithm confidence level below the preset threshold, or timeout or anomaly during the analysis process. A failure result indicates that the analysis channel failed to successfully complete the analysis task (including timeout, communication anomaly, or execution anomaly), and the failure result carries an error code to distinguish between retryable and non-retryable errors.
[0028] In this embodiment, video channel 10 (corresponding to task "task_001") completes analysis first and returns a callback message to the system. Upon receiving this callback message, the system parses it and extracts the target task identifier "task_001" and the channel determination result. If the video image of channel 10 is clear and the algorithm successfully identifies the violation, the channel determination result is valid; if the video image is blurry and the algorithm cannot identify it, the channel determination result is invalid.
[0029] S3: Construct a single structured query language update statement based on the target task identifier; specifically: S3-0 also includes a pre-interception step: before constructing the Structured Query Language update statement, the application server first verifies the existence of the target evidence object's record, the legality of the business, and the finality of the state. If the target evidence object does not exist or the business identifier is illegal, the callback message is directly discarded and the Structured Query Language update is not triggered.
[0030] The existence verification of records involves querying the database to confirm whether the record of the evidence object has been deleted or does not exist. Business legality verification specifically includes: verifying whether the type of evidence carried in the callback message is consistent with the type of evidence pre-registered for the target evidence object, verifying whether the business source identifier belongs to the scope of legitimate sources, and verifying whether the current business process status of the evidence object allows receiving AI callbacks. Furthermore, the application server checks the current business status (state finality) of the evidence object. If the current status already belongs to the preset final state set (e.g., manual processing completed, manual review completed, or has been fixed as an AI invalid final state), the callback message is directly discarded and does not enter the subsequent database update path to achieve final state short-circuit protection.
[0031] By using a pre-interception step, if any verification fails, the callback message is considered an invalid request and will not enter the database update path, thereby reducing unnecessary contention for the database.
[0032] S3-1) The application server determines whether the task set will be empty after removal based on the channel determination result and the number of keys in the task set before removal, and decides the target business status based on the determination result. The decision-making strategy for the target business status: (1) If the channel determination result is invalid, regardless of whether the task set is empty after removing the current task identifier, the application server will immediately decide the target business status as "AI analysis completed + invalid" and fix it. (2) If the channel determination result is valid, the application server determines whether there are any other pending tasks in the current task set besides the current callback task identifier (i.e., whether it will be empty after removal). If it is determined that the task set will be empty after removal, the target business status is decided as "analysis completed"; if it is determined that it is still not empty after removal, the target business status is kept as "processing". (3) If the channel determination result is failure and the error code indicates a retryable error, the application server determines that the task set will be empty after removing the current task identifier, and then decides the target business status as "unprocessed" so that the system can schedule the task to rescan and issue a new analysis task.
[0033] In this embodiment, the channel determination result returned by video channel 10 (corresponding to task "task_001") is a valid result, and the updated task set after operation a removes "task_001" is {"task_002":0, "task_003":0}, which is a non-empty set. Therefore, the application server predicts that the task set after removal is not empty, decides the target business status as "processing", and the system continues to wait for the callbacks from channel 11 and channel 12.
[0034] In other embodiments, if an analysis channel returns an invalid result due to data quality issues, the application server will decide the target business status as "AI analysis completed + invalid" and solidify it, regardless of whether the task set is empty after removing the current task identifier, and will no longer wait for callbacks from other channels. Specifically, if the video image is blurry, causing the algorithm of channel 10 to be unable to recognize it, and the channel judgment result returned by channel 10 (task_001) is invalid, the application server will decide the target business status as "AI analysis completed + invalid" and solidify it, regardless of whether the task set is a non-empty set {"task_002":0, "task_003":0} after the removal, and will trigger the invalid linkage process.
[0035] In another embodiment, the current callback is returned by channel 12 (task_003) and the channel judgment result is valid. Before this, the callbacks of channel 10 and channel 11 have been received and removed. The current task set is {"task_003":0}. The application server predicts that the task set will be empty after removing "task_003", so it decides the target business status as "analysis completed", indicating that all AI analysis tasks have been completed, and triggers the subsequent review conclusion generation process.
[0036] In another embodiment, the current callback is returned by channel 10 (task_001), but the analysis process times out, returning a failure with an error code indicating retry. At this point, the current task set is {"task_001":0, "task_002":0, "task_003":0}. The application server determines this failure to be a retryable error and anticipates that after removing "task_001", the task set will be {"task_002":0, "task_003":0}, which is a non-empty set. Therefore, the target business status is maintained at "processing," and the server continues to wait for callbacks from other channels. If subsequent channels also fail and return retryable errors, and the task set is predicted to be empty after removing the last task identifier, the application server will decide the target business status to "unprocessed," so that the system can schedule tasks to rescan and issue new analysis tasks.
[0037] S3-2) The application server constructs a Structured Query Language (SQL) update statement and sends the statement to the database server for execution; when the structured query language update statement is executed, the update operation is completed atomically within the same database transaction.
[0038] Atomic completion of the update operation on the target evidence object means that all update operations in the SQL update statement are processed by the database engine as an indivisible execution unit. When the database engine executes the SQL statement, it adds a row-level exclusive lock to the record that matches the WHERE condition. Before the lock is released, other concurrent transactions cannot modify the record, thus ensuring that the modifications of the record by multiple concurrent callbacks will not overlap or overwrite each other.
[0039] The structured query language update statement includes a SET clause and a WHERE condition. The SET clause is used to define the update operation on the target evidence object, and the WHERE condition is used to locate the target evidence object based on the record primary key.
[0040] The update operation includes: (a) Call the collection element removal function to remove the target task identifier; The database has a built-in function for removing elements from a collection. This function is either the JSON_REMOVE function or the JSON_SET function for handling JSON data types, or the array_remove function for handling array types.
[0041] In this embodiment, for the target task identifier "task_001" in the current callback message, the system calls the JSON_REMOVE function in the SET clause to remove "task_001" as the key from the current value {"task_001":0, "task_002":0, "task_003":0} of the task set field (ai_task_ids), resulting in the updated task set {"task_002":0, "task_003":0}.
[0042] (b) Write the target business status decided by S3-1 into the audit / status field.
[0043] The audit / status fields include the processing type field, processing result field, processing time field, update time field, and invalidation reason field.
[0044] In this embodiment, the channel determination result returned by video channel 10 (corresponding to task "task_001") is a valid result, and the decision target business status is "processing". The system performs the following write operations in the SET clause: writes "AI_PROCESSING" to the processing type field, updates the processing time field to the current system time "202X-0X-XX 15:30:45", and simultaneously updates the update time field to the current system time. The above write operations and the JSON_REMOVE of operation a are completed in the SET clause of the same UPDATE statement, and the atomicity is guaranteed by the database engine.
[0045] In another embodiment, the current callback is returned by channel 12 (task_003) and the channel judgment result is valid. Previously, channels 10 and 11 have both completed their callbacks and their task identifiers have been removed. The current task set is {"task_003":0}. It is predicted that the task set will be empty after removing "task_003". The decision target business status is "analysis completed". The system writes "AI_ANALYSIS" into the processing type field, "NORMAL" into the processing result field, and the current system time into the processing time field and the update time field. This is also completed atomically by the database engine in the same transaction.
[0046] In another embodiment, channel 11 (task_002) returns an invalid result due to corrupted video data, and the target service status is "AI invalid final state". The system writes "AI_ANALYSIS" to the processing type field, "INVALID" to the processing result field, "video data corrupted, cannot be identified" to the invalid reason field, and writes the current system time to the processing time field and the update time field. The above writing is completed atomically in the same transaction as JSON_REMOVE.
[0047] In another embodiment, the current callback is returned by channel 10 (task_001), but the analysis process times out, returning a failure with an error code indicating retry. At this time, the current task set is {"task_001":0, "task_002":0, "task_003":0}. The application server determines that the failure is a retryable error and predicts that after removing "task_001", the task set will be {"task_002":0, "task_003":0}, which is a non-empty set. Therefore, the target business status is kept in the "processing" state, and it continues to wait for other channel callbacks. If subsequent channels 11 and 12 also fail and return with retryable errors, when the last task identifier is removed, it is predicted that the task set will be empty after removal, so the target business status is decided to be "unprocessed".
[0048] In another failure scenario, channel 10 (task_001) returns a failure with an error code indicating non-retry. The application server determines this failure to be a non-retry error and anticipates that after removing "task_001", the task set will be {"task_002":0,"task_003":0}, which is a non-empty set. Therefore, the target business status is kept at "processing" and continues to wait for callbacks from other channels. If subsequent channels also return non-retry failures, and after the last task identifier is removed, it is predicted that the task set will be empty after removal. In this case, the target business status is decided to be "analysis completed", which is then fixed, and the task is not reissued.
[0049] The audit field is stored in a structured format to record the target business status and related traceability information of this update operation. In this embodiment, the audit field is specifically stored in JSON format, which facilitates the subsequent expansion of other audit information without modifying the database table structure; it also facilitates direct querying and parsing of audit records; and each subfield is independent of the others, with reading and parsing not interfering with each other. In other embodiments, the audit field can also use multiple independent fields to store the status, timestamp, and source identifier respectively, or store the above information elements in other formatted text within the audit field, all of which can achieve the same or similar technical effects.
[0050] The WHERE condition is used to locate the target evidence object based on the record primary key (such as tenant identifier, evidence identifier) and to determine whether the current task identifier still exists in the task set. If the current task identifier has been removed by other concurrent callbacks, the WHERE condition is deemed not met, and the update statement affects 0 rows. Determining whether the current task identifier still exists in the task set is key to achieving idempotency in callback processing.
[0051] S4: Execute the Structured Query Language update statement, obtain the execution result, and determine the task completion status based on the execution result.
[0052] In step S4, the execution result includes the number of rows affected by the Structured Query Language update statement; the strategy for determining the task completion status based on the execution result is as follows: When the number of affected rows is 1, it indicates that the WHERE condition matched successfully, the current task identifier was successfully removed, and the status field was successfully updated; the application server then performs subsequent processing based on the target business status decided in S3-1: If the target business status of S3-1 decision is "processing status" (i.e., there are still pending tasks before writing to the database), the system continues to wait for callbacks from other channels; If the target business status of S3-1 decision is "analysis completed" (i.e., the judgment mapping will be empty and not INVALID before writing to the database), then the system determines that all analysis tasks of the target evidence object have been completed, solidifies the analysis completed status, and can write back the extended processing type to further trigger the subsequent review conclusion generation process. If the target business status of S3-1 decision is "AI analysis completed + invalid" (i.e., determined to be INVALID before writing to the database), the system immediately solidifies the invalid final state and triggers invalid linkage processes such as alarm status and tags to confirm that the review process of the evidence object has ended. If the target business state of the decision in step S3-1 is "unprocessed" (i.e., the failure to write to the database can be retried and the mapping will be empty), the system will roll back the business state of the evidence object to unprocessed, and the scheduling task will rescan and issue a new analysis task.
[0053] When the number of affected rows is 0, it means that the WHERE condition is not met, the system idempotency ends, the callback message is discarded directly, and no external linkage is triggered.
[0054] In this embodiment, video channel 10 (corresponding to task "task_001") is the first to be called back. The channel determination result is valid, and it is predicted that after removing "task_001", the task set will be {"task_002":0, "task_003":0}, which is a non-empty set. The decision target business status is "processing". After the system executes the SQL update statement, the database returns an affected row count of 1, indicating that the target task identifier "task_001" has been successfully removed. Based on the already decided "processing" status, the application server maintains the business status of the evidence object as "processing" and continues to wait for the callbacks from channels 11 and 12.
[0055] In another specific example, suppose the current callback is returned from channel 11 (task_002), and the callback from channel 10 (task_001) has already arrived and completed processing. The current task set is {"task_002":0, "task_003":0}. It is predicted that after removing "task_002", the task set will be {"task_003":0}, which is a non-empty set. The decision target business status is "processing". After the system executes the SQL update statement, the database returns an affected row count of 1, indicating that the target task identifier "task_002" has been successfully removed. Based on the already decided "processing" status, the application server maintains the business status of the evidence object as "processing" and continues to wait for the callback from channel 12.
[0056] In another specific example, suppose the current callback is returned by channel 12 (task_003). Previously, tasks_001 and_002 have both arrived and been processed. The current task set is {"task_003":0}. It is predicted that the task set will be empty after removing "task_003," and the target business status is "analysis completed." After the system executes the SQL update statement, the database returns 1 affected row, indicating that the target task identifier "task_003" has been successfully removed. Based on the already decided "analysis completed" status, the application server solidifies the business status of the evidence object to "analysis completed," thereby triggering the subsequent review conclusion generation process.
[0057] In another specific example, suppose the callback for task_001 has been successfully processed, and its task identifier has been removed from ai_task_ids. Then, due to network jitter, the system receives a duplicate callback message for task_001. After the system executes the SQL update statement, the database returns an affected row count of 0, indicating that the WHERE condition "the current task identifier still exists in the task set" is not met. Upon detecting that the affected row count is 0, the application server directly discards the duplicate callback, ending idempotency without triggering any state changes or external linkages.
[0058] In another specific example, the current callback is that channel 10 (task_001) returned a failure with an error code indicating retry is possible. At this point, the current task set is {"task_001":0, "task_002":0, "task_003":0}, and the decision target's business status is "processing". After the system executes the SQL update statement, the database returns an affected row count of 1. Based on the already decided "processing" status, the application server maintains the business status of the evidence object as "processing" and continues to wait for callbacks from other channels. If subsequent channels 11 and 12 also return failures, both of which are retryable errors, after the last task identifier (task_003) is removed, it is predicted that the task set will be empty after removal, and the business status of the decision target will be "unprocessed". After the system executes the SQL update statement, it returns the number of affected rows as 1. Based on the already decided "unprocessed" status, the application server will roll back the business status of the evidence object to unprocessed, and the scheduling task will rescan and issue a new analysis task (evidence-level resubmission) instead of simply keeping it in processing on the same taskId.
[0059] In another specific example, the current callback is that channel 10 (task_001) returned a failure with an error code indicating that it is not retryable. If subsequent channels 11 and 12 have both been completed (the task identifier has been removed), the current task set is {"task_001":0}. It is predicted that the task set will be empty after removing "task_001," and the failure is determined to be a non-retryable error. Therefore, the target business status is decided as "analysis completed." After the system executes the SQL update statement, it returns an affected row count of 1. Based on the decided "analysis completed" status, the application server solidifies the business status of the evidence object to the "analysis completed" status and does not reissue the task.
[0060] Example 2 It also includes an AI-based multi-channel concurrent convergence system, which executes an AI-based multi-channel concurrent convergence method. Specifically, it includes: The task generation and mapping module is configured to generate multiple analysis tasks associated with the target evidence object in response to an AI review trigger command for the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database. The task set field is bound to the record primary key of the target evidence object, and the data type of the task set field is a structured data type that supports atomic set operations. The callback parsing module is configured to respond to the callback message returned by the analysis channel, and parse the callback message to obtain the target task identifier and the channel judgment result; The update statement construction module is configured to construct a single structured query language update statement based on the target task identifier; the update statement construction module includes: The business status prediction unit is configured to predict whether the task set is empty after removing the target task identifier based on the channel judgment result and the number of keys in the task set before removal, and to decide the target business status based on the prediction result. The statement generation unit is configured to construct a structured query language update statement. When the structured query language update statement is executed, the following update operations are performed atomically within the same database transaction: (a) calling the set element removal function to remove the target task identifier; (b) writing the target business status decided by the business status prediction unit into the audit / status field. The statement execution and result determination module is configured to execute the structured query language update statement, obtain the execution result, and determine the task completion status based on the execution result.
[0061] Example 3 It also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements all the steps of the AI verification multi-channel concurrent convergence method. The computer-readable storage medium includes, but is not limited to, non-volatile storage media such as ROM, RAM, CD-ROM, magnetic disk, or optical disk.
[0062] The above are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.
Claims
1. A method for AI-based multi-channel concurrent convergence verification, characterized in that, Includes the following steps: S1: In response to the AI review trigger command for the target evidence object, generate multiple analysis tasks associated with the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database. The task set field is bound to the record primary key of the target evidence object. S2: Respond to the callback message returned by the analysis channel, parse the callback message to obtain the target task identifier and the channel judgment result; S3: Construct a single structured query language update statement based on the target task identifier; S4: Execute the Structured Query Language update statement, obtain the execution result, and determine the task completion status based on the execution result.
2. The AI verification multi-channel concurrent convergence method according to claim 1, characterized in that: S3 includes: S3-1) Based on the channel determination result and the number of keys in the task set before removal, predict whether the task set will be empty after removal, and decide the target business status based on the prediction result. S3-2) Construct a Structured Query Language (SMQ) update statement, which, when executed, atomically completes the following update operations within the same database transaction: (a) Call the collection element removal function to remove the target task identifier; (b) Write the target business status decided by S3-1 into the audit / status field.
3. The AI verification multi-channel concurrent convergence method according to claim 1 or 2, characterized in that: The Structured Query Language update statement includes a SET clause, which is used to define the update operation on the target evidence object.
4. The AI verification multi-channel concurrent convergence method according to claim 2, characterized in that: The structured query language update statement includes a SET clause and a WHERE condition. The WHERE condition is used to locate the target evidence object based on the record primary key and determine whether the current task identifier still exists in the task set. If the current task identifier has been removed by other concurrent callbacks, the WHERE condition is not met, and the update statement affects 0 rows.
5. The AI verification multi-channel concurrent convergence method according to claim 1, characterized in that: It also includes pre-interception steps: Before constructing the Structured Query Language update statement, the application server first verifies the existence, business validity, and final state of the target evidence object. If the target evidence object does not exist or the business identifier is invalid, the callback message is discarded directly, and the Structured Query Language update is not triggered.
6. The AI verification multi-channel concurrent convergence method according to claim 5, characterized in that: When the application server checks the finality of the evidence object's state, if the current state already belongs to the preset finality set, the callback message is discarded directly and the subsequent database update path is not entered. The preset final state set includes the status of completed manual review, rejected status, and invalid evidence status.
7. The AI verification multi-channel concurrent convergence method according to claim 4, characterized in that: In step S4, the execution result includes the number of rows affected by the Structured Query Language update statement; the strategy for determining the task completion status based on the execution result is as follows: When the number of affected rows is 1, it indicates that the WHERE condition matched successfully, the current task identifier was successfully removed, and the status field was successfully updated; the application server then performs subsequent processing based on the target business status decided in S3-1: If the target business status of the S3-1 decision is "processing", the system will continue to wait for callbacks from other channels. If the target business status of S3-1 decision is "analysis completed", the system determines that all analysis tasks of the target evidence object have been completed, solidifies the analysis completed status, and can write back the extended processing type to further trigger the subsequent review conclusion generation process. If the target business status of S3-1 decision is "AI analysis completed + invalid", the system will immediately solidify the invalid final state and trigger invalid linkage processes such as alarm status and tagging to confirm that the review process of the evidence object has ended. If the target business status of the S3-1 decision is "unprocessed", the system will roll back the business status of the evidence object to unprocessed, and the scheduling task will rescan and issue a new analysis task. When the number of affected rows is 0, it means that the WHERE condition is not met, the system idempotency ends, the callback message is discarded directly, and no external linkage is triggered.
8. The AI verification multi-channel concurrent convergence method according to claim 1, characterized in that: The channel determination result includes valid results, invalid results, and failure results; in step S3, the decision-making strategy for the target service status of the target evidence object is: (1) If the channel determination result is invalid, regardless of whether the task set is empty after removing the current task identifier, the application server will immediately decide the target business status as "AI analysis completed + invalid" and fix it. (2) If the channel determination result is a valid result, the application server will determine whether there are any other pending tasks in the current task set besides the current callback task identifier; If it is determined that the task set will be empty after removal, the target business status will be decided as "analysis completed"; If the target business status is still not empty after removal, then keep the target business status as "processing". (3) If the channel determination result is failure and the error code indicates a retryable error, the application server determines that the task set will be empty after removing the current task identifier, and then decides the target business status as "unprocessed" so that the system can schedule the task to rescan and issue a new analysis task.
9. An AI-based multi-channel concurrent convergence system for verification, characterized in that, include: The task generation and mapping module is configured to generate multiple analysis tasks associated with the target evidence object in response to an AI review trigger command for the target evidence object, and write the unique task identifier of the analysis task as a set element into the task set field of the database, wherein the task set field is bound to the record primary key of the target evidence object; The callback parsing module is configured to respond to the callback message returned by the analysis channel, and parse the callback message to obtain the target task identifier and the channel judgment result; The update statement construction module is configured to construct a single structured query language update statement based on the target task identifier; The statement execution and result determination module is configured to execute the structured query language update statement, obtain the execution result, and determine the task completion status based on the execution result.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements all the steps of the method as described in any one of claims 1 to 8.