Software development framework, software development method and computer equipment
By using a unified software development framework, the problem of repetitive development of basic modules is solved, development efficiency and code quality are improved, module reusability and maintainability are achieved, and flexible configuration and extensibility are supported.
Patent Information
- Application Number
- CN202511570630.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-01-30
AI Technical Summary
Existing software development frameworks suffer from problems such as low development efficiency due to repetitive development of basic modules, inconsistent code quality, complex task scheduling, poor code maintainability, and high software code complexity.
A software development framework is provided, including a data input module, an executor module, a task management module, a data container, and a result output module. Through a unified data acquisition interface, task scheduling strategy, and configuration management module, it realizes unified management of data interaction and module reuse, reduces redundant development, and improves development efficiency and code quality.
It improves the efficiency of data acquisition and task scheduling, reduces code complexity, enhances code maintainability, and supports flexible configuration and scalability.
Smart Images

Figure CN121433833A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer software technology, specifically to a software development framework, software development method, and computer equipment. Background Technology
[0002] A software development framework is a set of structured tools, libraries, and specifications designed to simplify the development process and improve efficiency. It provides developers with infrastructure and common functionalities to help them quickly build stable and maintainable applications.
[0003] In related technologies, software development frameworks, in order to meet the needs of software development in all scenarios, require the repeated development of many basic modules, resulting in low development efficiency, inconsistent code quality, complex task scheduling, poor code maintainability, and high software code complexity. Summary of the Invention
[0004] One objective of this application is to provide a software development framework to address the problems in existing technologies, such as the need for repeated development of many basic modules, low development efficiency, inconsistent code quality, complex task scheduling, poor code maintainability, and high software code complexity. Another objective is to provide a software development method. A third objective is to provide a computer device.
[0005] To achieve the above objectives, the technical solution adopted in this application is as follows: This application provides a software development framework, which includes a data input module, an executor module, a task management module, a data container, and a result output module, wherein: The data input module receives data to be processed collected by the vehicle's sensors and registers a data acquisition interface using a callback function; the data acquisition interface provides the data to be processed to the actuator module. An actuator module, corresponding to the data to be processed, is used to acquire the data to be processed through a data acquisition interface and send the data to be processed to the data container; and to determine the target task corresponding to the data to be processed. The task management module is used to obtain the data to be processed from the data container and schedule the target task based on the task scheduling strategy. The target task is used to process the first target data corresponding to the data to be processed and obtain the output result corresponding to the target task. The results output module is used to obtain the output results corresponding to the target task; determine the target output data based on the output results corresponding to the target task; and publish the target output data.
[0006] Based on the aforementioned technical means, firstly, a data acquisition interface is registered in the data input module, enabling the actuator module to quickly acquire the data to be processed collected by the vehicle's sensors through a unified data acquisition interface, thereby improving data acquisition efficiency. Secondly, a task management module is encapsulated to unify task scheduling, improving task scheduling efficiency. Thirdly, a result output module is encapsulated to uniformly publish target output data, enabling rapid data interaction with external processes. Next, a data container is used to uniformly manage data interaction within the software development framework, allowing data interaction within the framework to be independent of external interfaces, improving data interaction efficiency between modules within the framework. Finally, by building a unified software development framework, encapsulated modules can be reused when developing different software, eliminating the need for repetitive development, thus reducing the amount of code development and improving software development efficiency. Furthermore, since different software can be implemented using the same encapsulated modules, code unification of each encapsulated module is achieved, improving code development quality and reducing code complexity. Moreover, during code maintenance, only the interface or external code needs to be maintained, without affecting other interfaces and encapsulated modules, thereby improving code maintainability.
[0007] Furthermore, the task management module includes multiple task execution functions and a thread pool. Based on a task scheduling strategy, the task management module also determines the target execution thread corresponding to the target task from multiple threads in the thread pool; schedules the target execution thread; the target execution thread determines the target task execution function corresponding to the target task from multiple task execution functions; obtains third target data, which is obtained by encapsulating fourth target data, including one of the following: data to be processed, or second target data obtained after preprocessing the data to be processed; and determines the output result corresponding to the target task based on the third target data and the target task execution function.
[0008] Based on the aforementioned technical means, the task management module uses a task scheduling strategy to uniformly schedule multiple task execution functions and thread pools, enabling parallel processing of multiple tasks and improving the efficiency of task scheduling.
[0009] Furthermore, the data container includes multiple single-frame data interfaces and an executor module, which is also used to send the fourth target data to the data container; the single-frame data interface is used to encapsulate the fourth target data according to a preset encapsulation format to obtain the third target data; the target execution thread is also used to obtain the third target data from the single-frame data interface; and input the third target data into the target task execution function to obtain the output result corresponding to the target task.
[0010] Based on the above technical means, data interaction within the software development framework is managed in a unified manner through a data container. This allows data interaction within the software development framework to be independent of external interfaces, improving the efficiency of data interaction between modules within the software development framework and reducing the amount of code development related to data interaction between modules.
[0011] Furthermore, the target execution thread is also used to send the output results corresponding to the target task to the result output module; the result output module is also used to encapsulate the output results corresponding to the target task to obtain the target output data; and publish the target output data using the data output interface.
[0012] Based on the above technical means, after encapsulating the output results corresponding to the target task, the result output module sends the target output data through a unified data output interface, realizing data interaction between the target execution thread and the external system, thereby improving the efficiency of data interaction.
[0013] Furthermore, the software development framework also includes a configuration management module, which is used to obtain configuration files; parse the configuration files to obtain the corresponding configuration information, and use the configuration information to create the executor module and the task management module.
[0014] Based on the aforementioned technical means, the unified configuration file parsing function provided by the configuration management module enables the software development framework to have flexible configuration capabilities, allowing the software development framework to flexibly configure the required executor modules and task management modules based on configuration information.
[0015] Furthermore, the software development framework also includes a creation module, which configures information including the data type of the data to be processed. This creation module is used to create an executor module that adapts to the data type of the data to be processed.
[0016] Based on the above technical means, the creation module flexibly creates the required executor module according to the data type of the data to be processed in the configuration information, so that the executor module can support processing the data to be processed of that data type.
[0017] Furthermore, the configuration information also includes the task name corresponding to the target task, the function name of the target task execution function used to execute the target task, and related tasks that have dependencies on the target task. The creation module is also used to create the target task execution function for executing the target task based on the task name, the function name of the target task execution function, and related tasks.
[0018] Based on the above technical means, the creation module flexibly creates the required target task execution function according to the relevant information of the target task in the configuration information, so that the target execution thread can schedule the target task based on the target task execution function.
[0019] Furthermore, the data input module is also used to register a data update interface using a callback function; the executor module is also used to obtain the updated data to be processed through the data update interface; and set the status identifier of the data to be processed to a first status identifier; wherein the first status identifier indicates that the data to be processed has been updated; the task management module is also used to obtain the updated data to be processed when the status identifier of the data to be processed is detected to be the first status identifier, and to schedule the target task based on the task scheduling strategy and the updated data to be processed.
[0020] Based on the aforementioned technical means, when the task management module determines that the data to be processed has been updated, it retrieves the updated data to be processed from the data container, enabling the task management module to schedule the target task based on the latest data to be processed, thereby improving the accuracy of the output results corresponding to the target task.
[0021] Furthermore, the data input module also includes a data type registration function, which is used to determine the data type of the data to be processed. In cases where the software development framework does not support the data type of the data to be processed, the data type registration function is used to register the data type of the data to be processed.
[0022] Based on the aforementioned technical means, software development frameworks can extend their support to more data types by registering functions for simple data types, thereby enabling the software development framework to have good scalability.
[0023] Furthermore, the executor module is also used for at least one of the following: determining the data type of the data to be processed; obtaining the data to be processed that matches the data type from the data input module through the data acquisition interface; and preprocessing the data to be processed based on the data type corresponding to the data to be processed to obtain the second target data corresponding to the data to be processed; wherein the preprocessing includes at least one of the following: filtering processing and alignment processing.
[0024] Based on the above technical means, the actuator module can obtain accurate data to be processed according to the data type, and preprocess the data to be processed to obtain the second target data, so as to further improve the data quality of the data to be processed.
[0025] This application provides a software development method, including: The software development framework is initialized by calling the singleton class provided by the framework. The framework includes a data input module, an executor module, a task management module, a data container, and a result output module. The data receiver provided by the data input module is used to input the data to be processed collected by the vehicle's sensors; The executor base class provided by the executor module is invoked. The executor base class corresponds to the data to be processed and is used to determine the target task corresponding to the data to be processed. The data frame base class provided by the data container is invoked. The data frame base class is used to receive the data to be processed sent by the executor module and to provide the data to be processed to the task management module. The task base class provided by the task management module is called. The task base class is used to schedule the target task based on the task scheduling strategy. The target task is used to process the first target data corresponding to the data to be processed and obtain the output result corresponding to the target task. The output base class provided by the result output module is invoked. The output base class is used to determine the target output data based on the output result corresponding to the target task, and to publish the target output data.
[0026] Based on the aforementioned technical methods, during software development, the executor base class, task base class, and output base class encapsulated by the software development framework can be reused, eliminating the need for redundant development. This reduces the amount of code required and improves software development efficiency. Furthermore, encapsulating multiple base classes through the software development framework improves code quality and reduces code complexity. Moreover, during code maintenance, only other code needs to be maintained, without affecting the base classes, thus improving code maintainability.
[0027] This application provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.
[0028] The beneficial effects of this application are: (1) This application registers a data acquisition interface in the data input module so that the actuator module can quickly acquire the data to be processed collected by the vehicle's sensors through a unified data acquisition interface, thereby improving data acquisition efficiency; (2) This application improves the efficiency of task scheduling by encapsulating a task management module to unify task scheduling; (3) This application uses a unified method to publish target output data by encapsulating the result output module, which can quickly realize data interaction with external processes; (4) By building a unified software development framework, this application can reuse the encapsulated modules when developing different software, without repeated development, thereby reducing the amount of software code development and improving software development efficiency. Moreover, since different software can be implemented using the same encapsulated modules, the code of each encapsulated module is unified, thereby improving the development quality of the code and reducing the complexity of the code. Furthermore, when maintaining the code, only the interface or external code needs to be maintained, without affecting other interfaces and encapsulated modules, thereby improving the maintainability of the code. (5) This application uses a data container to uniformly manage data interaction within the software development framework, so that data interaction within the software development framework does not depend on external interfaces, thereby improving the efficiency of data interaction between modules within the software development framework and reducing the amount of code development related to data interaction between modules. (6) This application provides the software development framework with flexible configuration capabilities through the unified configuration file parsing function provided by the configuration management module, so that the software development framework can flexibly configure the required executor module and task management module based on the configuration information; (7) In this application, when the task management module determines that the data to be processed has been updated, it obtains the updated data to be processed from the data container, so that the task management module can schedule the target task based on the latest data to be processed, thereby improving the accuracy of the output results corresponding to the target task. (8) The software development framework in this application can extend its support for more data types by registering functions for simple data types, thereby making the software development framework have good scalability; (9) In this application, the actuator module can obtain accurate data to be processed according to the data type, and preprocess the data to be processed to obtain the second target data, so as to further improve the data quality of the data to be processed. Attached Figure Description
[0029] Figure 1 A schematic diagram of a software development framework proposed in this application Figure 1 ; Figure 2 A schematic diagram of a software development framework proposed in this application Figure 2 ; Figure 3 A schematic diagram of a software development framework proposed in this application Figure 3 ; Figure 4 A schematic diagram of a software development framework proposed in this application Figure 4 ; Figure 5 A schematic diagram of a software development framework proposed in this application Figure 5 ; Figure 6 This is a schematic diagram of the implementation process of a software development method proposed in this application. Figure 1 ; Figure 7 This is a schematic diagram of the data flow of an algorithm software proposed in this application; Figure 8 A schematic diagram of a software development framework proposed in this application Figure 6 ; Figure 9 This is a schematic diagram of the implementation process of a software development method proposed in this application. Figure 2 ; Figure 10 This is a schematic diagram of the software layering of an autonomous driving system proposed in this application. Detailed Implementation
[0030] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.
[0031] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0032] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0033] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0035] This application proposes a software development framework, such as... Figures 1 to 5 As shown, the software development framework 100 includes a data input module 110, an executor module 120, a task management module 130, a data container 150, and a result output module 140, wherein: The data input module 110 is used to receive data to be processed collected by the vehicle's sensors and to register a data acquisition interface using a callback function; the data acquisition interface is used to provide data to be processed to the actuator module 120. The actuator module 120, corresponding to the data to be processed, is used to acquire the data to be processed through the data acquisition interface and send the data to be processed to the data container; and determine the target task corresponding to the data to be processed. The task management module 130 is used to obtain the data to be processed from the data container and schedule the target task based on the task scheduling strategy. The target task is used to process the first target data corresponding to the data to be processed and obtain the output result corresponding to the target task. The result output module 140 is used to acquire the output result corresponding to the target task; determine the target output data based on the output result corresponding to the target task; and publish the target output data.
[0036] In some implementations, the data input module 110 provides a unified external data input interface to obtain the required raw data from the outside, such as raw images from the camera, ultrasonic channel data, millimeter-wave point cloud data, etc.
[0037] In some implementations, the data input module 110 can be any suitable module capable of performing this function. This data input module supports receiving data collected by different sensors of the vehicle, using data from multiple sensors as the default supported data type. Sensors include, but are not limited to, at least one of the following: camera, ultrasonic sensor, and millimeter-wave radar.
[0038] In some implementations, the data input module 110 may include multiple external data receiving interfaces (data receivers) for receiving data from different sensors.
[0039] In some implementations, the data input module 110 can receive environmental data collected by the vehicle's sensors during autonomous driving, use the collected environmental data as data to be processed, and process the environmental data collected by the vehicle's sensors to achieve obstacle detection, path planning, etc. during the vehicle's driving process.
[0040] In some implementations, the data input module 110 adapts to the inter-process communication (IPC) mechanism to enable data transfer, information exchange, or synchronization with other processes.
[0041] In some implementations, the data input module 110 includes a callback function (such as SetDateCallback(callback)) and uses the callback function to register a unified data acquisition interface (such as OnInputData(DataType)); through the data acquisition interface, the data to be processed received by the data input module can be passed to the executor module 120.
[0042] In some implementations, the operator module 120 can be any suitable module capable of performing this function. The operator module 120 corresponds to the data to be processed. In some implementations, different types of data to be processed can correspond to different operator modules. The operator module obtains the data to be processed from the data input module through a data acquisition interface.
[0043] The target task can be determined in any suitable way. In some embodiments, the executor module 120 can determine the target task corresponding to the data to be processed based on the acquired task name. In some embodiments, the target task can be determined based on the data type or identification information of the data to be processed.
[0044] In some implementations, the actuator module 120 can send the acquired data to be processed to the data container 150 for storage, so that subsequent modules can retrieve the data to be processed from the data container 150 for processing.
[0045] In some implementations, the executor module 120 can send the target task to the task management module.
[0046] In some implementations, the TaskManager module 130 can be any suitable module capable of implementing this function. The TaskManager module 130 is a downstream module of the executor module 120, and its main function is to schedule target tasks according to a task scheduling strategy.
[0047] In some implementations, the task management module 130 schedules target tasks to process first target data corresponding to the data to be processed, thereby obtaining the output result corresponding to the target task. The first target data may be obtained by converting the data to be processed into the data type required to execute the target task. In some implementations, the first target data may be obtained from a data container.
[0048] In some implementations, the task scheduling strategy can be based on a task flow-based task scheduling management mechanism. This mechanism unifies the scheduling and management of tasks within the task flow and threads within the thread pool, enabling concurrent task processing. The task flow is built upon a distributed event-driven workflow framework, and the thread pool supports the execution of the task flow.
[0049] In some implementations, the software development framework 100 may include two types of threads: a main thread and task threads. The main thread is responsible for the common basic functions of the algorithm software, as well as data access (including input / output and shared data within the process). The task threads are a set of thread pools provided based on task flows to support the execution of algorithm tasks, maximizing concurrent processing, and the number of threads in the thread pool can be dynamically configured.
[0050] In some implementations, the executor module 120 can determine the target execution thread and target task execution function corresponding to the target task based on a task scheduling strategy. The target execution thread is used to execute the specific target task based on the data to be processed and the target task execution function, and output the corresponding result. The target task execution function is the specific algorithm implementation corresponding to the target task. The executor module 120 can send the target execution thread and target task execution function corresponding to the target task to the task management module 130, so that the task management module 130 can schedule the target task according to the target execution thread and target task execution function.
[0051] In some embodiments, the result output module 140 can be any suitable module capable of implementing this function. This result output module can obtain the output result corresponding to the target task from the task management module. In some embodiments, the result output module can encapsulate the output result corresponding to the target task to obtain target output data before publishing the target output data. Encapsulation can refer to encapsulating the output result corresponding to the target task into a specified format. For example, the output result can be encapsulated according to a preset IPC protocol to obtain the target output data. The IPC protocol can be any suitable protocol, and this application does not limit it.
[0052] The output of the target task can be the data output by the task management module after scheduling the target task based on the task scheduling strategy, or the output of the target task can be sent by the task management module to the result output module.
[0053] In some implementations, the result output module 140 may use a data output interface (such as Output::Instance()->Send(Data data)) to send the target output data to an external process.
[0054] In this embodiment, firstly, a data acquisition interface is registered in the data input module so that the actuator module can quickly acquire the data to be processed collected by the vehicle's sensors through a unified data acquisition interface, improving data acquisition efficiency. Secondly, a task management module is encapsulated to uniformly schedule tasks, improving task scheduling efficiency. Thirdly, a result output module is encapsulated to uniformly publish target output data, enabling rapid data interaction with external processes. Then, a data container is used to uniformly manage data interaction within the software development framework, allowing data interaction within the framework to be independent of external interfaces, improving data interaction efficiency between modules within the framework. Finally, by building a unified software development framework, encapsulated modules can be reused when developing different software, eliminating the need for repetitive development, thus reducing the amount of code development and improving software development efficiency. Furthermore, since different software can be implemented using the same encapsulation modules, code unification of each encapsulation module is achieved, improving code development quality and reducing code complexity. Moreover, during code maintenance, only the interface or external code needs to be maintained, without affecting other interfaces and encapsulated modules, thus improving code maintainability.
[0055] In some embodiments, the task management module 130 includes a plurality of task execution functions 131 and a thread pool 132. The task management module 130 is further configured to: determine the target execution thread corresponding to the target task from the plurality of threads in the thread pool 132 based on the task scheduling strategy; schedule the target execution thread; the target execution thread is configured to: determine the target task execution function corresponding to the target task from the plurality of task execution functions 131; obtain third target data, which is obtained by encapsulating fourth target data, and the fourth target data includes one of the following: the data to be processed, or second target data obtained by preprocessing the data to be processed; and determine the output result corresponding to the target task based on the third target data and the target task execution function.
[0056] In some implementations, the task execution function is an algorithm function that implements different task scheduling, with different tasks corresponding to different task execution functions.
[0057] A thread pool contains multiple threads. In some implementations, these threads can execute multiple tasks in parallel. The task management module can select a suitable thread as the target execution thread based on the current load of the threads in the thread pool.
[0058] The target execution thread is the executor that implements the target task. In some implementations, the target task execution function is created based on the target task's task name, the target task execution function's function name, and related tasks that have dependencies on the target task. Therefore, the target task and the target task execution function are corresponding, and the target task execution function can be determined based on these two names.
[0059] In some implementations, the task management module 130 may further include multiple task modules, each corresponding to a multiple task execution function. The target execution thread calls the target task execution function from the target task module corresponding to the target task execution function.
[0060] The third target data can be obtained by encapsulating the fourth target data. Encapsulation can involve packaging the fourth target data into data with information such as timestamps and data sources. The fourth target data can be the data to be processed, or it can be the data obtained after preprocessing the data to be processed. Preprocessing can include, but is not limited to, filtering and alignment.
[0061] In some implementations, the actuator module can directly send the data to be processed to the data container. Alternatively, the actuator module can preprocess the data to be processed and then send the resulting second target data to the data container.
[0062] The data container can be any suitable module that can implement this function.
[0063] The target execution thread can input the third target data into the target task execution function for processing, and determine the output data of the target task execution function as the output result corresponding to the target task.
[0064] In some implementations, the third target data may be the output of an upstream task obtained by calling a unified interface (such as GetDataFrame():map) in the data container.
[0065] In some implementations, when there are related tasks that depend on the target task, these related tasks are scheduled based on the output of the target task. Therefore, after the target execution thread completes its target task, it can call a unified interface provided by the data container (such as AddFrame(DataFrame)) to store the output of the target task in the data container, so that downstream tasks that depend on the target task can obtain the output of the target task.
[0066] In this embodiment, the task management module performs unified scheduling of multiple task execution functions and thread pools based on a task scheduling strategy, thereby enabling parallel processing of multiple tasks and improving the efficiency of task scheduling.
[0067] In some embodiments, the data container 150 includes a plurality of single-frame data interfaces 151, wherein: the executor module 120 is further configured to send the fourth target data to the data container; the single-frame data interface 151 is configured to encapsulate the fourth target data according to a preset encapsulation format to obtain the third target data; the target execution thread is further configured to obtain the third target data from the single-frame data interface; and input the third target data to the target task execution function to obtain the output result corresponding to the target task.
[0068] Here, data container 150 is used to store data that needs to be exchanged between modules in the software development framework 100. Each module can use data container 150 to provide a unified interface to achieve data interaction between modules. For example, other modules can use the AddFrame(DataFrame) interface to store data into data container 150, and use the GetDataFrame():map interface to retrieve data from data container 150.
[0069] In some implementations, data interaction between modules within a software development framework requires retrieval and updating through interfaces provided by a data container. In one example, after the executor module obtains the data to be processed, it updates the data container using the data container's interface AddFrame(DataFrame). In another example, the target execution thread can retrieve third-party target data from the data container using the data container's interface GetDataFrame():map.
[0070] In some implementations, after receiving the data to be processed, the executor module 120 stores the data to be processed into the data container through the data container's interface AddFrame(DataFrame). After preprocessing the data to be processed, the executor module 120 stores the preprocessed data to be processed into the data container through the data container's interface GetDataFrame():map.
[0071] In some embodiments, the data container 150 includes multiple single-frame data interfaces 151. The single-frame data interface 151 can encapsulate the fourth target data according to a preset encapsulation format to obtain the third target data. In some embodiments, when encapsulating the fourth target data, the single-frame data interface 151 can construct a data frame containing information such as timestamps and data sources.
[0072] In some implementations, the single-frame data interface 151 supports encapsulating any data type into a unified data frame. Users can customize the encapsulation of data frames based on DataFrame, and this application does not limit this.
[0073] In some implementations, the single-frame data interface 151 can be an interface for acquiring data frames, and the target execution thread can acquire third target data through the single-frame data interface corresponding to the target task in the data container.
[0074] In some implementations, after the target execution thread obtains the third target data, it can use the third target data as the input to the target task execution function and use the output of the target task execution function as the output result of the target task.
[0075] In this embodiment, a data container is used to uniformly manage data interaction within the software development framework, enabling data interaction within the software development framework to operate independently of external interfaces. This improves the efficiency of data interaction between modules within the software development framework and reduces the amount of code development required for data interaction between modules.
[0076] In some embodiments, the target execution thread is further configured to send the output result corresponding to the target task to the result output module; the result output module is further configured to encapsulate the output result corresponding to the target task to obtain the target output data; and publish the target output data using the data output interface.
[0077] In some implementations, the output is sent to the result output module after the target execution thread has completed the target task.
[0078] In some implementations, to enable data interaction with external processes, the result output module encapsulates the output of the target task. Encapsulation refers to packaging the output of the target task into a specified format. For example, the output can be encapsulated according to a preset IPC protocol to obtain the target output data. This IPC protocol can be any suitable protocol, and this application does not limit it. In some implementations, the result output module provides a unified data output interface, which is used to publish the target output data externally.
[0079] In some implementations, IPC can also be encapsulated through a data output interface, and the software development framework can be output to the outside world through the data output interface, so as to maximize the decoupling between the IPC interface layer and the algorithm business code.
[0080] Understandably, the result output module defines output data based on a DataFrame, which can be directly defined through the macro interface provided by the software development framework, such as: DATA_FRAME_DECLARE(DataFrame, RawData). When the task is completed and needs to be output externally, the data output interface of the result output module can be called directly, such as calling the interface Output::Instance()->Send(Data data).
[0081] In this embodiment, after encapsulating the output result corresponding to the target task, the result output module sends the target output data through a unified data output interface, thereby realizing data interaction between the target execution thread and external processes and improving the efficiency of data interaction between processes.
[0082] In some embodiments, the software development framework 100 further includes a configuration management module 160, wherein: the configuration management module 160 is used to obtain a configuration file; parse the configuration file to obtain configuration information corresponding to the configuration file, and the configuration information is used to create the executor module and the task management module.
[0083] In some implementations, the configuration management (ConfigManager) module 160 can be any suitable software module capable of implementing this functionality. This configuration management module provides a unified configuration file parsing function, offering flexible configuration capabilities for the algorithm module software.
[0084] After the configuration management module 160 obtains the configuration file, it parses the configuration file to obtain the configuration information.
[0085] Configuration files can include, but are not limited to, basic software configuration files, executor configuration files, and task configuration files. Basic configuration files can include, but are not limited to, basic functionality and a list of executors to be run. Executor configuration files can include, but are not limited to, data types and the number of threads in the thread pool. Task configuration files can include, but are not limited to, a task list, task names, the function names of the task execution functions, and related tasks that depend on the target task.
[0086] In some implementations, the base configuration file, executor configuration file, and task configuration file can be separate configuration files. The configuration management module 160 parses the base configuration file, executor configuration file, and task configuration file respectively.
[0087] In some implementations, after startup, the software development framework reads the configuration file through the configuration management base class provided by the configuration management module, and parses the read configuration file to obtain configuration information. This configuration information can be used to create executor modules, task management modules, etc. In some implementations, the configuration information can also be used to create multiple task execution functions, thread pools, etc., within the task management module. In some implementations, the configuration information can also be used to create data containers.
[0088] In this embodiment of the application, the unified configuration file parsing function provided by the configuration management module provides the software development framework with flexible configuration capabilities, enabling the software development framework to flexibly configure the required executor modules and task management modules based on configuration information.
[0089] In some embodiments, the software development framework 100 further includes a creation module 170, wherein the configuration information includes the data type of the data to be processed, and the creation module 170 is used to create an executor module adapted to the data type based on the data type of the data to be processed.
[0090] In some implementations, the creation module 170 can be any suitable software module capable of performing this function; for example, the creation module 170 can be an application process (app).
[0091] In some implementations, the creation module 170 may obtain configuration information from the configuration management module. This configuration information includes at least the data type of the data to be processed. The data type of the data to be processed may include, but is not limited to, one of the following: visual sensor data, radar data, ultrasonic channel data, etc.
[0092] In some implementations, the executor module 120 corresponds to different data types of data to be processed. Therefore, when creating the executor module 120, the creation module 170 needs to create it according to the data type of the data to be processed, so that the executor module 120 can support processing the data to be processed of that data type, that is, the executor module 120 is adapted to that data type.
[0093] In this embodiment, the creation module flexibly creates the required executor module according to the data type of the data to be processed in the configuration information, so that the executor module can support processing the data to be processed of that data type.
[0094] In some embodiments, the configuration information further includes the task name corresponding to the target task, the function name of the target task execution function used to execute the target task, and related tasks that have a dependency relationship with the target task, wherein: the creation module is further configured to create a target task execution function for executing the target task based on the task name, the function name of the target task execution function, and the related tasks.
[0095] The task name corresponding to the target task is used to identify the target task.
[0096] The function name is used to identify the function to be executed by the target task.
[0097] Related tasks are used to identify tasks that have dependencies on the target task.
[0098] In some implementations, different tasks correspond to different task execution functions. Therefore, the creation module can create a target task execution function corresponding to the target task based on the task name, function name, and related tasks. This target task execution function is an algorithm function that implements the target task.
[0099] In some implementations, if no related task exists for the target task, the creation module can create a target task execution function corresponding to the target task based on the task name and the function name of the target task execution function.
[0100] In this embodiment of the application, the creation module flexibly creates the target task execution function of the required target task based on the relevant information of the target task in the configuration information, so that the target execution thread can determine the output result corresponding to the target task based on the target task execution function.
[0101] In some embodiments, the data input module is further configured to register a data update interface using the callback function; the executor module is further configured to obtain updated data to be processed through the data update interface; and set the status identifier of the data to be processed to a first status identifier; wherein the first status identifier indicates that the data to be processed has been updated; the task management module is further configured to obtain the updated data to be processed when the status identifier of the data to be processed is detected to be the first status identifier, and schedule the target task based on the task scheduling strategy and the updated data to be processed.
[0102] In some implementations, the data input module uses a callback function (such as SetDateCallback(callback)) to register a unified data update interface (such as OndataChanged(DataType)). Through the data update interface, the updated data to be processed received by the data input module can be passed to the executor module.
[0103] In some implementations, when the data input module detects that the data to be processed has been updated, it triggers the data update interface and sends the updated data to the actuator module.
[0104] In some implementations, the executor module receives the updated data to be processed through a data update interface, and then updates the data to the data container through an interface provided by the data container (such as AddFrame(DataFrame)). In some implementations, the executor module may also preprocess the updated data to be processed before updating it to the data container.
[0105] The status identifier may include, but is not limited to, a first status identifier and a second status identifier. The second status identifier indicates that the data to be processed has not been updated. In some implementations, the actuator module sets the status identifier of the data to be processed to the first status identifier to indicate to the task management module that the data to be processed has been updated.
[0106] In some implementations, the task manager module cyclically registers all tasks in the task list. When looping to the target task, if the status identifier of the pending data corresponding to the target task is detected as the first status identifier, the task management module knows that the pending data has been updated and needs to reschedule the target task based on the updated pending data. Therefore, the task manager module retrieves the updated pending data from the data container and schedules the target task based on the task scheduling strategy and the updated pending data to obtain a more accurate output result corresponding to the target task.
[0107] In some implementations, the status identifier of the data to be processed can be defaulted to the second status identifier, and then set to the first status identifier if the data to be processed is updated.
[0108] When the task manager detects that the status identifier of the pending data corresponding to the target task is the second status identifier, the task management module knows that the pending data has not been updated and there is no need to reschedule the target task. Therefore, the task management module skips the target task and then loops to the next task.
[0109] In this embodiment, when the task management module determines that the data to be processed has been updated, it retrieves the updated data to be processed from the data container, enabling the task management module to schedule the target task based on the latest data to be processed, thereby improving the accuracy of the output results corresponding to the target task.
[0110] In some embodiments, the data input module further includes a data type registration function, and the data input module is further configured to determine the data type of the data to be processed; and, if the software development framework does not support the data type of the data to be processed, to register the data type of the data to be processed using the data type registration function.
[0111] In some implementations, the data type registration function provides a unified interface for the data input module to register data types, allowing data types not supported by the current software development framework to be registered into the framework.
[0112] The software development framework can support data types such as raw camera images, ultrasonic channel data, and millimeter-wave point cloud data by default.
[0113] In some implementations, the data input module supports the extension of new data types. When the data type of the data to be processed is not registered in the software development framework, it is a data type that the framework does not support. Therefore, a data type registration function, such as the `REGISTER_AMSF_DATA_RECEIVER_CLASS(UserDataReceiver)` macro, can be used to register the new data type of the data to be processed into the software development framework, thus supporting the processing of data of that data type. The executor module can then determine the required data to be processed based on the received data type.
[0114] In this embodiment, the software development framework can extend its support for more data types by registering functions for simple data types, thereby enabling the software development framework to have good scalability.
[0115] In some embodiments, the actuator module is further configured to: determine the data type of the data to be processed; obtain data to be processed that is compatible with the data type from the data input module through the data acquisition interface; preprocess the data to be processed based on the data type corresponding to the data to be processed to obtain second target data corresponding to the data to be processed; wherein the preprocessing includes at least one of the following: filtering processing and alignment processing.
[0116] In some implementations, different actuator modules only support data types adapted to that actuator module, and each actuator module may support one or more data types, which is not limited in this application.
[0117] The actuator module obtains data to be processed that is compatible with the data type from the data input module through a data acquisition interface. In some implementations, the data to be processed obtained from the data input module is compatible with the data type. The data type may include one of the following: visual data type, ultrasonic data type, and radar data type, etc.
[0118] In some implementations, the data characteristics of the data to be processed differ depending on the data type. Therefore, different preprocessing methods can be used for different data types. In one example, visual data may be greatly affected by changes in lighting, so data with abnormal brightness can be removed during the filtering process; for radar data, since there are many data with excessively low reflectivity, only data with reflectivity higher than a threshold can be retained during the filtering process.
[0119] In some implementations, preprocessing may include at least one of the following: filtering processing and alignment processing. Filtering processing refers to filtering out invalid data, abnormal data, etc., from the data to be processed to improve the quality of the data to be processed. Alignment processing may include time alignment, spatial alignment, etc.
[0120] In some implementations, preprocessing may also include noise filtering, data augmentation, etc. Noise filtering refers to filtering the data to be processed to reduce the impact of noise on the data to be processed, thereby improving the quality of the data to be processed; data augmentation refers to transforming the data to be processed or generating new data, thereby increasing the diversity of the data to be processed.
[0121] In this embodiment, the actuator module can obtain accurate data to be processed based on the data type, and preprocess the data to be processed to obtain second target data, so as to further improve the data quality of the data to be processed.
[0122] In some embodiments, the software development framework is applied between the application layer and middleware.
[0123] Here, the application layer is the highest layer in the software layering of an autonomous driving system. It directly faces users and applications, providing users with network services and interaction interfaces between applications.
[0124] Middleware is a key software layer located between the operating system and the application layer. It enables efficient communication and collaboration between different components by providing common services and abstracting the underlying complexity.
[0125] In some implementations, the software development framework generates software code corresponding to the task requirements provided by the application layer, and interacts with the underlying layer through middleware to execute the software code corresponding to the task requirements and realize the task corresponding to the task requirements.
[0126] In some implementations, the software code corresponding to the task requirement can be executed by the underlying central processing unit or neural network processor, etc.
[0127] This application provides a software development method, such as... Figure 6 As shown, the steps include S601 to S605 as follows: Step S601: Call the singleton class provided by the software development framework to initialize the software development framework; the software development framework includes a data input module, an executor module, a task management module, a data container, and a result output module; Step S602: Call the data receiver provided by the input data module to input the data to be processed collected by the vehicle's sensors; Step S603: Call the executor base class provided by the executor module. The executor base class corresponds to the data to be processed and is used to determine the target task corresponding to the data to be processed. Step S604: Call the data frame base class provided by the data container. The data frame base class is used to receive the data to be processed sent by the executor module and to provide the data to be processed to the task management module. Step S605: Call the task base class provided by the task management module. The task base class is used to schedule the target task based on the task scheduling strategy. The target task is used to process the first target data corresponding to the data to be processed and obtain the output result corresponding to the target task. Step S606: Call the output base class provided by the result output module. The output base class is used to determine the target output data based on the output result corresponding to the target task; and publish the target output data.
[0128] In some implementations, when developing software, the main program is written first, and the initialization of the software development framework is performed by inheriting the singleton class provided by the software development framework.
[0129] In some implementations, the data input module may include multiple data receivers, each corresponding to different types of data collected by the vehicle's sensors. Therefore, multiple types of data to be processed can be received by calling multiple data receivers.
[0130] The executor module encapsulates an executor base class. By calling the executor base class provided by the executor module, the target task corresponding to the data to be processed can be determined.
[0131] The task management module encapsulates a task base class, which is used to schedule target tasks. By scheduling target tasks, the first target data corresponding to the data to be processed is processed, and the output result corresponding to the target task is obtained. The output module encapsulates an output base class. By calling the output base class provided by the output module, the target output data can be published externally. The output base class can also be used to encapsulate the output results corresponding to the target task to obtain the target output data.
[0132] In some implementations, a data container is also encapsulated within the software development framework. Data interaction between modules within the framework is achieved by calling a data frame base class provided by the data container. In some implementations, this data frame base class can also be used to encapsulate fourth target data to obtain third target data.
[0133] In some implementations, a configuration management module is encapsulated within the software development framework. The configuration file is retrieved by calling the configuration management base class of this module. In some implementations, the configuration management base class is also used to parse the configuration file to obtain configuration information. In some implementations, the configuration file can be customized according to user needs.
[0134] In some implementations, when developing software, based on the software development framework proposed in this application, only the corresponding data to be processed, the corresponding configuration file, and the relevant code of the target task execution function corresponding to the target task need to be input to realize the software development of task scheduling of the target task, which reduces the amount of code in software development and can improve the efficiency of software development.
[0135] In this embodiment, during software development, the executor base class, task base class, and output base class encapsulated by the software development framework can be reused, eliminating the need for repetitive development. This reduces the amount of code development and improves software development efficiency. Furthermore, encapsulating multiple base classes through the software development framework improves code quality and reduces code complexity. During code maintenance, only other code needs to be maintained, without affecting the base classes, thus improving code maintainability.
[0136] The following describes the application of the embodiments of this application in a real-world scenario.
[0137] Software development frameworks are typically designed to meet all software development needs in various scenarios. This often leads to the need to reinvent the wheel for many basic modules, resulting in low development efficiency and inconsistent code quality. Input and output are limited to fixed types, restricting data diversity. Task scheduling is complex, resulting in poor system flexibility and maintainability. Data interaction relies on external interfaces, leading to high software system complexity.
[0138] Related technologies focus on solving the problem of algorithm model adaptation, deploying algorithms by calling encapsulated interface modules on different platforms, which can improve algorithm deployment capabilities, but do not solve the problems of algorithm software development code quality and development efficiency. In related technologies, the focus is on encapsulating each stage of the data flow in algorithm software, which solves the problem of algorithm software development efficiency to some extent. However, the encapsulation of data processing is insufficient, requiring users to call framework interfaces for data acquisition, verification, storage, and other management, resulting in a considerable amount of actual development work. Furthermore, algorithm task scheduling is not encapsulated, requiring users to manage and schedule algorithm task execution themselves.
[0139] This application targets algorithm software, fully encapsulating the acquisition of specific types of data (such as camera, millimeter-wave radar, etc.), and providing a simple interface for algorithm tasks to acquire the required data (corresponding to the data to be processed in the aforementioned embodiments). It also encapsulates a thread pool-based task scheduling function. Users only need to develop the task execution process code and configure task attributes and dependencies through configuration files to delegate task scheduling to the software development framework for unified processing. After task execution, a unified data publishing interface (corresponding to the data output interface in the aforementioned embodiments) is called, and the software development framework automatically publishes the output results through inter-process communication. By encapsulating as much functionality as possible outside the task algorithm itself (corresponding to the task execution function in the aforementioned embodiments), users can focus on the implementation of the task algorithm (such as visual obstacle recognition algorithms, visual parking space recognition algorithms, etc.), improving software development efficiency and increasing software reliability.
[0140] In this embodiment, the basic modules upon which algorithm software development depends are encapsulated, taking into account the characteristics of algorithm software development. Algorithm software development only requires creating a singleton object by calling the interface provided by the software development framework in the main function. This object will automatically create and initialize the key objects required for software operation based on the software configuration. Furthermore, the software development framework encapsulates the interfaces of each module and provides unified task scheduling, significantly reducing the amount of code development required for algorithm software. It also allows for reuse across different algorithms, improving software development efficiency, resulting in more standardized code at the static level and higher stability at runtime.
[0141] The algorithm software data stream in the embodiments of this application can be as follows: Figure 7 As shown, the data input module 110 first obtains the raw data required by the algorithm from the external process, such as the original image from the camera, ultrasonic channel data, and millimeter-wave point cloud data. Then, the executor module 120 provides the data to each task in the task management module 130 through a unified data acquisition interface and starts the thread pool for task scheduling. Next, each algorithm task performs calculations on the data. Finally, through the unified data publishing interface provided by the result output module 140, the output results are published to the downstream software after the task execution is completed.
[0142] The software development framework provided in this application embodiment is as follows: Figure 8 As shown, it may include the following modules: (1) Data input module 110: The data input module may include the internal interfaces: datalist:Data and callback: std::function <void>External interfaces: Init(Data data): void and SetDataCallback(callback): void; The data input module 110 may include multiple data receivers 111. The data receiver 111 (DataReceiver) includes the internal interface: rawData: DataType; and the external interface: Init(Config config): void and GetData(): DataType; The data receiver 111 inherits data from the sensor data receiver 112 (CameraDataReceiver). The sensor data receiver 112 includes the internal interface: name: string; and the external interface: Init(Config config): void and GetData(): DataType.
[0143] The data input module provides a unified external data input interface (corresponding to the data receiver in the aforementioned embodiment) and has good cross-platform compatibility and scalability. The data input module is responsible for accessing external data, adapting to different sensor input data and IPC mechanism, and encapsulating the main data of current autonomous driving applications, including data from cameras, ultrasonic sensors, and millimeter-wave radar, as the default supported input data.
[0144] The data input module registers a unified data acquisition interface (such as OnInputData(DataType):void) and a data update interface (such as OndataChanged(DataType):void) through a data callback function registration interface (corresponding to the callback function in the aforementioned embodiments, such as SetDateCallback(callback)), so that the executor module can obtain the required data. After receiving the input data (corresponding to the data to be processed in the aforementioned embodiments), the data input module will pass the input data to the executor module through the data acquisition interface and the data update interface.
[0145] In addition, the data input module supports the extension of new data types. If the data type of the data to be processed is not registered in the software development framework, then this data type is not supported by the framework. Therefore, a data type registration function, such as the `REGISTER_AMSF_DATA_RECEIVER_CLASS(UserDataReceiver)` macro, can be used to register the new data type of the data to be processed into the software development framework, thus supporting the processing of data of that data type. The executor module can then determine the required data to be processed based on the received data type.
[0146] (2) Executor module 120: Executor module 120 includes internal interfaces: name: string, configs: ConfigType and data_map: map; external interfaces: Init(): void, Delnit(): void, Start(): void, OnInputData(DataType): void and OndataChanged(DataType): void.
[0147] The executor module 120 is based on the unified scheduling management of thread pools and task flows, and includes the execution and scheduling of all algorithm tasks.
[0148] In this embodiment, the TaskFlow is the core execution element of the algorithm software. To achieve efficient multi-threaded task scheduling, the executor module 120 adopts a task scheduling management mechanism based on the TaskFlow, providing a set of thread pools to support the operation of the algorithm taskflow and realize concurrent task processing.
[0149] The task flow is built on the Workflow framework. The executor module allocates tasks to appropriate target execution threads in the thread pool based on the current load of multiple threads to execute the target tasks.
[0150] (3) Task Management Module 130: Task Management Module 130 includes the internal interface: tasks: map; external interface: RunTask(): void; Task Management Module 130 includes multiple task modules 133, and Task Module 133 (corresponding to multiple task execution functions 131) includes the internal interface: name: string; external interfaces: Init(): void, Delnit(): void and Start(): void; Task Management Module 130 includes a task flow 134, and Task Flow 134 includes the internal interface: name: string; external interface: Run(FinishCallback cb): void. The task flow includes the scheduling of each thread in the thread pool 132 and multiple task execution functions 131.
[0151] The task management module 130 includes multiple task modules and a thread pool. Each task module is the smallest execution unit within the software development framework. After the task management module determines the target execution thread, the target execution thread schedules the target task's corresponding target task module to call the target task's execution function. After completing the scheduling of the target task, the target execution thread obtains the corresponding output result.
[0152] Data container 150 (also known as the data frame management interface) provides a unified set of acquisition and update interfaces. All data interactions between tasks must be performed through the interfaces provided by the data container. Data container 150 includes internal interfaces: datasource:string and dataframes:map; and external interfaces: GetDataFrames():map, DataSource():string, and AddFrame(DataFrame).
[0153] The data container 150 includes multiple single-frame data interfaces 151. Each single-frame data interface 151 supports encapsulating any data type into a unified data frame. Users can customize data frame encapsulation based on DataFrame; this application does not impose any limitations on this. The single-frame data interface 151 may include external interfaces: SetName(): void and SetTimeStamp(): void.
[0154] Single-frame data interface 151 is the interface for obtaining data frames. Single-frame data interface 151 is obtained through data frame base class 152 (DataFrameBase), which is used to encapsulate arbitrary data types. Data frame base class 152 includes internal interfaces: timestamp: uint64, name: string, and rawData: RawData; and external interfaces: SetName(): void, SetData(RawData): void, GetData(): RawData, and SetTimeStamp(): void.
[0155] The base class 152 of the data frame implements the encapsulation of arbitrary data types by inheriting from the user-defined data frame 153. The user-defined data frame 153 includes the external interfaces: SetData(RawData): void and GetData(): RawData.
[0156] The software development framework also includes a shared data management module 190 (SharedDataManager), which includes internal interfaces: datamap: map and users: map; and external interfaces: RegistDataChanged(callbak): void and SetData(SharedData data): void. The shared data management module 190 also includes multiple shared data interfaces 191 (SharedData), which include an internal interface: item: ItemType; and external interfaces: RegistDataChanged(callbak): void and SetData(SharedData data): void.
[0157] (4) Result Output Module 140: Provides a unified data output interface. The result output module encapsulates the output results corresponding to the target task. Encapsulation can refer to encapsulating the output results corresponding to the target task into a specified format. For example, the output results can be encapsulated according to a preset IPC protocol to obtain the target output data. The IPC protocol can be any suitable protocol, and this application does not limit it. The result output module defines an output data based on a DataFrame, which can be directly defined through the macro interface provided by the software development framework, such as: DATA_FRAME_DECLARE(DataFrame,RawData). When the task is completed and needs to be output externally, the data output interface of the result output module can be called directly, such as Output::Instance()->Send(Data data).
[0158] The output module 140 includes an internal interface: tasks: map; and an external interface: Send(Data data): void.
[0159] (5) Configuration Management Module 160: Provides a unified configuration file parsing function. It provides flexible configuration capabilities for the software development framework, including basic software configuration files, executor configuration files, and task configuration files.
[0160] The basic configuration file includes information such as basic functions and a list of executors to be run; the executor configuration file includes information such as data types and the number of threads in the thread pool; the task configuration includes information such as a task list and task names (corresponding to the task names corresponding to the target task in the aforementioned embodiments), class names (corresponding to the function names of the target task execution functions used to execute the target task in the aforementioned embodiments), and dependent tasks (corresponding to related tasks that have a dependency relationship with the target task in the aforementioned embodiments).
[0161] In this embodiment of the application, after the software development framework starts, it reads various configuration files through the configuration management base class, parses the read configuration files to obtain configuration information, and uses the configuration information to create objects such as executor modules, thread pools, multiple task execution functions, and data containers.
[0162] The configuration management module 160 includes an internal interface: configfile: string; and external interfaces: GetOperatorList(): Operator and GetConfigParam(): Params.
[0163] The software development framework also includes application process 180, which reads and obtains configuration information from configuration management module 160. Application process 180 includes internal interface: config: ConfigManager; external interfaces: Init(): void, Start: type, and CreateOperator(): void.
[0164] The development process of the algorithm software provided in this application embodiment can be as follows: Figure 9 As shown, the steps include S801 to S808 as follows: Step S901: Obtain the Software Development Kit (SDK) package for the software development framework; Step S902: Write the main program and call the singleton class provided by the software development framework to perform initialization and start the software development framework; Write the main function of the software, inherit the main program base class of the framework, write the main program, call the framework interface to create the main program object, and implement the initialization and startup of the main program.
[0165] Step S903: Implement the algorithm software executor class based on the Operator base class; Inherit from the Operator base class to implement the algorithm software executor class, override the data response callback function, obtain the data to be processed from the acquired external data based on the data type in the callback function, preprocess the data to be processed, and then add the preprocessed data to the data container through the data container interface.
[0166] Step S904: Implement the data classes used during task execution based on the DataFrame base class; Inherit the DataFrame base class to implement the data classes used in the task processing, define the data types required for task execution, and call the data type registration interface provided by the software development framework to register the data classes into the data container for unified management.
[0167] Step S905: Implement a task execution class based on the Task base class and associate it with a data class, then write the task execution code; Inheriting from the Task base class, a task execution class is implemented and associated with a data class. The data to be processed in the data container is converted into the data type required to execute the task. The task execution function is overridden, and data processing (i.e. algorithm processing) is implemented in the target task execution function.
[0168] Step S906: Implement the output class based on the Output base class and specify the IPC output signal; Inherit the Output base class to implement the output class, override the data output interface, and encapsulate the output result into the specified format by calling the interface provided by the software development framework (such as DATA_FRAME_DECLARE(DataFrame, RawData)) to obtain the target output data. Then, use the data output interface to publish the target output data to the outside world.
[0169] Step S907: According to the configuration file format of the software development framework, add the executor to be enabled, the task, and the data types that need to be input to the configuration file; The configuration file format of the software development framework, which configures the executor modules, task modules, and data types to be enabled.
[0170] Step S908: Compile and generate algorithm software.
[0171] In this embodiment, the software development framework is applied between the application layer and the middleware. The software layering of the autonomous driving system can be as follows: Figure 10 As shown, it includes an application layer 1010, a software development framework 100, middleware 1020, a kernel in the operating system 1030, and hardware 1040. The application layer 1010 includes multiple application software such as application software 1, application software 2, and application software 3; the software development framework 100 includes a data input module 110, an actuator module 120, a task management module 130, a result output module 140, and a configuration management module 160; the middleware 1020 includes a log 1021, a diagnostic module 1022, a monitor 1023, and an over-the-air technology module 1024; the kernel 1030 includes a Serial Peripheral Interface (SPI) 1031, an Ethernet interface 1032, and an image signal processor 1033; and the hardware 1040 includes a central processing unit (CPU), a double data rate synchronous dynamic random access memory (DDR) 1042, and an embedded multi-media card (EMMC).
[0172] The software development framework 100 obtains task requirements from the application layer 1010, generates software code corresponding to the task requirements, and interacts with the central processing unit through middleware and the operating system so that the central processing unit can execute the software code generated by the software development framework.
[0173] This embodiment also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement some or all of the steps in the above method.
[0174] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0175] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0176] The above embodiments are merely preferred embodiments provided to fully illustrate this application, and the scope of protection of this application is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on this application are all within the scope of protection of this application.< / void>
Claims
1. A software development framework, characterized by The software development framework comprises a data input module, an executor module, a task management module, a data container and a result output module, wherein: The data input module is configured to receive data collected by sensors of a vehicle and register a data acquisition interface by using a callback function; the data acquisition interface is configured to provide the executor module with the data to be processed; The executor module, corresponding to the data to be processed, is configured to acquire the data to be processed through the data acquisition interface and send the data to the data container; and determine a target task corresponding to the data to be processed; The task management module is configured to acquire the data to be processed from the data container, schedule the target task based on a task scheduling strategy, process first target data corresponding to the data to be processed to obtain an output result corresponding to the target task; and The result output module is configured to acquire the output result corresponding to the target task, determine target output data based on the output result corresponding to the target task, and publish the target output data.
2. The software development framework of claim 1, wherein, The task management module comprises a plurality of task execution functions and a thread pool, wherein: The task management module is further configured to determine a target execution thread corresponding to the target task from a plurality of threads of the thread pool based on the task scheduling strategy, and schedule the target execution thread; The target execution thread is configured to determine a target task execution function corresponding to the target task from the plurality of task execution functions, acquire third target data obtained by encapsulating fourth target data, the fourth target data comprising one of the data to be processed and second target data obtained by preprocessing the data to be processed, and determine the output result corresponding to the target task based on the third target data and the target task execution function.
3. The software development framework of claim 2, wherein, The data container comprises a plurality of single-frame data interfaces, wherein: The executor module is further configured to send the fourth target data to the data container; The single-frame data interface is configured to encapsulate the fourth target data according to a preset encapsulation format to obtain the third target data; The target execution thread is further configured to acquire the third target data from the single-frame data interface and input the third target data into the target task execution function to obtain the output result corresponding to the target task.
4. The software development framework of claim 3, wherein: The target execution thread is further configured to send the output result corresponding to the target task to the result output module; The result output module is further configured to encapsulate the output result corresponding to the target task to obtain the target output data, and publish the target output data by using a data output interface.
5. The software development framework of claim 1, wherein, The software development framework further comprises a configuration management module, wherein: The configuration management module is configured to acquire a configuration file, parse the configuration file to obtain configuration information corresponding to the configuration file, and create the executor module and the task management module based on the configuration information.
6. The software development framework of claim 5, wherein, The software development framework further comprises a creating module, and the configuration information comprises a data type of the to-be-processed data, wherein: The creating module is configured to create the executor module adapted to the data type of the to-be-processed data based on the data type of the to-be-processed data.
7. The software development framework of claim 6, wherein, The configuration information further comprises a task name corresponding to the target task, a function name of a target task execution function used for executing the target task, and a related task having a dependency relationship with the target task, wherein: The creating module is further configured to create the target task execution function used for executing the target task based on the task name, the function name of the target task execution function, and the related task.
8. The software development framework according to any one of claims 1 to 7, wherein: The data input module is further configured to register a data update interface by using the callback function. The executor module is further configured to acquire the updated to-be-processed data through the data update interface, and set a state identifier of the to-be-processed data as a first state identifier, wherein the first state identifier represents that the to-be-processed data has been updated. The task management module is further configured to acquire the updated to-be-processed data when detecting that the state identifier of the to-be-processed data is the first state identifier, and schedule the target task based on a task scheduling strategy and the updated to-be-processed data.
9. The software development framework of any one of claims 1 to 7, wherein, The data input module further comprises a data type registration function, The data input module is further configured to determine a data type of the to-be-processed data, and register the data type of the to-be-processed data by using the data type registration function when the software development framework does not support the data type of the to-be-processed data.
10. The software development framework of any one of claims 1 to 7, wherein, The executor module is further configured to perform at least one of the following: Determine a data type of the to-be-processed data, and acquire the to-be-processed data adapted to the data type from the data input module through the data acquisition interface. Preprocess the to-be-processed data based on the data type corresponding to the to-be-processed data to obtain second target data corresponding to the to-be-processed data, wherein the preprocessing comprises at least one of the following: screening processing, alignment processing.
11. The software development framework of any one of claims 1 to 7, wherein, The software development framework is applied between an application layer and a middleware.
12. A software development method, characterized by, The method comprises: Initializing the software development framework by calling a singleton class provided by the software development framework; The software development framework comprises a data input module, an executor module, a task management module, a data container, and a result output module; Input the to-be-processed data collected by a sensor of a vehicle by calling a data receiver provided by the data input module; Determine a target task corresponding to the to-be-processed data by calling an executor base class provided by the executor module; Receive the to-be-processed data sent by the executor module by calling a data frame base class provided by the data container, and provide the to-be-processed data to the task management module. invoke a task base class provided by the task management module, the task base class being configured to schedule the target task based on a task scheduling strategy, the target task being configured to process first target data corresponding to the to-be-processed data to obtain an output result corresponding to the target task; invoke an output base class provided by the result output module, the output base class being configured to determine target output data based on the output result corresponding to the target task; and publish the target output data.
13. A computer device, comprising: A software development framework according to any one of claims 1 to 11.