A reasoning task processing method, device and equipment
By employing a dual-scheduling track mechanism and filtering the differences in intermediate inference results, the problem of balancing inference task processing latency and resource utilization efficiency is solved. This enables efficient processing of tasks with high real-time requirements and large computational demands, thereby improving the utilization efficiency of computing resources.
Patent Information
- Application Number
- CN202611482459.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-24
AI Technical Summary
In the process of inference tasks, existing technologies have difficulty balancing the processing latency of inference tasks with high real-time requirements with the efficiency of computing resource utilization. Furthermore, inference tasks with large computational loads are difficult to accumulate enough tasks for batch processing within a short scheduling cycle, making it difficult to balance processing timeliness and resource utilization efficiency.
A dual-scheduling track mechanism is adopted, which calls different inference tasks in the first and second preset cycles respectively. By filtering the differences between intermediate inference results and historical processing status, duplicate inference is reduced, and the orderly connection and coordinated processing of different inference tasks are achieved.
By using a dual-scheduling track mechanism, the computational resource overhead caused by repeated inference is reduced, the utilization efficiency of computational resources is improved, and coordinated processing between different inference tasks is achieved, meeting the processing latency and resource utilization requirements of different inference tasks.
Smart Images

Figure CN123157388A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a reasoning task processing method, apparatus and device. Background Technology
[0002] Inference task processing refers to the organization and execution of multiple inference tasks according to the processing requirements of different inference tasks during the artificial intelligence inference process, in order to obtain the corresponding inference results.
[0003] Currently, in the process of inference tasks, different inference tasks can be processed in batches according to the same scheduling cycle. When it is necessary to process inference tasks with high real-time requirements and inference tasks with large computational loads simultaneously, a longer scheduling cycle will increase the waiting time of inference tasks with high real-time requirements, while a shorter scheduling cycle will make it difficult for inference tasks with large computational loads to accumulate enough tasks for batch processing. This makes it difficult to balance the processing latency of inference tasks with the efficiency of computing resource utilization.
[0004] Therefore, how to balance the processing latency of different inference tasks with the efficiency of computing resource utilization has become an urgent technical problem to be solved. Summary of the Invention
[0005] Based on the above problems, this application provides a reasoning task processing method, which aims to solve the problem that it is difficult to balance the processing delay of different reasoning tasks with the efficiency of computing resource utilization.
[0006] The embodiments of this application disclose the following technical solutions: Firstly, this application provides a method for processing inference tasks, including: acquiring input data; executing a first inference task by calling a first scheduling track according to a first preset period to obtain intermediate inference results; the first inference task being used to perform batch inference on the input data; filtering the intermediate inference results based on the difference between the intermediate inference results and the historical processing states corresponding to the intermediate inference results to obtain filtering results; when the filtering results indicate the existence of intermediate inference results to be processed, executing a second inference task by calling a second scheduling track according to a second preset period to obtain target inference results; the second inference task being used to perform batch inference on the intermediate inference results to be processed, and the second preset period being longer than the first preset period.
[0007] In this embodiment, by calling the first scheduling track to execute the first inference task according to a first preset period, the input data can be processed according to a scheduling period that matches the real-time requirements of the first inference task, reducing the waiting time of the input data during the scheduling process. After obtaining intermediate inference results, the intermediate inference results are filtered based on the differences between the intermediate inference results and the corresponding historical processing states, reducing the computational resource overhead caused by repeated inference. When there are intermediate inference results to be processed, the second scheduling track is called to execute the second inference task according to a second preset period, so that the intermediate inference results to be processed can be batched for inference according to a scheduling period that matches the processing requirements of the second inference task. Thus, the first inference task and the second inference task can be scheduled according to different processing requirements, taking into account both the processing latency and computational resource utilization efficiency of different inference tasks.
[0008] In one possible implementation, the step of filtering the intermediate inference results based on the difference between the intermediate inference results and the historical processing states corresponding to the intermediate inference results to obtain filtering results includes: comparing the intermediate inference results with the historical processing states corresponding to the intermediate inference results to obtain difference information; generating a state change identifier corresponding to the intermediate inference results when the difference information meets preset change conditions; determining the intermediate inference results carrying the state change identifier as the intermediate inference results to be processed; and generating the filtering results based on the intermediate inference results to be processed.
[0009] In this embodiment, by comparing the intermediate inference results with the corresponding historical processing states, and determining whether the intermediate inference results have undergone a state change that meets the preset change conditions based on the obtained difference information, a corresponding state change identifier is generated when a state change is determined to have occurred, so that the state changes of the intermediate inference results can be distinguished by identifiers; based on the state change identifiers, the intermediate inference results to be processed are filtered, so that the subsequent inference process can process the intermediate inference results whose states have changed, thereby reducing the computational resource overhead caused by the repeated processing of intermediate inference results whose states have not changed.
[0010] In one possible implementation, the step of calling the second scheduling track to execute the second inference task according to the second preset period to obtain the target inference result includes: calling the second scheduling track according to the second preset period to extract the intermediate inference result to be processed; and executing the second inference task on the intermediate inference result to be processed to obtain the target inference result.
[0011] In this embodiment of the application, by calling the second scheduling track according to the second preset cycle and extracting the intermediate inference results to be processed, the filtered intermediate inference results can enter the subsequent inference process according to the preset scheduling time. The target inference result is obtained by executing the second inference task on the intermediate inference results to be processed, so that the intermediate inference results can be processed by subsequent inference to form the target inference result, thus realizing the orderly connection between the first inference task and the second inference task.
[0012] In one possible implementation, the method further includes: generating a third inference task upon detecting a preset end event; the third inference task having a higher priority than the second inference task; and executing the third inference task before the second scheduling track makes its next call according to the second preset period to obtain the target inference result.
[0013] In this embodiment of the application, by generating a third inference task with a higher execution priority when a preset end event is detected, and executing the third inference task before the second scheduling track makes its next call, the inference processing corresponding to the preset end event can be executed before the next scheduling of the second scheduling track, reducing the processing delay caused by waiting for the scheduling opportunity of the second scheduling track, and improving the timeliness of the response of the inference task under the end event.
[0014] In one possible implementation, before the step of calling the first scheduling track to execute the first inference task according to the first preset period and obtaining the intermediate inference result, the method further includes: storing the input data in a cache; the step of calling the first scheduling track to execute the first inference task according to the first preset period and obtaining the intermediate inference result includes: calling the first scheduling track according to the first preset period and extracting the first batch of data from the input data in the cache; and executing the first inference task based on the first batch of data to obtain the intermediate inference result.
[0015] In this embodiment of the application, by storing the input data in a cache and retrieving the corresponding first batch of data from the cache for the first inference task when the first scheduling track is called according to the first preset period, the continuously received input data can be temporarily stored and centrally processed during the scheduling process, which facilitates the formation of batches based on the actual received data and the inference process, thereby improving the processing efficiency of the first inference task.
[0016] In one possible implementation, the step of calling the second scheduling track to execute the second inference task according to the second preset period to obtain the target inference result includes: calling the second scheduling track according to the second preset period to aggregate the intermediate inference results to be processed to obtain a second batch of data; executing the second inference task based on the second batch of data to obtain the target inference result; the batch size corresponding to the second batch of data is larger than the batch size corresponding to the first batch of data.
[0017] In this embodiment, by calling the second scheduling track according to the second preset period, the intermediate inference results to be processed are aggregated and formed into a second batch of data, so that multiple intermediate inference results to be processed can be centrally entered into the second inference task for processing; by making the batch size of the second batch of data larger than the batch size of the first batch of data, the second inference task can form a relatively larger batch processing scale, thereby improving the efficiency of computing resource utilization in the batch inference process.
[0018] In one possible implementation, the first scheduling track and the second scheduling track each employ independent asynchronous schedulers.
[0019] In this embodiment of the application, by configuring independent asynchronous schedulers for the first scheduling track and the second scheduling track respectively, the first scheduling track and the second scheduling track can perform task scheduling according to their respective scheduling cycles, thereby reducing the mutual influence between the two scheduling tracks due to different scheduling times, reducing scheduling interference between different inference tasks, and enabling different inference tasks to be asynchronously scheduled according to their respective processing needs.
[0020] In one possible implementation, the input data includes audio data; the step of calling the first scheduling track to execute the first inference task according to a first preset period to obtain an intermediate inference result includes: calling the first scheduling track to execute an acoustic decoding task according to the first preset period to obtain preliminary transcribed text; the acoustic decoding task is used to perform acoustic decoding on the audio data; the step of calling the second scheduling track to execute the second inference task according to a second preset period to obtain a target inference result when the filtering result indicates the existence of intermediate inference results to be processed includes: calling the second scheduling track according to the second preset period to perform punctuation restoration and / or semantic correction on the intermediate inference results to be processed to obtain the target inference result.
[0021] In this embodiment, the audio data processing is divided into acoustic decoding and subsequent text processing. The audio data can first be transcribed into preliminary text via a first scheduling track, and then the preliminary transcribed text can be restored with punctuation and / or semantic correction by a second scheduling track. This allows different processing stages to be processed according to their respective scheduling cycles. While meeting the real-time processing requirements of the audio stream, the second scheduling track is used to perform batch inference on the text processing tasks, thus balancing the processing timeliness of real-time transcription with the computational resource utilization efficiency of subsequent text processing.
[0022] Second aspect: Embodiments of this application provide a reasoning task processing apparatus, including: The data acquisition unit is used to acquire input data; The first inference unit is used to execute the first inference task by calling the first scheduling track according to the first preset period to obtain intermediate inference results; the first inference task is used to perform batch inference on the input data. A filtering unit is used to filter the intermediate inference results based on the difference between the intermediate inference results and the historical processing states corresponding to the intermediate inference results, and obtain the filtering results. The second inference unit is used to execute a second inference task according to a second preset period when the screening result indicates that there are intermediate inference results to be processed, thereby obtaining the target inference result; the second inference task is used to perform batch inference on the intermediate inference results to be processed, and the second preset period is longer than the first preset period.
[0023] Third aspect: This application provides a computer device, which includes a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of the method described above according to the instructions in the program code.
[0024] Fourth aspect: Embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.
[0025] Fifth aspect: This application provides a computer program product, which, when run on a computer, enables the computer to perform the steps of the method described above.
[0026] Sixth aspect: This application provides a chip including a processor coupled to a memory for executing a computer program or instructions stored in the memory, such that the chip implements the steps of the method described above. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application; Figure 2 A flowchart illustrating an overall inference task processing method provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of a reasoning task processing device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the hardware structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions "a," "an," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the embodiments of this application, "one or more" refers to one, two, or more; "and / or" describes the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0030] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0031] The "multiple" mentioned in the embodiments of this application refers to two or more. It should be noted that in the description of the embodiments of this application, terms such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they be construed as indicating or implying order.
[0032] Currently, during the inference task processing, different inference tasks can be batch-scheduled and processed according to the same scheduling cycle to obtain the corresponding inference results.
[0033] For example, in a streaming speech recognition scenario, inference tasks with high real-time requirements and inference tasks with high computational requirements can be generated from the user-input speech data. When the preset scheduling period is reached, the different types of inference tasks generated can be scheduled according to the preset scheduling period, and computing resources can be called to perform corresponding inference processing to obtain the corresponding recognition results and optimization results.
[0034] However, this method has at least the following problems: First, different inference tasks have different processing requirements. When using the same scheduling period, if the scheduling period is set relatively long, inference tasks with high real-time requirements will have to wait a long time to be processed; if the scheduling period is set relatively short, inference tasks with large computational loads will find it difficult to accumulate enough tasks in a single scheduling, making it difficult to balance the processing timeliness of inference tasks with the efficiency of computing resource utilization. Second, in scenarios where inference tasks are continuously generated, the data corresponding to adjacent processing processes may have some unchanged content. However, the existing scheduling method directly sends the currently accumulated data to the computing resources for inference processing each time a scheduling is performed, resulting in unchanged data being repeatedly sent to the computing resources for inference processing, thus causing redundant consumption of computing resources and low computing resource utilization. Third, in scenarios where different inference tasks have sequential processing relationships, the existing scheduling method processes each inference task according to a uniform scheduling period. The processing timing of subsequent inference tasks is limited by the uniform scheduling period, making it difficult to determine the processing timing of subsequent inference tasks based on the actual processing status of the previous stage's inference results, thus affecting the processing coordination between different inference tasks.
[0035] Based on this, embodiments of this application provide a method for processing inference tasks, which includes: acquiring input data; executing a first inference task by calling a first scheduling track according to a first preset period to obtain intermediate inference results; the first inference task being used to perform batch inference on the input data; filtering the intermediate inference results based on the differences between the intermediate inference results and the historical processing states corresponding to the intermediate inference results to obtain filtering results; when the filtering results indicate the existence of intermediate inference results to be processed, executing a second inference task by calling a second scheduling track according to a second preset period to obtain target inference results; the second inference task being used to perform batch inference on the intermediate inference results to be processed, wherein the second preset period is longer than the first preset period.
[0036] In this embodiment, by setting up a first scheduling track and a second scheduling track, and using different preset periods for scheduling, different inference tasks can be processed according to their respective processing needs. By comparing intermediate inference results with corresponding historical processing states and filtering them, data whose states have not changed do not need to enter the subsequent inference process, reducing the computational resource overhead caused by repeated inference. When there are intermediate inference results to be processed, the second scheduling track is called for batch inference, so that the first scheduling track and the second scheduling track can cooperate based on the intermediate inference results to be processed, thereby achieving coordinated processing between different inference tasks.
[0037] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0038] See Figure 1 This figure is a schematic diagram of an application scenario provided by an embodiment of this application.
[0039] The reasoning task processing method provided in this application can be applied to computer devices. In some embodiments, the computer device may include, but is not limited to, electronic devices such as mobile phones, tablets, laptops, desktop computers, vehicle terminals, and smart terminals. This application does not impose any special limitations on the specific form of the computer device.
[0040] In this embodiment, computer device 1101 acts as a user terminal, interacting with server 1102. Computer device 1101 may include voice acquisition, voice input, or other interactive functions, used to receive input data from the user and send the input data to server 1102.
[0041] For example, taking voice data as input data, computer device 1101 can respond to the user's voice input operation, acquire the voice data input by the user, and send the voice data to server 1102.
[0042] After receiving the input data, the server 1102 can store the input data in a cache and call the first scheduling track according to the first preset period to extract the input data from the cache for batch inference and obtain intermediate inference results.
[0043] Server 1102 can filter the intermediate inference results based on the difference between the intermediate inference results and the corresponding historical processing states to obtain a filtering result. If the filtering result indicates that there are intermediate inference results to be processed, a second scheduling track can be invoked according to a second preset period to perform batch inference on the intermediate inference results to be processed to obtain the target inference result, wherein the second preset period is longer than the first preset period.
[0044] Server 1102 can send the target inference result to computer device 1101, so that computer device 1101 can output the target inference result to the user through a corresponding interactive method.
[0045] The following description, in conjunction with the accompanying drawings, introduces a reasoning task processing method provided by an embodiment of this application. (See attached drawings.) Figure 2 The figure is an overall flowchart of a reasoning task processing method provided in an embodiment of this application, including S201-S204.
[0046] S201. Obtain input data.
[0047] In this embodiment, streaming data input from external sources can be continuously received through a data receiving interface, and the received data can be used as the input data. The streaming data can be data continuously generated in chronological order, such as audio or video streams.
[0048] For example, in a streaming speech recognition scenario, a user can establish a persistent connection with a server and continuously send audio segments through the persistent connection. The server can continuously receive the audio segments sent by the user through the persistent connection and use the received audio segments as input data.
[0049] S202. The first inference task is executed by calling the first scheduling track according to the first preset cycle to obtain the intermediate inference result.
[0050] In this embodiment of the application, the first inference task can be an inference task with high processing timeliness requirements. The first scheduling track can call the first inference task according to a short first preset period, so that the input data can enter the first inference task for processing in a timely manner and obtain the intermediate inference result.
[0051] For example, in a streaming speech recognition scenario, the first inference task may include an acoustic decoding task. The acoustic decoding task has high processing timeliness requirements and can be invoked at short first preset intervals to perform acoustic decoding on the audio data extracted from the first scheduling track, obtaining preliminary transcribed text, and using the preliminary transcribed text as the intermediate inference result.
[0052] In this embodiment, the received input data can be feature-recognized, and its real-time characteristics can be determined based on any one of the following: the input method, the corresponding inference task type, and the real-time requirements. If the input data is continuously input streaming data and the corresponding inference task has high real-time requirements, the input data can be determined to have real-time characteristics.
[0053] In one possible implementation, input data with real-time characteristics can be stored in the buffer of the corresponding session, so that the first scheduling track can extract and process it according to the first preset period. The session can be identified based on a session identifier; input data with the same session identifier can be determined to belong to the same session and stored in the buffer corresponding to the session identifier.
[0054] For example, in a streaming speech recognition scenario, when a user establishes a long connection with the server, a corresponding session identifier can be associated with the long connection. When the user continuously sends audio segments through the long connection, the session to which the audio segment belongs can be determined based on the session identifier, and the audio segment can be stored in the cache area corresponding to the session identifier.
[0055] In one possible implementation, S202 can be achieved through steps 221 to 222.
[0056] Step 221: Call the first scheduling track according to the first preset period and extract the first batch of data from the input data in the cache.
[0057] In this embodiment, the first scheduling track can continuously scan the buffer according to a first preset period to detect whether there is any input data to be processed in the buffer. When the first preset period is reached, the first scheduling track can perform a scan of the buffer; after completing the data extraction of the current period, it can wait for the next first preset period and scan the buffer again, thereby continuously detecting whether there is any input data to be processed in the buffer.
[0058] For example, a first preset period can be set to 10ms, enabling the first scheduling track to continuously scan the buffer at a high scheduling frequency. When input data to be processed is detected in the buffer, the input data to be processed can be extracted from the buffer, and the first batch of data can be assembled based on the extracted input data.
[0059] In this embodiment, the first batch of data may include small batches of data. By assembling a small batch of the first batch of data, the input data currently awaiting processing in the buffer can be promptly entered into the first inference task for processing.
[0060] For example, in a streaming speech recognition scenario, when the buffer contains multiple audio segments to be processed, the multiple audio segments to be processed can be extracted from the buffer and combined to form the first batch of data. The first batch of data can be used as input for a first inference task.
[0061] Step 222: Execute the first inference task based on the first batch of data to obtain intermediate inference results.
[0062] In this embodiment, a first inference task can be performed on the first batch of data, and intermediate inference results corresponding to the first scheduling track can be output. These intermediate inference results can be used as input for subsequent inference tasks.
[0063] S203. Based on the difference between the intermediate inference result and the historical processing state corresponding to the intermediate inference result, the intermediate inference result is filtered to obtain the filtered result.
[0064] In one possible implementation, S203 can be achieved through steps 231 to 234.
[0065] Step 231: Compare the intermediate inference result with the historical processing state corresponding to the intermediate inference result to obtain the difference information.
[0066] In this embodiment, the historical processing state corresponding to the intermediate inference result can be obtained, and the intermediate inference result can be compared with the historical processing state to determine the difference information between the currently obtained intermediate inference result and the historical processing state. The historical processing state can be used to characterize the processing state corresponding to the intermediate inference result obtained in the previous inference process.
[0067] For example, in a streaming speech recognition scenario, the currently obtained intermediate inference result may include the preliminary transcribed text at the current moment, and the historical processing state may include the preliminary transcribed text corresponding to the previous processing. The currently obtained preliminary transcribed text can be compared with the preliminary transcribed text in the historical processing state to determine the difference information between the currently output text and the historical output text.
[0068] For example, if the initial transcribed text obtained now is "hello world", and the initial transcribed text in the corresponding historical processing state is "hello", then "hello world" and "hello" can be compared, and the newly added text content "world" can be identified as the difference information.
[0069] Step 232: If the difference information meets the preset change conditions, generate the state change identifier corresponding to the intermediate reasoning result.
[0070] In this embodiment, it can be determined whether the intermediate inference result has undergone a substantial change relative to the corresponding historical processing state based on the difference information. If the difference information does not meet the preset change conditions, it can be determined that the intermediate inference result has not undergone a substantial change, and the current intermediate inference result can be ignored without performing subsequent inference processing on it; if the difference information meets the preset change conditions, it can be determined that the intermediate inference result has undergone a substantial change, and a state change identifier corresponding to the intermediate inference result can be generated.
[0071] For example, whether the difference information is empty can be used as the basis for determining whether the difference information meets the preset change conditions. When the difference information is "world", it can be determined that the difference information is not empty and meets the preset change conditions, thereby determining that the intermediate inference result has undergone a substantial change and generating a corresponding state change identifier; when the difference information is empty, it can be determined that the difference information does not meet the preset change conditions, thereby determining that the intermediate inference result has not undergone a substantial change.
[0072] Step 233: Determine the intermediate inference result carrying the state change identifier as the intermediate inference result to be processed.
[0073] In this embodiment of the application, intermediate inference results that generate the state change identifier can be determined as intermediate inference results to be processed, while intermediate inference results that do not generate the state change identifier can be excluded from being intermediate inference results to be processed.
[0074] Step 234: Generate the filtering results based on the intermediate reasoning results to be processed.
[0075] In this embodiment, the filtering result can be generated based on one or more determined intermediate inference results to be processed. The filtering result can be used to indicate whether there are currently any intermediate inference results to be processed. If there are intermediate inference results to be processed, the filtering result can indicate the existence of intermediate inference results to be processed, thereby triggering a subsequent second scheduling track to process the intermediate inference results to be processed.
[0076] S204. If the screening result indicates that there are intermediate inference results to be processed, the second inference task is executed by calling the second scheduling track according to the second preset cycle to obtain the target inference result.
[0077] The second inference task is used to perform batch inference on the intermediate inference results to be processed, and the second preset period is longer than the first preset period.
[0078] In this embodiment, the second inference task can be an inference task with relatively low processing time requirements and suitable for batch processing. The second scheduling track can call the second inference task according to a relatively long second preset period to perform batch inference on the intermediate inference results to be processed and obtain the target inference result.
[0079] For example, in a streaming speech recognition scenario, the second inference task may include a punctuation recovery task and / or a semantic correction task. The punctuation recovery task and / or semantic correction task may process the preliminary transcribed text obtained from the first inference task to optimize the preliminary transcribed text, obtain an optimized transcribed text, and use the optimized transcribed text as the target inference result.
[0080] In one possible implementation, the first and second scheduling tracks can each employ independent asynchronous schedulers, enabling them to operate independently according to their respective scheduling cycles. While the second scheduling track is waiting for the second preset cycle or executing the second inference task, the first scheduling track can continue to perform data extraction and scheduling of the first inference task according to the first preset cycle.
[0081] In one possible implementation, a third inference task can be generated upon detection of a preset end event. This third inference task has a higher priority than the second inference task. The preset end event can be used to indicate the end of the input process corresponding to the current session, such as when the user stops input or when an End of Stream (EOS) event is detected.
[0082] In one possible implementation, the third inference task is executed before the second scheduling track makes its next call according to the second preset period to obtain the target inference result.
[0083] For example, when the preset end event is detected, instead of waiting for the second preset period to arrive, a third inference task with a higher priority can be generated and processed to bypass the periodic waiting of the second scheduling track and obtain the final inference result corresponding to the current session.
[0084] In this embodiment of the application, if it is determined that there are intermediate inference results to be processed based on the screening results, the intermediate inference results to be processed can be stored in the corresponding queue to be processed, and the intermediate inference results to be processed can be processed by calling the second scheduling track according to the second preset period.
[0085] For example, when the filtering result does not indicate the existence of intermediate inference results to be processed, the second scheduling track remains in a waiting state.
[0086] In one possible implementation, S204 can be achieved through steps 241 to 242.
[0087] Step 241: Call the second scheduling track according to the second preset cycle and extract the intermediate inference results to be processed.
[0088] In this embodiment of the application, when the second preset period is reached, the second scheduling track is invoked to extract the intermediate inference results to be processed for subsequent second inference tasks.
[0089] For example, a second preset period can be set to 500ms, so that the second scheduling track is invoked according to a scheduling period of 500ms. When the second preset period of 500ms is reached, the second scheduling track is invoked, and the intermediate inference result carrying the state change identifier is extracted from the currently existing intermediate inference results to be processed.
[0090] Step 242: Perform the second reasoning task on the intermediate reasoning result to be processed to obtain the target reasoning result.
[0091] In this embodiment of the application, after extracting the intermediate inference results to be processed, a second scheduling track can be invoked to execute a second inference task based on the extracted intermediate inference results to be processed, and the processing result of the second inference task can be output as the target inference result.
[0092] In another possible implementation, S204 can be implemented through steps 251 to 252.
[0093] Step 251: Call the second scheduling track according to the second preset cycle to aggregate the intermediate inference results to be processed, and obtain the second batch of data.
[0094] In this embodiment, the second scheduling track can be invoked according to a second preset period to aggregate the intermediate inference results to be processed, combining multiple intermediate inference results to form a second batch of data. The second batch of data may include data corresponding to multiple intermediate inference results to be processed. By aggregating the intermediate inference results to be processed, more data to be processed can be accumulated over a longer scheduling period to form a large batch of second batch data.
[0095] For example, in a streaming speech recognition scenario, the second scheduling track can be invoked according to a second preset period of 500ms. During each invocation, multiple preliminary transcribed texts carrying the state change identifier generated within the second preset period can be extracted, and these multiple preliminary transcribed texts can be aggregated to obtain a second batch of data.
[0096] Step 252: Execute the second inference task based on the second batch of data to obtain the target inference result.
[0097] The batch size corresponding to the second batch of data is larger than the batch size corresponding to the first batch of data.
[0098] In this embodiment of the application, a second inference task is executed based on a second batch of data by calling a second scheduling track, and the processing result of the second inference task is output as the target inference result.
[0099] In one possible application scenario of this application embodiment, the input data may include audio data, and the corresponding inference task processing can be applied to a streaming speech recognition scenario. In this scenario, the user can continuously input audio data, and the server can call the first scheduling track according to a first preset period, extract the first batch of data from the cached audio data, and perform an acoustic decoding task on the first batch of data to obtain preliminary transcribed text.
[0100] After obtaining the initial transcribed text, it can be compared with the corresponding historical processing state to determine whether the initial transcribed text has undergone substantial changes. The initial transcribed text that has undergone substantial changes is identified as the initial transcribed text to be processed. When the second preset cycle is reached, the second scheduling track can be invoked to extract the initial transcribed text to be processed. Punctuation restoration and / or semantic correction are then performed on the extracted initial transcribed text, and the text obtained after punctuation restoration and / or semantic correction is output as the target inference result.
[0101] For example, in a real-time captioning scenario at a conference, a speaker can continuously input voice. The server can perform acoustic decoding on the cached voice data according to a first preset period of 10ms to obtain preliminary transcribed text. If the preliminary transcribed text contains new text content compared to the previous processing state, the updated preliminary transcribed text can be identified as the preliminary transcribed text to be processed. When the second preset period of 500ms is reached, a second scheduling track can be invoked to restore punctuation and / or correct semantics in the current preliminary transcribed text to be processed, thereby obtaining the caption text for display.
[0102] In summary, in this embodiment, by setting up a first scheduling track and a second scheduling track, and using a first preset period and a second preset period for scheduling respectively, inference tasks with different processing timeliness requirements can be processed according to the corresponding scheduling rhythm. Simultaneously, by comparing intermediate inference results with corresponding historical processing states, changed intermediate inference results are filtered out, preventing unchanged results from repeatedly entering the subsequent inference process, thereby reducing the computational resource overhead caused by repeated inference. Furthermore, the second scheduling track can perform batch inference on the filtered results, enabling the first scheduling track to continuously process inference tasks with high real-time requirements, while the second scheduling track can process non-real-time optimization tasks with a longer period. This satisfies the processing timeliness requirements of different inference tasks while improving the utilization efficiency of computational resources and achieving coordinated processing between different inference tasks.
[0103] This application also provides a reasoning task processing device, see [link to relevant documentation]. Figure 3 The figure is a schematic diagram of the structure of a reasoning task processing device provided in an embodiment of this application. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiments of the above method. Some contents will not be repeated.
[0104] A reasoning task processing device 3100, characterized in that it comprises: Data acquisition unit 3101 is used to acquire input data; The first inference unit 3102 is used to call the first scheduling track to execute the first inference task according to the first preset period and obtain intermediate inference results; the first inference task is used to perform batch inference on the input data. The filtering unit 3103 is used to filter the intermediate inference result based on the difference between the intermediate inference result and the historical processing state corresponding to the intermediate inference result, and obtain the filtering result. The second inference unit 3104 is used to execute a second inference task according to a second preset period when the screening result indicates that there are intermediate inference results to be processed, and to obtain the target inference result; the second inference task is used to perform batch inference on the intermediate inference results to be processed, and the second preset period is greater than the first preset period.
[0105] In one possible implementation, the first inference unit is specifically used for: Store the input data in a cache; The step of executing the first inference task by calling the first scheduling track according to the first preset period to obtain intermediate inference results includes: The first scheduling track is invoked according to the first preset cycle to extract the first batch of data from the input data in the cache. The first inference task is performed based on the first batch of data to obtain intermediate inference results.
[0106] In one possible implementation, the filtering unit is specifically used for: The intermediate inference results are compared with the historical processing states corresponding to the intermediate inference results to obtain the difference information; If the difference information meets the preset change conditions, a state change identifier corresponding to the intermediate inference result is generated. The intermediate inference result carrying the state change identifier is determined as the intermediate inference result to be processed; The filtering results are generated based on the intermediate inference results to be processed.
[0107] In one possible implementation, the second inference unit is specifically used for: The second scheduling track is invoked according to the second preset cycle to extract the intermediate inference results to be processed; The second reasoning task is performed on the intermediate reasoning results to be processed to obtain the target reasoning result.
[0108] In one possible implementation, the second inference unit is specifically used for: If a preset termination event is detected, a third inference task is generated; the third inference task has a higher priority than the second inference task. Before the second scheduling track is called again according to the second preset period, the third inference task is executed to obtain the target inference result.
[0109] In one possible implementation, the second inference unit is specifically used for: The second scheduling track is invoked according to the second preset cycle to aggregate the intermediate inference results to be processed, thereby obtaining the second batch of data. The second inference task is performed based on the second batch of data to obtain the target inference result; the batch size corresponding to the second batch of data is larger than the batch size corresponding to the first batch of data.
[0110] In one possible implementation, the first scheduling track and the second scheduling track each employ independent asynchronous schedulers.
[0111] In one possible implementation, the input data includes audio data; the first inference unit is specifically used for: The acoustic decoding task is executed by calling the first scheduling track according to the first preset period to obtain preliminary transcribed text; the acoustic decoding task is used to perform acoustic decoding on the audio data; The second inference unit is specifically used for: The second scheduling track is invoked according to the second preset period to restore punctuation and / or correct semantics in the intermediate inference results to be processed, so as to obtain the target inference result.
[0112] In summary, in this embodiment, by setting up a first inference unit and a second inference unit, and executing corresponding inference tasks according to different preset cycles via a first scheduling track and a second scheduling track respectively, the device can adopt different scheduling rhythms for inference tasks with different processing timeliness requirements. By setting up a filtering unit, intermediate inference results are compared with corresponding historical processing states, and intermediate inference results are filtered based on differences, so that unchanged intermediate inference results do not need to enter the subsequent inference process, thereby reducing the computational resource overhead caused by repeated inference. Through caching, batch processing, and an independent asynchronous scheduler, the first scheduling track and the second scheduling track can execute corresponding inference tasks independently, ensuring that the first inference task is processed in a timely manner while the second inference task can process the intermediate inference results to be processed in batches, thereby improving the efficiency of computational resource utilization and realizing coordinated processing between different inference tasks.
[0113] This application provides a computer device, such as... Figure 4 As shown in the figure, this figure is a schematic diagram of the hardware structure of a computer device provided in an embodiment of this application. The computer device includes: a processor 4101 and a memory 4102. The memory 4102 is used to store program code and transmit the program code to the processor; The processor 4101 is used to execute the steps of the method described above according to the instructions in the program code.
[0114] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.
[0115] This application provides a computer program product that, when run on a computer, executes the steps of the method described above.
[0116] This application provides a chip including a processor coupled to a memory for executing computer programs or instructions stored in the memory, such that the chip implements the steps of the method described above.
[0117] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for processing reasoning tasks, characterized in that, include: Get the input data; The first inference task is executed by calling the first scheduling track according to the first preset cycle to obtain intermediate inference results; The first inference task is used to perform batch inference on the input data; Based on the difference between the intermediate inference results and the historical processing states corresponding to the intermediate inference results, the intermediate inference results are filtered to obtain the filtered results. If the screening result indicates the existence of intermediate inference results to be processed, the second inference task is executed by calling the second scheduling track according to the second preset period to obtain the target inference result; the second inference task is used to perform batch inference on the intermediate inference results to be processed, and the second preset period is longer than the first preset period.
2. The method according to claim 1, characterized in that, The intermediate inference results are filtered based on the difference between the intermediate inference results and the corresponding historical processing states to obtain the filtered results, including: The intermediate inference results are compared with the historical processing states corresponding to the intermediate inference results to obtain the difference information; If the difference information meets the preset change conditions, a state change identifier corresponding to the intermediate inference result is generated. The intermediate inference result carrying the state change identifier is determined as the intermediate inference result to be processed; The filtering results are generated based on the intermediate inference results to be processed.
3. The method according to claim 2, characterized in that, The step of calling the second scheduling track to execute the second inference task according to the second preset period to obtain the target inference result includes: The second scheduling track is invoked according to the second preset cycle to extract the intermediate inference results to be processed; The second reasoning task is performed on the intermediate reasoning results to be processed to obtain the target reasoning result.
4. The method according to claim 1, characterized in that, The method further includes: If a preset termination event is detected, a third inference task is generated; the third inference task has a higher priority than the second inference task. Before the second scheduling track is called again according to the second preset period, the third inference task is executed to obtain the target inference result.
5. The method according to claim 1, characterized in that, Before the step of executing the first inference task according to the first preset period and obtaining the intermediate inference result by calling the first scheduling track, the method further includes: Store the input data in a cache; The step of executing the first inference task by calling the first scheduling track according to the first preset period to obtain intermediate inference results includes: The first scheduling track is invoked according to the first preset cycle to extract the first batch of data from the input data in the cache. The first inference task is performed based on the first batch of data to obtain intermediate inference results.
6. The method according to claim 5, characterized in that, The step of calling the second scheduling track to execute the second inference task according to the second preset period to obtain the target inference result includes: The second scheduling track is invoked according to the second preset cycle to aggregate the intermediate inference results to be processed, thereby obtaining the second batch of data. The second inference task is performed based on the second batch of data to obtain the target inference result; the batch size corresponding to the second batch of data is larger than the batch size corresponding to the first batch of data.
7. The method according to any one of claims 1 to 6, characterized in that, The first scheduling track and the second scheduling track each use an independent asynchronous scheduler.
8. The method according to any one of claims 1 to 6, characterized in that, The input data includes audio data; the step of calling the first scheduling track to execute the first inference task according to the first preset period to obtain intermediate inference results includes: The acoustic decoding task is executed by calling the first scheduling track according to the first preset period to obtain preliminary transcribed text; the acoustic decoding task is used to perform acoustic decoding on the audio data; When the screening result indicates the existence of intermediate inference results to be processed, the second inference task is executed by calling the second scheduling track according to the second preset period to obtain the target inference result, including: The second scheduling track is invoked according to the second preset period to restore punctuation and / or correct semantics of the intermediate inference results to be processed, so as to obtain the target inference result.
9. A reasoning task processing device, characterized in that, include: The data acquisition unit is used to acquire input data; The first inference unit is used to call the first scheduling track to execute the first inference task according to the first preset period and obtain intermediate inference results; The first inference task is used to perform batch inference on the input data; A filtering unit is used to filter the intermediate inference results based on the difference between the intermediate inference results and the historical processing states corresponding to the intermediate inference results, and obtain the filtering results. The second inference unit is used to execute a second inference task according to a second preset period when the screening result indicates that there are intermediate inference results to be processed, thereby obtaining the target inference result; the second inference task is used to perform batch inference on the intermediate inference results to be processed, and the second preset period is longer than the first preset period.
10. A computer device, characterized in that, The computer device includes: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps of the method as described in any one of claims 1 to 8 according to instructions in the program code.
