Calculation middleware function implementation method and device applied to DSP (Digital Signal Processor)

By constructing a matrix structure based on the DSP computing library interface and MATLAB data types, and optimizing the DSP function library, the problems of inconvenience in using the DSP function library and poor convenience in switching hardware languages ​​were solved. Support for complex vector operations and radar processing functions was realized, improving development efficiency and error correction capabilities.

CN120848871APending Publication Date: 2025-10-28TSINGHUA UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510684892.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing DSP function libraries are inconvenient to use, have poor hardware language switching convenience, and do not support calculations commonly used in radar processing, such as complex vector operations, complex matrix operations, FFT, and one-dimensional sliding window.

Method used

Based on the DSP computing library interface and MATLAB data types of the pre-defined embedded processing platform, a matrix type structure is constructed, the application interface of the computing middleware is determined, and the operation functions are optimized according to the DSP underlying function library and radar signal processing requirements. The corresponding implementation files for the optimized operation functions are written.

Benefits of technology

It improves DSP development efficiency, simplifies hardware language switching, supports radar processing functions such as complex vector operations, complex matrix operations, FFT and one-dimensional sliding window, and enhances error correction capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120848871A_ABST
    Figure CN120848871A_ABST
Patent Text Reader

Abstract

The invention relates to a computing middleware function implementation method and device applied to a DSP processor, and the method comprises the steps: constructing a corresponding matrix type structural body based on a DSP computing library interface and an MATLAB data type of an embedded processing platform, and determining a preset application interface of computing middleware through the matrix type structural body; determining a calculation middleware function library according to a DSP bottom layer function library and a radar signal processing function demand, and extracting an operation function corresponding to a function function from the DSP bottom layer function library based on the calculation middleware function library and the function function; obtaining DSP features corresponding to the DSP processor, and optimizing the operation function according to the DSP features to obtain an optimized operation function; and determining an implementation function of the calculation middleware function library, and compiling a function function implementation file corresponding to the optimization operation function based on the implementation function. Therefore, the problems that in the prior art, a DSP function library is inconvenient to use, and when different pieces of hardware are used, the convenience of hardware language switching is poor are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software-based radar computing middleware technology, and in particular to a method and apparatus for implementing computing middleware functions applied to DSP processors. Background Technology

[0002] To address the challenges posed by the constantly emerging new targets and complex environments of modern battlefields, software-defined radar technology has become an important development direction in the radar field. Due to its open architecture with decoupled hardware and software and its modular development features, software-defined radar is easy to upgrade, maintain, and develop, making it a key development goal for various advanced radar systems both domestically and internationally.

[0003] Middleware technology is an indispensable part of software-defined radar, and it is divided into communication middleware and computing middleware, among others. Middleware is a general-purpose service located between the operating system and applications. These services have standard program interfaces and protocols, and they have the function of decoupling bare hardware from application software. They can shield the complexity of the underlying operating system, allowing program developers to face a simple and unified development environment, reducing the complexity of program design, improving code and program portability, and simplifying the development process.

[0004] The 6678DSP library primarily comprises the DSPLIB and MATHLIB libraries for TI c66x, both open-source libraries. They feature callable C language routines and are fully compatible with the TI C6000 compiler, mainly providing vector and matrix operation functions. The DSPLIB library is an optimized DSP function library for C programmers, including many optimized, general-purpose signal processing routines that can be called in C. Using these routines, execution speeds can be significantly faster than equivalent code written in standard ANSI C. It primarily provides functions for matrix decomposition and reconstruction, as well as many specialized modules such as Fast Fourier Transform, convolution and filtering operations, adaptive filters, cross-correlation operations, and endianness conversion. The MATHLIB library contains commonly used floating-point routines and source code, primarily providing vector calculation functions such as trigonometric functions, inverse trigonometric functions, exponential functions, logarithmic functions, and square root functions.

[0005] In recent years, existing technologies have been able to design and implement a network computing middleware built on top of the streaming data processing process IStream; in addition, existing technologies can also use the international standard for computing middleware, VSIPL, to study the improvement in computational efficiency brought by computing middleware to Fast Fourier Transform.

[0006] However, current DSP libraries and computing middleware still have the following drawbacks:

[0007] 1. Different languages ​​are required when developing on different types or models of hardware, which reduces development efficiency and is not conducive to programming for developers; in addition, DSP library functions have the disadvantages of complex function names, a large number of parameters, multiple types, and unpredictable order, requiring manual consultation each time they are used, which is inconvenient to use.

[0008] 2. Existing computing middleware incurs significant memory overhead during computation.

[0009] 3. Existing computing middleware does not support complex vector operations, complex matrix operations, FFT, one-dimensional sliding window, and other calculations commonly used in radar processing.

[0010] In summary, existing DSP function libraries are inconvenient to use, and the ease of switching between hardware languages ​​is poor when using different hardware, which urgently needs to be addressed. Summary of the Invention

[0011] This application provides a method and apparatus for implementing computing middleware functions for DSP processors, in order to solve the problems of inconvenience in using DSP function libraries in the prior art and poor convenience in switching hardware languages ​​when using different hardware.

[0012] The first aspect of this application provides a method for implementing computational middleware functions applied to a DSP processor, comprising the following steps: constructing a corresponding matrix type structure based on a preset embedded processing platform's DSP computation library interface and MATLAB data type, and determining the preset application interface of the computational middleware through the matrix type structure; determining the computational middleware function library according to the DSP underlying function library and radar signal processing function requirements, and extracting the operation functions corresponding to the function functions from the DSP underlying function library based on the computational middleware function library and function functions; obtaining the DSP characteristics corresponding to the DSP processor, and optimizing the operation functions according to the DSP characteristics to obtain optimized operation functions; determining the implementation functions of the computational middleware function library, and writing the function implementation file corresponding to the optimized operation functions based on the implementation functions.

[0013] Optionally, in one embodiment of this application, determining the computational middleware function library based on the DSP underlying function library and radar signal processing function requirements includes: obtaining multiple corresponding functions for the computational middleware by using a preset function naming rule and referencing the MATLAB function functions and names of the computational middleware; constructing the computational middleware function library based on the multiple corresponding functions, wherein the computational middleware function library includes multiple mathematical operation functions and multiple radar signal processing functions.

[0014] Optionally, in one embodiment of this application, the step of extracting the operation function corresponding to the function function from the DSP underlying function library based on the computing middleware function library and function functions includes: passing a reference corresponding to the input matrix into the DSP underlying function library to directly access the input matrix inside the function according to the reference; obtaining the matrix information of the input matrix and determining whether the input matrix meets the requirements of the corresponding functional DSP underlying library function according to the matrix information; if the input matrix does not meet the requirements of the functional DSP underlying library function, obtaining and reporting the error information corresponding to the input matrix; if the input matrix meets the requirements of the functional DSP underlying library function, determining the parameter information of the interface matrix corresponding to the input matrix, creating a target output matrix according to the parameter information, and calculating the target output matrix. The system determines the size of the target output matrix and allocates corresponding storage space for it. It then determines whether the target output matrix requires other matrix parameters. If the target output matrix does not require other matrix parameters, it performs corresponding operations on the target output matrix according to the matrix size to obtain a first operation result, which is then stored in the target output matrix to obtain the operation function. If the target output matrix requires other matrix parameters, it creates a temporary matrix corresponding to the target output matrix, calculates the matrix data corresponding to the temporary matrix, performs corresponding operations based on the matrix data to obtain a second operation result, stores the second operation result in the target output matrix, and releases the memory of the temporary matrix to obtain the operation function.

[0015] Optionally, in one embodiment of this application, the step of obtaining the DSP features corresponding to the DSP processor and optimizing the operation function according to the DSP features to obtain the optimized operation function includes: determining whether the number of matrix elements in the operation function meets the requirements of the underlying function, wherein, if the number of matrix elements does not meet the requirements of the underlying function, a preset zero-padding operation is performed on the operation function, or calculations are performed on the parts that meet the preset length requirements and the parts that do not meet the preset length requirements respectively, to obtain the corresponding optimized operation function.

[0016] A second aspect of this application provides a device for implementing computational middleware functions applied to a DSP processor, comprising: a construction module for constructing a corresponding matrix type structure based on a preset DSP computational library interface and MATLAB data types of an embedded processing platform, and determining a preset application interface for the computational middleware through the matrix type structure; an extraction module for determining a computational middleware function library based on the requirements of the DSP underlying function library and radar signal processing functions, and extracting the operation functions corresponding to the function functions from the DSP underlying function library based on the computational middleware function library and function functions; an optimization module for acquiring DSP features corresponding to the DSP processor, and optimizing the operation functions according to the DSP features to obtain optimized operation functions; and an implementation module for determining the implementation functions of the computational middleware function library, and writing a function implementation file corresponding to the optimized operation functions based on the implementation functions.

[0017] Optionally, in one embodiment of this application, the extraction module includes: a benchmarking unit, used to obtain multiple benchmarking functions corresponding to the computing middleware by benchmarking the MATLAB function functions and names based on a preset function naming rule and using the computing middleware; and a building unit, used to build the computing middleware function library based on the multiple benchmarking functions, wherein the computing middleware function library includes multiple mathematical operation functions and multiple radar signal processing functions.

[0018] Optionally, in one embodiment of this application, the extraction module further includes: an access unit, configured to pass a reference corresponding to the input matrix to the DSP underlying function library, so as to directly access the input matrix within the function according to the reference; a first judgment unit, configured to obtain the matrix information of the input matrix, and determine whether the input matrix meets the corresponding functional DSP underlying library function requirements according to the matrix information; an acquisition unit, configured to acquire and report the error information corresponding to the input matrix if the input matrix does not meet the functional DSP underlying library function requirements; and an allocation unit, configured to determine the parameter information of the interface matrix corresponding to the input matrix if the input matrix meets the functional DSP underlying library function requirements, and create a target output matrix according to the parameter information, calculate the matrix size of the target output matrix, and allocate the target output matrix... The system comprises: a first calculation unit, which allocates corresponding storage space to store the target output matrix; a second judgment unit, which determines whether the target output matrix requires other matrix parameters; a calculation unit, which, if the target output matrix does not require the other matrix parameters, performs corresponding calculations on the target output matrix according to the matrix size to obtain a corresponding first calculation result and stores the first calculation result in the target output matrix to obtain the calculation function; and a release unit, which, if the target output matrix requires the other matrix parameters, creates a temporary matrix corresponding to the target output matrix, calculates the matrix data corresponding to the temporary matrix, performs corresponding calculations according to the matrix data to obtain a corresponding second calculation result, stores the second calculation result in the target output matrix, and releases the memory of the temporary matrix to obtain the calculation function.

[0019] Optionally, in one embodiment of this application, the optimization module includes: a third judgment unit, used to judge whether the number of matrix elements in the operation function meets the requirements of the underlying function, wherein, if the number of matrix elements does not meet the requirements of the underlying function, a preset zero-padding operation is performed on the operation function, or calculations are performed on the parts that meet the preset length requirements and the parts that do not meet the preset length requirements respectively, so as to obtain the corresponding optimized operation function.

[0020] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the method for implementing computational middleware functions applied to a DSP processor as described in the above embodiments.

[0021] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for implementing computational middleware functions applied to a DSP processor.

[0022] A fifth aspect of this application provides a computer program product, including a computer program that is executed to implement the above-described method for implementing the computing middleware function of a DSP processor.

[0023] Therefore, the embodiments of this application have the following beneficial effects:

[0024] The embodiments of this application can construct a corresponding matrix type structure based on the DSP computing library interface and MATLAB data types of a preset embedded processing platform, and determine the application interface of the preset computing middleware through the matrix type structure; determine the computing middleware function library according to the requirements of the DSP underlying function library and radar signal processing functions, and extract the corresponding operation functions from the DSP underlying function library based on the computing middleware function library and function functions; obtain the DSP characteristics corresponding to the DSP processor, and optimize the operation functions according to the DSP characteristics to obtain optimized operation functions; determine the implementation functions of the computing middleware function library, and write the function function implementation file corresponding to the optimized operation functions based on the implementation functions. This application fully explores the performance of the detector without adding extra training and detection processes by constraining the output results of the detector, and can effectively improve the error correction capability. Thus, it solves the problems of inconvenience in using DSP function libraries in the prior art, and poor convenience of switching hardware languages ​​when using different hardware.

[0025] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0026] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0027] Figure 1 This is a flowchart illustrating a method for implementing computational middleware functions applied to a DSP processor, according to an embodiment of this application.

[0028] Figure 2 A schematic diagram of the execution logic of a method for implementing computing middleware functions in a DSP processor, provided as an embodiment of this application;

[0029] Figure 3 A schematic diagram of the logical architecture of a computing middleware function implementation system applied to a DSP processor, provided as an embodiment of this application;

[0030] Figure 4This is an example diagram of a computing middleware function implementation device applied to a DSP processor according to an embodiment of this application;

[0031] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0032] Among them, 10-the function implementation device for the computing middleware of the DSP processor; 100-the building module, 200-the extraction module, 300-the optimization module, 400-the implementation module; 501-the memory, 502-the processor, 503-the communication interface. Detailed Implementation

[0033] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0034] The following describes a method and apparatus for implementing computational middleware functions applied to a DSP processor, with reference to the accompanying drawings. Addressing the problems mentioned in the background art, this application provides a method for implementing computational middleware functions applied to a DSP processor. In this method, a corresponding matrix type structure is constructed based on the DSP computational library interface of a preset embedded processing platform and MATLAB data types. The matrix type structure is used to determine the application interface of the preset computational middleware. A computational middleware function library is determined according to the requirements of the DSP underlying function library and radar signal processing functions. Based on the computational middleware function library and function functions, the corresponding operational functions are extracted from the DSP underlying function library. DSP features corresponding to the DSP processor are obtained, and the operational functions are optimized based on the DSP features to obtain optimized operational functions. The implementation functions of the computational middleware function library are determined, and based on the implementation functions, the function implementation file corresponding to the optimized operational functions is written. This application constrains the output results of the detector, thereby fully exploring the detector performance without adding extra training and detection processes, and effectively improving error correction capabilities. This solves the problems of inconvenient use of DSP function libraries in the prior art, and poor convenience of switching hardware languages ​​when using different hardware.

[0035] Specifically, Figure 1 This is a flowchart illustrating a method for implementing computational middleware functions applied to a DSP processor, as provided in an embodiment of this application.

[0036] like Figure 1 As shown, the method for implementing the computational middleware function applied to a DSP processor includes the following steps:

[0037] In step S101, based on the preset embedded processing platform's DSP computing library interface and MATLAB data type, a corresponding matrix type structure is constructed, and the application interface of the preset computing middleware is determined through the matrix type structure.

[0038] In step S102, the computational middleware function library is determined according to the requirements of the DSP underlying function library and radar signal processing functions, and the operation functions corresponding to the function functions are extracted from the DSP underlying function library based on the computational middleware function library and function functions.

[0039] In this embodiment, a matrix type structure can be constructed based on the DSP computing library interface used by the embedded processing platform, with reference to MATLAB data types, and used as the application interface of the computing middleware. This includes defining the name of the application interface and member variable parameters. The application interface can meet the interface requirements of the DSP library functions, thus achieving the purpose of interface matching.

[0040] In actual implementation, the embodiments of this application create matrix structures using templates as the type, which include information such as matrix data, number of rows, number of columns, number of elements, number of bytes occupied, and overloads of some operators, supporting floating-point and floating-point complex data types.

[0041] Specifically, the DSP library interface used by the embedded processing platform includes information such as the starting address of the data, the vector length or matrix size, and other parameters. After constructing a matrix type structure with reference to MATLAB data types, the structure contains the information required by the DSP library interface. Therefore, this embodiment of the application can use this matrix type as the application interface of the computing middleware. This application interface can meet the interface requirements of the DSP library functions, achieve the purpose of interface matching, and perform interface matching in a concise and clear form, which is convenient for programmers to use and improves development efficiency.

[0042] Secondly, in this embodiment of the application, after the matrix interface of the computing middleware is defined, the composition of the computing middleware function library is designed and determined according to the requirements of the DSP underlying function library and commonly used radar signal processing functions. This includes special matrix generation functions, matrix reconstruction and rearrangement functions, element-wise algebraic operations, matrix algebraic operations, trigonometric functions, commonly used radar signal processing functions, and other commonly used calculation functions.

[0043] Subsequently, in this embodiment of the application, the calculation middleware function library is constructed, and the operation function corresponding to the function function is extracted from the DSP underlying function library according to the function function. The function is encapsulated and the matrix interface is adapted to realize various function functions. The matrix is ​​used as input to obtain the calculation result matrix, and the calculation result matrix is ​​returned as the function return value.

[0044] It is understood that in the architecture design of the computing middleware in this application embodiment, the matrix interface provided to the user is fully compatible with the distributed computing interface used by the current embedded processing platform. The interface is encapsulated into a matrix type. As long as the matrix is ​​passed in, the function will automatically obtain the matrix parameters to match the interface of the underlying library. The function library is implemented in the style of MATLAB functions. The matrix data type is simple, the function calls are convenient, which is convenient for programmers to develop, improves the efficiency of DSP development, and facilitates the agile verification of algorithms from MATLAB to DSP.

[0045] Optionally, in one embodiment of this application, the calculation middleware function library is determined according to the requirements of the DSP underlying function library and radar signal processing functions, including: based on a preset function naming rule, and using the calculation middleware to benchmark the function functions and names of MATLAB, to obtain multiple benchmark functions corresponding to the calculation middleware; and constructing the calculation middleware function library based on the multiple benchmark functions, wherein the calculation middleware function library includes multiple mathematical operation functions and multiple radar signal processing functions.

[0046] As one possible approach, the specific steps for designing and determining the composition of the computational middleware function library in this application embodiment are as follows:

[0047] Step 1: Calculate the function functionality and name of the middleware corresponding to MATLAB. Functions with the same functionality can be named by capitalizing the first letter of the MATLAB function name.

[0048] Step 2: For functions implemented by symbols that cannot be overloaded, use the English name of the symbol. For example, in MATLAB, the colon represents an arithmetic sequence, which is named Colon in this calculation middleware.

[0049] Step 3: The function library contains almost all commonly used arithmetic functions. Mathematical operations include one-dimensional convolution, FFT, matrix decomposition, matrix inversion, etc. Commonly used radar signal processing functions include generating linear frequency modulated signals, digital beamforming, pulse compression, MTD, CA-CFAR, etc.

[0050] It should be noted that in the computational middleware architecture applicable to DSP processors, the function names in the computational middleware function library correspond to MATLAB function names. Functions with the same functionality can be named by capitalizing the first letter of the MATLAB function name, and all functions return matrix types. This makes the computational middleware, from data structures to function composition, MATLAB-style, facilitating development by programmers familiar with MATLAB code. In addition to basic vector and matrix mathematical functions, the computational middleware function library also includes operations commonly used in radar signal processing, serving as an important component of software-based radar component development.

[0051] Optionally, in one embodiment of this application, based on the computational middleware function library and function functionality, the operation function corresponding to the function functionality is extracted from the DSP underlying function library, including: passing a reference corresponding to the input matrix to the DSP underlying function library so as to directly access the input matrix inside the function according to the reference; obtaining the matrix information of the input matrix, and determining whether the input matrix meets the requirements of the corresponding functional DSP underlying library function based on the matrix information; if the input matrix does not meet the requirements of the functional DSP underlying library function, obtaining and reporting the error information corresponding to the input matrix; if the input matrix meets the requirements of the functional DSP underlying library function, determining the parameter information of the interface matrix corresponding to the input matrix, creating the target output matrix according to the parameter information, and calculating the target output. The system determines the size of the target output matrix and allocates corresponding storage space for it. It then determines whether the target output matrix requires other matrix parameters. If no other matrix parameters are needed, the system performs the corresponding operations on the target output matrix based on its size to obtain the first operation result, which is then stored in the target output matrix to obtain the operation function. If other matrix parameters are needed, the system creates a temporary matrix corresponding to the target output matrix, calculates the corresponding matrix data, performs the corresponding operations based on the matrix data to obtain the second operation result, stores the second operation result in the target output matrix, and releases the memory of the temporary matrix to obtain the operation function.

[0052] In actual implementation, the steps of this application embodiment to implement the functions of each function using the DSP underlying function library are as follows:

[0053] Step 1: Pass the input matrix by reference. The function will directly access the input matrix and set it to const to avoid modifying the input matrix.

[0054] Step 2: Obtain information such as the size and number of elements of the input matrix, and determine whether it meets the requirements of the corresponding DSP underlying library function, such as the length being a multiple of 2 or 4. If it does not meet the requirements, report the error information.

[0055] Step 3: Based on the parameters such as the size and number of elements of the interface matrix, create the matrix to be output and calculate the size of the output matrix. Allocate dynamic storage space for it. It is also possible that the parameters of the library function need to be constructed or transformed using the input matrix. In this case, memory needs to be allocated to these matrices and the temporary memory needs to be released at the end of the function.

[0056] Step 4: After configuring the parameters of all DSP underlying functions, call the underlying library functions;

[0057] Step 5: Return the output matrix.

[0058] The construction of the DSP underlying function library includes the following steps:

[0059] Step 1: The TI C6000 DSPLIB is an optimized DSP function library for C programmers. It includes many C-language callable, optimized, and general-purpose signal processing routines. These routines are typically used in computationally intensive real-time applications where optimal execution speed is crucial. By using these routines, execution speeds can be achieved much faster than equivalent code written in standard ANSI C. Furthermore, by providing ready-to-use DSP functionality, the TIDSPLIB can significantly reduce DSP application development time.

[0060] Step 2: TI's MATHLIB library is an optimized floating-point math function library suitable for C programmers using TI floating-point devices. These routines are typically used in computationally intensive real-time applications where optimal execution speed is critical. By using these routines instead of those in the existing runtime support library, execution speed can be significantly improved without rewriting existing code. The MATHLIB library includes all floating-point math routines currently provided in the existing runtime support library. In this embodiment, these new functions can be called using either the current runtime support library name or a new name included in the MATHLIB library.

[0061] Specifically, the input parameter of the function is a reference to a matrix structure, and the matrix information is obtained directly from the original address of the parameter. The `const` modifier is added to prevent changes to the input variable. If the DSP library function requires matrices other than the input matrix, these temporary matrices need to be created and memory allocated. Creating the matrix to be returned and allocating memory is a necessary step. Then, in this embodiment, the DSP library function can be called to directly store the calculation result into the matrix to be returned. Finally, in this embodiment, the dynamic memory of the temporary matrix can be released and the matrix returned. Here, the input parameter is a reference to the matrix, reusing data memory and avoiding the extra time and space resources consumed by copying input matrix data inside the function. This lightweight design improves the efficiency and reliability of the computational middleware.

[0062] Therefore, in the embodiments of this application, the reference of the input parameter can be passed into the function during the operation of the computing middleware, which reuses the data memory and adopts a thin layer design. There is no need to copy the input data inside the function, which avoids additional space and time overhead and improves the running efficiency and reliability of the computing middleware.

[0063] In step S103, the DSP characteristics corresponding to the DSP processor are obtained, and the operation function is optimized based on the DSP characteristics to obtain the optimized operation function.

[0064] In step S104, the implementation functions of the calculation middleware function library are determined, and based on the implementation functions, the function implementation files corresponding to the optimized calculation functions are written.

[0065] Furthermore, after the function implementation, the embodiments of this application also need to optimize the function according to the characteristics of the DSP, including supplementing the functions of the DSP underlying library and optimizing the function time efficiency. After the function optimization process is completed, the embodiments of this application can write a function implementation file according to the implementation function of the DSP computing middleware function library, which mainly introduces the function functions and usage methods of the computing middleware function library, including the corresponding usage methods of various functions in MATLAB, as well as the function name, function function description, input parameter format, return parameter format, etc.

[0066] Optionally, in one embodiment of this application, obtaining the DSP features corresponding to the DSP processor and optimizing the operation function based on the DSP features to obtain the optimized operation function includes: determining whether the number of matrix elements in the operation function meets the requirements of the underlying function, wherein, if the number of matrix elements does not meet the requirements of the underlying function, a preset zero-padding operation is performed on the operation function, or calculations are performed on the parts that meet the preset length requirements and the parts that do not meet the preset length requirements respectively, to obtain the corresponding optimized operation function.

[0067] It should be noted that the embodiments of this application can optimize the functions according to the characteristics of the DSP and supplement the functionality of the DSP's underlying library functions. The specific process is as follows:

[0068] Step 1: When the number of matrix elements in some functions does not meet the requirements of the underlying function, such as the length must be a multiple of 2 or 4, add some zero-padding operations to ensure that it can still call the underlying library function and ensure that the result is correct and the efficiency remains basically unchanged, such as the Fft function.

[0069] Step 2: When the number of matrix elements in some functions does not meet the requirements of the underlying function, such as the length must be a multiple of 2 or 4, calculate the parts that meet the length requirements and the parts that do not meet the length requirements respectively, and ensure that the results are correct and the efficiency remains basically unchanged, such as the Add function.

[0070] Specifically, the optimization of functions in this application is reflected in two aspects. Firstly, it optimizes function time efficiency, especially in the implementation of functions for which there are no corresponding functionalities in the DSP library. Secondly, it optimizes the use of DSP library functions when the conditions for their use are not met, typically the condition that the vector length is not a multiple of 2 or 4. This is achieved through zero-padding or separate processing of the remaining portion after modulo 2 or 4. Developers no longer need to manually determine the length condition or perform manual operations to meet the requirements, nor are they prevented from using efficient middleware function libraries due to unmet conditions, thus simplifying the development process and improving efficiency.

[0071] It is understood that the computational middleware in this application embodiment not only supports computational functions commonly used in airborne radar processing, such as complex vector operations, complex matrix operations, fast Fourier transform, and one-dimensional sliding window, but also includes commonly used radar signal processing algorithm modules such as linear frequency modulation signal generation function, pulse compression function, moving target detection function, and cell average constant false alarm rate detection function.

[0072] Subsequently, in the embodiments of this application, the implementation file of the computational middleware function includes an introduction and usage method for the entire computational middleware function library. In particular, it includes more detailed descriptions of the function input parameter format, function, output parameter format, and the corresponding MATLAB function name for understanding, making it easier for developers to use and improving efficiency.

[0073] The following describes the execution logic of the computing middleware function implementation method applied to a DSP processor according to a specific embodiment and in conjunction with the accompanying drawings.

[0074] Figure 2 This is a schematic diagram illustrating the execution logic of the computational middleware function implementation method applied to a DSP processor according to this application. Figure 2 As shown, the execution process of the computational middleware function implementation method applied to the DSP processor of this application is as follows:

[0075] S201: The application initiated the call;

[0076] S202: Pass in a reference to the input matrix;

[0077] S203: Does the length requirement meet? If the length requirement is met, proceed to S204; otherwise, proceed to S205.

[0078] S204: Create the output matrix and allocate memory, then go to S206;

[0079] S205: Output error message and terminate;

[0080] S206: Are other matrix parameters needed? If so, go to S207; otherwise, go to S2010.

[0081] S207: Create a temporary matrix and calculate the matrix data;

[0082] S208: Perform the operation and store the result in the output matrix;

[0083] S209: Release the memory of the temporary matrix and go to S2011;

[0084] S2010: Perform the operation and store the result in the output matrix;

[0085] S2011: Returns the output matrix and exits.

[0086] Specifically, in one specific embodiment of this application, based on the Windows operating system and the CCS12.2.0 platform, taking floating-point vector addition as an example, the implementation process of the computing middleware function implementation method applied to the DSP processor of this application is described in detail.

[0087] In this embodiment, the dsplib_c66x_3_4_0_4 and mathlib_c66x_3_1_2_4 installation packages can be downloaded from official sources, decompressed, and installed. The program folder should be added to the project's reference file path, and referenced in the project header file.<dsplib.h> Furthermore, the mtp namespace is used in the project.

[0088] First, in a specific embodiment of this application, a new function Matrix can be created in the computational middleware function library. <float>operator+(const Matrix <float>&m1,const Matrix <float>&m2), which determines the function name, input matrix type, and output matrix type, takes a reference to the matrix as a parameter, and adds the const modifier; Matrix is ​​the matrix interface type, and m1 and m2 are the two matrices that need to be added.

[0089] Secondly, the functions in the DSPLIB library are divided into seven types: adaptive filtering, correlation, fast Fourier transform, filtering and convolution, mathematics, matrix, and others. Locate the category to which floating-point vector addition belongs—mathematics—and find the function DSPF_sp_vecadd within that category that performs floating-point vector addition. Its interface information is DSPF_sp_vecadd(float*x,float*y,float*r,int nx), where DSPF_sp_vecadd is the interface name, float indicates that the vector data type is floating-point, *x and *y are pointers to the input vector, *r is a pointer to the output vector, and nx is the operation length, which must be ≥ 4 and a multiple of 4.

[0090] Furthermore, after clarifying the interface information of the DSP library functions, the specific embodiments of this application can determine whether the conditions for calling the DSP library functions are met. First, compare whether the number of elements in the two input matrices m1 and m2 are equal. If they are not equal, the program terminates and outputs an error message.

[0091] Subsequently, in a specific embodiment of this application, a matrix ans to be returned is created, and dynamic memory is allocated for it, with the allocated space size being the space sizes of m1 and m2.

[0092] Furthermore, in a specific embodiment of this application, it can determine whether the number of elements in m1 is a multiple of 4. If so, the data pointers of matrix m1, m2, and the returned matrix ans, along with the number of elements in m1, are sequentially passed to the function DSPF_sp_vecadd. If not, the result of taking m1 modulo 4 is calculated, and the DSPF_sp_vecadd function is called as described above for the first 4 multiples of the matrix. The remaining three elements are then manually added. This completes the matrix addition operation, i.e., ans = m1 + m2.

[0093] Finally, a specific embodiment of this application can return the matrix ans, thus concluding the function generation process.

[0094] Furthermore, this application can also construct a corresponding computing middleware function implementation system for DSP processors based on the computing middleware function implementation method applied to DSP processors. Figure 3 This is a schematic diagram of the logical architecture of a system that implements the computational middleware functions applied to a DSP processor. (Example:) Figure 3 As shown, the computing middleware function implementation system applied to the DSP processor mainly includes application software, application interface module, space resource configuration module, function implementation module, DSP library and operating system, etc.

[0095] The method for implementing computational middleware functions for DSP processors proposed in this application involves constructing a corresponding matrix structure based on the DSP computational library interface and MATLAB data types of a pre-defined embedded processing platform, and determining the application interface of the pre-defined computational middleware through the matrix structure. The computational middleware function library is determined according to the requirements of the DSP underlying function library and radar signal processing functions. Based on the computational middleware function library and function functions, the corresponding operational functions are extracted from the DSP underlying function library. DSP features corresponding to the DSP processor are obtained, and the operational functions are optimized based on these features to obtain optimized operational functions. The implementation functions of the computational middleware function library are determined, and based on these functions, the corresponding function implementation files for the optimized operational functions are written. This application constrains the output results of the detector, thereby fully exploring the detector performance without adding additional training and detection processes, and effectively improving error correction capabilities.

[0096] Secondly, with reference to the accompanying drawings, a computing middleware function implementation apparatus for a DSP processor according to an embodiment of this application is described.

[0097] Figure 4 This is a block diagram of a computing middleware function implementation device applied to a DSP processor according to an embodiment of this application.

[0098] like Figure 4 As shown, the computing middleware function implementation device 10 applied to the DSP processor includes: a construction module 100, an extraction module 200, an optimization module 300, and an implementation module 400.

[0099] The construction module 100 is used to construct a corresponding matrix type structure based on the DSP computing library interface and MATLAB data type of the preset embedded processing platform, and to determine the application interface of the preset computing middleware through the matrix type structure.

[0100] The extraction module 200 is used to determine the calculation middleware function library according to the requirements of the DSP underlying function library and radar signal processing function, and extract the corresponding operation functions from the DSP underlying function library based on the calculation middleware function library and function functions.

[0101] The optimization module 300 is used to obtain the DSP characteristics corresponding to the DSP processor and optimize the operation function according to the DSP characteristics to obtain the optimized operation function.

[0102] Module 400 is used to determine the implementation functions of the computation middleware function library, and based on the implementation functions, write the function implementation files corresponding to the optimized operation functions.

[0103] Optionally, in one embodiment of this application, the extraction module 200 includes a benchmarking unit and an establishment unit.

[0104] The benchmarking unit is used to benchmark MATLAB functions and names based on preset function naming rules and by using the computation middleware to obtain multiple benchmarking functions corresponding to the computation middleware.

[0105] The establishment unit is used to construct a computational middleware function library based on multiple benchmarking functions. The computational middleware function library includes multiple mathematical operation functions and multiple radar signal processing functions.

[0106] Optionally, in one embodiment of this application, the extraction module 200 further includes: an access unit, a first judgment unit, an acquisition unit, an allocation unit, a second judgment unit, a calculation unit, and a release unit.

[0107] The access unit is used to pass a reference to the input matrix to the DSP's underlying function library, so that the input matrix can be directly accessed inside the function based on the reference.

[0108] The first judgment unit is used to obtain the matrix information of the input matrix and determine whether the input matrix meets the requirements of the corresponding DSP underlying library function based on the matrix information.

[0109] The acquisition unit is used to acquire and report the error information corresponding to the input matrix if the input matrix does not meet the requirements of the underlying DSP library function.

[0110] The allocation unit is used to determine the parameter information of the interface matrix corresponding to the input matrix if the input matrix meets the requirements of the functional DSP underlying library function, create the target output matrix according to the parameter information, calculate the matrix size of the target output matrix, and allocate corresponding storage space for the target output matrix to store the target output matrix.

[0111] The second judgment unit is used to determine whether the target output matrix requires other matrix parameters.

[0112] The operation unit is used to perform corresponding operations on the target output matrix according to the matrix size if the target output matrix does not require other matrix parameters, so as to obtain the corresponding first operation result and store the first operation result in the target output matrix to obtain the operation function.

[0113] The release unit is used to create a temporary matrix corresponding to the target output matrix if the target output matrix requires other matrix parameters, calculate the matrix data corresponding to the temporary matrix, perform corresponding operations based on the matrix data to obtain the corresponding second operation result, store the second operation result in the target output matrix, and release the memory of the temporary matrix to obtain the operation function.

[0114] Optionally, in one embodiment of this application, the optimization module 300 includes: a third judgment unit, used to judge whether the number of matrix elements in the operation function meets the requirements of the underlying function, wherein, if the number of matrix elements does not meet the requirements of the underlying function, a preset zero-padding operation is performed on the operation function, or calculations are performed on the parts that meet the preset length requirements and the parts that do not meet the preset length requirements respectively, so as to obtain the corresponding optimized operation function.

[0115] It should be noted that the foregoing explanation of the implementation method of the computing middleware function applied to the DSP processor also applies to the implementation device of the computing middleware function applied to the DSP processor in this embodiment, and will not be repeated here.

[0116] The device for implementing computational middleware functions for DSP processors according to embodiments of this application includes a construction module 100, used to construct a corresponding matrix type structure based on a preset embedded processing platform's DSP computation library interface and MATLAB data types, and to determine the preset application interface of the computational middleware through the matrix type structure; an extraction module 200, used to determine the computational middleware function library according to the requirements of the DSP underlying function library and radar signal processing functions, and to extract the corresponding operation functions from the DSP underlying function library based on the computational middleware function library and function functions; an optimization module 300, used to obtain the DSP features corresponding to the DSP processor, and to optimize the operation functions according to the DSP features to obtain optimized operation functions; and an implementation module 400, used to determine the implementation functions of the computational middleware function library, and to write the function function implementation file corresponding to the optimized operation functions based on the implementation functions. This application, by constraining the output results of the detector, fully explores the detector performance without adding extra training and detection processes, and can effectively improve error correction capabilities.

[0117] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:

[0118] The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.

[0119] When the processor 502 executes the program, it implements the computing middleware function implementation method for the DSP processor provided in the above embodiments.

[0120] Furthermore, electronic devices also include:

[0121] Communication interface 503 is used for communication between memory 501 and processor 502.

[0122] The memory 501 is used to store computer programs that can run on the processor 502.

[0123] The memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0124] If the memory 501, processor 502, and communication interface 503 are implemented independently, then the communication interface 503, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0125] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.

[0126] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0127] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method for implementing computational middleware functions applied to a DSP processor.

[0128] This application also provides a computer program product, including a computer program, which, when executed, is used to implement the above-described method for implementing the computing middleware function of a DSP processor.

[0129] In the description of this specification, the references to "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0130] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0131] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0133] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0134] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0135] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0136] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.< / float> < / float> < / float>

Claims

1. A method for implementing computational middleware functions applied to a DSP processor, characterized in that, Includes the following steps: Based on the DSP computing library interface and MATLAB data type of the preset embedded processing platform, a corresponding matrix type structure is constructed, and the application interface of the preset computing middleware is determined through the matrix type structure. Based on the requirements of the DSP underlying function library and radar signal processing functions, a calculation middleware function library is determined, and based on the calculation middleware function library and function functions, the operation functions corresponding to the function functions are extracted from the DSP underlying function library; Obtain the DSP characteristics corresponding to the DSP processor, and optimize the operation function based on the DSP characteristics to obtain the optimized operation function; Determine the implementation functions of the computational middleware function library, and based on the implementation functions, write the function implementation files corresponding to the optimized operation functions.

2. The method according to claim 1, characterized in that, The process of determining the computational middleware function library based on the DSP's underlying function library and radar signal processing function requirements includes: Based on the preset function naming rules, and by using the computing middleware to align with the function functions and names of MATLAB, multiple corresponding functions of the computing middleware are obtained. The computational middleware function library is constructed based on the multiple benchmarking functions, wherein the computational middleware function library includes multiple mathematical operation functions and multiple radar signal processing functions.

3. The method according to claim 2, characterized in that, The step of extracting the corresponding operation functions from the DSP underlying function library based on the computing middleware function library and function functions includes: A reference to the input matrix is ​​passed to the DSP underlying function library so that the input matrix can be directly accessed inside the function based on the reference. Obtain the matrix information of the input matrix, and determine whether the input matrix meets the requirements of the corresponding functional DSP underlying library function based on the matrix information; If the input matrix does not meet the requirements of the DSP underlying library function, then obtain and report the error information corresponding to the input matrix; If the input matrix satisfies the requirements of the functional DSP underlying library function, then the parameter information of the interface matrix corresponding to the input matrix is ​​determined, and a target output matrix is ​​created according to the parameter information. The size of the target output matrix is ​​calculated, and corresponding storage space is allocated for the target output matrix to store the target output matrix. Determine whether the target output matrix requires other matrix parameters; If the target output matrix does not require the other matrix parameters, then perform the corresponding operation on the target output matrix according to the matrix size to obtain the corresponding first operation result, and store the first operation result in the target output matrix to obtain the operation function; If the target output matrix requires the other matrix parameters, a temporary matrix corresponding to the target output matrix is ​​created, and the matrix data corresponding to the temporary matrix is ​​calculated. The corresponding operation is performed according to the matrix data to obtain the corresponding second operation result, and the second operation result is stored in the target output matrix. The memory of the temporary matrix is ​​then released to obtain the operation function.

4. The method according to claim 3, characterized in that, The step of acquiring the DSP characteristics corresponding to the DSP processor and optimizing the operation function based on the DSP characteristics to obtain the optimized operation function includes: Determine whether the number of matrix elements in the operation function meets the requirements of the underlying function. If the number of matrix elements does not meet the requirements of the underlying function, perform a preset zero-padding operation on the operation function, or calculate the parts that meet the preset length requirements and the parts that do not meet the preset length requirements respectively, so as to obtain the corresponding optimized operation function.

5. A device for implementing computational middleware functions in a DSP processor, characterized in that, include: The module is used to construct a corresponding matrix type structure based on the DSP computing library interface and MATLAB data type of the preset embedded processing platform, and to determine the application interface of the preset computing middleware through the matrix type structure. The extraction module is used to determine the calculation middleware function library according to the requirements of the DSP underlying function library and radar signal processing function, and extract the operation function corresponding to the function function from the DSP underlying function library based on the calculation middleware function library and function functions; An optimization module is used to obtain the DSP characteristics corresponding to the DSP processor and optimize the operation function according to the DSP characteristics to obtain an optimized operation function; The implementation module is used to determine the implementation functions of the computing middleware function library, and based on the implementation functions, write the function implementation files corresponding to the optimized operation functions.

6. The apparatus according to claim 5, characterized in that, The extraction module includes: The benchmarking unit is used to benchmark the MATLAB function functions and names based on the preset function naming rules and by using the computing middleware to obtain multiple benchmarking functions corresponding to the computing middleware; A building unit is used to construct the computational middleware function library based on the plurality of benchmarking functions, wherein the computational middleware function library includes a plurality of mathematical operation functions and a plurality of radar signal processing functions.

7. The apparatus according to claim 6, characterized in that, The extraction module further includes: An access unit is used to pass a reference to the input matrix into the DSP underlying function library so that the input matrix can be directly accessed inside the function based on the reference. The first judgment unit is used to obtain the matrix information of the input matrix and determine whether the input matrix meets the corresponding functional DSP underlying library function requirements based on the matrix information. The acquisition unit is used to acquire and report the error information corresponding to the input matrix if the input matrix does not meet the requirements of the DSP underlying library function. The allocation unit is used to determine the parameter information of the interface matrix corresponding to the input matrix if the input matrix meets the requirements of the functional DSP underlying library function, create a target output matrix according to the parameter information, calculate the matrix size of the target output matrix, and allocate corresponding storage space for the target output matrix to store the target output matrix. The second judgment unit is used to determine whether the target output matrix requires other matrix parameters; The operation unit is configured to perform corresponding operations on the target output matrix according to the matrix size if the target output matrix does not require the other matrix parameters, to obtain a corresponding first operation result, and store the first operation result in the target output matrix to obtain the operation function; The release unit is used to create a temporary matrix corresponding to the target output matrix if the target output matrix requires the other matrix parameters, calculate the matrix data corresponding to the temporary matrix, perform corresponding operations based on the matrix data to obtain the corresponding second operation result, store the second operation result in the target output matrix, and release the memory of the temporary matrix to obtain the operation function.

8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method for implementing the computational middleware function of a DSP processor as described in any one of claims 1-4.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the computational middleware function implementation method for a DSP processor as described in any one of claims 1-4.

10. A computer program product, comprising a computer program, characterized in that, The computer program is executed to implement the method for implementing the computational middleware function of a DSP processor as described in any one of claims 1-4.

Citation Information

Cited By

  • Resource optimal supply method for underwater acoustic open-type architecture signal processor

    CN122196977A