Embedded software development method and device, equipment, medium and product

By using the common SDK and virtual interface to bind to the underlying interface of the platform SDK in embedded software development, the development efficiency problem caused by the differences in SDK API interfaces of different chip manufacturers is solved, and a more efficient and flexible development process is achieved.

CN119987758APending Publication Date: 2025-05-13GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411894727.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In embedded software development, due to the different SDK API interfaces provided by different chip manufacturers, the original application layer code needs to be rewrite or modified when replacing the hardware platform, which reduces development efficiency.

Method used

By obtaining the general SDK and calling the virtual interface in the general SDK in the application layer code, a binding relationship is established with the underlying interface in the current platform SDK through the virtual interface, thereby realizing the function.

Benefits of technology

It realizes that when replacing the hardware platform or SDK, you only need to update the binding relationship without large-scale modification of the application layer code, avoid relying on the SDK of specific chip manufacturers, and improve development efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987758A_ABST
    Figure CN119987758A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an embedded software development method and device, equipment, a medium and a product, and the method comprises the steps: obtaining a universal SDK (Software Development Kit) in an embedded software development process; wherein the universal SDK comprises one or more functional modules, and each functional module is provided with one or more virtual interfaces; according to the method and the device, the current platform SDK is acquired, and the binding relationship between the virtual interface in the universal SDK and the bottom layer interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is realized through the bottom layer interface bound with the virtual interface, and the universal SDK is arranged between the application layer code and the platform SDK; according to the technical scheme, the application layer code can call the bottom layer interface in the platform SDK through the virtual interface in the universal SDK, the application layer code does not need to pay attention to the platform SDK, then when a hardware platform or the SDK is replaced, only the binding relation needs to be updated, the application layer code does not need to be modified on a large scale, dependence on the SDK of a specific chip manufacturer is avoided, and the development efficiency and quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment, medium and product for developing embedded software. Background Art

[0002] In embedded software development, it is usually dependent on the SDK (Software Development Kit) provided by a specific chip manufacturer. As an important bridge connecting hardware and software, SDK provides developers with an interface to access hardware resources and implement specific functions.

[0003] However, in the prior art, different chip manufacturers provide different SDKs, and different SDKs have different API interfaces. When the hardware platform is replaced, the original application layer code cannot be directly reused and requires a lot of rewriting or modification work, which reduces development efficiency. Summary of the invention

[0004] In view of the above problems, a method, apparatus, device, medium and product for developing embedded software is proposed to overcome the above problems or at least partially solve the above problems, including:

[0005] A method for developing embedded software, the method comprising:

[0006] In the process of embedded software development, a general SDK is obtained; wherein the general SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces;

[0007] The current platform SDK is obtained, and a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0008] Optionally, before establishing the binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, the method further includes:

[0009] Determine the underlying interface that each virtual interface matches in the current platform SDK.

[0010] Optionally, determining the underlying interface that matches each virtual interface in the current platform SDK includes:

[0011] Relevant information of each virtual interface is obtained, and based on the relevant information, an underlying interface that matches each virtual interface in the current platform SDK is determined.

[0012] Optionally, the relevant information includes any one or more of the following: interface definition information, function description information.

[0013] Optionally, the establishing a binding relationship between the virtual interface and the underlying interface includes: encapsulating the underlying interface in the virtual interface.

[0014] Optionally, before obtaining the universal SDK, the method further includes:

[0015] In the preset universal SDK, create one or more functional modules;

[0016] For each functional module, one or more virtual interfaces are set.

[0017] Optionally, the current platform SDK is an SDK provided by a chip manufacturer.

[0018] Optionally, the functional modules include any one or more of the following: a wireless network initialization and connection module, a Bluetooth pairing and data transmission module, a data acquisition and processing module, a communication processing module, a device status monitoring module, and a monitoring and reporting module.

[0019] A device for developing embedded software, comprising:

[0020] A general SDK acquisition module, used to acquire a general SDK during the embedded software development process; wherein the general SDK includes one or more functional modules, each functional module is provided with one or more virtual interfaces;

[0021] The binding relationship establishment module is used to obtain the current platform SDK and establish a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0022] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.

[0023] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0024] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described above.

[0025] The embodiments of the present invention have the following advantages:

[0026] In an embodiment of the present invention, a universal SDK is obtained during the process of embedded software development; wherein the universal SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces; the current platform SDK is obtained, and a binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface, thereby setting a universal SDK between the application layer code and the platform SDK, and the application layer code can call the underlying interface in the platform SDK through the virtual interface in the universal SDK, and the application layer code does not need to pay attention to the platform SDK, and then when the hardware platform or SDK is replaced, it is only necessary to update the binding relationship without large-scale modification of the application layer code, thereby avoiding dependence on the SDK of a specific chip manufacturer and improving development efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0028] Figure 1 is a flowchart of the steps of a method for developing embedded software provided by some embodiments of the present invention;

[0029] Figure 2 It is a flowchart of an embedded software development method provided by some embodiments of the present invention;

[0030] Figure 3 is a flowchart of steps of another method for developing embedded software provided by some embodiments of the present invention;

[0031] Figure 4 is a flowchart of steps of another method for developing embedded software provided by some embodiments of the present invention;

[0032] Figure 5 It is a structural block diagram of an embedded software development device provided by some embodiments of the present invention. DETAILED DESCRIPTION

[0033] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] In related technologies, the embedded software development model mainly relies on the software development kit (SDK) provided by specific chip manufacturers. As an important bridge between hardware and software, SDK provides developers with interfaces to access hardware resources and implement specific functions. However, this model has exposed a series of significant problems in actual applications.

[0035] First, the SDKs of different chip manufacturers have large differences in architecture, functions and interface design. Developers need to constantly adapt to new SDKs during the development process, learn and master their unique API (Application Programming Interface) calling methods and development processes. This not only increases the learning cost of developers, but may also extend the development cycle and affect the overall progress of the project.

[0036] Second, since different SDKs have different API interfaces, when a project needs to change the hardware platform, the original code often cannot be directly reused. Developers need to rewrite or modify the code in large quantities to adapt to the new SDK and hardware environment. This not only increases the development workload, but may also introduce new errors and unstable factors, posing a threat to the stability and reliability of the project.

[0037] In addition, this development method that relies on a specific SDK also significantly increases development time and cost. In multi-platform projects, the development team needs to adapt the SDKs of different manufacturers separately to meet the needs of different hardware platforms. This not only requires a lot of manpower, material and financial resources, but may also lead to waste of project resources and low development efficiency.

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

[0039] Reference Figure 1 , shows a flowchart of a method for developing embedded software provided by some embodiments of the present invention, which may specifically include the following steps:

[0040] Step 101, in the process of embedded software development, obtain a general SDK; wherein the general SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces.

[0041] Among them, SDK (Software Development Kit) refers to a set of programming codes and tools that allow software developers to create applications for specific software packages, applications, hardware platforms or operating systems; a general SDK can be an SDK designed to provide general support for the development of a variety of embedded systems, which can be pre-designed according to the actual needs of developers.

[0042] In actual applications, a general SDK can be set between the application layer code and the platform SDK. In the process of embedded software development, a pre-created general SDK can be obtained.

[0043] In some embodiments of the present invention, before obtaining the universal SDK, the method further includes: creating one or more functional modules in the preset universal SDK; and setting one or more virtual interfaces for each functional module.

[0044] When developers design a general SDK, they can divide the multiple functions that need to be implemented into multiple functional modules, each module focusing on implementing a specific function or providing a specific service. For example, one functional module can be responsible for network communication, and another functional module can be responsible for data collection and processing.

[0045] One or more virtual interfaces are provided for each functional module, which may mean that one or more virtual interfaces are defined for each functional module to interact with the outside or other modules.

[0046] For example, in the pre-built universal SDK, it can be divided into the following functional modules according to its functions. Each functional module can be developed, debugged and reused separately:

[0047] 1. WiFi_Module (responsible for Wi-Fi initialization, connection and disconnection)

[0048] 2. BLE_Module (responsible for Bluetooth pairing and data transmission)

[0049] 3. MQTT_Module (responsible for initialization, subscription, and publishing of MQTT protocol)

[0050] 4. Data_Processing (data collection and processing)

[0051] 5. Device_Status (monitor device status (such as power, temperature, etc.) and report)

[0052] After dividing multiple functional modules, one or more virtual interfaces (universal APIs) can be set for each module. These interfaces do not depend on specific SDKs, but only define the tasks that the modules need to complete. The specific implementation of the interfaces is filled in by different chip manufacturers according to the SDK. For example, the following is an example of virtual interface definition:

[0053] 1. WiFi_Module:

[0054] int WiFi_Init(void) (Initialize Wi-Fi module)

[0055] int WiFi_Connect(const char* ssid, const char* password) (Connect to Wi-Fi network)

[0056] int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0057] int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0058] 2.BLE_Module:

[0059] int BLE_Init(void) (initialize Bluetooth module)

[0060] int BLE_Pair(const char*device_name) (pair with Bluetooth device)

[0061] int BLE_SendData(const uint8_t*data,size_t length)(send data)

[0062] int BLE_ReceiveData(uint8_t*buffer,size_t length)(receive data)

[0063] 3.MQTT_Module:

[0064] int MQTT_Init(const char*server,int port) (Initialize MQTT connection)

[0065] int MQTT_Connect(void) (Connect to MQTT server)

[0066] int MQTT_Subscribe(const char*topic)(Subscribe to topic)

[0067] int MQTT_Publish(const char*topic,const uint8_t*payload,size_tlength)(Publish message)

[0068] int MQTT_Disconnect(void) (disconnect MQTT connection)

[0069] 4.Data_Processing:

[0070] int Data_Init(void) (initialize data processing module)

[0071] int Data_Acquire(void*data_buffer) (get sensor data)

[0072] int Data_Process(const void*raw_data,void*processed_data)(process the data)

[0073] 5.Device_Status:

[0074] int Status_Init(void) (Initialize status monitoring module)

[0075] int Status_GetBatteryLevel(void) (Get battery level)

[0076] int Status_GetTemperature(void) (Get device temperature)

[0077] int Status_Report(void) (Report device status)

[0078] As some examples, one or more functional modules are created in a preset universal SDK. After one or more virtual interfaces are set for each functional module, the configured universal SDK can be sent to chip manufacturers. The chip manufacturers can determine the required underlying interfaces based on the interface definition information and function description information defined in the universal SDK, and encapsulate the underlying interfaces into the virtual interfaces of the corresponding functional modules.

[0079] In some embodiments of the present invention, the functional modules include any one or more of the following: wireless network initialization and connection module, Bluetooth pairing and data transmission module, data acquisition and processing module, communication processing module, device status monitoring module, monitoring and reporting module.

[0080] Among them, the wireless network initialization and connection module can be responsible for the initialization of the wireless network function of the device, including scanning available wireless networks, selecting and connecting to a specific wireless network; it can also include functions such as managing network connections, such as disconnecting, reconnecting, switching networks, etc.

[0081] The Bluetooth pairing and data transmission module can handle the pairing process of the device with other Bluetooth devices, as well as data transmission via Bluetooth; it can also include functions such as discovering nearby Bluetooth devices, requesting and accepting pairing requests, establishing Bluetooth connections, sending and receiving data, etc.

[0082] The data collection and processing module can be responsible for collecting data from the device's sensors or other data sources and processing the data; it can also perform operations such as data cleaning, format conversion, aggregation, and analysis.

[0083] The communication processing module can be responsible for the communication between the device and other devices or systems; it can also include functions such as processing network communication protocols, managing communication sessions, sending and receiving data, etc. The communication processing module can support multiple communication methods, such as TCP / IP, HTTP, MQTT, etc., to adapt to different application scenarios and needs.

[0084] The device status monitoring module can be responsible for monitoring the status of the device, including hardware status (such as power supply, temperature, memory usage) and software status (such as running applications, process status), etc. It can also include alarm and logging functions to promptly notify administrators or users when the device status is abnormal.

[0085] The monitoring and reporting module can be responsible for monitoring specific parameters or conditions of the device and reporting information to the administrator or system when certain conditions are met; it can also include monitoring device performance, error logs, abnormal events, etc., and reporting to the remote server or management system.

[0086] Step 102, obtain the current platform SDK, and establish a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0087] In some embodiments of the present invention, the current platform SDK is an SDK provided by a chip manufacturer.

[0088] In some embodiments of the present invention, the establishing of the binding relationship between the virtual interface and the underlying interface includes: encapsulating the underlying interface in the virtual interface.

[0089] As some examples, the specific implementation of each module can depend on the SDK of a specific platform; for example, after obtaining the general SDK, you can obtain the current platform SDK, find the underlying interface in the current platform SDK that can implement the corresponding functions of the target functional module, and encapsulate it into the virtual interface of the target functional module of the general SDK, so that the virtual interface in the general SDK is associated with the specific implementation interface in the current platform SDK, and use it as a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK; when the application layer code calls the virtual interface in the general SDK, it actually calls the corresponding underlying interface in the current platform SDK encapsulated in the virtual interface, thereby executing the corresponding function.

[0090] In some examples, by defining standardized interfaces, the specific implementation of each module can depend on the SDK of a specific platform, but the interface format and calling method remain consistent; this means that application layer code (such as the main control logic) can directly call these interfaces without having to consider the differences between different platform SDKs. For example, the general design idea of ​​WiFi_Module can be as follows:

[0091] Abstract virtual interface (VAPI): define common interfaces such as WiFi_Init (initialize Wi-Fi module) and WiFi_Connect (connect to Wi-Fi network).

[0092] Specific implementation (completed by chip manufacturers): On each platform, the underlying SDK interface provided by chip manufacturers may be different. For example, there may be esp_wifi_init on ESP32, and HAL_WIFI_Init on STM32, but the manufacturer will call the corresponding underlying API in the WiFi_Init general interface to complete the initialization.

[0093] For example, when an IoT device wants to connect to a router WiFi after it is started, it must first initialize its own network card and configure various functional parameters required for network configuration, such as its own network card MAC address, IP address, IP protocol (IPv4 or IPv6), etc.

[0094] These can be achieved in the upper application layer by calling a wifi_init VAPI (i.e. virtual interface). This virtual interface is already encapsulated. It is achieved by finding an API (i.e. underlying interface) that can initialize the network card and configure network configuration parameters in the SDK provided by the chip manufacturer. For example, the SDK provided by ESP32 can implement the above functions through esp_wifi_init and esp_ethernet_init or similar APIs. This underlying API (underlying interface) is encapsulated into the virtual interface wifi_init VAPI of the wireless network initialization and connection module of the general SDK:

[0095] int WiFi_Init(void)

[0096] {

[0097] Int ret = 0;

[0098] ret = esp_wifi_init();

[0099] ret = esp_ethernet_init();

[0100] return ret;

[0101] }

[0102] In some embodiments of the present invention, before establishing the binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, the process further includes: determining the underlying interface that matches each virtual interface in the current platform SDK.

[0103] In some embodiments of the present invention, determining the underlying interface that each virtual interface matches in the current platform SDK includes: obtaining relevant information of each virtual interface, and determining the underlying interface that each virtual interface matches in the current platform SDK based on the relevant information.

[0104] For example, the wireless network initialization and connection module (WiFi_Module) defines multiple virtual interfaces:

[0105] 1. int WiFi_Init(void) (initialize Wi-Fi module)

[0106] 2. int WiFi_Connect(const char*ssid, const char*password) (Connect to Wi-Fi network)

[0107] 3. int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0108] 4. int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0109] Among them, the relevant information of the virtual interface (1) is "initialize the Wi-Fi module". After determining the relevant information of the virtual interface, the underlying interface that can perform this function can be found from the current platform SDK, such as esp_wifi_init, and then the esp_ethernet_init is encapsulated into the virtual interface (1) to obtain:

[0110] int WiFi_Init(void)

[0111] {

[0112] Int ret = 0;

[0113] ret = esp_wifi_init();

[0114] return ret;

[0115] }

[0116] By determining the relevant information corresponding to each virtual interface, the underlying interface that matches the relevant information of each virtual interface is determined from the current platform SDK, and encapsulated in the corresponding virtual interface, so that when the application layer code subsequently calls the virtual interface in the general SDK, the underlying interface encapsulated in the virtual interface can be used to execute the corresponding function.

[0117] For example, when the application layer calls the virtual interface WiFi_Init (initializes the Wi-Fi module) in the wireless network initialization and connection module (WiFi_Module), the specific implementation inside WiFi_Module is to call the underlying interface wifi_init_config of the current platform SDK for configuration;

[0118] The application layer calls the virtual interface WiFi_Connect (connect to Wi-Fi network) in the wireless network initialization and connection module (WiFi_Module) and specifies the SSID and password of the network; the specific implementation of the virtual interface WiFi_Connect of WiFi_Module is to call the corresponding method in the current platform SDK, such as esp_wifi_connect of ESP32 or HAL_WIFI_Connect of STM32, to complete the connection.

[0119] The application layer continues to call other modules, such as MQTT_Connect, BLE_Pair, etc., to realize the complete functions of the device.

[0120] In some embodiments of the present invention, the relevant information includes any one or more of the following: interface definition information, function description information.

[0121] Among them, interface definition information can be information about the specific definition and specifications of the interface; it can include the name of the interface, parameter list (including the name, type and meaning of each parameter), return value type, exception handling, etc.; interface definition information is the basis for understanding and using the interface, and it provides detailed information on how the interface is called and what information needs to be passed.

[0122] Functional description information can be information that describes and explains the functions provided by the interface; it can include the role of the interface, the operations it performs, possible side effects, usage scenarios, and relationships with other interfaces or systems; functional description information helps developers understand the purpose and use of the interface, and how to use it correctly in applications.

[0123] In an embodiment of the present invention, a universal SDK is obtained during the process of embedded software development; wherein the universal SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces; the current platform SDK is obtained, and a binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface, thereby setting a universal SDK between the application layer code and the platform SDK, and the application layer code can call the underlying interface in the platform SDK through the virtual interface in the universal SDK, and the application layer code does not need to pay attention to the platform SDK, and then when the hardware platform or SDK is replaced, it is only necessary to update the binding relationship without large-scale modification of the application layer code, thereby avoiding dependence on the SDK of a specific chip manufacturer and improving development efficiency and quality.

[0124] The following combination Figure 2 The present invention is further described:

[0125] Step 201, demand analysis.

[0126] Based on the development needs of developers, determine the functions that the device needs to implement, such as WiFi networking, Bluetooth pairing, etc.

[0127] Step 202: Demand decomposition and functional module design.

[0128] According to the needs, the implementation steps of the function are decomposed. For example, the implementation of the WiFi networking function can include initializing the Wi-Fi module, connecting to the Wi-Fi network, disconnecting the Wi-Fi connection, obtaining the current Wi-Fi connection status, etc.

[0129] Create one or more function modules in the general SDK according to the type of function.

[0130] Step 203: module interface definition.

[0131] For the functional module corresponding to each function, one or more virtual interfaces are set, and the tasks that need to be completed by the virtual interface are defined.

[0132] Step 204: software framework design.

[0133] After completing the creation of all functional modules and the definition of virtual interfaces, the specific implementation is bound to the virtual interface through function pointers or configuration files, so that the overall framework can adapt to different chips and form a complete framework.

[0134] Step 205: Manufacturer API adaptation.

[0135] The configured universal SDK is sent to the chip manufacturer, who can determine the required underlying interface (API) based on the interface definition information and function description information defined in the universal SDK, and encapsulate the underlying interface (API) into the virtual interface of the corresponding functional module.

[0136] Step 206: Function implementation and testing.

[0137] The application layer calls the virtual interfaces in each functional module and performs functional testing through the underlying interfaces encapsulated in the virtual interfaces.

[0138] Reference Figure 3 , shows a flowchart of another method for developing embedded software provided by some embodiments of the present invention, which may specifically include the following steps:

[0139] Step 301, in the process of embedded software development, obtain a general SDK; wherein the general SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces.

[0140] Among them, SDK (Software Development Kit) refers to a set of programming codes and tools that allow software developers to create applications for specific software packages, applications, hardware platforms or operating systems; a general SDK can be an SDK designed to provide general support for the development of a variety of embedded systems, which can be pre-designed according to the actual needs of developers.

[0141] In actual applications, a general SDK can be set between the application layer code and the platform SDK. In the process of embedded software development, a pre-created general SDK can be obtained.

[0142] In some embodiments of the present invention, before obtaining the universal SDK, the method further includes: creating one or more functional modules in the preset universal SDK; and setting one or more virtual interfaces for each functional module.

[0143] When developers design a general SDK, they can divide the multiple functions that need to be implemented into multiple functional modules, each of which focuses on implementing specific functions or providing specific services. For example, one functional module can be responsible for network communication, and another functional module can be responsible for data collection and processing.

[0144] One or more virtual interfaces are provided for each functional module, which may mean that one or more virtual interfaces are defined for each functional module to interact with the outside or other modules.

[0145] For example, in the pre-built universal SDK, it can be divided into the following functional modules according to its functions. Each functional module can be developed, debugged and reused separately:

[0146] 1. WiFi_Module (responsible for Wi-Fi initialization, connection and disconnection)

[0147] 2. BLE_Module (responsible for Bluetooth pairing and data transmission)

[0148] 3. MQTT_Module (responsible for initialization, subscription, and publishing of MQTT protocol)

[0149] 4. Data_Processing (data collection and processing)

[0150] 5. Device_Status (monitor device status (such as power, temperature, etc.) and report)

[0151] After dividing multiple functional modules, one or more virtual interfaces (universal APIs) can be set for each module. These interfaces do not depend on specific SDKs, but only define the tasks that the modules need to complete. The specific implementation of the interfaces is filled in by different chip manufacturers according to the SDK. For example, the following is an example of virtual interface definition:

[0152] 1. WiFi_Module:

[0153] int WiFi_Init(void) (Initialize Wi-Fi module)

[0154] int WiFi_Connect(const char* ssid, const char* password) (Connect to Wi-Fi network)

[0155] int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0156] int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0157] 2.BLE_Module:

[0158] int BLE_Init(void) (initialize Bluetooth module)

[0159] int BLE_Pair(const char*device_name) (pair with Bluetooth device)

[0160] int BLE_SendData(const uint8_t*data,size_t length)(send data)

[0161] int BLE_ReceiveData(uint8_t*buffer,size_t length)(receive data)

[0162] 3.MQTT_Module:

[0163] int MQTT_Init(const char*server,int port) (Initialize MQTT connection)

[0164] int MQTT_Connect(void) (Connect to MQTT server)

[0165] int MQTT_Subscribe(const char*topic)(Subscribe to topic)

[0166] int MQTT_Publish(const char*topic,const uint8_t*payload,size_tlength)(Publish message)

[0167] int MQTT_Disconnect(void) (disconnect MQTT connection)

[0168] 4.Data_Processing:

[0169] int Data_Init(void) (initialize data processing module)

[0170] int Data_Acquire(void*data_buffer) (get sensor data)

[0171] int Data_Process(const void*raw_data,void*processed_data)(process the data)

[0172] 5.Device_Status:

[0173] int Status_Init(void) (Initialize status monitoring module)

[0174] int Status_GetBatteryLevel(void) (Get battery level)

[0175] int Status_GetTemperature(void) (Get device temperature)

[0176] int Status_Report(void) (Report device status)

[0177] As some examples, one or more functional modules are created in a preset universal SDK. After one or more virtual interfaces are set for each functional module, the configured universal SDK can be sent to chip manufacturers. The chip manufacturers can determine the required underlying interfaces based on the interface definition information and function description information defined in the universal SDK, and encapsulate the underlying interfaces into the virtual interfaces of the corresponding functional modules.

[0178] In some embodiments of the present invention, the functional modules include any one or more of the following: wireless network initialization and connection module, Bluetooth pairing and data transmission module, data acquisition and processing module, communication processing module, device status monitoring module, monitoring and reporting module.

[0179] Among them, the wireless network initialization and connection module can be responsible for the initialization of the wireless network function of the device, including scanning available wireless networks, selecting and connecting to a specific wireless network; it can also include functions such as managing network connections, such as disconnecting, reconnecting, switching networks, etc.

[0180] The Bluetooth pairing and data transmission module can handle the pairing process of the device with other Bluetooth devices, as well as data transmission via Bluetooth; it can also include functions such as discovering nearby Bluetooth devices, requesting and accepting pairing requests, establishing Bluetooth connections, sending and receiving data, etc.

[0181] The data collection and processing module can be responsible for collecting data from the device's sensors or other data sources and processing the data; it can also perform operations such as data cleaning, format conversion, aggregation, and analysis.

[0182] The communication processing module can be responsible for the communication between the device and other devices or systems; it can also include functions such as processing network communication protocols, managing communication sessions, sending and receiving data, etc. The communication processing module can support multiple communication methods, such as TCP / IP, HTTP, MQTT, etc., to adapt to different application scenarios and needs.

[0183] The device status monitoring module can be responsible for monitoring the status of the device, including hardware status (such as power supply, temperature, memory usage) and software status (such as running applications, process status), etc. It can also include alarm and logging functions to promptly notify administrators or users when the device status is abnormal.

[0184] The monitoring and reporting module can be responsible for monitoring specific parameters or conditions of the device and reporting information to the administrator or system when certain conditions are met; it can also include monitoring device performance, error logs, abnormal events, etc., and reporting to the remote server or management system.

[0185] Step 302: Obtain the current platform SDK and determine the underlying interface that matches each virtual interface in the current platform SDK.

[0186] In some embodiments of the present invention, the current platform SDK is an SDK provided by a chip manufacturer.

[0187] As some examples, the specific implementation of each module can depend on the SDK of a specific platform; for example, after obtaining the general SDK, you can obtain the current platform SDK, find the underlying interface in the current platform SDK that can implement the corresponding functions of the target functional module, and encapsulate it into the virtual interface of the target functional module of the general SDK, so that the virtual interface in the general SDK is associated with the specific implementation interface in the current platform SDK, and use it as a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK; when the application layer code calls the virtual interface in the general SDK, it actually calls the corresponding underlying interface in the current platform SDK encapsulated in the virtual interface, thereby executing the corresponding function.

[0188] Step 303, establishing a binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0189] In some examples, by defining standardized interfaces, the specific implementation of each module can depend on the SDK of a specific platform, but the interface format and calling method remain consistent; this means that application layer code (such as the main control logic) can directly call these interfaces without having to consider the differences between different platform SDKs. For example, the general design idea of ​​WiFi_Module can be as follows:

[0190] Abstract virtual interface (VAPI): define common interfaces such as WiFi_Init (initialize Wi-Fi module) and WiFi_Connect (connect to Wi-Fi network).

[0191] Specific implementation (completed by chip manufacturers): On each platform, the underlying SDK interface provided by chip manufacturers may be different. For example, there may be esp_wifi_init on ESP32, and HAL_WIFI_Init on STM32, but the manufacturer will call the corresponding underlying API in the WiFi_Init general interface to complete the initialization.

[0192] For example, when an IoT device wants to connect to a router WiFi after it is started, it must first initialize its own network card and configure various functional parameters required for network configuration, such as its own network card MAC address, IP address, IP protocol (IPv4 or IPv6), etc.

[0193] These can be achieved in the upper application layer by calling a wifi_init VAPI (i.e. virtual interface). This virtual interface is already encapsulated. It is achieved by finding an API (i.e. underlying interface) that can initialize the network card and configure network configuration parameters in the SDK provided by the chip manufacturer. For example, the SDK provided by ESP32 can implement the above functions through esp_wifi_init and esp_ethernet_init or similar APIs. This underlying API (underlying interface) is encapsulated into the virtual interface wifi_init VAPI of the wireless network initialization and connection module of the general SDK:

[0194] int WiFi_Init(void)

[0195] {

[0196] Int ret = 0;

[0197] ret = esp_wifi_init();

[0198] ret = esp_ethernet_init();

[0199] return ret;

[0200] }

[0201] In some embodiments of the present invention, before establishing the binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, the process further includes: determining the underlying interface that matches each virtual interface in the current platform SDK.

[0202] In some embodiments of the present invention, determining the underlying interface that each virtual interface matches in the current platform SDK includes: obtaining relevant information of each virtual interface, and determining the underlying interface that each virtual interface matches in the current platform SDK based on the relevant information.

[0203] For example, the wireless network initialization and connection module (WiFi_Module) defines multiple virtual interfaces:

[0204] 1. int WiFi_Init(void) (initialize Wi-Fi module)

[0205] 2. int WiFi_Connect(const char*ssid, const char*password) (Connect to Wi-Fi network)

[0206] 3. int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0207] 4. int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0208] Among them, the relevant information of the virtual interface (1) is "initialize the Wi-Fi module". After determining the relevant information of the virtual interface, the underlying interface that can perform this function can be found from the current platform SDK, such as esp_wifi_init, and then the esp_ethernet_init is encapsulated into the virtual interface (1) to obtain:

[0209] int WiFi_Init(void)

[0210] {

[0211] Int ret = 0;

[0212] ret = esp_wifi_init();

[0213] return ret;

[0214] }

[0215] By determining the relevant information corresponding to each virtual interface, the underlying interface that matches the relevant information of each virtual interface is determined from the current platform SDK, and encapsulated in the corresponding virtual interface, so that when the application layer code subsequently calls the virtual interface in the general SDK, the underlying interface encapsulated in the virtual interface can be used to execute the corresponding function.

[0216] For example, when the application layer calls the virtual interface WiFi_Init (initializes the Wi-Fi module) in the wireless network initialization and connection module (WiFi_Module), the specific implementation inside WiFi_Module is to call the underlying interface wifi_init_config of the current platform SDK for configuration;

[0217] The application layer calls the virtual interface WiFi_Connect (connect to Wi-Fi network) in the wireless network initialization and connection module (WiFi_Module) and specifies the SSID and password of the network; the specific implementation of the virtual interface WiFi_Connect of WiFi_Module is to call the corresponding method in the current platform SDK, such as esp_wifi_connect of ESP32 or HAL_WIFI_Connect of STM32, to complete the connection.

[0218] The application layer continues to call other modules, such as MQTT_Connect, BLE_Pair, etc., to realize the complete functions of the device.

[0219] In some embodiments of the present invention, the relevant information includes any one or more of the following: interface definition information, function description information.

[0220] Among them, interface definition information can be information about the specific definition and specifications of the interface; it can include the name of the interface, parameter list (including the name, type and meaning of each parameter), return value type, exception handling, etc.; interface definition information is the basis for understanding and using the interface, and it provides detailed information on how the interface is called and what information needs to be passed.

[0221] Functional description information can be information that describes and explains the functions provided by the interface; it can include the role of the interface, the operations it performs, possible side effects, usage scenarios, and relationships with other interfaces or systems; functional description information helps developers understand the purpose and use of the interface, and how to use it correctly in applications.

[0222] In an embodiment of the present invention, a universal SDK is obtained during the process of embedded software development; wherein the universal SDK includes one or more functional modules, each functional module is provided with one or more virtual interfaces; the current platform SDK is obtained, and the underlying interface that each virtual interface matches in the current platform SDK is determined; a binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface, thereby setting a universal SDK between the application layer code and the platform SDK, and the application layer code can call the underlying interface in the platform SDK through the virtual interface in the universal SDK, and the application layer code does not need to pay attention to the platform SDK, and then when the hardware platform or SDK is replaced, it is only necessary to update the binding relationship without large-scale modification of the application layer code, thereby avoiding dependence on the SDK of a specific chip manufacturer and improving development efficiency and quality.

[0223] Reference Figure 4, shows a flowchart of the steps of another method for developing embedded software provided by some embodiments of the present invention, which may specifically include the following steps:

[0224] Step 401: Create one or more functional modules in a preset universal SDK.

[0225] When developers design a general SDK, they can divide the multiple functions that need to be implemented into multiple functional modules, each module focusing on implementing a specific function or providing a specific service. For example, one functional module can be responsible for network communication, and another functional module can be responsible for data collection and processing.

[0226] Step 402: Set one or more virtual interfaces for each functional module.

[0227] One or more virtual interfaces are provided for each functional module, which may mean that one or more virtual interfaces are defined for each functional module to interact with the outside or other modules.

[0228] For example, in the pre-built universal SDK, it can be divided into the following functional modules according to its functions. Each functional module can be developed, debugged and reused separately:

[0229] 1. WiFi_Module (responsible for Wi-Fi initialization, connection and disconnection)

[0230] 2. BLE_Module (responsible for Bluetooth pairing and data transmission)

[0231] 3. MQTT_Module (responsible for initialization, subscription, and publishing of MQTT protocol)

[0232] 4. Data_Processing (data collection and processing)

[0233] 5. Device_Status (monitor device status (such as power, temperature, etc.) and report)

[0234] After dividing multiple functional modules, one or more virtual interfaces (universal APIs) can be set for each module. These interfaces do not depend on specific SDKs, but only define the tasks that the modules need to complete. The specific implementation of the interfaces is filled in by different chip manufacturers according to the SDK. For example, the following is an example of virtual interface definition:

[0235] 1. WiFi_Module:

[0236] int WiFi_Init(void) (Initialize Wi-Fi module)

[0237] int WiFi_Connect(const char* ssid, const char* password) (Connect to Wi-Fi network)

[0238] int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0239] int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0240] 2.BLE_Module:

[0241] int BLE_Init(void) (initialize Bluetooth module)

[0242] int BLE_Pair(const char*device_name) (pair with Bluetooth device)

[0243] int BLE_SendData(const uint8_t*data,size_t length)(send data)

[0244] int BLE_ReceiveData(uint8_t*buffer,size_t length)(receive data)

[0245] 3.MQTT_Module:

[0246] int MQTT_Init(const char*server,int port) (Initialize MQTT connection)

[0247] int MQTT_Connect(void) (Connect to MQTT server)

[0248] int MQTT_Subscribe(const char*topic)(Subscribe to topic)

[0249] int MQTT_Publish(const char*topic,const uint8_t*payload,size_tlength)(Publish message)

[0250] int MQTT_Disconnect(void) (disconnect MQTT connection)

[0251] 4.Data_Processing:

[0252] int Data_Init(void) (initialize data processing module)

[0253] int Data_Acquire(void*data_buffer) (get sensor data)

[0254] int Data_Process(const void*raw_data,void*processed_data)(process the data)

[0255] 5.Device_Status:

[0256] int Status_Init(void) (Initialize status monitoring module)

[0257] int Status_GetBatteryLevel(void) (Get battery level)

[0258] int Status_GetTemperature(void) (Get device temperature)

[0259] int Status_Report(void) (Report device status)

[0260] As some examples, one or more functional modules are created in a preset universal SDK. After one or more virtual interfaces are set for each functional module, the configured universal SDK can be sent to chip manufacturers. The chip manufacturers can determine the required underlying interfaces based on the interface definition information and function description information defined in the universal SDK, and encapsulate the underlying interfaces into the virtual interfaces of the corresponding functional modules.

[0261] In some embodiments of the present invention, the functional modules include any one or more of the following: wireless network initialization and connection module, Bluetooth pairing and data transmission module, data acquisition and processing module, communication processing module, device status monitoring module, monitoring and reporting module.

[0262] Among them, the wireless network initialization and connection module can be responsible for the initialization of the wireless network function of the device, including scanning available wireless networks, selecting and connecting to a specific wireless network; it can also include functions such as managing network connections, such as disconnecting, reconnecting, switching networks, etc.

[0263] The Bluetooth pairing and data transmission module can handle the pairing process of the device with other Bluetooth devices, as well as data transmission via Bluetooth; it can also include functions such as discovering nearby Bluetooth devices, requesting and accepting pairing requests, establishing Bluetooth connections, sending and receiving data, etc.

[0264] The data collection and processing module can be responsible for collecting data from the device's sensors or other data sources and processing the data; it can also perform operations such as data cleaning, format conversion, aggregation, and analysis.

[0265] The communication processing module can be responsible for the communication between the device and other devices or systems; it can also include functions such as processing network communication protocols, managing communication sessions, sending and receiving data, etc. The communication processing module can support multiple communication methods, such as TCP / IP, HTTP, MQTT, etc., to adapt to different application scenarios and needs.

[0266] The device status monitoring module can be responsible for monitoring the status of the device, including hardware status (such as power supply, temperature, memory usage) and software status (such as running applications, process status), etc. It can also include alarm and logging functions to promptly notify administrators or users when the device status is abnormal.

[0267] The monitoring and reporting module can be responsible for monitoring specific parameters or conditions of the device and reporting information to the administrator or system when certain conditions are met; it can also include monitoring device performance, error logs, abnormal events, etc., and reporting to the remote server or management system.

[0268] Step 403, in the process of embedded software development, obtain a general SDK; wherein the general SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces.

[0269] Among them, SDK (Software Development Kit) refers to a set of programming codes and tools that allow software developers to create applications for specific software packages, applications, hardware platforms or operating systems; a general SDK can be an SDK designed to provide general support for the development of a variety of embedded systems, which can be pre-designed according to the actual needs of developers.

[0270] In actual applications, a general SDK can be set between the application layer code and the platform SDK. In the process of embedded software development, a pre-created general SDK can be obtained.

[0271] Step 404, obtain the current platform SDK, and establish a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0272] In some embodiments of the present invention, the current platform SDK is an SDK provided by a chip manufacturer.

[0273] In some embodiments of the present invention, the establishing of the binding relationship between the virtual interface and the underlying interface includes: encapsulating the underlying interface in the virtual interface.

[0274] As some examples, the specific implementation of each module can depend on the SDK of a specific platform; for example, after obtaining the general SDK, you can obtain the current platform SDK, find the underlying interface in the current platform SDK that can implement the corresponding functions of the target functional module, and encapsulate it into the virtual interface of the target functional module of the general SDK, so that the virtual interface in the general SDK is associated with the specific implementation interface in the current platform SDK, and use it as a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK; when the application layer code calls the virtual interface in the general SDK, it actually calls the corresponding underlying interface in the current platform SDK encapsulated in the virtual interface, thereby executing the corresponding function.

[0275] In some examples, by defining standardized interfaces, the specific implementation of each module can depend on the SDK of a specific platform, but the interface format and calling method remain consistent; this means that application layer code (such as the main control logic) can directly call these interfaces without having to consider the differences between different platform SDKs. For example, the general design idea of ​​WiFi_Module can be as follows:

[0276] Abstract virtual interface (VAPI): define common interfaces such as WiFi_Init (initialize Wi-Fi module) and WiFi_Connect (connect to Wi-Fi network).

[0277] Specific implementation (completed by chip manufacturers): On each platform, the underlying SDK interface provided by chip manufacturers may be different. For example, there may be esp_wifi_init on ESP32, and HAL_WIFI_Init on STM32, but the manufacturer will call the corresponding underlying API in the WiFi_Init general interface to complete the initialization.

[0278] For example, when an IoT device wants to connect to a router WiFi after it is started, it must first initialize its own network card and configure various functional parameters required for network configuration, such as its own network card MAC address, IP address, IP protocol (IPv4 or IPv6), etc.

[0279] These can be achieved in the upper application layer by calling a wifi_init VAPI (i.e. virtual interface). This virtual interface is already encapsulated. It is achieved by finding an API (i.e. underlying interface) that can initialize the network card and configure network configuration parameters in the SDK provided by the chip manufacturer. For example, the SDK provided by ESP32 can implement the above functions through esp_wifi_init and esp_ethernet_init or similar APIs. This underlying API (underlying interface) is encapsulated into the virtual interface wifi_init VAPI of the wireless network initialization and connection module of the general SDK:

[0280] int WiFi_Init(void)

[0281] {

[0282] Int ret = 0;

[0283] ret = esp_wifi_init();

[0284] ret = esp_ethernet_init();

[0285] return ret;

[0286] }

[0287] In some embodiments of the present invention, before establishing the binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, the process further includes: determining the underlying interface that matches each virtual interface in the current platform SDK.

[0288] In some embodiments of the present invention, determining the underlying interface that each virtual interface matches in the current platform SDK includes: obtaining relevant information of each virtual interface, and determining the underlying interface that each virtual interface matches in the current platform SDK based on the relevant information.

[0289] For example, the wireless network initialization and connection module (WiFi_Module) defines multiple virtual interfaces:

[0290] 1. int WiFi_Init(void) (initialize Wi-Fi module)

[0291] 2. int WiFi_Connect(const char*ssid, const char*password) (Connect to Wi-Fi network)

[0292] 3. int WiFi_Disconnect(void) (disconnect Wi-Fi connection)

[0293] 4. int WiFi_GetStatus(void) (Get the current Wi-Fi connection status)

[0294] Among them, the relevant information of the virtual interface (1) is "initialize the Wi-Fi module". After determining the relevant information of the virtual interface, the underlying interface that can perform this function can be found from the current platform SDK, such as esp_wifi_init, and then the esp_ethernet_init is encapsulated into the virtual interface (1) to obtain:

[0295] int WiFi_Init(void)

[0296] {

[0297] Int ret = 0;

[0298] ret = esp_wifi_init();

[0299] return ret;

[0300] }

[0301] By determining the relevant information corresponding to each virtual interface, the underlying interface that matches the relevant information of each virtual interface is determined from the current platform SDK, and encapsulated in the corresponding virtual interface, so that when the application layer code subsequently calls the virtual interface in the general SDK, the underlying interface encapsulated in the virtual interface can be used to execute the corresponding function.

[0302] For example, when the application layer calls the virtual interface WiFi_Init (initializes the Wi-Fi module) in the wireless network initialization and connection module (WiFi_Module), the specific implementation inside WiFi_Module is to call the underlying interface wifi_init_config of the current platform SDK for configuration;

[0303] The application layer calls the virtual interface WiFi_Connect (connect to Wi-Fi network) in the wireless network initialization and connection module (WiFi_Module) and specifies the SSID and password of the network; the specific implementation of the virtual interface WiFi_Connect of WiFi_Module is to call the corresponding method in the current platform SDK, such as esp_wifi_connect of ESP32 or HAL_WIFI_Connect of STM32, to complete the connection.

[0304] The application layer continues to call other modules, such as MQTT_Connect, BLE_Pair, etc., to realize the complete functions of the device.

[0305] In some embodiments of the present invention, the relevant information includes any one or more of the following: interface definition information, function description information.

[0306] Among them, interface definition information can be information about the specific definition and specifications of the interface; it can include the name of the interface, parameter list (including the name, type and meaning of each parameter), return value type, exception handling, etc.; interface definition information is the basis for understanding and using the interface, and it provides detailed information on how the interface is called and what information needs to be passed.

[0307] Functional description information can be information that describes and explains the functions provided by the interface; it can include the role of the interface, the operations it performs, possible side effects, usage scenarios, and relationships with other interfaces or systems; functional description information helps developers understand the purpose and use of the interface, and how to use it correctly in applications.

[0308] In an embodiment of the present invention, one or more functional modules are created in a preset universal SDK; one or more virtual interfaces are set for each functional module; in the process of embedded software development, a universal SDK is obtained; wherein the universal SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces; the current platform SDK is obtained, and a binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface, thereby setting a universal SDK between the application layer code and the platform SDK, and the application layer code can call the underlying interface in the platform SDK through the virtual interface in the universal SDK, and the application layer code does not need to pay attention to the platform SDK, and then when the hardware platform or SDK is replaced, it is only necessary to update the binding relationship without large-scale modification of the application layer code, thereby avoiding dependence on the SDK of a specific chip manufacturer and improving development efficiency and quality.

[0309] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0310] Reference Figure 5 , shows a schematic diagram of the structure of an embedded software development device provided by some embodiments of the present invention, which may specifically include the following modules:

[0311] The general SDK acquisition module 501 is used to acquire the general SDK during the embedded software development process; wherein the general SDK includes one or more functional modules, each functional module is provided with one or more virtual interfaces;

[0312] The binding relationship establishment module 502 is used to obtain the current platform SDK and establish a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

[0313] In some embodiments of the present invention, the device further comprises:

[0314] The bottom layer interface determination module is used to determine the bottom layer interface that each virtual interface matches in the current platform SDK.

[0315] In some embodiments of the present invention, the bottom layer interface determination module is used to:

[0316] Relevant information of each virtual interface is obtained, and based on the relevant information, an underlying interface that matches each virtual interface in the current platform SDK is determined.

[0317] In some embodiments of the present invention, the relevant information includes any one or more of the following: interface definition information, function description information.

[0318] In some embodiments of the present invention, the binding relationship establishing module 502 includes:

[0319] The encapsulation submodule is used to encapsulate the underlying interface in the virtual interface.

[0320] In some embodiments of the present invention, the device further comprises:

[0321] A function module creation module is used to create one or more function modules in a preset general SDK;

[0322] The virtual interface setting module is used to set one or more virtual interfaces for each functional module.

[0323] In some embodiments of the present invention, the current platform SDK is an SDK provided by a chip manufacturer.

[0324] In some embodiments of the present invention, the functional modules include any one or more of the following: wireless network initialization and connection module, Bluetooth pairing and data transmission module, data acquisition and processing module, communication processing module, device status monitoring module, monitoring and reporting module.

[0325] Some embodiments of the present invention further provide an electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the above method is implemented when the computer program is executed by the processor.

[0326] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, and the computer program implements the above method when executed by a processor.

[0327] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above method when executed by a processor.

[0328] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0329] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0330] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0331] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0332] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0333] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0334] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0335] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0336] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.

[0337] The above is a detailed introduction to the provided method, device, equipment, medium and product for embedded software development. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for developing embedded software, characterized in that: The method comprises: In the process of embedded software development, a general SDK is obtained; wherein the general SDK includes one or more functional modules, and each functional module is provided with one or more virtual interfaces; The current platform SDK is obtained, and a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK is established, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

2. The method according to claim 1, characterized in that: Before establishing the binding relationship between the virtual interface in the universal SDK and the underlying interface in the current platform SDK, the method further includes: Determine the underlying interface that each virtual interface matches in the current platform SDK.

3. The method according to claim 2, characterized in that The determining of the underlying interface that each virtual interface matches in the current platform SDK includes: Relevant information of each virtual interface is obtained, and based on the relevant information, an underlying interface that matches each virtual interface in the current platform SDK is determined.

4. The method according to claim 3, characterized in that The relevant information includes any one or more of the following: interface definition information and function description information.

5. The method according to claim 1, characterized in that The establishing of the binding relationship between the virtual interface and the underlying interface includes: encapsulating the underlying interface in the virtual interface.

6. The method according to any one of claims 1 to 5, characterized in that: Before obtaining the universal SDK, the following steps are also included: In the preset universal SDK, create one or more functional modules; For each functional module, one or more virtual interfaces are set.

7. The method according to claim 1, characterized in that The current platform SDK is the SDK provided by the chip manufacturer.

8. The method according to claim 1, characterized in that The functional modules include any one or more of the following: a wireless network initialization and connection module, a Bluetooth pairing and data transmission module, a data acquisition and processing module, a communication processing module, a device status monitoring module, and a monitoring and reporting module.

9. A device for developing embedded software, characterized in that: The device comprises: A general SDK acquisition module, used to acquire a general SDK during the embedded software development process; wherein the general SDK includes one or more functional modules, each functional module is provided with one or more virtual interfaces; The binding relationship establishment module is used to obtain the current platform SDK and establish a binding relationship between the virtual interface in the general SDK and the underlying interface in the current platform SDK, so that when the application layer code calls the virtual interface, the corresponding function is implemented through the underlying interface bound to the virtual interface.

10. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 8 when executed by the processor.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.