Embedded software code generation method, device, equipment, medium and product

By using algorithm-based automatic code generation and large-scale testing incentives for verification, the problems of low efficiency and poor quality in embedded software development have been solved, thereby improving the development efficiency and quality of embedded software.

CN122195402APending Publication Date: 2026-06-12SOUTHWEST CHINA RES INST OF ELECTRONICS EQUIP
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHWEST CHINA RES INST OF ELECTRONICS EQUIP
Filing Date
2026-02-10
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

In current embedded software development, problems such as low efficiency, poor quality, poor maintainability, and high cost of hardware platform replacement due to manual coding are common, especially in complex systems where comprehensive testing and repair are difficult.

Method used

An automatic code generation method based on algorithm models is adopted, including algorithm model design, embedded software configuration, automatic code generation, large-scale incentive generation, and automatic verification and evaluation, to improve development efficiency and quality.

Benefits of technology

By automatically generating embedded software through algorithmic models and conducting large-scale testing and verification, the development efficiency, portability, and software quality of embedded software are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122195402A_ABST
    Figure CN122195402A_ABST
Patent Text Reader

Abstract

The application relates to the field of embedded software design and provides an embedded software code generation method, device, equipment, medium and product, which comprises the following steps: in an algorithm model design module, an algorithm model based on a standard interface is designed based on application requirements; in an embedded software configuration module, embedded software function configuration is completed based on application requirements; in a code automatic generation module, the development of embedded software is completed through automatic code generation based on the algorithm model and the embedded software function configuration; in a large-batch excitation generation module, large-batch test excitation data are generated based on the application requirements and algorithm boundaries of the algorithm model; and in an automatic verification and evaluation module, the algorithm model and the developed embedded software are verified based on the large-batch test excitation data. The application can improve the development efficiency, portability and software quality of embedded software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded software design, and more specifically, to an embedded software code generation method, apparatus, device, medium, and product. Background Technology

[0002] Current embedded software development relies heavily on manual coding. Firstly, due to varying coding skills among software designers, significant problems arise in the efficiency, quality, maintainability, and resource optimization of embedded software development. These limitations become even more pronounced when facing the complexity and high reliability requirements of modern embedded software systems. During the coding phase of embedded software development, manual coding requires handling numerous low-level details (such as register configuration and memory management), and the strong hardware coupling necessitates code rewriting when changing hardware platforms. Furthermore, since testing envelope issues is only conducted after manual coding is complete, manual testing struggles to cover all boundaries, especially under complex system conditions, leading to high costs for later repairs. Summary of the Invention

[0003] The present invention aims to provide an embedded software code generation method to solve the above-mentioned problems.

[0004] In a first aspect, the present invention provides an embedded software code generation method, comprising: In the algorithm model design module, an algorithm model based on standard interfaces is designed based on application requirements; In the embedded software configuration module, embedded software functions are configured based on application requirements. In the automatic code generation module, based on the algorithm model and the embedded software function configuration, the development of the embedded software is completed through automatic code generation; In the large-scale stimulus generation module, a large batch of test stimulus data is generated based on the application requirements and algorithm boundaries of the algorithm model. In the automatic verification and evaluation module, the algorithm model and the developed embedded software are verified based on the large batch of test stimulus data.

[0005] In a preferred embodiment, the embedded software feature configuration includes an embedded hardware platform, programming language, data type, software acceleration method, memory usage type, coding style, and software implementation dependency libraries.

[0006] In a preferred embodiment, the verification of the algorithm model and the developed embedded software refers to automatically comparing the verification results of the algorithm model and the embedded software, thereby completing the consistency verification of the embedded software and the algorithm model, as well as the robustness and stability verification of the embedded software.

[0007] In a second aspect, the present invention provides an embedded software code generation apparatus, comprising: The algorithm model design module is used to design algorithm models based on standard interfaces according to application requirements; The embedded software configuration module is used to configure embedded software functions based on application requirements. The code automatic generation module is used to complete the development of embedded software by automatically generating code based on the algorithm model and embedded software function configuration. The large-scale stimulus generation module is used to generate large-scale test stimulus data based on the application requirements and algorithm boundaries of the algorithm model. The automatic verification and evaluation module is used to verify the algorithm model and the developed embedded software based on the large batch of test stimulus data.

[0008] Thirdly, the present invention provides an electronic device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions stored in the memory to perform the above-described method.

[0009] Fourthly, the present invention provides a computer-readable storage medium for storing instructions that, when executed, cause the above-described method to be implemented.

[0010] Fifthly, the present invention provides a computer program product that, when invoked by a computer, causes the computer to execute the above-described method.

[0011] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: This invention automatically generates embedded software using an algorithm model and verifies the consistency between the embedded software and the algorithm model through large-scale testing, thereby improving the development efficiency, portability, and software quality of embedded software. Attached Figure Description

[0012] Figure 1 This is a schematic diagram of an embedded software code generation method provided in an embodiment of the present invention.

[0013] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0015] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0016] The embedded software code generation method provided in this embodiment of the invention is a model-driven, highly reliable embedded software code generation method, such as... Figure 1 As shown, it includes the following steps: Step 1: In the algorithm model design module, design an algorithm model based on the standard interface according to the application requirements. Alternatively, the algorithm model can be designed based on commonly used algorithm modeling languages ​​such as Matlab and Python.

[0017] Step 2: In the embedded software configuration module, complete the embedded software function configuration based on application requirements; the embedded software function configuration includes embedded hardware platform, programming language, data type, software acceleration method, memory usage type, code style, software implementation dependency library, etc., to support the embedded software development needs of different applications.

[0018] Step 3: In the automatic code generation module, based on the algorithm model and embedded software function configuration, the development of embedded software is completed through automatic code generation, thereby improving the development efficiency of embedded software and the portability of hardware platforms.

[0019] Step 4: In the large-scale stimulus generation module, based on the application requirements of the algorithm model and the algorithm input boundaries (data type / value range, length range, etc. of input parameters), a large batch of test stimulus data is generated.

[0020] Step 5: In the automatic verification and evaluation module, the algorithm model and the developed embedded software are verified based on the large batch of test stimulus data. Specifically, the verification results of the algorithm model and the embedded software are automatically compared to complete the consistency verification between the embedded software and the algorithm model, as well as the robustness and stability verification of the embedded software.

[0021] Therefore, this invention automatically generates embedded software through an algorithm model and verifies the consistency between the embedded software and the algorithm model through large-scale testing, thereby improving the development efficiency, portability, and software quality of embedded software.

[0022] An application example: This paper describes the embedded software development requirements of eigenvalue decomposition algorithms in array applications, and uses Matlab Coder to complete an application example.

[0023] Step 1: In the algorithm model design module, the Matlab modeling language is used to define a standard interface of 8 based on application requirements. The complex double-precision form of 8 is proposed, and an algorithm model based on the QR algorithm is designed to complete the eigenvalue decomposition.

[0024] Step 2: In the embedded software configuration module, complete the embedded software function configuration based on application requirements. Select C++ as the programming language, long long as the data type, 200KB as the maximum stack space for memory usage, and C++03 as the standard math library for software implementation.

[0025] The third step: In the code generation module, based on the algorithm model and embedded software function configuration, Matlab Coder is used to automatically generate code to complete the development of embedded software, thereby improving the development efficiency of embedded software and the portability of hardware platforms.

[0026] Step 4: In the large-scale stimulus generation module, based on the application requirements of the algorithm model and the algorithm input boundaries, the specific steps are as follows: randomly generate 8... A complex matrix A of size 8, where the real and imaginary parts of each data point in A all follow a Gaussian distribution with a mean square deviation of 1; then A is used... A T As the stimulus input, where A T This represents the conjugate transpose of A. The above process is repeated 100,000 times, generating 100,000 different test stimuli.

[0027] Step 5: In the automatic verification and evaluation module, the algorithm model and embedded software are verified based on 100,000 different test stimuli. The verification results of the algorithm model and embedded software are automatically compared to complete the consistency verification of the embedded software and the algorithm model, as well as the robustness and stability verification of the embedded software.

[0028] Based on the same technical concept, embodiments of the present invention also provide an embedded software code generation apparatus, comprising: The algorithm model design module is used to design algorithm models based on standard interfaces according to application requirements; The embedded software configuration module is used to configure embedded software functions based on application requirements. The code automatic generation module is used to complete the development of embedded software by automatically generating code based on the algorithm model and embedded software function configuration. The large-scale stimulus generation module is used to generate large-scale test stimulus data based on the application requirements and algorithm boundaries of the algorithm model. The automatic verification and evaluation module is used to verify the algorithm model and the developed embedded software based on the large batch of test stimulus data.

[0029] The working principle of each functional module in the above device can be referred to the description in the foregoing method embodiments, and will not be repeated here.

[0030] Based on the same technical concept, embodiments of the present invention also provide an electronic device that can implement the embedded software code generation method flow provided in the above embodiments of the present invention. In one embodiment, the electronic device may be a server, a terminal device, or other electronic devices. Figure 2 As shown, the electronic device may include: At least one processor and a memory connected to the at least one processor. In this embodiment of the invention, the specific connection medium between the processor and the memory is not limited. Figure 2 The example used is the connection between the processor and memory via a bus. The bus... Figure 2 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. Buses can be divided into address buses, data buses, control buses, etc., but for ease of representation, [the specific bus type is not shown here]. Figure 2 The processor is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, a processor can also be called a controller; there are no restrictions on the name.

[0031] In this embodiment of the invention, the memory stores instructions that can be executed by at least one processor. By executing the instructions stored in the memory, at least one processor can execute an embedded software code generation method as described above.

[0032] The processor is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory and calling data stored in memory, it can monitor the device's various functions and process data, thereby enabling overall monitoring of the device.

[0033] In an alternative design, the processor may include one or more processing units. The processor may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may also not be integrated into the processor. In some embodiments, the processor and memory may be implemented on the same chip; in some embodiments, they may also be implemented separately on separate chips.

[0034] The processor can be a general-purpose processor, such as a CPU, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the embedded software code generation method disclosed in the embodiments of this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0035] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia cards, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), and electrically erasable programmable read-only memory (EPROM). Only memory (EEPROM), magnetic storage, magnetic disks, optical disks, etc. A memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. The memory in embodiments of this invention can also be a circuit or any other device capable of performing storage functions for storing program instructions and / or data.

[0036] By designing and programming the processor, the code corresponding to the embedded software code generation method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the steps of the method described in the foregoing embodiments during runtime. How to design and program the processor is a technique well-known to those skilled in the art and will not be elaborated upon here.

[0037] Based on the same inventive concept, embodiments of the present invention also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to execute an embedded software code generation method described above.

[0038] In some alternative embodiments, the present invention also provides that various aspects of the embedded software code generation method can also be implemented in the form of a program product comprising program code, which, when the program product is run on a device, causes the control device to perform the steps in the embedded software code generation method according to various exemplary embodiments of the present invention described above.

[0039] It should be noted that although several units or sub-units of the apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the invention, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units. Furthermore, although the operation of the method of the invention is described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0040] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can be implemented in one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs) containing computer-usable program code. The form of a computer program product implemented on ROM, optical memory, etc.

[0041] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0042] Program code for performing the operations of this invention can be written using any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0043] In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0044] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0045] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0046] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An embedded software code generation method, characterized in that, include: In the algorithm model design module, an algorithm model based on standard interfaces is designed based on application requirements; In the embedded software configuration module, embedded software functions are configured based on application requirements. In the automatic code generation module, based on the algorithm model and the embedded software function configuration, the development of the embedded software is completed through automatic code generation; In the large-scale stimulus generation module, a large batch of test stimulus data is generated based on the application requirements and algorithm boundaries of the algorithm model. In the automatic verification and evaluation module, the algorithm model and the developed embedded software are verified based on the large batch of test stimulus data.

2. The embedded software code generation method according to claim 1, characterized in that, The embedded software function configuration includes the embedded hardware platform, programming language, data type, software acceleration method, memory usage type, coding style, and software implementation dependency library.

3. The embedded software code generation method according to claim 1, characterized in that, The verification of the algorithm model and the developed embedded software refers to automatically comparing the verification results of the algorithm model and the embedded software, thereby completing the consistency verification of the embedded software and the algorithm model, as well as the robustness and stability verification of the embedded software.

4. An embedded software code generation device, characterized in that, include: The algorithm model design module is used to design algorithm models based on standard interfaces according to application requirements; The embedded software configuration module is used to configure embedded software functions based on application requirements. The code automatic generation module is used to complete the development of embedded software by automatically generating code based on the algorithm model and embedded software function configuration. The large-scale stimulus generation module is used to generate large-scale test stimulus data based on the application requirements and algorithm boundaries of the algorithm model. The automatic verification and evaluation module is used to verify the algorithm model and the developed embedded software based on the large batch of test stimulus data.

5. The embedded software code generation device according to claim 4, characterized in that, The embedded software function configuration includes the embedded hardware platform, programming language, data type, software acceleration method, memory usage type, coding style, and software implementation dependency library.

6. The embedded software code generation device according to claim 4, characterized in that, The verification of the algorithm model and the developed embedded software refers to automatically comparing the verification results of the algorithm model and the embedded software, thereby completing the consistency verification of the embedded software and the algorithm model, as well as the robustness and stability verification of the embedded software.

7. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which executes the instructions stored in the memory to perform the method as described in any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instructions that, when executed, cause the method as described in any one of claims 1-3 to be implemented.

9. A computer program product, characterized in that, When the computer program product is invoked by a computer, it causes the computer to perform the method as described in any one of claims 1-3.