A method, device and medium for implementing a secure delegated management strategy for audio processing

By establishing a security commission in the audio processing equipment and performing parameter verification, combining synchronous and asynchronous task management, real-time monitoring and optimization of the audio processing process, the difficulty of multi-task coordination, data competition and security in traditional audio processing is solved, and the problem of multi-task coordination in traditional audio processing is improved. Processing effect and security.

CN119002858BActive Publication Date: 2025-02-25GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411199258.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-02-25
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

There are problems in traditional digital audio processing methods that have difficulty in multi-task coordination, untimely data processing, and data competition and conflict in multi-threaded environments, which affect the effect and quality of audio processing, and at the same time, data security is not guaranteed.

Method used

Using a single access protection technology of threads and data, a security commission corresponding to audio processing matters is established, and a parameter verification of the security commission is carried out. Through synchronous tasks, asynchronous tasks perform audio effect processing and audio playback, and monitor task execution time and audio processing frame rate in real time, dynamically adjust and optimize the execution of delegated instances.

Benefits of technology

It improves the security and reliability of the digital audio processing process, avoids data competition and conflict in multi-threaded environments, ensures the integrity of audio data, and improves the execution efficiency and quality of audio processing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119002858B_ABST
    Figure CN119002858B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of audio processing technology, and specifically discloses a method, device and medium for implementing a security delegation management strategy for audio processing, including using a single access protection technology for threads and data to establish a security delegation corresponding to an audio processing matter, and performing parameter verification on the security delegation; if the result of the parameter verification is not passed, the security delegation is stopped and the security delegation is re-established for the audio processing matter; otherwise, a delegation instance corresponding to the security delegation is created in an audio processing device; a delegation instance corresponding to audio acquisition is executed in a synchronous task manner, and a delegation instance corresponding to audio effect processing and audio playback is executed in an asynchronous task manner; the task execution time and audio processing frame rate of the delegation instance are monitored in real time, and the execution of the delegation instance is dynamically adjusted and optimized according to the monitoring result; and corresponding subsequent operations are executed according to the result returned by the delegation instance. The present invention improves the security and reliability of the audio processing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio processing, and in particular to a method, device and medium for implementing a security delegation management strategy for audio processing. Background Art

[0002] The process of digital audio processing involves many complex operations, such as real-time data processing in the process of collecting audio signals, adding and processing audio effects, and outputting audio. However, in traditional digital audio processing methods, there are generally problems such as difficulty in multi-task coordination, untimely data processing, and data competition and conflict in a multi-threaded environment, which affect the effect and quality of audio processing. At the same time, the data security in the audio processing process cannot be guaranteed. Summary of the invention

[0003] In order to overcome the problems of poor data security and reliability in the existing digital audio processing process, the present invention provides a method, device and medium for implementing a security delegation management strategy for audio processing.

[0004] The present invention provides a method for implementing a security delegation management strategy for audio processing, which is applied to the security management of audio data in an audio processing device, and is characterized in that it includes the following steps:

[0005] Using the single access protection technology of threads and data, a security delegation corresponding to the audio processing matters is established, and parameter verification is performed on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback;

[0006] If the result of the parameter check is not passed, the security delegation is stopped and a security delegation is re-established for the audio processing matter; otherwise, a delegation instance corresponding to the security delegation is created in the audio processing device;

[0007] Use synchronous tasks to execute the delegate instance corresponding to audio acquisition, and use asynchronous tasks to execute the delegate instance corresponding to audio effect processing and audio playback;

[0008] Monitor the task execution time and audio processing frame rate of the delegate instance in real time, and dynamically adjust and optimize the execution of the delegate instance based on the monitoring results;

[0009] According to the result returned by the delegate instance, corresponding subsequent operations are performed; wherein the subsequent operations include transmitting audio signals, outputting audio data, or outputting error prompts.

[0010] Preferably, the step of creating a delegation instance corresponding to the security delegation in the audio processing device further comprises the following steps:

[0011] The execution process of the delegate instance is monitored in real time through an exception handling mechanism. When an exception occurs in the execution of the delegate instance, the exception handling mechanism stops the execution of the delegate instance, releases the thread and audio data occupied by the delegate instance, and issues an error message.

[0012] Preferably, the step uses a single access protection technology for threads and data to establish a security delegation corresponding to the audio processing matter, and performs parameter verification on the security delegation, including the following sub-steps:

[0013] Use lock mechanisms and semaphore techniques to restrict multi-threaded data access.

[0014] Preferably, the step uses a single access protection technology for threads and data to establish a security delegation corresponding to the audio processing matter, and performs parameter verification on the security delegation, including the following sub-steps:

[0015] The audio data to be written and read is stored using an atomic type register, and the data area storing the audio data is locked when the audio data is called.

[0016] Preferably, the real-time monitoring of the task execution time and the audio processing frame rate of the delegate instance, and dynamically adjusting and optimizing the execution of the delegate instance according to the monitoring results, comprises the following steps:

[0017] Set the maximum execution time and target frame rate of the asynchronous task;

[0018] During the execution of the asynchronous task, a timer is started to monitor the execution time of the asynchronous task each time it is executed, and when the execution time is greater than the maximum execution time, the thread allocation, algorithm and load balancing of the asynchronous task are optimized;

[0019] The frame rate of the audio data processed by the asynchronous task is monitored in real time, and when the frame rate is less than the target frame rate, the thread allocation, algorithm and load balancing of the asynchronous task are optimized.

[0020] The present invention also provides a device for implementing a security delegation management strategy for audio processing, comprising: a security delegation module, a delegation instance module, a task execution module, a dynamic optimization module and a result processing module;

[0021] The security delegation module is used to use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform parameter verification on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback;

[0022] The delegation instance module is used to stop the security delegation and re-establish the security delegation for the audio processing matter if the result of the parameter verification fails; otherwise, create a delegation instance corresponding to the security delegation in the audio processing device;

[0023] The task execution module is used to execute the delegate instance corresponding to audio acquisition in a synchronous task manner, and to execute the delegate instance corresponding to audio effect processing and audio playback in an asynchronous task manner;

[0024] The dynamic optimization module is used to monitor the task execution time and audio processing frame rate of the delegate instance in real time, and dynamically adjust and optimize the execution of the delegate instance according to the monitoring results;

[0025] The result processing module is used to perform corresponding subsequent operations according to the result returned by the delegation instance; wherein the subsequent operations include transmitting audio signals, outputting audio data or outputting error prompts.

[0026] The present invention provides a terminal device, including a processor and a storage device, wherein the storage device is used to store one or more programs; when the one or more programs are executed by the processor, the processor implements the above-mentioned method for implementing the security delegation management strategy of audio processing.

[0027] The present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned method for implementing the security delegation management strategy for audio processing.

[0028] The beneficial effects of the present invention are:

[0029] (1) By defining and using secure delegation, we ensure that the assignment and execution of tasks are verified and authorized, thus improving the security and reliability of the digital audio processing process.

[0030] (2) By using thread synchronization technology, the integrity of audio data is ensured and data competition and conflicts are avoided in a multi-threaded environment.

[0031] (3) Ensure the efficiency and quality of audio processing tasks through real-time monitoring and optimization, and detect and solve problems in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The present invention will be further described below in conjunction with the accompanying drawings, wherein:

[0033] Figure 1 This is a flow chart of a method according to Embodiment 1 of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] See also Figure 1 As a first embodiment of the present invention, a method for implementing a security delegation management strategy for audio processing is disclosed, which is applied to the security management of audio data in an audio processing device, and includes the following steps:

[0036] S1. Security delegation: Use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform strict parameter verification on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback;

[0037] S2, delegation instance: if the result of the parameter verification is not passed, return to step S1; otherwise, create a delegation instance corresponding to the security delegation in the audio processing device;

[0038] S3, task execution: Use synchronous tasks to execute the delegate instance corresponding to audio acquisition, and use asynchronous tasks to execute the delegate instance corresponding to audio effect processing and audio playback;

[0039] S4, dynamic optimization: real-time monitoring of the task execution time and audio processing frame rate of the delegated instance, and dynamic adjustment and optimization of the execution of the delegated instance based on the monitoring results;

[0040] S5. Result processing: executing corresponding subsequent operations according to the result returned by the delegation instance; wherein the subsequent operations include transmitting audio signals, outputting audio data, or outputting error prompts.

[0041] This embodiment defines and uses security delegation to ensure that the allocation and execution of tasks are verified and authorized, thereby improving the security and reliability of the digital audio processing process; by using thread synchronization technology, the integrity of audio data is ensured to avoid data competition and conflicts in a multi-threaded environment; through real-time monitoring and optimization, the execution efficiency and quality of audio processing tasks are ensured, and problems are discovered and resolved in a timely manner.

[0042] This embodiment also provides a device for implementing a security delegation management strategy for audio processing, including: a security delegation module, a delegation instance module, a task execution module, a dynamic optimization module, and a result processing module;

[0043] The security delegation module is used to use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform parameter verification on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback;

[0044] The delegation instance module is used to stop the security delegation and re-establish the security delegation for the audio processing matter if the result of the parameter verification fails; otherwise, create a delegation instance corresponding to the security delegation in the audio processing device;

[0045] The task execution module is used to execute the delegate instance corresponding to audio acquisition in a synchronous task manner, and to execute the delegate instance corresponding to audio effect processing and audio playback in an asynchronous task manner;

[0046] The dynamic optimization module is used to monitor the task execution time and audio processing frame rate of the delegate instance in real time, and dynamically adjust and optimize the execution of the delegate instance according to the monitoring results;

[0047] The result processing module is used to perform corresponding subsequent operations according to the result returned by the delegation instance; wherein the subsequent operations include transmitting audio signals, outputting audio data or outputting error prompts.

[0048] The following is a second embodiment of the present invention. The difference between this embodiment and the first embodiment is that this embodiment provides a method for implementing a security delegation management strategy based on C# in an audio processor. In step S2 of this embodiment, the following sub-steps are also included:

[0049] S21. The execution process of the delegate instance is monitored in real time through an exception handling mechanism. When an exception occurs in the execution of the delegate instance, the exception handling mechanism stops the execution of the delegate instance, releases the thread and audio data occupied by the delegate instance, and issues an error message.

[0050] The step S1 of this embodiment further includes the following sub-steps:

[0051] S11. Use lock mechanism and semaphore technology to restrict multi-threaded data access to avoid data competition and conflict when multi-threaded accesses audio data. This thread synchronization technology ensures data consistency.

[0052] S12, storing the written and read audio data in an atomic type register, and locking the data area storing the audio data when the audio data is called, so that the audio data has atomicity when called.

[0053] Lock the data area to ensure that only one thread can access and modify the data to avoid interference from other threads. When one thread is collecting data, other threads cannot read or write to the data area, ensuring the integrity of the data and protecting the data area from interference from other threads during the data collection process.

[0054] In step S4 of this embodiment, the sub-steps are as follows:

[0055] S41, setting the maximum execution time and target frame rate of the asynchronous task;

[0056] S42, during the execution of the asynchronous task, starting a timer to monitor the execution time of each execution of the asynchronous task, and when the execution time is greater than the maximum execution time, optimizing the thread allocation, algorithm and load balancing of the asynchronous task;

[0057] S43, monitoring the frame rate of the audio data processed by the asynchronous task in real time, and when the frame rate is less than the target frame rate, optimizing the thread allocation, algorithm and load balancing of the asynchronous task.

[0058] The following is a third embodiment of the present invention, which is a more specific embodiment of the second embodiment. In traditional audio processing, possible unsafe factors include:

[0059] 1. Data competition and conflict in a multi-threaded environment;

[0060] 2. Difficulties in task coordination may lead to untimely or erroneous data processing;

[0061] 3. Lack of effective exception handling mechanism. Once an exception occurs, it may cause the entire system to crash or data to be damaged.

[0062] Therefore, the implementation steps of this embodiment are as follows:

[0063] A1. Use single access protection technology for threads and data to ensure the integrity of audio data and avoid data competition;

[0064] The specific steps of step A1 are as follows:

[0065] A11 uses lock mechanisms and semaphores to ensure data consistency and avoid data competition and conflicts;

[0066] Lock mechanism: Use lock (dataLock) to ensure that only one thread can access and modify shared data at the same time. Variable: object dataLock = new object()

[0067] Semaphore: Use SemaphoreSlim to control access to shared resources to avoid data inconsistency caused by simultaneous access by multiple threads.

[0068] A12 locks the data area: locks the data area during the acquisition process to ensure that only one thread can access and modify the data to avoid interference from other threads. When one thread is acquiring data, other threads cannot read or write to the data area to ensure data integrity. For example, use the variable: lock(dataLock);

[0069] A2. Define the security delegate types related to audio processing and create corresponding security delegates according to the security delegate types; security delegate types such as audio capture delegate (AudioCaptureDelegate), parameters include the identifier of the capture device (such as microphone 1, line input 1, etc.), sampling rate (such as 44100Hz, 48000Hz, etc.), number of channels (such as mono, stereo, etc.);

[0070] The specific implementation steps of step A2 are as follows:

[0071] A21. Define the delegate type: define the delegate types related to audio processing in the system; the delegate types include audio acquisition delegate, audio effect processing delegate and audio playback delegate;

[0072] A22. Create a delegate instance: Create a corresponding delegate instance based on specific business needs and processes. For example, if you need to collect audio from a microphone, create an audio collection delegate instance and specify the collection device, sampling rate, and number of channels.

[0073] A23. Assign tasks: Assign the created delegate instances to specific objects or functions that can handle these tasks. These objects or functions need to have the ability to handle specific audio tasks and are pre-defined and verified.

[0074] A3. Strict parameter verification for security delegation: When defining delegation, strictly verify the parameters to ensure that they are within a reasonable range;

[0075] A4. In each module of audio processing, accurately create corresponding delegate instances according to specific business needs and processes. For example, in the audio acquisition module, create an audio acquisition delegate instance for specific devices and sampling parameters. After the audio acquisition delegate instance defined above is created, it can be prepared for acquisition operations. In the audio effect adding module, create an audio effect processing delegate instance according to the effect type (such as reverb, equalizer, compression, etc.) and effect strength (a value between 0-1) that needs to be added. For example, create a reverb effect processing delegate (ReverbEffectDelegate), the parameter is the reverb effect type, and the strength is set to 0.5.

[0076] A5. Execute synchronous delegate call;

[0077] The specific steps of step A5 are as follows:

[0078] A51. Initialize the acquisition parameters: Set the sampling rate to int sampleRate=44100, and collect 44100 audio data points per second. Sample Rate: The number of times the audio signal is collected per second. sampleRate=44100 means 44100 times per second. Set the number of channels to int channels=2, that is, stereo (left channel and right channel). Number of channels: The number of channels of the audio signal. channels=2 means there are two channels, left channel and right channel.

[0079] A52. Start the data acquisition task: Create and start a data acquisition task to enable it to run in real time and collect audio data. Task variable: Task.Run(()=>StartAudioCapture(sampleRate,channels)); Ensure orderly access to shared resources in a multi-threaded environment: Use ConcurrentQueue<byte[]> To organize data so that data can be written and read in a certain order to prevent data confusion.

[0080] A53. Audio data collection method:

[0081] A531. After the task is started, the acquisition device audioDevice begins to collect data according to the set sampling rate and number of channels.

[0082] A532. Acquisition equipment: such as Microphone, SoundCard, etc., used to capture audio signals.

[0083] A533, sampling parameters: sampling rate sampleRate = 44100 and number of channels channels = 2.

[0084] A54, collects 44100 data points per second, each point may represent a 16-bit audio sample (each sample consists of two bytes).

[0085] A541, data point: The audio data unit obtained during the sampling process. 44,100 data points represent one second of audio signal.

[0086] A542, audio sample size: 16-bit (2 bytes).

[0087] For stereo, the collected data is stored in order, with odd indexes for left channel data and even indexes for right channel data. The data storage order is odd indexes for left channel and even indexes for right channel. Variable: byte[]audioBuffer.

[0088] A55. Real-time data collection process: Start a real-time data collection task and ensure that it runs continuously. At regular intervals (e.g., 100 milliseconds), collect audio data from a specified microphone (e.g., microphone 1). During the collection process, strictly adhere to the set sampling rate and number of channels to ensure that the collected audio data meets the required accuracy and completeness.

[0089] A6. Execute asynchronous delegate call;

[0090] A61. Thread management mechanism: Use thread pool or Task Parallel Library (TPL) to manage asynchronous tasks, allocate thread resources reasonably, ensure that asynchronous tasks can be executed efficiently, and will not affect the normal progress of other tasks. Parameters include thread pool size (threadPoolSize) and maximum task waiting time (maxTaskWaitTime): thread pool size is used to configure the maximum number of threads to ensure reasonable resource allocation; maximum task waiting time refers to the maximum time that an asynchronous task waits for execution in the thread pool. If this time is exceeded, it will be discarded or otherwise processed.

[0091] A62. Real-time monitoring and optimization: Use a timer or performance monitoring tool to monitor the execution time of the task and the audio processing frame rate in real time, and dynamically adjust and optimize the task execution based on the monitoring results to ensure performance. Parameters include monitoring interval (monitoringInterval) and maximum execution time threshold (maxExecutionTimeThreshold): the monitoring interval is used to set the time interval of the monitoring tool or timer to regularly check the task execution status; the maximum execution time threshold specifies the threshold of the asynchronous task execution time, exceeding this time will trigger optimization measures.

[0092] A7. Parameter execution process includes the following steps:

[0093] A71. Initialize asynchronous task parameters: Set the maximum allowed execution time of asynchronous tasks to 100ms to ensure that the tasks are completed within a reasonable time (parameter name: maxExecutionTime); set the target audio processing frame rate to 30 frames per second to ensure the smoothness of audio processing (parameter name: targetFrameRate); configure the performance monitoring system, set the monitoring interval and threshold to trigger the optimization logic;

[0094] A72. Start asynchronous tasks: Create and start asynchronous tasks, manage them through thread pools to ensure task allocation and execution; integrate performance monitoring modules to track task execution time and processing frame rate in real time;

[0095] A73. Asynchronous task execution and optimization: When a task starts, start a timer to record the execution time; monitor the execution time and frame rate in real time. Once it is detected that the execution time exceeds 100ms or the frame rate is lower than 20 frames per second, take the following optimization measures immediately:

[0096] (1) Thread resource allocation adjustment: increase the number of threads in the thread pool or improve the thread priority of the current task to reduce the waiting time of the task queue.

[0097] (2) Audio processing algorithm optimization: Use more efficient data processing technology, such as using the fast Fourier transform (FFT) algorithm to optimize the frequency domain processing process and reduce time complexity.

[0098] (3) Load balancing task allocation: Analyze the current system load, dynamically adjust task allocation, and migrate tasks to processors or cores with lighter loads.

[0099] A74. Monitoring and adjustment of optimization measures: Continuously monitor the effects of optimization measures to ensure that execution time and frame rate are restored to the target range; dynamically adjust optimization strategies based on monitoring data, such as adjusting the thread pool size or optimizing algorithm parameters.

[0100] A75. Expected effect analysis: Through optimization measures, it is expected that the task execution time can be reduced to less than 100ms and the frame rate can be increased to more than 20 frames per second; after optimization, the system will show higher processing efficiency and better real-time response capabilities, thereby providing a better audio processing experience.

[0101] A8. Process the commission result: Perform subsequent processing based on the result returned by the commission. For example, if the audio acquisition commission returns successfully, the collected audio signal is passed to the effect processing module. If the commission returns unsuccessfully, an error message is displayed and corresponding error processing is performed. For example, the user is prompted that the acquisition device is not connected, or an audio effect processing error occurs.

[0102] In the above sub-step A11, the lock mechanism (such as using lock(dataLock)) and semaphore (such as SemaphoreSlim) are used to control access to shared resources, ensuring that only one thread can access and modify shared data at the same time, thereby avoiding data competition and conflict.

[0103] The advantages of this embodiment are:

[0104] 1. Definition of delegate types: The present invention ensures the accuracy and rationality of delegate types by carefully defining a variety of secure delegate types related to audio processing, such as the audio capture delegate (AudioCaptureDelegate), and specifying its parameters and return types.

[0105] 2. Creation of delegate instances: Create delegate instances that meet the requirements in different modules according to specific business needs and processes. For example, create an audio acquisition delegate instance in the audio acquisition module for specific acquisition devices and sampling parameters.

[0106] 3. Execution mechanism of synchronous and asynchronous delegation: The present invention provides a strict synchronization mechanism for synchronous delegation and efficient thread management for asynchronous delegation, ensuring the accuracy and real-time performance of data processing. At the same time, thread management is used to ensure the smooth execution of asynchronous tasks without affecting the normal progress of other tasks.

[0107] 4. Real-time monitoring: The present invention monitors the entrusted execution status and performance indicators in real time, such as execution time, audio processing frame rate, etc., and makes timely adjustments and optimizations based on the monitoring results.

[0108] 5. Result processing: The result processing module is responsible for receiving and processing the results returned by the delegate, and performing corresponding follow-up operations according to different result types and meanings, such as transmitting audio signals or outputs, or providing error prompts and processing.

[0109] 6. System modular design: The system of the present invention includes a delegation definition module, a delegation execution module and a result processing module. Each module has clear responsibilities and functions, thus achieving seamless connection of the entire delegation management process.

[0110] 7. Security: Through rigorous design and perfect mechanism, the present invention effectively avoids various security issues that may arise during audio processing and ensures the integrity and consistency of audio data.

[0111] 8. Adaptability and flexibility: Support users to flexibly define and use various delegation types according to specific audio project requirements to adapt to different audio processing scenarios and business logic.

[0112] 9. Performance: Through optimized delegation execution process and reasonable thread management, the performance loss caused by synchronous blocking is significantly reduced, and the overall performance of the audio processing system is improved.

[0113] 10. Code structure: The present invention has a concise and clear code structure, simplifies the code of multi-threaded delegate calls, reduces the complexity and error probability of the code, and improves the readability and maintainability of the code.

[0114] The data area is locked in step A12, which emphasizes the importance of locking the data area during the acquisition process to ensure the integrity of the data. By locking the data area, interference from other threads during the data acquisition process can be prevented.

[0115] Sub-steps A11 and A12 can be executed separately. If stricter synchronization control is required, you can choose to execute sub-step A11 and use lock mechanisms and semaphores to control access to shared resources. If the focus is to protect the data area during the data acquisition process from interference from other threads, you can choose to execute sub-step A12 and lock the data area.

[0116] In some cases, in order to provide stronger data protection, these two solutions can be used at the same time. For example, at the beginning of the data collection task, the semaphore in sub-step A11 is first used to limit the number of accesses to the shared resource, and then the lock mechanism in sub-step A12 is used during the specific data operation process to ensure the atomicity of the data operation. When designing a system, developers can decide to use a single solution or combine multiple solutions to achieve the best thread synchronization effect based on actual concurrency requirements, performance considerations, and resource availability.

[0117] Specifically, a lock (dataLock) is used to ensure data consistency: This means that before accessing shared data, the thread needs to first acquire the lock on the dataLock object. Only when the lock is successfully acquired can the thread perform operations on the shared data, which prevents multiple threads from modifying the data at the same time, thereby ensuring data consistency.

[0118] Use semaphore (SemaphoreSlim) to control access rights: This means using SemaphoreSlim to control concurrent access to shared resources. By setting the initial count of the semaphore, you can limit the number of threads that access shared resources at the same time, thereby avoiding data inconsistency problems.

[0119] In step A6, the optimization of asynchronous delegation includes the following detailed description of the sub-steps:

[0120] 1. Performance baseline setting: First, determine the expected baseline of task execution time and frame rate as the benchmark for performance monitoring.

[0121] 2 Real-time data collection: Use monitoring tools to collect actual data on task execution time and frame rate.

[0122] 3Performance analysis: Analyze the collected data and identify tasks with insufficient performance or timeouts.

[0123] 4 Resource adjustment: If you find that the task execution time is too long, add threads or optimize the algorithm to reduce the processing time.

[0124] 5. Algorithm optimization: Optimize algorithms with low execution efficiency to reduce computational complexity.

[0125] 6. Load balancing: In a multi-tasking environment, avoid overloading certain processors by adjusting task distribution.

[0126] 7. Priority management: Adjust the execution order according to the importance of tasks to ensure that key tasks are completed first.

[0127] 8 Dynamic adjustment: Dynamically adjust system configuration, such as the number of threads, memory allocation, etc., based on real-time monitoring results.

[0128] 9. Feedback mechanism: Establish a performance feedback mechanism to continuously track optimization results and make adjustments based on feedback.

[0129] The monitoring interval and the maximum execution time threshold are the trigger conditions for the dynamic optimization process, and the specific optimization measures are determined based on the real-time monitoring data and performance analysis results. These measures are designed to solve the performance problems found by monitoring and ensure that the system can continue to operate in the best state.

[0130] The present invention also discloses a terminal device, including a processor and a storage device, the storage device is used to store one or more programs; when the one or more programs are executed by the processor, the processor implements the above-mentioned method for implementing the security delegation management strategy for audio processing. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the test equipment, and various interfaces and lines are used to connect the various parts of the entire test equipment.

[0131] The storage device can be used to store computer programs and / or modules. The processor realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the storage device and calling the data stored in the storage device. The storage device can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal device, etc. In addition, the storage device can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0132] Wherein, if the module / unit integrated in the device for implementing the security delegation management strategy for audio processing is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in at least one computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0133] It should be noted that the embodiments of the devices and apparatuses described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

Claims

1. A method for implementing a security delegation management strategy for audio processing, applied to the security management of audio data in an audio processing device, characterized in that: The steps include: Using the single access protection technology of threads and data, a security delegation corresponding to the audio processing matters is established, and parameter verification is performed on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback; If the result of the parameter check is not passed, the security delegation is stopped and a security delegation is re-established for the audio processing matter; otherwise, a delegation instance corresponding to the security delegation is created in the audio processing device; Use synchronous tasks to execute the delegate instance corresponding to audio acquisition, and use asynchronous tasks to execute the delegate instance corresponding to audio effect processing and audio playback; Monitor the task execution time and audio processing frame rate of the delegate instance in real time, and dynamically adjust and optimize the execution of the delegate instance based on the monitoring results; According to the result returned by the delegate instance, corresponding subsequent operations are performed; wherein the subsequent operations include transmitting audio signals, outputting audio data, or outputting error prompts.

2. The method for implementing a security delegation management strategy for audio processing according to claim 1, characterized in that: The step of creating a delegate instance corresponding to the security delegate in the audio processing device further includes the following steps: The execution process of the delegate instance is monitored in real time through an exception handling mechanism. When an exception occurs in the execution of the delegate instance, the exception handling mechanism stops the execution of the delegate instance, releases the thread and audio data occupied by the delegate instance, and issues an error message.

3. The method for implementing a security delegation management strategy for audio processing according to claim 1, characterized in that: The steps use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform parameter verification on the security delegation, including the following sub-steps: Use lock mechanisms and semaphore techniques to restrict multi-threaded data access.

4. The method for implementing a security delegation management strategy for audio processing according to claim 1, characterized in that: The steps use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform parameter verification on the security delegation, including the following sub-steps: The audio data to be written and read is stored using an atomic type register, and the data area storing the audio data is locked when the audio data is called.

5. The method for implementing a security delegation management strategy for audio processing according to claim 1, characterized in that: The real-time monitoring of the task execution time and the audio processing frame rate of the delegate instance, and the dynamic adjustment and optimization of the execution of the delegate instance according to the monitoring results, includes the following steps: Set the maximum execution time and target frame rate of the asynchronous task; During the execution of the asynchronous task, a timer is started to monitor the execution time of the asynchronous task each time it is executed, and when the execution time is greater than the maximum execution time, the thread allocation, algorithm and load balancing of the asynchronous task are optimized; The frame rate of the audio data processed by the asynchronous task is monitored in real time, and when the frame rate is less than the target frame rate, the thread allocation, algorithm and load balancing of the asynchronous task are optimized.

6. A device for implementing a security delegation management strategy for audio processing, characterized in that: include: Security delegation module, delegation instance module, task execution module, dynamic optimization module and result processing module; The security delegation module is used to use the single access protection technology of threads and data to establish a security delegation corresponding to the audio processing matters, and perform parameter verification on the security delegation; wherein the audio processing matters include audio collection, audio effect processing and audio playback; The delegation instance module is used to stop the security delegation and re-establish the security delegation for the audio processing matter if the result of the parameter verification fails; otherwise, create a delegation instance corresponding to the security delegation in the audio processing device; The task execution module is used to execute the delegate instance corresponding to audio acquisition in a synchronous task manner, and to execute the delegate instance corresponding to audio effect processing and audio playback in an asynchronous task manner; The dynamic optimization module is used to monitor the task execution time and audio processing frame rate of the delegate instance in real time, and dynamically adjust and optimize the execution of the delegate instance according to the monitoring results; The result processing module is used to perform corresponding subsequent operations according to the result returned by the delegation instance; wherein the subsequent operations include transmitting audio signals, outputting audio data or outputting error prompts.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for implementing a security delegation management strategy for audio processing according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • A full-gear market data real-time calculation method and device

    CN109741179A

  • Non-intrusive workflow to-do delegation method and non-intrusive workflow to-do delegation system

    CN117196511A