Task data processing method and device, and electronic device

By cleaning and storing task data upon receiving an interruption signal, the problem of data accumulation caused by interruptions in artificial intelligence task processing is solved, ensuring the continuity and stability of data processing.

CN116361040BActive Publication Date: 2026-04-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2021-12-27
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

When an AI task is interrupted, unprocessed data accumulates in the pipeline structure, causing data processing anomalies in subsequent tasks.

Method used

By clearing the task data in the first and second data buffer modules after receiving an interrupt signal, and storing task status data to restore the task when necessary, the continuity of data processing is ensured.

Benefits of technology

This avoids data processing anomalies caused by interrupt signals, improving the flexibility and stability of the task execution process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116361040B_ABST
    Figure CN116361040B_ABST
Patent Text Reader

Abstract

This application discloses a task data processing method, apparatus, and electronic device. The method includes: a second data processing module responding to a received interrupt signal to acquire the content of the received interrupt signal; if the content of the interrupt signal indicates termination of the current task and commencement of the next task, clearing the task data corresponding to the current task in the first data buffer module, the second data processing module, and the second data buffer module; if the content of the interrupt signal indicates pausing the current task and commencement of the next task, storing the task status data corresponding to the current task; and executing the next task corresponding to the interrupt signal. This method allows for clearing the current task data or storing the task status data corresponding to the current task based on the interrupt signal, avoiding data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a task data processing method, apparatus, and electronic device. Background Technology

[0002] In related approaches, artificial intelligence tasks typically require the use of pipelined structures to process data. For example, when a Neural Network Processing Unit (NPU) executes an algorithm to process an image, it generally first needs to preprocess the image, then input the processed image into the NPU for further processing, and finally input the processed image into the display module for display.

[0003] However, there are still issues with data processing anomalies in the relevant task data processing methods. For example, when a task is interrupted during execution, the data corresponding to the task has not yet been processed and accumulates in the pipeline structure, causing anomalies in the data processing of subsequent tasks in the pipeline. Summary of the Invention

[0004] In view of the above problems, this application proposes a task data processing method, apparatus, electronic device, and computer program product to improve the above problems.

[0005] In a first aspect, this application provides a task data processing method applied to an electronic device. The electronic device includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module stores data output by the first data processing module. The second data processing module reads data from the first data buffer module during task execution, processes it, and outputs the processed data to the second data buffer module. The electronic device also includes a first mailbox module for communication between the first data processing module and the second data processing module. The method includes: the second data processing module responding to a received interrupt signal to obtain the content of the received interrupt signal; if the content of the interrupt signal indicates termination of the current task and commencement of the next task, clearing the task data corresponding to the current task in the first data buffer module and the second data processing module, and clearing the task data corresponding to the current task in the second data buffer module; if the content of the interrupt signal indicates pause of the current task and commencement of the next task, storing task status data corresponding to the current task, which is used by the second data processing module to resume execution of the current task after completing the next task; and executing the next task corresponding to the interrupt signal.

[0006] Secondly, this application provides a task data processing device operating in an electronic device. The electronic device includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module stores data output by the first data processing module. The second data processing module reads data from the first data buffer module during task execution, processes it, and outputs the processed data to the second data buffer module. The electronic device also includes a first mailbox module for communication between the first and second data processing modules. The device includes an interrupt signal content acquisition unit, used by the second data processing module in response to a received interrupt signal. The system includes: a current task data cleanup unit, configured to clean up the task data corresponding to the current task in the first data buffer module and the second data processing module, and clean up the task data corresponding to the current task in the second data buffer module, if the content of the interrupt signal indicates termination of the current task and commencement of the next task; a current task status data storage unit, configured to store the task status data corresponding to the current task, if the content of the interrupt signal indicates termination of the current task and commencement of the next task, and the task status data is used to resume execution of the current task after the second data processing module has completed the execution of the next task; and a next task execution unit, configured to execute the next task corresponding to the interrupt signal.

[0007] Thirdly, this application provides an electronic device, including a first data processing module, a second data processing module, a first data buffer module, a second data buffer module, a first mailbox module, and a memory. The first data buffer module is used to store data output by the first data processing module. The second data processing module is used to read data from the first data buffer module for processing during task execution and output the processed data to the second data buffer module. The first mailbox module is used for communication between the first data processing module and the second data processing module. One or more programs are stored in the memory and configured to be executed by the data processing module, and the one or more programs are configured to perform the above-described method.

[0008] Fourthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

[0009] Fifthly, this application provides a computer-readable storage medium storing program code, wherein the above-described method is executed when the program code is run.

[0010] This application provides a task data processing method, apparatus, electronic device, computer program product, and storage medium. In response to a received interrupt signal, the second data processing module acquires the content of the received interrupt signal. If the interrupt signal indicates termination of the current task and commencement of the next task, the module clears the task data corresponding to the current task in both the first and second data processing modules, and also clears the task data corresponding to the current task in the second data buffer module. If the interrupt signal indicates pause of the current task and commencement of the next task, the module stores the task status data corresponding to the current task. This task status data is used by the second data processing module to resume execution of the current task and the next task corresponding to the interrupt signal after the second data processing module has completed the next task. This method allows for the clearing or storage of task status data corresponding to the current task based on the interrupt signal, avoiding data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0012] Figure 1 A flowchart of a task data processing method according to an embodiment of this application is shown;

[0013] Figure 2 This application shows Figure 1 A flowchart of one embodiment of S120;

[0014] Figure 3 This invention illustrates a method for clearing the data corresponding to the current task of the first data buffer module.

[0015] Figure 4 This invention illustrates a method for clearing the data corresponding to the current task of the second data buffer module.

[0016] Figure 5 A flowchart of a task data processing method according to another embodiment of this application is shown;

[0017] Figure 6 This illustration shows a schematic diagram of a second data processing module executing the next task corresponding to an interrupt signal, according to an embodiment of this application.

[0018] Figure 7This paper shows a structural block diagram of a task data processing apparatus according to an embodiment of the present application;

[0019] Figure 8 A structural block diagram of an electronic device proposed in this application is shown;

[0020] Figure 9 This is a storage unit in this application embodiment for storing or carrying program code that implements the task data processing method according to this application embodiment. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0022] In related approaches, artificial intelligence tasks typically require the use of pipelined structures to process task data. For example, when a Neural Network Processing Unit (NPU) executes an algorithm to process an image, it generally first needs to preprocess the image, then input the processed image into the NPU for further processing, and finally input the processed image into the display module for display.

[0023] The inventors discovered in their research that there are still data processing anomalies in the relevant task data processing methods. For example, when a task is interrupted during execution, the data corresponding to the task has not yet been processed and accumulates in the pipeline structure, causing anomalies in the subsequent task data processing in the pipeline.

[0024] Therefore, the inventors have proposed a task data processing method, apparatus, electronic device, and computer program product in this application. After the second data processing module responds to a received interrupt signal and obtains the content of the received interrupt signal, if the content of the interrupt signal indicates termination of the current task and commencement of the next task, the task data corresponding to the current task in the first data buffer module and the second data processing module is cleared, as is the task data corresponding to the current task in the second data buffer module. If the content of the interrupt signal indicates pause of the current task and commencement of the next task, the task status data corresponding to the current task is stored. This task status data is used by the second data processing module to resume execution of the current task and execute the next task corresponding to the interrupt signal after the second data processing module has completed the execution of the next task. This method allows for the clearing or storage of task status data corresponding to the current task based on the interrupt signal, avoiding data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal.

[0025] Please see Figure 1 This application provides a task data processing method applied to an electronic device. The electronic device includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module stores data output by the first data processing module. The second data processing module reads data from the first data buffer module during task execution, processes it, and outputs the processed data to the second data buffer module. The electronic device also includes a first mailbox module for communication between the first data processing module and the second data processing module. The method includes:

[0026] S110: The second data processing module responds to the received interrupt signal and obtains the content of the received interrupt signal.

[0027] In this embodiment, the second data processing module is a module capable of performing data calculation and image data processing. More specifically, the second data processing module can be a chip with data calculation and image processing functions, such as an NPU or a DSP (Digital Signal Processing).

[0028] In one approach, the central control module (e.g., MCU (Microcontroller Unit), CPU (Central Processing Unit)) may respond to an interrupt request from other functional modules in the electronic device (e.g., telephone communication module, voice receiving module, etc.) by sending an interrupt signal to the second data processing module. This interrupt request can indicate that other functional modules require the second data processing module to process the task data corresponding to that functional module.

[0029] As another approach, it could be an interrupt signal sent directly from other functional modules in the electronic device (e.g., telephone communication module, voice receiving module, etc.) to the second data processing module.

[0030] Furthermore, in the embodiments of this application, the content of the interrupt signal can be to terminate the task being executed by the second data processing module and start executing the next task, or to pause the task being executed by the second data processing module and start executing the next task.

[0031] One approach is to determine the content of the interrupt signal based on the application scenario. For example, when the second data processing module is performing a video processing task, and the telephone communication function module needs the second data processing module to process telephone-related task data, the telephone communication function module can directly send an interrupt signal to the second data processing module indicating the termination of the video processing task and the execution of the telephone processing task. Alternatively, the telephone communication function module can send an interrupt request to the central control module, indicating that the telephone communication function module needs the second data processing module to process telephone-related task data. In response to this interrupt request, the central control module can send an interrupt signal to the second data processing module indicating the termination of the video processing task and the execution of the telephone processing task.

[0032] For example, when the second data processing module is performing a music playback task, the voice receiving module needs the second data processing module to process voice-related task data. In this case, the voice receiving module can directly send an interrupt signal to the second data processing module, indicating that the music playback task is paused and the voice receiving task is executed. Alternatively, the voice receiving module can send an interrupt request to the central control module. This request indicates that the voice receiving module needs the second data processing module to process voice-related task data. In response to this interrupt request, the central control module can send an interrupt signal to the second data processing module, indicating that the music playback task is paused and the voice receiving task is executed.

[0033] S120: If the content of the interrupt signal indicates that the current task is terminated and the next task is started, clear the task data corresponding to the current task in the first data buffer module and the second data processing module, and clear the task data corresponding to the current task in the second data buffer module.

[0034] Among them, as a method, such as Figure 2 As shown, clearing the task data corresponding to the current task in the first data buffer module and the second data processing module includes:

[0035] S121: Clear the task data corresponding to the current task in the second data processing module by using a reset signal.

[0036] In one approach, when the second data processing module responds to an interrupt signal sent by the central control module or other functional modules of the electronic device, which indicates the termination of the current task and the start of the next task, the central control module can send a reset signal to the second data processing module, thereby clearing the task data corresponding to the current task in the second data processing module.

[0037] S122: Send a first signal to the first mailbox module. The first signal is used to notify the first data processing module that the task data corresponding to the current task in the first data buffer module is in a cleanable state.

[0038] In this embodiment, the first mailbox module is a communication module that enables communication between different modules. More specifically, the first mailbox module can be a module that communicates between the first data processing module and the second data processing module, such as a mailbox communication (MAILBOX) module. The first data processing module can be a module for data preprocessing, for example, the first data processing module can perform image resizing, translation, rotation, and other processing.

[0039] Optionally, data that needs to be preprocessed can be input to the first data processing module via DMA (Direct Memory Access).

[0040] In one approach, the second data processing module can send a first signal to the first mailbox module to clear the task data corresponding to the current task in the first data buffer module. This first signal can be used to notify the first data processing module via the first mailbox module that the task data corresponding to the current task in the first data buffer module is in a cleanable state. The first signal can include a fake read signal and a read completion signal. The fake read signal can be used to start a fake read thread, and the read completion signal can be used to indicate that the second data processing module has finished reading the task data corresponding to the current task from the first data buffer module.

[0041] More specifically, such as Figure 3 As shown, when it is necessary to clean up the task data corresponding to the current task in the first data buffer module, the second data processing module can first send a fake read signal to the first mailbox module to indicate that the "fake read" thread has been started, and then send a read completion signal (such as a csync signal) to the first mailbox module through the "fake read" thread. The read completion signal indicates that the second data processing module has finished reading the task data corresponding to the current task in the first data buffer module, but in fact, the second data processing module has not performed the operation of reading the task data corresponding to the current task in the first data buffer module. When MAILBOX receives the fake read signal and the read completion signal (such as a csync signal) in succession, it can increase the available storage space of the current first data buffer module. The increased available storage space is exactly the same as the storage space required for the task data corresponding to the current task. This allows the data output by the first data processing module corresponding to the next task to overwrite the task data corresponding to the current task in the first data buffer module during the execution of the next task, thereby realizing the cleanup of the task data corresponding to the current task in the first data buffer module.

[0042] Furthermore, in this embodiment, the electronic device also includes a data output module and a second mailbox module. The second mailbox module is a communication module that enables communication between different modules. More specifically, the second mailbox module can be a module that communicates between the second data processing module and the data output module, such as a mailbox communication (MAILBOX) module. The data output module can be used to read data from the second data buffer module and output it. More specifically, the data output module can be a display module, etc., wherein the display module can be used to display the image processed by the second data processing module.

[0043] Optionally, in this embodiment of the application, there are multiple ways to clear the task data corresponding to the current task in the second data buffer module.

[0044] In one approach, the first communication module can send a write completion signal to the data output module to clear the task data corresponding to the current task in the second data buffer module. This write completion signal can be used to trigger the data output module to read the task data corresponding to the current task in the second data buffer module, and to supplement the read task data before outputting it.

[0045] Optionally, the first communication module can be a signal line for connecting the second data processing module and the data output module. For example, such as... Figure 4 As shown, the second data processing module can send a write completion signal to the data output module via signal line 1. This signal allows the data output module to confirm that the second data processing module has written all the task data corresponding to the current task into the second data buffer module. At this point, the data output module reads the task data corresponding to the current task from the second data buffer module. Since the execution of the current task is interrupted by an interrupt signal, the data output module does not receive the complete output data corresponding to the current task. In this case, the NPU can send a data supplementation command to the data output module via signal line 1. Upon receiving this command, the data output module can complete the output data corresponding to the current task by padding with zeros and then output it.

[0046] Optionally, the first communication module may include a second data processing module, a central control module, a data output module, and a signal line for connecting the second data processing module, the central control module, and the data output module. For example,... Figure 4 As shown, the second data processing module can send a write completion signal to the data output module via signal line 2 through the central control module. Similarly, since the execution of the current task is interrupted by an interrupt signal, the data output module does not receive the complete output data corresponding to the current task. At this time, the NPU can send a data supplementation command to the data output module via signal line 2 through the central control module. After receiving the command, the data output module can supplement the output data corresponding to the current task by padding with zeros and other methods before outputting it.

[0047] Optionally, when the write completion signal can be sent from the second data processing module to the data output module via signal line 1, the data supplementation command can also be sent from the second data processing module via signal line 2 to the data output module via the central control module.

[0048] Alternatively, a second signal can be sent to the second mailbox module to clean up the task data corresponding to the current task in the second data buffer module. This second signal can be used to trigger the data output module to read and output the task data corresponding to the current task from the second data buffer module. The second signal can include a fake write signal and a write completion signal. The fake write signal can be used to start a fake write thread, and the write completion signal can be used to indicate that the second data processing module has finished reading the task data corresponding to the current task from the first data buffer module.

[0049] More specifically, such as Figure 4 As shown, when it is necessary to clean up the task data corresponding to the current task in the second data buffer module, the second data processing module can first send a fake write signal to the second mailbox module to indicate that the "fake write" thread has been started. Then, through the "fake write" thread, it sends a write completion signal (such as the psync signal) to the second mailbox module. This indicates that the second data processing module has written all the task data corresponding to the current task into the second data buffer module, but in reality, the second data processing module has not performed the operation of writing the task data corresponding to the current task. When MAILBOX receives the fake write signal and the write completion signal (such as the psync signal) in succession, it can reduce the available storage space of the current second data buffer module. The reduced available storage space is exactly the same as the storage space required for the task data corresponding to the current task in the second data processing module. This allows the data output module to determine that the second data processing module has written all the task data corresponding to the current task into the second data buffer module. At this time, the data output module can read the task data corresponding to the current task from the second data buffer module and output it, thereby realizing the cleanup of the task data corresponding to the current task in the second data buffer module.

[0050] S130: If the content of the interrupt signal indicates that the current task is paused and the next task is started, the task status data corresponding to the current task is stored. The task status data is used by the second data processing module to resume the execution of the current task after the next task is completed.

[0051] The task status data corresponding to the current task represents the processing progress of the second data processing module. More specifically, the task status data can be data information from the registers of the second data processing module. Alternatively, the second data processing module can input the task status data corresponding to the current task into its internal memory for storage.

[0052] S140: Execute the next task corresponding to the interrupt signal.

[0053] In one approach, when the second data processing module completes step S120 or S130, the second data processing module can send a task request to the central control module. This task request allows the central control module to determine that the second data processing module can begin executing the next task corresponding to the interrupt signal. After responding to the task request, the central control module can send the next task information corresponding to the interrupt signal (e.g., the data storage location of the next task) to the second data processing module so that the second data processing module can execute the next task corresponding to the interrupt signal.

[0054] This embodiment provides a task data processing method. When the second data processing module responds to a received interrupt signal and acquires the content of the received interrupt signal, if the interrupt signal indicates termination of the current task and commencement of the next task, the method clears the task data corresponding to the current task in both the first data buffer module and the second data processing module, and also clears the task data corresponding to the current task in the second data buffer module. If the interrupt signal indicates pause of the current task and commencement of the next task, the method stores the task status data corresponding to the current task. This task status data is used by the second data processing module to resume execution of the current task and the next task corresponding to the interrupt signal after the second data processing module has completed the next task. This method allows for the clearing or storage of task status data corresponding to the current task based on the interrupt signal, avoiding data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal.

[0055] Please see Figure 5 This application provides a task data processing method applied to an electronic device, comprising a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module stores data output by the first data processing module. The second data processing module reads data from the first data buffer module during task execution, processes it, and outputs the processed data to the second data buffer module. The electronic device further includes a first mailbox module for communication between the first data processing module and the second data processing module. The method includes:

[0056] S210: The second data processing module responds to the received interrupt signal and obtains the content of the received interrupt signal.

[0057] S220: If the content of the interrupt signal indicates that the current task is terminated and the next task is started, clear the task data corresponding to the current task in the first data buffer module and the second data processing module, and clear the task data corresponding to the current task in the second data buffer module.

[0058] S230: If the content of the interrupt signal indicates that the current task is paused and the next task is started, the task status data corresponding to the current task is stored. The task status data is used by the second data processing module to resume the execution of the current task after the next task is completed.

[0059] S240: If the interrupt signal indicates that the current task is paused and the next task is started, a first status signal is sent to the first data processing module through the first mailbox module to prevent the first data processing module from sending data to the first data buffer module.

[0060] The first status signal can be a signal indicating that the storage space of the first data buffer module is full; for example, the first status signal can be the pstatus signal. As one approach, when the second data processing module stops reading data from the first data buffer module, the first data processing module will continue writing data to the first data buffer module. When the storage space of the first data buffer module is full of data written by the first data processing module, the first mailbox module can send the first status signal to the first data processing module to confirm that the storage space of the first data buffer module is full, and thus stop sending data to the first data buffer module.

[0061] As one approach, once the first data processing module stops sending data and the second data processing module has finished saving the status data corresponding to the current task, the second data processing module can read the data corresponding to the next task from the electronic device's memory and output the processing result to the storage location corresponding to the output data of the next task. For example... Figure 6 As shown, the second data processing module can read the data corresponding to the next task from area A of memory 1 and output the processing result to the storage location corresponding to the output data of the next task, namely area B of memory 1 and area C of memory 2.

[0062] S250: In response to the completion of the next task, read the stored task status data.

[0063] In one approach, the second data processing module can send a recovery request to the central control module after completing the next task corresponding to the interrupt signal. This recovery request can enable the central control module to determine that the second data processing module can continue to execute the task before the interrupt signal. After responding to the recovery request, the central control module can send a recovery confirmation to the second data processing module. After receiving the recovery confirmation, the second data processing module can read the stored task status data from its internal memory.

[0064] Alternatively, the second data processing module can directly read the stored task status data from the internal memory after completing the next task corresponding to the interrupt signal.

[0065] S260: Based on the task status data, a second status signal is sent to the first data processing module through the first mailbox module to control the first data processing module to resume the execution of the current task and output data to the first data buffer module.

[0066] The second status signal can be a signal indicating that the first data buffer module still has available storage space. For example, the second status signal can be the pstatus signal. As one approach, when the second data processing module resumes execution of the task interrupted by the interrupt signal, it reads the data corresponding to the task from the first data buffer module and sends a read signal (e.g., a csync signal) to the first mailbox module. When the first mailbox module receives this read signal, it can increase the available storage space of the first data buffer module. This available storage space is the same as the data storage space read by the second data processing module. Furthermore, the first mailbox module can send the second status signal to the first data processing module to confirm that the first data buffer module still has available storage space, thereby allowing the first data processing module to continue sending the data corresponding to the task before the interrupt signal to the first data buffer module.

[0067] This embodiment provides a task data processing method that, through the aforementioned approach, allows for the clearing or storage of current task data based on interrupt signals, preventing data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal. Furthermore, in this embodiment, when the interrupt signal indicates a pause in the current task and the commencement of the next task, the second data processing module can, after completing the next task corresponding to the interrupt signal, continue executing the task interrupted by the interrupt signal by reading the task status data corresponding to the task prior to the interrupt signal, thereby improving the flexibility of the task execution process.

[0068] Please see Figure 7This application provides a task data processing device 400, which operates in an electronic device. The electronic device includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module stores data output by the first data processing module. The second data processing module reads data from the first data buffer module during task execution, processes it, and outputs the processed data to the second data buffer module. The electronic device also includes a first mailbox module for communication between the first data processing module and the second data processing module. The device 400 includes:

[0069] The signal response unit 410 is used by the second data processing module to obtain the content of the received interrupt signal in response to the received interrupt signal.

[0070] The task data cleaning unit 420 is used to clean up the task data corresponding to the current task in the first data buffer module and the second data processing module, and to clean up the task data corresponding to the current task in the second data buffer module, if the content of the interrupt signal indicates that the current task is terminated and the next task is started.

[0071] The task status data storage unit 430 is used to store the task status data corresponding to the current task if the interrupt signal pauses the current task and starts executing the next task. The task status data is used by the second data processing module to resume the execution of the current task after the second data processing module has completed the next task.

[0072] The task execution unit 440 is used to execute the next task corresponding to the interrupt signal.

[0073] In one approach, the task data cleaning unit 420 is specifically used to clean up the task data corresponding to the current task in the second data processing module through a reset signal; and to send a first signal to the first mailbox module, the first signal being used to notify the first data processing module through the first mailbox module that the task data corresponding to the current task in the first data buffer module is in a cleanable state.

[0074] Optionally, the electronic device further includes a data output module and a first communication module. The data output module is used to read data from the second data buffer module and output it. The task data cleaning unit 420 is specifically used to send a write completion signal to the data output module through the first communication module. The write completion signal is used to trigger the data output module to read the task data corresponding to the current task in the second data buffer module, and to supplement the read task data before outputting it.

[0075] Optionally, the electronic device further includes a data output module and a second mailbox module. The second mailbox module is used for communication between the second data processing module and the data output module. The data output module is used to read data from the second data buffer module and output it. The task data cleaning unit 420 is specifically used to send a second signal to the second mailbox module. The second signal is used to trigger the data output module to read the task data corresponding to the current task in the second data buffer module and output it.

[0076] Alternatively, the task status data storage unit 430 is specifically used to send a first status signal to the first data processing module through the first mailbox module if the content of the interrupt signal indicates that the current task is paused and the next task is started, so as to prevent the first data processing module from sending data to the first data buffer module.

[0077] In another manner, the task execution unit 440 is specifically used to read the stored task status data in response to the completion of the next task; and to send a second status signal to the first data processing module through the first mailbox module based on the task status data, so as to control the first data processing module to resume the execution of the current task and output data to the first data buffer module.

[0078] The following will combine Figure 8 This application describes an electronic device.

[0079] Please see Figure 8 Based on the aforementioned task data processing method and apparatus, this application embodiment also provides another electronic device 100 capable of executing the aforementioned task data processing method. The electronic device 100 includes a first data processing module 102, a second data processing module 104, a memory 106, a first data buffer module 108, a second data buffer module 110, and a first mailbox module 112. The first data processing module 102 is used to preprocess task data; the first data buffer module 108 is used to store data output by the first data processing module; the second data processing module 104 is used to read data from the first data buffer module 108 during task execution, process it, and output the processed data to the second data buffer module 110; the first mailbox module 112 is used for communication between the first data processing module 102 and the second data processing module 104. The memory 106 stores programs capable of executing the contents of the aforementioned embodiments, and the second data processing module 104 can execute the programs stored in the memory 106.

[0080] The second data processing module 104 may include one or more processing cores. The second data processing module 104 connects to various parts within the electronic device 100 using various interfaces and lines. It executes various functions of the electronic device 100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 106, and by calling data stored in the memory 106. Optionally, the second data processing module 104 may be implemented using at least one of the following hardware forms: a network processor (NPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The second data processing module 104 may integrate one or a combination of several of the following: a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; the NPU handles multimedia data such as video and images; and the modem handles wireless communication. It is understood that the modem may not be integrated into the second data processing module 104 and can be implemented using a separate communication chip.

[0081] The memory 106 may include random access memory (RAM) or read-only memory (ROM). The memory 106 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 106 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the terminal 100 during use (such as phonebook data, audio and video data, chat log data, etc.).

[0082] The electronic device also includes a second mailbox module 114 and a data output module 116. The second mailbox module 114 is used for communication between the second data processing module 104 and the data output module 116. The data output module 116 is used to read data from the second data buffer module 110 and output it.

[0083] Please refer to Figure 9 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 800 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0084] The computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 810 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 810 may, for example, be compressed in a suitable form.

[0085] In summary, the task data processing method, apparatus, and electronic device provided in this application, after the second data processing module responds to a received interrupt signal and obtains the content of the received interrupt signal, if the content of the interrupt signal indicates termination of the current task and commencement of the next task, clears the task data corresponding to the current task in both the first data buffer module and the second data processing module, and also clears the task data corresponding to the current task in the second data buffer module. If the content of the interrupt signal indicates pause of the current task and commencement of the next task, the task status data corresponding to the current task is stored. This task status data is used by the second data processing module to resume execution of the current task and execute the next task corresponding to the interrupt signal after completing the next task. This approach allows for the clearing or storage of task status data corresponding to the current task based on the interrupt signal, avoiding data processing anomalies when the electronic device executes the next task corresponding to the interrupt signal.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A task data processing method, characterized in that, The invention is applied to an electronic device, which includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module is used to store the data output by the first data processing module. The second data processing module is used to read data from the first data buffer module for processing during the execution of a task and output the processed data to the second data buffer module. The electronic device further includes a first mailbox module, which is used for communication between the first data processing module and the second data processing module. The method includes: The second data processing module responds to the received interrupt signal and obtains the content of the received interrupt signal; If the interrupt signal indicates that the current task is terminated and the next task is started, the task data corresponding to the current task in the first data buffer module and the second data processing module is cleared, and the task data corresponding to the current task in the second data buffer module is also cleared. If the interrupt signal indicates that the current task is paused and the next task is started, the task status data corresponding to the current task is stored. The task status data is used by the second data processing module to resume the execution of the current task after the next task is completed. Execute the next task corresponding to the interrupt signal.

2. The method according to claim 1, characterized in that, The step of clearing the task data corresponding to the current task in the first data buffer module and the second data processing module includes: The task data corresponding to the current task in the second data processing module is cleared by a reset signal; A first signal is sent to the first email module. The first signal is used to notify the first data processing module that the task data corresponding to the current task in the first data buffer module is in a cleanable state.

3. The method according to claim 1, characterized in that, The electronic device further includes a data output module and a first communication module. The data output module is used to read data from the second data buffer module and output it. Clearing the task data corresponding to the current task in the second data buffer module includes: The first communication module sends a write completion signal to the data output module. The write completion signal is used to trigger the data output module to read the task data corresponding to the current task from the second data buffer module, and to supplement the read task data before outputting it.

4. The method according to claim 1, characterized in that, The electronic device further includes a data output module and a second mailbox module. The second mailbox module is used for communication between the second data processing module and the data output module. The data output module is used to read data from the second data buffer module and output it. Clearing the task data corresponding to the current task in the second data buffer module includes: A second signal is sent to the second mailbox module, which triggers the data output module to read the task data corresponding to the current task from the second data buffer module and output it.

5. The method according to claim 1, characterized in that, The method further includes: If the interrupt signal indicates that the current task is paused and the next task is started, a first status signal is sent to the first data processing module through the first mailbox module to prevent the first data processing module from sending data to the first data buffer module.

6. The method according to any one of claims 1-5, characterized in that, If the interrupt signal indicates that the current task is paused and the next task is started, after storing the task status data corresponding to the current task, the method further includes: In response to the completion of the next task, the stored task status data is read; Based on the task status data, the first email module sends a second status signal to the first data processing module to control the first data processing module to resume the execution of the current task and output data to the first data buffer module.

7. A task data processing device, characterized in that, The invention is applied to an electronic device, which includes a first data processing module, a second data processing module, a first data buffer module, and a second data buffer module. The first data buffer module is used to store the data output by the first data processing module. The second data processing module is used to read data from the first data buffer module for processing during the execution of a task and output the processed data to the second data buffer module. The electronic device further includes a first mailbox module, which is used for communication between the first data processing module and the second data processing module. The device includes: A signal response unit is used for the second data processing module to obtain the content of the received interrupt signal in response to the received interrupt signal; The task data cleaning unit is used to clean up the task data corresponding to the current task in the first data buffer module and the second data processing module, and to clean up the task data corresponding to the current task in the second data buffer module, if the content of the interrupt signal indicates that the current task is terminated and the next task is started. A task status data storage unit is used to pause the current task and start executing the next task if the interrupt signal content is paused. The task status data is used by the second data processing module to resume the execution of the current task after the second data processing module has completed the next task. The task execution unit is used to execute the next task corresponding to the interrupt signal.

8. An electronic device, characterized in that, It includes a first data processing module, a second data processing module, a first data buffer module, a second data buffer module, a first mailbox module, and a memory. The first data buffer module is used to store the data output by the first data processing module. The second data processing module is used to read data from the first data buffer module during the execution of the task, process the data, and output the processed data to the second data buffer module. The first email module is used for communication between the first data processing module and the second data processing module; One or more programs are stored in the memory and configured to be executed by the data processing module, the one or more programs being configured to perform the method of any one of claims 1-6.

9. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code, wherein the method described in any one of claims 1-6 is executed when the program code is run.

Citation Information

Patent Citations

  • Data processing method and system and electronic equipment

    CN111444022A

  • Neural network segmentation method, prediction method, and related apparatus

    CN112543918A