Software configuration method and related equipment
By building and packaging SDK, the problem of reducing internal communication protocol security of terminal device manufacturers caused by open source code of IoT device manufacturers is solved, and higher data security and SDK adaptability are achieved.
Patent Information
- Application Number
- CN202410118875.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-01-26
AI Technical Summary
IoT device manufacturers open the SDK source code of terminal device manufacturers, resulting in the reduction of the security of internal communication protocols of terminal device manufacturers and threatening private data.
By obtaining the device form, feature collection and chip platform information of IoT devices, building an SDK and packaging it in the form of a configurable static library, it is only open to IoT device manufacturers for configuration and firmware integration, avoiding open source and ensuring terminal The internal communication protocol of the equipment manufacturer is secure.
It improves the security of private data of terminal equipment manufacturers, enhances the adaptability and integration efficiency of SDK, and avoids the security risks of internal communication protocols.
Smart Images

Figure CN119271256A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent terminals, and in particular to a software configuration method and related equipment. Background Art
[0002] With the development of Internet of Things (IoT) technology, the application of IoT devices such as audio devices and wearable devices is becoming more and more widespread. IoT devices usually need to interact with applications of other terminal devices such as smartphones to realize corresponding functions. However, IoT devices and other terminal devices may come from different manufacturers. IoT devices are configured with the corresponding software development kit (SDK) of the terminal device, and feature modules are configured in the SDK to interact with the terminal device application.
[0003] In related technologies, terminal equipment manufacturers usually open source code to IoT equipment manufacturers, so that IoT equipment manufacturers can customize feature modules and SDKs to adapt SDKs to the firmware and features of IoT devices. However, the source code contains the internal communication protocol of the terminal equipment manufacturer. If the source code is opened to IoT equipment manufacturers, the security of the internal communication protocol of the terminal equipment manufacturer cannot be guaranteed, resulting in reduced security of the private data of the terminal equipment manufacturer. Summary of the invention
[0004] In view of the above, it is necessary to provide a software configuration method and related equipment to solve the above-mentioned problem of opening the SDK source code to IoT device manufacturers so that IoT device manufacturers can customize the SDK and reduce the security of private data of terminal device manufacturers.
[0005] In a first aspect, the present application provides a software configuration method, which is applied to a first electronic device, and the method includes: obtaining the device form, feature set and chip platform information of an Internet of Things device; executing an SDK general build script on a build file according to the device form, feature set and chip platform information of the Internet of Things device to obtain the SDK of the Internet of Things device; sending the SDK to a second electronic device, which integrates the SDK into the firmware of the Internet of Things device through a firmware integration link, and runs the SDK in the Internet of Things device.
[0006] Through the above technical solution, the peer device manufacturer of the IoT device packages the feature set of the IoT device into an SDK in the form of a configurable static library through the first electronic device, and then opens the SDK to the IoT device manufacturer for further configuration and firmware integration. There is no need to open the source code of the feature module to the IoT device manufacturer, which ensures the security of the internal communication protocol of the terminal device manufacturer and improves the security of the private data of the terminal device manufacturer.
[0007] In a possible implementation, the method also includes: determining whether the chip platform of the Internet of Things device is a newly added chip platform based on the chip platform information; if the chip platform of the Internet of Things device is a newly added chip platform, adding a cross-compilation chain of the chip platform; adding the compilation options of the chip platform to the build file of the SDK; adding the configuration information of the chip platform; establishing an association between the cross-compilation chain of the chip platform and the build file, and establishing an association between the chip platform and the device form.
[0008] Through the above technical solution, the information of the newly added chip platform can be added to the first electronic device, so that the constructed SDK can adapt to different chip platforms, thereby enhancing the adaptability of the SDK.
[0009] In one possible implementation, the method also includes: determining whether it is necessary to update the characteristic configuration of the device form; if it is necessary to update the characteristic configuration of the device form, responding to an update request for the characteristic configuration of the device form, running a configuration tool, configuring and applying the characteristics of the device form; and updating the characteristic configuration file of the device form.
[0010] Through the above technical solution, the feature set corresponding to the device form can be updated, thereby enhancing the scalability of the static feature library in the SDK.
[0011] In a possible implementation, the method also includes: determining whether a feature customization request sent by the second electronic device is received; if the feature customization request sent by the second electronic device is received, responding to the feature customization request sent by the second electronic device, running a configuration tool, importing a feature requirement list of the Internet of Things device, and configuring the feature combination required by the Internet of Things device; modifying the feature switch and the static parameter configuration of the feature according to the requirements of the Internet of Things device; and generating a feature configuration file corresponding to the Internet of Things device connected according to the modified feature switch and the static parameter configuration of the feature.
[0012] Through the above technical solution, the manufacturer of the peer device of the IoT device can perform customized configuration of the characteristics, without the need for the IoT device manufacturer to perform customized configuration of the characteristics, which can improve the efficiency of SDK integration in the IoT device.
[0013] In a second aspect, an embodiment of the present application provides a software configuration method, which is applied to a second electronic device, and the method includes: obtaining an SDK constructed by a first electronic device, and integrating the SDK into the firmware of an Internet of Things device through a firmware integration link; running the SDK and initializing the SDK; and applying the SDK to perform business processing.
[0014] Through the above technical solution, IoT device manufacturers can obtain pre-built SDKs and further configure and integrate the SDK with firmware. In this way, the peer device manufacturers of IoT devices do not need to open the source code of feature modules to IoT device manufacturers, which ensures the security of the internal communication protocols of terminal device manufacturers and improves the security of private data of terminal device manufacturers. IoT device manufacturers can also enhance the adaptability of SDK to IoT devices by configuring and integrating the SDK with firmware.
[0015] In a possible implementation, the SDK is integrated into the firmware of the IoT device through a firmware integration link, including: running a configuration tool, loading the SDK, and configuring the feature combination required by the IoT device through the configuration tool; generating a configuration file according to the feature combination required by the IoT device; adding the SDK to the firmware of the IoT device according to the configuration file; modifying the link script in the IoT device; adapting the feature interface of the SDK; compiling and linking the firmware of the IoT device to generate an executable file; and running and debugging the executable file.
[0016] Through the above technical solution, IoT device manufacturers can integrate the SDK into the firmware of IoT devices through firmware integration, so that the SDK is compatible with the IoT devices and the operating efficiency of the SDK is improved.
[0017] In a possible implementation, modifying the link script in the IoT device includes: obtaining an automatic modification script in the SDK, configuring chip platform parameter information and an SDK identifier insertion position of the IoT device in the automatic modification script; importing an original link script of the chip platform in the automatic modification script; running the automatic modification script, inserting the SDK identifier into the original link script according to the SDK identifier insertion position through the automatic modification script, to obtain a modified link script; and applying the modified link script.
[0018] Through the above technical solution, the SDK identifier is inserted into the original link script of the IoT device using the automatic modification script provided by the SDK, so that the self-registration mechanism of the configurable module in the SDK can be realized, thereby improving the initialization efficiency of the configurable module during the SDK operation.
[0019] In a possible implementation, modifying the link script in the IoT device includes: modifying an original link script of the chip platform; and inserting an SDK identifier into the original link script according to an insertion position of the SDK identifier.
[0020] Through the above technical solution, IoT device manufacturers can modify the platform's link script by themselves and insert identifiers in the link script according to SDK requirements.
[0021] In a possible implementation, the method further includes: declaring an initialization method of each configurable module of the SDK to a corresponding segment of a symbolic identifier customized by the SDK, and generating an initialization method table according to an initialization priority.
[0022] Through the above technical solution, self-registration of configurable modules can be achieved. The initialization method does not need to be explicitly called. It only needs to be declared in a predetermined way at the initialization method definition, and the initialization method will be executed during the SDK operation.
[0023] In a possible implementation, the initializing the SDK includes: creating an object of each configurable module of the SDK, creating a service of each configurable module, and adding a message processing method of each configurable module to a message processing mapping table.
[0024] Through the above technical solution, each configurable module is initialized, which can effectively ensure the normal operation of the SDK.
[0025] In a possible implementation, adding the message processing method of each configurable module to the message processing mapping table includes: setting the ID and message processing method of each protocol instruction in the configurable module; converting the ID of each protocol instruction into an index value; and adding the message processing method of each protocol instruction to the message processing mapping table.
[0026] Through the above technical solution, the message processing method of the configurable module is added to the message processing mapping table in combination with the hash algorithm, which can improve the traversal efficiency of the message processing method during the message processing process, thereby improving the message processing efficiency.
[0027] In a possible implementation, adding the message processing method of each configurable module to the message processing mapping table includes: setting the ID and message processing method of each protocol instruction in the configurable module; using the ID of each protocol instruction as an index value; and adding the message processing methods of all protocol instructions in the configurable module as a whole to the message processing mapping table.
[0028] Through the above technical solution, the message processing methods of all protocol instructions in the configurable module can be added as a whole to the message processing mapping table, thereby improving the registration efficiency of the message processing methods.
[0029] In a possible implementation manner, the initializing the SDK includes: decoupling multiple configurable modules in the SDK through a registration public service mechanism or a weak mechanism.
[0030] Through the above technical solution, multiple configurable modules in the SDK are decoupled, which can enhance the maintainability and scalability of the SDK.
[0031] In one possible implementation, the application of the SDK to perform business processing includes: creating a processing thread of the SDK through firmware, and sending a business processing request to the SDK; the SDK schedules the processing thread to traverse the message processing method of the message corresponding to the business processing request in the message processing mapping table, and calls the traversed message processing method to process the business processing request.
[0032] Through the above technical solution, for each message corresponding to a business processing request, the corresponding message processing method can be obtained in the message processing mapping table, which effectively improves the processing efficiency of the business processing request.
[0033] In a possible implementation manner, the method further includes: when shutting down the SDK, deinitializing the SDK.
[0034] Through the above technical solution, when the SDK is closed, the SDK is deinitialized, which can release system resources in time to avoid occupying system resources and affecting the operation of other functions of the device.
[0035] In a possible implementation, the deinitializing the SDK includes: deleting the message processing method of each configurable module in the SDK from the message processing mapping table, deleting the service of each configurable module, and deleting the object of each configurable module.
[0036] Through the above technical solution, each configurable module in the SDK is deinitialized to ensure that system resources are completely released after the SDK is closed.
[0037] In a third aspect, an embodiment of the present application also provides a software configuration method, which includes: a first electronic device executes an SDK general construction script on a construction file according to the acquired device form, feature set and chip platform information of the Internet of Things device to obtain the SDK of the Internet of Things device; the first electronic device sends the SDK to a second electronic device; the second electronic device obtains the SDK constructed by the first electronic device, and integrates the SDK into the firmware of the Internet of Things device through a firmware integration link; the second electronic device runs the SDK, initializes the SDK, and applies the SDK to perform business processing.
[0038] Through the above technical solution, IoT device manufacturers can obtain pre-built SDKs and further configure and integrate the SDK with firmware. In this way, the peer device manufacturers of IoT devices do not need to open the source code of feature modules to IoT device manufacturers, which ensures the security of the internal communication protocols of terminal device manufacturers and improves the security of private data of terminal device manufacturers. IoT device manufacturers can also enhance the adaptability of SDK to IoT devices by configuring and integrating the SDK with firmware.
[0039] In a possible implementation, the method also includes: if it is determined based on the chip platform information that the chip platform of the Internet of Things device is a newly added chip platform, the first electronic device adds a cross-compilation chain of the chip platform; the first electronic device adds the compilation options of the chip platform to the build file of the SDK; the first electronic device adds the configuration information of the chip platform; the first electronic device establishes an association between the cross-compilation chain of the chip platform and the build file, and establishes an association between the chip platform and the device form.
[0040] Through the above technical solution, the information of the newly added chip platform can be added to the first electronic device, so that the constructed SDK can adapt to different chip platforms, thereby enhancing the adaptability of the SDK.
[0041] In a possible implementation, the method further includes: the first electronic device responds to an update request for a characteristic configuration of the device form, runs a configuration tool, configures and applies the characteristics of the device form; and the first electronic device updates a characteristic configuration file of the device form.
[0042] Through the above technical solution, the feature set corresponding to the device form can be updated, thereby enhancing the scalability of the static feature library in the SDK.
[0043] In a possible implementation, the method also includes: the second electronic device runs a configuration tool, loads the SDK, and configures the feature combination required by the Internet of Things device through the configuration tool; the second electronic device generates a configuration file according to the feature combination required by the Internet of Things device; the second electronic device adds the SDK to the firmware of the Internet of Things device according to the configuration file; the second electronic device modifies the link script in the Internet of Things device; the second electronic device adapts the feature interface of the SDK; the second electronic device compiles and links the firmware of the Internet of Things device to generate an executable file; the second electronic device runs and debugs the executable file.
[0044] Through the above technical solution, IoT device manufacturers can integrate the SDK into the firmware of IoT devices through firmware integration, so that the SDK is compatible with the IoT devices and the operating efficiency of the SDK is improved.
[0045] In a possible implementation, the method also includes: the second electronic device obtains an automatic modification script in the SDK, and configures the chip platform parameter information and the SDK identifier insertion position of the Internet of Things device in the automatic modification script; the second electronic device imports the original link script of the chip platform in the automatic modification script; the second electronic device runs the automatic modification script, and inserts the SDK identifier into the original link script according to the SDK identifier insertion position through the automatic modification script to obtain a modified link script; the second electronic device applies the modified link script.
[0046] Through the above technical solution, the SDK identifier is inserted into the original link script of the IoT device using the automatic modification script provided by the SDK, so that the self-registration mechanism of the configurable module in the SDK can be realized, thereby improving the initialization efficiency of the configurable module during the SDK operation.
[0047] In a possible implementation, the method further includes: the second electronic device declaring the initialization method of each configurable module of the SDK to a corresponding segment of the SDK's custom symbol identifier, and generating an initialization method table according to the initialization priority.
[0048] Through the above technical solution, self-registration of configurable modules can be achieved. The initialization method does not need to be explicitly called. It only needs to be declared in a predetermined way at the initialization method definition, and the initialization method will be executed during the SDK operation.
[0049] In a fourth aspect, the present application provides an electronic device, comprising a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device executes the above-mentioned software configuration method.
[0050] In a fifth aspect, the present application provides a chip coupled to a memory in an electronic device, wherein the chip is used to control a processor of the electronic device to execute the above-mentioned software configuration method.
[0051] In a sixth aspect, the present application provides a computer storage medium storing program instructions, which, when executed on an electronic device, causes a processor of the electronic device to execute the above-mentioned software configuration method.
[0052] In addition, the technical effects brought about by the fourth to sixth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic diagram of the interaction framework between an Internet of Things device and a mobile phone application provided in one embodiment of the present application.
[0054] Figure 2 It is a software architecture diagram of an electronic device provided in one embodiment of the present application.
[0055] Figure 3 It is a structural diagram of a software configuration system provided in one embodiment of the present application.
[0056] Figure 4 It is a flowchart of a software configuration method provided in one embodiment of the present application.
[0057] Figure 5 It is a schematic diagram of the SDK feature library provided in one embodiment of the present application.
[0058] Figure 6 It is a schematic diagram of the overall architecture of the SDK provided in one embodiment of the present application.
[0059] Figure 7 This is a flowchart of building an SDK provided by an embodiment of the present application.
[0060] Figure 8 This is a flowchart of a firmware integration link SDK provided in one embodiment of the present application.
[0061] Fig. 9 It is a schematic diagram of the interface of the configuration tool provided in one embodiment of the present application.
[0062] Fig.10This is a flowchart of modifying the link script in the SDK provided by an embodiment of the present application.
[0063] Fig.11 This is a flowchart of the SDK operation provided in one embodiment of the present application.
[0064] Fig.12 This is a flowchart of initializing configuration parameters provided by an embodiment of the present application.
[0065] Fig.13 It is a schematic diagram of a configurable module self-registration mechanism provided in an embodiment of the present application.
[0066] Fig.14 This is a flowchart of module initialization provided by an embodiment of the present application.
[0067] Fig.15 It is a flowchart of adding a message processing method of a module to a message processing mapping table provided by an embodiment of the present application.
[0068] Fig.16 This is a flowchart of adding a message processing method of a module to a message processing mapping table provided by another embodiment of the present application.
[0069] Fig.17 This is a flowchart of module deinitialization provided by an embodiment of the present application.
[0070] Fig.18 It is a schematic diagram of a registration public service mechanism provided in an embodiment of the present application.
[0071] Fig.19 It is a schematic diagram of a Weak mechanism provided in an embodiment of the present application.
[0072] Fig. 20 This is a flowchart of building an SDK provided by another embodiment of the present application.
[0073] Fig.21 This is a flowchart of a customized configuration SDK provided in one embodiment of the present application.
[0074] Fig. 22 This is a flowchart of a firmware integration link SDK provided by another embodiment of the present application.
[0075] Fig.23 It is an overall flow chart of the software configuration method provided in one embodiment of the present application.
[0076] Fig.24 This is a flowchart of building a cloud SDK provided by an embodiment of the present application.
[0077] Fig.25 This is a flowchart of a second electronic device accessing an SDK of a first electronic device provided by an embodiment of the present application.
[0078] Fig.26 This is a hardware architecture diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0079] The terms "first" and "second" involved in the embodiments of the present application are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0080] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" refers to one or more. "Multiple" refers to two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c. In the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0081] With the development of IoT technology, audio devices, wearable devices and other IoT devices are being used more and more widely. For example, audio devices include wireless headphones and wireless speakers, and wearable devices include smart watches and smart bracelets. IoT devices usually need to interact with applications of other terminal devices such as smartphones to achieve corresponding functions. For example, audio devices need to obtain audio data from mobile phone applications for playback, and wearable devices need to transmit collected user activity data (such as walking, running, etc.) to mobile phone applications so that the mobile phone can manage the user activity data or perform corresponding business processing based on the user activity data.
[0082] However, IoT devices and other terminal devices (i.e., the peer devices that communicate with IoT devices) usually come from different manufacturers. IoT devices must be configured with SDKs corresponding to other terminal devices and corresponding feature modules in the software development kit in order to interact with other terminal device applications. In order to support third-party IoT devices to access the ecosystem of terminal device manufacturers, terminal device manufacturers need to build SDKs and open the SDKs to IoT device manufacturers. In order to enable IoT devices with different chip platforms, different device forms, and different business feature requirements to access different terminal device applications, the constructed SDK needs to provide software configurability for IoT devices to integrate and use.
[0083] See also Figure 1 As shown, it is a schematic diagram of the interaction framework between the IoT device and the terminal device application provided in one embodiment of the present application. The IoT devices supported by the SDK include, but are not limited to: audio devices, wearable devices, the SDK supports the integration of multiple chip platforms, provides support for multiple business features, supports docking with multiple terminal device applications, and supports expansion. For example, mobile phone applications include smart space applications, audio housekeeper applications, sports health applications, Synergy multi-device collaborative applications, etc. The supported business features include device information query, status query and subscription, data communication capabilities, request services, message notifications, basic application services, extended application services, etc. Basic application services include device authentication, proximity discovery, firmware updates, log uploads, file transfers, etc. Extended application services include weather, heart rate, dials, music, card wallets, headphone searches, etc.
[0084] After the terminal device manufacturer provides the SDK to the IoT device manufacturer, the IoT device manufacturer can customize the SDK, for example, customize the feature module in the SDK to make the SDK compatible with the firmware and features of the IoT device. In related technologies, terminal device manufacturers usually open source code (such as the source code of the feature module or the SDK source code) to IoT device manufacturers. However, the source code contains the internal communication protocol of the terminal device manufacturer. If the source code is opened to the IoT device manufacturer, the security of the internal communication protocol of the terminal device manufacturer cannot be guaranteed, thereby reducing the security of the private data of the terminal device manufacturer.
[0085] In order to avoid opening the source code to IoT device manufacturers, which may result in the terminal device manufacturer's internal communication protocol being unsecured and the terminal device manufacturer's private data being compromised, the present application embodiment provides a software configuration method that opens the feature module to third-party manufacturers' devices in the form of a configurable static library, thereby ensuring the security of the terminal device manufacturer's internal communication protocol and, in turn, the security of the terminal device manufacturer's private data. The software configuration method of the present application embodiment is applied to electronic devices, and the following text will be combined with the following text. Figure 2A diagram illustrating the software architecture of an electronic device.
[0086] See also Figure 2 As shown, it is a software architecture diagram of the electronic device provided in the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. For example, the Android system is divided into four layers, from top to bottom, respectively, the application layer 101, the framework layer 102, the Android runtime (Androidruntime) and the system library 103, the hardware abstraction layer 104, the kernel layer 105, and the hardware layer 106.
[0087] The application layer 101 may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, device control service and other applications.
[0088] The framework layer 102 provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0089] Among them, the window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to the application. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions for electronic devices. For example, the management of call status (including connected, hung up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0090] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one is the function that the Java language needs to call, and the other is the Android core library.
[0091] The application layer 101 and the framework layer 102 run in a virtual machine. The virtual machine executes the Java files of the application layer and the framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0092] The system library 103 may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (eg, OpenGL ES), a 2D graphics engine (eg, SGL), and the like.
[0093] Among them, the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0094] The hardware abstraction layer 104 runs in the user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer.
[0095] The kernel layer 105 is a layer between hardware and software. The kernel layer 105 at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0096] The kernel layer 105 is the core of the operating system of the electronic device. It is the first layer of software expansion based on hardware, provides the most basic functions of the operating system, is the basis of the operating system, is responsible for managing the system's processes, memory, device drivers, files and network systems, and determines the performance and stability of the system. For example, the kernel can determine the operating time of an application on a certain part of the hardware.
[0097] The kernel layer 105 includes programs closely related to the hardware, such as interrupt handlers, device drivers, etc., and also includes basic, common, and high-frequency modules, such as clock management modules, process scheduling modules, etc., and also includes key data structures. The kernel layer can be set in the processor or solidified in the internal memory.
[0098] The hardware layer 106 includes the hardware of the electronic device, such as a display screen, buttons, a camera, etc.
[0099] See also Figure 3 As shown, it is a structural diagram of the software configuration system provided in one embodiment of the present application. In one embodiment of the present application, the software configuration system 10 includes a first electronic device 11 and a second electronic device 12. The first electronic device 11 and the second electronic device 12 are communicatively connected via a wired network or a wireless network. The first electronic device 11 is an electronic device of a manufacturer that builds and provides SDK, such as a personal computer, a server, a smart phone and other devices; the second electronic device 12 is an electronic device of an Internet of Things device manufacturer, such as various types of Internet of Things devices, or personal computers, servers, smart phones and other devices.
[0100] See also Figure 4 FIG. 1 is a flowchart of a software configuration method provided in an embodiment of the present application. The method is applied in a software configuration system, and the software configuration method includes:
[0101] S101, obtaining the device form, feature set and chip platform information of the IoT device, and building an SDK according to the device form, feature set and chip platform information of the IoT device. The SDK includes a configurable static library, which includes multiple configurable feature modules.
[0102] In one embodiment of the present application, if an IoT device manufacturer wants to enable an IoT device to access applications of other terminal devices, it can request access to the ecosystem of other terminal device manufacturers. Other terminal devices can interact with IoT devices for data or instructions through applications. Ecosystem refers to a complete ecosystem established and maintained by device manufacturers, including hardware devices, operating systems, applications, services, and developer platforms. This ecosystem aims to provide users with a comprehensive device experience and attract developers and partners to join in and build a complete ecosystem.
[0103] To facilitate the clear description of the following multiple embodiments, the devices of other device manufacturers are referred to as the first electronic device, and the devices provided by the IoT device manufacturer are referred to as the second electronic device. The IoT device manufacturer sends an ecological access request to the first electronic device through the second electronic device. The first electronic device receives the ecological access request of the second electronic device, authenticates the ecological access request, and after the authentication is passed, sends feedback information of agreeing to access the ecology to the second electronic device. The second electronic device responds to the feedback information and sends product information to the first electronic device. The product information includes, but is not limited to: device form, feature set and chip platform information. The device form is the type of IoT device, for example, the device form is wireless headphones, wireless speakers, smart watches, smart bracelets, etc. The feature set includes multiple functions of the IoT device, such as device information query, status check and subscription, data communication capabilities, wallets, alarm clocks, weather, etc. The chip platform information is the type of chip used by the IoT device, for example wait.
[0104] In one embodiment of the present application, the first electronic device receives the product information sent by the second electronic device, obtains the device form, feature set and chip platform information of the IoT device in the product information, selects the corresponding feature library according to the device form, and executes the SDK general build script on the build file according to the chip platform information to build the SDK corresponding to the IoT device. Among them, the build file includes private communication protocols, basic services, basic frameworks, third-party components, feature libraries, operating system adaptation files, configuration tools, APIs (Application Programming Interfaces), etc.
[0105] See also Figure 5 As shown, it is a schematic diagram of the SDK feature library provided by an embodiment of the present application. The SDK feature library can decouple different features, normalize the basic framework, and split it into independent feature libraries and sub-feature libraries according to the differences in device form and features. The SDK feature library includes, but is not limited to: a basic feature library, an audio device feature library, and a wearable device feature library. The basic feature library includes a basic operating framework, proximity discovery features, device authentication features, device management features, etc. The audio device feature library includes common features of audio devices, headphone search features, same account free pairing features, dual connection features, etc. The wearable device feature library includes common features of wearable devices, music service features, weather service features, watch face service features, etc.
[0106] See also Figure 6The figure is a schematic diagram of the overall architecture of the SDK provided by one embodiment of the present application. When the SDK is integrated into the firmware of the IoT device, it includes a communication protocol module, a processing thread module, a basic service module, a third-party component module, a wearable device feature module, an audio device feature module, a basic framework module, an operating system adaptation layer, and a configuration tool. The SDK is connected to the firmware of the IoT device through an API, and is connected to the peer device based on a communication protocol, wherein the peer device can be a smart phone, a personal computer, etc. The peer device includes multiple applications, and the IoT device can interact with multiple applications of the peer device through the SDK, and the IoT device can also interact with cloud services through the peer device. In order to show the overall architecture of the SDK, Figure 6 The SDK shown contains a full range of functional modules. In actual applications, the functional modules of the SDK are adapted to the characteristics of the corresponding IoT devices.
[0107] See also Figure 7 As shown, it is a flowchart of building SDK provided by an embodiment of the present application.
[0108] S1011, obtaining device form, feature set and chip platform information of the IoT device.
[0109] In one embodiment of the present application, the IoT device manufacturer sends an ecological access request to the first electronic device through the second electronic device. The first electronic device receives the ecological access request of the second electronic device, authenticates the ecological access request, and after the authentication is passed, sends feedback information agreeing to access the ecology to the second electronic device. The second electronic device responds to the feedback information and sends product information to the first electronic device. The product information includes but is not limited to: device form, feature set and chip platform information. The feature set may include all the features currently possessed by the corresponding IoT device, and may also include the features required by the IoT device manufacturer for a specific IoT device. Among them, the chip platform information includes but is not limited to: chip platform model, operating system information, cross-compilation chain, and compilation options.
[0110] S1012, judging whether the chip platform of the IoT device is a newly added chip platform according to the chip platform information. If the chip platform of the IoT device is a newly added chip platform, the process executes S1013; if the chip platform of the IoT device is not a newly added chip platform, the process executes S1017.
[0111] In one embodiment of the present application, chip platform information is pre-recorded in the first electronic device. After receiving the product information sent by the second electronic device, it is determined whether the acquired chip platform information matches the chip platform information pre-stored in the first electronic device. If the chip platform information pre-stored in the first electronic device can match the chip platform information that is the same as the acquired chip platform information, it is determined that the chip platform of the Internet of Things device is not a newly added chip platform; if the chip platform information pre-stored in the first electronic device cannot match the chip platform information that is the same as the acquired chip platform information, it is determined that the chip platform of the Internet of Things device is a newly added chip platform.
[0112] S1013, add the cross-compilation chain for the chip platform.
[0113] In one embodiment of the present application, if the chip platform of the IoT device is a newly added chip platform, the cross-compilation chain in the chip platform information of the IoT device is stored in the first electronic device. The cross-compilation chain is a set of tools for generating executable code on a target platform in an operating system environment, and the cross-compilation chain includes at least a cross-compiler, a cross-assembler, a linker, and related tools, which can be used to compile source code from one operating system or architecture into machine code required by another operating system or architecture.
[0114] S1014, add the compilation options of the chip platform to the build file of the SDK.
[0115] In one embodiment of the present application, the compilation options are parameters and options passed to the compiler during the compilation process, which are used to specify the behavior of the compiler and the characteristics of the generated executable file.
[0116] S1015, adding chip platform configuration information.
[0117] In one embodiment of the present application, the configuration information in the chip platform information is stored in the first electronic device. For example, the configuration information of the chip platform includes processor performance, memory information, communication protocol, graphics processing performance, power consumption, connectivity, etc.
[0118] S1016, establishing an association between the cross-compilation chain of the chip platform and the build file, and establishing an association between the chip platform and the device form.
[0119] In one embodiment of the present application, by specifying the cross-compilation chain of the chip platform, an association is established between the cross-compilation chain of the chip platform and the build file, and the newly added compilation chain information of the chip platform is added to the SDK build process. By establishing an association between the cross-compilation chain of the chip platform and the build file, when the build file is currently and subsequently compiled, the cross-compilation chain corresponding to the chip platform is used to convert the build file into executable code on the chip platform. By specifying the device form corresponding to the chip platform, an association is established between the chip platform and the device form. By establishing an association between the chip platform and the device form, SDKs for different chip platforms can be built when the device form is known.
[0120] S1017, determine whether the characteristic configuration of the device form needs to be updated. If the characteristic configuration of the device form needs to be updated, the process executes S1018; if the characteristic configuration of the device form does not need to be updated, the process executes S1020.
[0121] In one embodiment of the present application, the feature set of the Internet of Things device is compared with the feature library in the first electronic device to determine whether the feature set of the Internet of Things device contains new features (for example, newly added features). If it is determined that the feature set of the Internet of Things device contains new features, it is determined that the feature configuration of the device form needs to be updated; if it is determined that the feature set of the Internet of Things device does not contain new features, it is determined that the feature configuration of the device form does not need to be updated.
[0122] S1018, run the configuration tool to configure and apply the characteristics of the device form.
[0123] In one embodiment of the present application, a configuration tool is run to add a new feature in the feature set of the IoT device to the feature library of the first electronic device through the configuration tool, configure the new feature, and apply the configuration. The feature configuration includes feature switch configuration, parameter configuration, conditional logic configuration, default value configuration, and permission control configuration.
[0124] S1019, update the feature configuration file of the device form.
[0125] In an embodiment of the present application, the configuration of the new feature is added to the feature configuration file of the corresponding device form, thereby updating the feature configuration file of the device form.
[0126] S1020, executing the SDK general build script on the build file according to the chip platform of the IoT device, and building the SDK of the IoT device.
[0127] In one embodiment of the present application, when building an SDK in a first electronic device, run the configuration tool, check the feature configuration corresponding to the device form, select the chip platform for which the SDK needs to be built, and execute the SDK general build script on the build file to build the SDK of the IoT device, and the built SDK corresponds to the selected chip platform. The build file includes multiple functional modules, and the multiple functional modules include private communication protocols, basic services, basic frameworks, third-party components, feature libraries, operating system adaptation files, configuration tools, APIs, etc. The feature library is a configurable static feature library.
[0128] In one embodiment of the present application, after the construction of the IoT device SDK is completed, the SDK is released to the outside, for example, the SDK is sent to the second electronic device via a wired network or a wireless network, or published on the developer website or cloud of the first electronic device manufacturer. The IoT device manufacturer can download the SDK from the developer website or the cloud through the second electronic device.
[0129] Through the above-mentioned embodiments of the present application, the peer device manufacturer of the IoT device packages the feature set of the IoT device into an SDK in the form of a configurable static library through the first electronic device, and then opens the SDK to the IoT device manufacturer for further configuration and firmware integration. There is no need to open the source code of the feature module to the IoT device manufacturer, which ensures the security of the internal communication protocol of the terminal device manufacturer and improves the security of the private data of the terminal device manufacturer.
[0130] S102, obtaining the SDK, and integrating the SDK into the firmware of the IoT device through a firmware integration link.
[0131] In one embodiment of the present application, the second electronic device can receive the SDK sent by the first electronic device through a wired network or a wireless network, or can download the SDK from a developer website or a cloud server. After obtaining the SDK, the second electronic device performs a firmware integration link on the SDK, runs a configuration tool, modifies the link script, and completes the tailored configuration of the SDK, that is, the custom configuration.
[0132] See also Figure 8 As shown, it is a flowchart of the firmware integration link SDK provided in one embodiment of the present application. Figure 8 The method shown is applied in a second electronic device.
[0133] S1021, run the configuration tool, load the SDK, and configure the feature combination required by the IoT device through the configuration tool.
[0134] In one embodiment of the present application, the configuration tool is installed in the second electronic device, including an SDK path input bar or an SDK insert option. The SDK can be loaded by entering the SDK storage path in the path input bar, or the SDK can be found and loaded by triggering the insert option.
[0135] See also Fig. 9 As shown, it is a schematic diagram of the interface of the configuration tool provided by an embodiment of the present application. After the SDK is loaded in the configuration tool, the interface of the configuration tool displays the feature list of the SDK, and the user can select the features required for the IoT device in the feature list. For example, the device form of the IoT device is a wireless headset, and the feature list of the SDK includes active noise reduction, custom card, headset search, log upload, multi-connection, online upgrade, pairing-free, and wearing detection. The user can select active noise reduction, headset search, online upgrade, and wearing detection as the feature combination required for the wireless headset.
[0136] S1022, generating a configuration file according to the characteristic combination required by the IoT device.
[0137] In one embodiment of the present application, after the user completes selecting the feature combination required for the IoT device, the user saves the selected feature combination, and the configuration tool responds to the user's save operation and generates a configuration file based on the feature combination required for the IoT device.
[0138] S1023, adding the SDK to the firmware of the IoT device according to the configuration file.
[0139] In one embodiment of the present application, during the firmware construction process of the IoT device, the SDK required by the IoT device is linked to the firmware in combination with the configuration file. The feature library in the SDK is screened in combination with the configuration file, the feature combination required by the IoT device is retained, the SDK required by the IoT device is obtained, and the SDK required by the IoT device is linked to the firmware of the IoT device, thereby adding the SDK required by the IoT device to the firmware of the IoT device, and the feature combination required by the IoT device is integrated in the SDK in the form of a static feature library.
[0140] S1024, modify the link script in the IoT device.
[0141] In one embodiment of the present application, a linker script (with the file suffix "lds") is a file used to define the layout and organization of a program in memory. The linker script specifies information such as the address range, alignment, and storage location of different section (code segment) symbols in the program. The linker script is used to control each link process in the program, specify how to put the code segments in the input file into the output file, and control the layout of each part of the output file in the program address space. The input file includes the SDK, and the output file is the firmware integrated with the SDK.
[0142] S1025, adapt the characteristic interface of the SDK.
[0143] In one embodiment of the present application, the feature interface is adapted according to the reference sample code (demo). The second electronic device pre-stores the reference sample code, which is a sample code that has implemented basic functions. The interface is modified or expanded on the basis of the reference sample code so that the interface meets the characteristics of the corresponding business characteristics. After the feature interface is adapted, the firmware can access the characteristics in the SDK through the feature interface.
[0144] S1026, compile and link the firmware of the IoT device to generate an executable file.
[0145] In one embodiment of the present application, compilation is the process of converting the source code files of the SDK and the IoT device firmware into executable target code files. During the compilation phase, the compiler translates the source code into machine code or intermediate code related to the target platform. In addition, the compiler performs lexical analysis, syntax analysis, and semantic analysis on the source code and generates target code.
[0146] In one embodiment of the present application, linking is the process of combining multiple target files and library files to form a final executable file or shared library. In the linking stage, the linker resolves the symbol references in different target files into actual addresses and resolves symbol duplication and dependency. The linker also combines the code and data segments in the target file into a final memory layout and generates an executable file.
[0147] S1027, running and debugging the executable file.
[0148] In one embodiment of the present application, an executable file is run through an IoT device and debugged to detect whether the executable file can run normally and whether all features in the SDK can be realized by running the executable file.
[0149] The above-mentioned embodiments of the present application enable IoT device manufacturers to customize the static feature library of the SDK through the second electronic device, enhance the adaptability of the SDK to IoT devices and their firmware, and improve the data interaction efficiency between IoT devices and peer devices.
[0150] See also Fig.10 As shown, it is a flowchart of modifying the link script in the Internet of Things device provided by an embodiment of the present application.
[0151] S201, obtaining an automatic modification script in the SDK, and configuring chip platform parameter information and an SDK identifier insertion position of the IoT device in the automatic modification script.
[0152] In one embodiment of the present application, an automatic modification script in the SDK is obtained and run, and the chip platform parameter information of the IoT device and the configuration of the SDK identifier insertion position are modified in the automatic modification script. The chip platform parameter information includes the number of chip bits, such as 32 bits, 64 bits, etc., and the SDK identifier data can be aligned with the link script according to the number of chip bits, thereby determining the insertion position of the SDK identifier in the link script. The SDK identifier includes an initialization entry identifier, an initialization exit identifier, a deinitialization entry identifier, and a deinitialization exit identifier of a configurable module. The initialization address of the configurable module in the SDK can be determined according to the initialization entry identifier and the initialization exit identifier of the configurable module, and the deinitialization address of the configurable module in the SDK can be determined according to the deinitialization entry identifier and the deinitialization exit identifier of the configurable module.
[0153] S202, importing the original link script of the chip platform into the automatic modification script.
[0154] In one embodiment of the present application, the automatic modification script includes a path input field for the original link script, and the original link script can be imported by inputting the storage path of the original link script in the path input field.
[0155] S203, running the automatic modification script, inserting the SDK identifier into the original link script according to the SDK identifier insertion position through the automatic modification script, to obtain a modified link script.
[0156] In one embodiment of the present application, after importing the original link script of the chip platform, the automatic modification script is run to insert the initialization entry identifier into the initialization address of the configurable module in the original link script, and the initialization exit identifier is inserted into the deinitialization address of the configurable module in the original link script, thereby modifying the original link script to obtain a modified link script.
[0157] S204, applying the modified link script.
[0158] In one embodiment of the present application, during the running phase of the SDK, the modified link script is applied to determine the location of the SDK identifier, find the configurable module in the SDK according to the location of the SDK identifier, and initialize the configurable module.
[0159] In another embodiment of the present application, there is no need to run the automatic modification script in the SDK. The second electronic device can directly open the original link script of the chip platform and modify the original link script, and insert the SDK identifier into the original link script according to the SDK identifier insertion position.
[0160] The above embodiment of the present application modifies the link script and adds custom symbols to the link script, so that the feature modules (or configurable modules) in the static feature library of the SDK can be added and implemented using a self-registration mechanism. In addition, the SDK provides a script for automatically adding symbols for use by IoT device manufacturers, which facilitates manufacturers to quickly modify the link script.
[0161] S103, running the SDK and initializing the SDK.
[0162] See also Fig.11 The figure shows a flowchart of the SDK operation provided in one embodiment of the present application. S301, the second electronic device runs the SDK by running the firmware, and after the firmware runs, the SDK is initialized; S302, the SDK initializes the configuration parameters; S303, the SDK initializes the basic framework and basic services; S304, the SDK initializes the configurable modules; S305, the firmware creates a processing thread, and sends pending events or business processing requests to the SDK, for example, the pending events include message reporting, service requests, message reception, etc.; S306, the firmware system schedules the processing thread of the SDK; S307, the processing thread of the SDK distributes the message corresponding to the pending event to the message processing mapping table; S308, the message processing method of the message of the pending event is obtained from the message processing mapping table, and the pending event is processed by the message processing method, for example, processing message reporting, processing service requests, processing timed events, etc.; S309, when the firmware is closed, the SDK is deinitialized; S310, the SDK deinitializes the configurable modules; S311, the SDK deinitializes the basic framework and basic services.
[0163] In one embodiment of the present application, in 304, the SDK initializes the configurable framework module, configurable public service module, and configurable specific service module between the initialization entry identifier and the initialization exit identifier by traversing the initialization method table. In S310, the SDK deinitializes the configurable specific service module, configurable public service module, and configurable framework module between the deinitialization entry identifier and the deinitialization exit identifier by traversing the deinitialization method table.
[0164] See also Fig.12 As shown, it is a flowchart of configuration parameter initialization provided by an embodiment of the present application. In an embodiment of the present application, configuration parameter initialization includes: calling the API provided by the SDK to configure the characteristic parameters. First, the SDK initialization configuration and the characteristic API configuration are performed, and then the characteristic switch configuration is performed to generate characteristic static parameters. For example, the SDK initializes the configuration of characteristic parameters such as the Bluetooth transmission rate and the interval time for sending data.
[0165] In one embodiment of the present application, Figure 6 As shown, the basic framework of the SDK includes linked lists, message queues, security functions, serialization, channel management, circular buffers, timers, and CRC checks. The basic services of the SDK include data security management, proximity discovery, reconnection pop-up windows, device management, device authentication, protocol parsing, and public service modules.
[0166] In one embodiment of the present application, the configurable module includes a configurable framework module, a configurable public business module and a configurable specific business module. The configurable framework module, the configurable public business module and the configurable specific business module may also respectively include corresponding sub-modules. The configurable module initialization includes configurable framework module initialization, configurable public business module initialization and configurable specific business module initialization.
[0167] See also Fig.13 As shown, it is a schematic diagram of a configurable module self-registration mechanism provided by an embodiment of the present application. The self-registration mechanism means that the initialization method does not need to be explicitly called, but only needs to be declared in a predetermined way at the definition of the initialization method, and the initialization method will be executed during the operation of the SDK. The SDK's self-registration mechanism uses a custom symbol segment, and puts the methods that need to be called at runtime into the segment to form a method table. During the operation of the SDK, the method table will be traversed and the functions in the method table will be called to achieve the purpose of self-registration.
[0168] In one embodiment of the present application, in the self-registration mechanism, the initialization method of each configurable module (such as the configurable modules 1 to n in the figure) is declared to the corresponding segment of the SDK's custom symbol identifier, and an initialization method table is generated according to the initialization priority. The self-registration of the configurable module can be realized according to the initialization method, and the configurable module is registered in the link script to complete the initialization of the configurable module. The SDK's custom symbol segment is used to divide the framework, public service, and specific business into three levels, with different initialization priorities and deinitialization priorities, and the module priorities of initialization and deinitialization are opposite. The initialization method table includes an initialization entry identifier, an initialization exit identifier, a configurable framework module, a configurable public business module, and a configurable specific business module arranged in order of priority. The configurable framework module also includes multiple framework modules, the configurable public business module also includes multiple public business modules, and the configurable specific business module also includes multiple specific business modules.
[0169] In one embodiment of the present application, the initialization entry identifier includes an initialization method table of the configurable module, which records the initialization priority of the configurable module. For example, the initialization priority of the configurable framework module is the highest, the initialization priority of the configurable public service module is the second highest, and the initialization priority of the configurable specific service module is the lowest. The initialization priorities of multiple submodules in each configurable module can be the same, or the corresponding initialization priorities can be set in the initialization entry identifier according to requirements.
[0170] In one embodiment of the present application, during the initialization process of the configurable module, the link script determines the configurable modules between the initialization entry identifier and the initialization exit identifier based on the inserted SDK identifier, such as the initialization entry identifier and the initialization exit identifier, and calls the initialization method in the initialization entry identifier to initialize the configurable modules between the initialization entry identifier and the initialization exit identifier in order of priority.
[0171] See also Fig.14 As shown, it is a flowchart of module initialization provided in one embodiment of the present application.
[0172] S401, creating an object of each configurable module of the SDK.
[0173] In one embodiment of the present application, the class of the object of each configurable module that needs to be created is defined, including object properties and methods; according to the nature and requirements of the object, the constructor is called to instantiate the object, complete the creation of the object, and register the created object in the link script.
[0174] S402, creating a service for each configurable module.
[0175] In one embodiment of the present application, a service interface is defined to determine the functions and methods provided by the service of each configurable module; the service interface is implemented by writing a class; the service is registered in the link script through the service interface, and a service instance is created, thereby completing the creation of the service.
[0176] S403: Add the message processing method of each configurable module to the message processing mapping table.
[0177] See also Fig.15 As shown, it is a flowchart of adding a message processing method of a module to a message processing mapping table provided by an embodiment of the present application.
[0178] S4031, setting the ID and message processing method of each protocol instruction in the configurable module.
[0179] In one embodiment of the present application, a protocol instruction is a set of instructions or protocols that specify the communication method and data exchange format between configurable modules, including command format, data format, communication process, error handling method, security specification, version management, etc. Each feature module processes the message by executing the protocol instruction. The ID of the protocol instruction is a unique identifier of the protocol instruction, which is used to identify different protocol instructions. The message processing method is a specific operation performed by the configurable module when receiving a specific protocol instruction, such as instruction parsing, business logic execution, error handling, response generation, communication, etc.
[0180] S4032, convert the ID of each protocol instruction into an index value.
[0181] In one embodiment of the present application, each protocol instruction of the module is registered in the message processing mapping table, and first, the ID of each protocol instruction is converted into an index value by a hash algorithm. The hash algorithm can be MD5, SHA-1, SHA-256, etc.
[0182] S4033, adding the message processing method of each protocol instruction to the message processing mapping table.
[0183] In one embodiment of the present application, the message processing mapping table is a hash table, which is used to store a mapping table of the ID of the protocol instruction and the corresponding message processing method. A key-value pair of the index value of the protocol instruction and the corresponding message processing method is established, and the key-value pair is inserted into the message processing mapping table, so that the message processing method of each protocol instruction is added to the message processing mapping table one by one.
[0184] S4034, determine whether all protocol instructions have been added to the message processing mapping table. If all protocol instructions have been added to the message processing mapping table, the process ends; if any protocol instruction has not been added to the message processing mapping table, the process returns to execute S4032.
[0185] The above-mentioned embodiment of the present application uses a hash algorithm to add the message processing method of the protocol instruction to the message processing mapping table, which reduces the traversal complexity of the message processing method and improves the operating efficiency of the SDK.
[0186] See also Fig.16 As shown, it is a flowchart of adding a message processing method of a module to a message processing mapping table provided by another embodiment of the present application.
[0187] S4035, taking the ID of each protocol instruction of the configurable module as an index value.
[0188] In one embodiment of the present application, all protocol instructions of the feature module and the corresponding message processing methods are registered in the message processing mapping table. First, the ID of each protocol instruction is determined as an index value.
[0189] S4036, adding the message processing methods of all protocol instructions in the configurable module as a whole to the message processing mapping table.
[0190] In one embodiment of the present application, a key-value pair of the index value of the protocol instruction and the corresponding message processing method is established, and all key-value pairs are inserted into the message processing mapping table, so that the message processing methods of all protocol instructions in the configurable module are added to the message processing mapping table.
[0191] S104, applying SDK to perform business processing.
[0192] In one embodiment of the present application, the firmware creates a processing thread of the SDK and sends a business processing request to the SDK. The SDK schedules the processing thread to traverse the message processing method of the message corresponding to the business processing request in the message processing mapping table, and processes the business processing request through the traversed message processing method. For example, the business processing request includes message reporting, service request, message reception, etc.
[0193] In one embodiment of the present application, the method further includes: when the SDK is closed, deinitializing the SDK. The deinitialization of the SDK includes deinitialization of the configurable modules, the basic framework, and the basic services. Fig.11 As shown, the deinitialization entry identifier includes a deinitialization method table of the configurable module, which records the deinitialization priority of the configurable module, wherein the deinitialization priority of the configurable module is opposite to the initialization priority. In the above embodiment of the present application, when the SDK is closed, the configurable module is deinitialized to release system resources, such as memory, to avoid occupying system resources.
[0194] See also Fig.17 As shown, it is a flowchart of module deinitialization provided by an embodiment of the present application.
[0195] S501, deleting the message processing method of each configurable module from the message processing mapping table. S502, deleting the service of each configurable module. S503, deleting the object of each configurable module.
[0196] In an embodiment of the present application, the method further includes: decoupling multiple configurable modules in the SDK.
[0197] In one embodiment of the present application, multiple configurable modules in the SDK are decoupled through a registration public service mechanism. Fig.18 As shown, it is a schematic diagram of the registration public service mechanism provided by an embodiment of the present application. The service of the second business module (such as business module A in the figure) associated with the first business module (such as business module B in the figure) is registered to the public service module. When the first business module is running, it obtains the service of the second business module from the public service module. Among them, the association between the first business module and the second business module means that the first business module and the second business module have a strong dependency relationship. In the case of non-decoupling, the service of the first business module needs to be connected to the second business module to be realized. Through the registration public service mechanism, the service of the first business module can also be realized when it is not connected to the second business module.
[0198] In one embodiment of the present application, multiple configurable modules in the SDK are decoupled through a Weak mechanism. Fig.19 As shown, it is a schematic diagram of the Weak mechanism provided by an embodiment of the present application. A weak reference is established between a first business module and a second business module associated with the first business module through a Weak method module. When the first business module is running, the Weak method is called from the Weak method module to perform a weak implementation. The Weak method module can also perform a strong implementation from the second business module by linking the Weak method. The Weak mechanism allows a module to reference an object of another module by means of a weak reference or a weak pointer, but does not increase the reference count of the object, thereby avoiding the problem of circular references and achieving decoupling between modules.
[0199] Through the above-mentioned embodiments of the present application, multiple configurable modules in the SDK are fully decoupled, so that the business layering of the SDK is reasonable, and the maintainability and scalability of the SDK are enhanced.
[0200] In another embodiment of the present application, the characteristic configuration may also be performed by the first electronic device. Fig. 20 As shown, it is a flowchart of building SDK provided by another embodiment of the present application.
[0201] S601, obtaining device form, feature set and chip platform information of the IoT device.
[0202] S602, judging whether the chip platform of the IoT device is a newly added chip platform according to the chip platform information. If the chip platform of the IoT device is a newly added chip platform, the process executes S603; if the chip platform of the IoT device is not a newly added chip platform, the process executes S607.
[0203] S603, add the cross-compilation chain of the chip platform.
[0204] S604, adding the compilation options of the chip platform to the build file of the SDK.
[0205] S605, adding chip platform configuration information.
[0206] S606, establishing an association between the cross-compilation chain of the chip platform and the build file, and establishing an association between the chip platform and the device form.
[0207] S607, determine whether the characteristic configuration of the device form needs to be updated. If the characteristic configuration of the device form needs to be updated, the process executes S608; if the characteristic configuration of the device form does not need to be updated, the process executes S610.
[0208] S608, running the configuration tool to configure and apply the characteristics of the device form.
[0209] S609: Update the feature configuration file of the device form.
[0210] S610, customized configuration SDK.
[0211] S611, determine the SDK general build script corresponding to the chip platform, execute the SDK general build script on the build file, and obtain the SDK of the Internet of Things device.
[0212] See also Fig.21 As shown, it is a flowchart of a customized configuration SDK provided in one embodiment of the present application.
[0213] S701, determining whether a feature customization request sent by a second electronic device is received. If a feature customization request sent by a second electronic device is received, the process proceeds to S702; if no feature customization request sent by the second electronic device is received, the process ends.
[0214] In one embodiment of the present application, it is determined whether the SDK construction request sent by the second electronic device includes a feature customization request. If the SDK construction request sent by the second electronic device includes a feature customization request, it indicates that the IoT device manufacturer has a demand for customized configuration of the SDK.
[0215] S702, run the configuration tool, import the feature requirement list of the IoT device manufacturer, and configure the feature combination required by the IoT device.
[0216] S703: Modify the feature switch and static parameter configuration according to the requirements of the IoT device manufacturer.
[0217] S704: Generate a feature configuration file corresponding to the connected IoT device according to the modified feature switch and the static parameter configuration of the feature.
[0218] See also Fig. 22 As shown, it is a flowchart of the firmware integration link SDK provided by another embodiment of the present application.
[0219] S801, add the SDK to the firmware of the IoT device.
[0220] In one embodiment of the present application, the SDK is copied to the directory structure of the firmware, thereby adding the SDK to the firmware of the IoT device.
[0221] S802, modify the link script in the IoT device.
[0222] S803, adapting the characteristic interface of the SDK.
[0223] S804, compile and link the firmware of the IoT device to generate an executable file.
[0224] S805: Run and debug the executable file.
[0225] See also Fig.23 , which is an overall flow chart of a software configuration method provided in one embodiment of the present application.
[0226] The hardware device manufacturer (the manufacturer of the device connected to the IoT device) builds an SDK through the first electronic device, compiles the built SDK, sets the device form and chip platform of the IoT device, and sends the built SDK to the second electronic device of the IoT device manufacturer. For example, the built SDK contains a set of all supported feature libraries, including a basic feature library, a music application library, an alarm application library, a dial application library, a weather application library, and the like. The second electronic device of the IoT device manufacturer executes firmware integration to link the SDK, configures the SDK, and checks the required feature libraries. For example, the required feature libraries include a basic feature library, a music application library, an alarm application library, and a dial application library. Linking the SDK includes modifying the link script, inserting identifiers, and linking files. After the firmware integration linking the SDK is completed, the SDK operation process is executed. During the SDK operation phase, the feature parameters are configured and the SDK is initialized, including the initialization of each configurable module.
[0227] See also Fig.24 As shown, it is a flowchart of building SDK in the cloud provided by an embodiment of the present application.
[0228] The IoT device manufacturer uploads the chip platform information to the cloud server through the second electronic device, selects the device form and required characteristic information, generates platform configuration information and manufacturer configuration information in the cloud, and verifies the platform configuration information and manufacturer configuration information. If the platform configuration information and manufacturer configuration information fail to pass the verification, the cloud sends an error prompt to the second electronic device, and the second electronic device resubmits after inspection and correction. If the platform configuration information and manufacturer configuration information pass the verification, obtain the latest version of the SDK, load the platform configuration information and manufacturer configuration information into the SDK construction system, and the SDK construction system builds the SDK corresponding to the chip platform, device form, and manufacturer, and determines whether the SDK is successfully built. If the SDK is successfully built, the SDK is released for download by the second electronic device. If the SDK is not successfully built, run the error check script to determine the cause of the error, and generate and publish an error report for the second electronic device to download and view. The above embodiments of the present application can realize the automated construction of the SDK in the cloud server.
[0229] See also Fig.25 As shown, it is a flowchart of a second electronic device accessing the SDK of a first electronic device provided by an embodiment of the present application.
[0230] The second electronic device sends an ecological access request, creates an IoT device product, configures product functions, and provides the chip platform information of the product. Determine whether the existing SDK already supports the chip platform of the product. If the existing SDK already supports the chip platform of the product, the second electronic device directly downloads the existing SDK. If the existing SDK does not support the chip platform of the product, the first electronic device locally builds the SDK and releases the joint debugging version of the SDK based on the built SDK. The second electronic device obtains the joint debugging version of the SDK and executes the firmware integration link to the SDK. The first electronic device and the second electronic device perform joint debugging verification to solve the joint debugging problem, and after the joint debugging problem is solved, it is determined that the SDK verification has passed. Then, the first electronic device releases the official version of the SDK. For example, the official version of the SDK can be released in grayscale, test activities and certification tests can be performed, and after the certification is passed, the SDK is released for commercial use.
[0231] The present application also provides an electronic device 100. Fig.26As shown, the electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device 100.
[0232] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0233] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0234] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0235] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0236] The processor 110 may also be provided with a memory for storing instructions and data. In one embodiment of the present application, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use instructions or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0237] In one embodiment of the present application, the processor 110 may include one or more interfaces. The interface may include an Inter-integrated Circuit (I2C) interface, an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.
[0238] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In one embodiment of the present application, the processor 110 may include multiple groups of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 can be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the electronic device 100.
[0239] The I2S interface can be used for audio communication. In one embodiment of the present application, the processor 110 may include multiple I2S buses. The processor 110 may be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In one embodiment of the present application, the audio module 170 may transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call via a Bluetooth headset.
[0240] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In one embodiment of the present application, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In one embodiment of the present application, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering a call via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0241] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In one embodiment of the present application, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In one embodiment of the present application, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0242] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In one embodiment of the present application, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the electronic device 100.
[0243] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In one embodiment of the present application, the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0244] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices 100, such as AR devices, etc.
[0245] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0246] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.
[0247] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0248] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0249] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0250] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In one embodiment of the present application, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In one embodiment of the present application, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0251] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In one embodiment of the present application, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be arranged in the same device as the mobile communication module 150 or other functional modules.
[0252] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0253] In one embodiment of the present application, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include Global System For Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a Global Positioning System (GPS), a Global Navigation Satellite System (GLONASS), a Beidou Navigation Satellite System (BDS), a Quasi-Zenith Satellite System (QZSS) and / or a Satellite Based Augmentation System (SBAS).
[0254] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a software-configured microprocessor of an IoT device, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0255] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, Microled, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In one embodiment of the present application, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0256] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0257] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In one embodiment of the present application, ISP can be set in camera 193.
[0258] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In one embodiment of the present application, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0259] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0260] The video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0261] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0262] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0263] Random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.;
[0264] Non-volatile memory may include disk storage devices and flash memory.
[0265] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle. It can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage specification. It can be divided into universal flash storage (UFS), embedded Multi Media Card (eMMC), etc. according to the storage specification.
[0266] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0267] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0268] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0269] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the screen display detection method executed on the electronic device 100 in the above embodiment can be implemented to implement the screen display detection function of the electronic device 100.
[0270] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0271] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment of the present application, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0272] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0273] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0274] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0275] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm Open Mobile Terminal Platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0276] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0277] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0278] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0279] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In one embodiment of the present application, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100. The embodiment of the present application also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned related method steps to implement the software configuration method in the above-mentioned embodiment.
[0280] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the software configuration method in the above-mentioned embodiment.
[0281] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the software configuration method in the above-mentioned method embodiments.
[0282] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.
[0283] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0284] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0285] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0286] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0287] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program code.
[0288] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A software configuration method, applied to a first electronic device, characterized in that: The method comprises: Obtain device form, feature set, and chip platform information of IoT devices; According to the device form, feature set and chip platform information of the IoT device, execute the SDK general build script on the build file to obtain the SDK of the IoT device; The SDK is sent to a second electronic device, and the second electronic device integrates the SDK into the firmware of the IoT device through a firmware integration link, and runs the SDK in the IoT device.
2. The software configuration method according to claim 1, characterized in that: The method further comprises: If it is determined according to the chip platform information that the chip platform of the IoT device is a newly added chip platform, a cross-compilation chain of the chip platform is added; Adding the compilation options of the chip platform to the build file of the SDK; Adding configuration information of the chip platform; An association is established between the cross-compile chain of the chip platform and the build file, and an association is established between the chip platform and the device form.
3. The software configuration method according to claim 1, characterized in that: The method further comprises: In response to an update request for a characteristic configuration of the device form, a configuration tool is run to configure and apply the characteristic of the device form; Updates the feature profile for the device form factor.
4. The software configuration method according to claim 1, characterized in that: The method further comprises: In response to the feature customization request sent by the second electronic device, run a configuration tool, import a feature requirement list of the IoT device, and configure a feature combination required by the IoT device; Modify the static parameter configuration of feature switches and features according to the requirements of the IoT device; According to the modified feature switch and the static parameter configuration of the feature, a feature configuration file corresponding to the IoT device connected thereto is generated.
5. A software configuration method, applied to a second electronic device, characterized in that: The method comprises: Obtaining a software development kit SDK constructed by the first electronic device, and integrating the SDK into the firmware of the IoT device through a firmware integration link; Running the SDK to initialize the SDK; Apply the SDK to perform business processing.
6. The software configuration method according to claim 5, characterized in that: The step of integrating the SDK into the firmware of the IoT device through a firmware integration link includes: Run the configuration tool, load the SDK, and configure the feature combination required by the IoT device through the configuration tool; Generate a configuration file according to the characteristic combination required by the IoT device; Adding the SDK to the firmware of the IoT device according to the configuration file; Modify the link script in the IoT device; Adapting the characteristic interface of the SDK; Compile and link the firmware of the IoT device to generate an executable file; The executable file is run and debugged.
7. The software configuration method according to claim 6, characterized in that: The modifying the link script in the IoT device includes: Obtaining an automatic modification script in the SDK, and configuring chip platform parameter information and an SDK identifier insertion position of the IoT device in the automatic modification script; Importing the original link script of the chip platform into the automatic modification script; By running the automatic modification script, the SDK identifier is inserted into the original link script according to the SDK identifier insertion position, so as to obtain a modified link script; Apply the modified linker script.
8. The software configuration method according to claim 6, characterized in that: The modifying the link script in the IoT device includes: Modify the original link script of the chip platform of the IoT device; The SDK identifier is inserted into the original link script according to the SDK identifier insertion position.
9. The software configuration method according to claim 5, characterized in that: The method further comprises: Declare the initialization method of each configurable module of the SDK to the corresponding segment of the SDK custom symbol identifier, and generate an initialization method table according to the initialization priority.
10. The software configuration method according to claim 5, characterized in that: The initializing the SDK includes: An object of each configurable module of the SDK is created, a service of each configurable module is created, and a message processing method of each configurable module is added to a message processing mapping table.
11. The software configuration method according to claim 10, characterized in that: The adding of the message processing method of each configurable module to the message processing mapping table includes: Setting the ID and message processing method of each protocol instruction in the configurable module; Convert the ID of each protocol instruction into an index value; The message processing method of each protocol instruction is added to the message processing mapping table.
12. The software configuration method according to claim 10, characterized in that: The adding of the message processing method of each configurable module to the message processing mapping table includes: Setting the ID and message processing method of each protocol instruction in the configurable module; The ID of each protocol instruction is used as the index value; The message processing methods of all protocol instructions in the configurable module are added as a whole to the message processing mapping table.
13. The software configuration method according to claim 5, characterized in that: The initializing the SDK includes: Multiple configurable modules in the SDK are decoupled through a registration public service mechanism or a weak mechanism.
14. The software configuration method according to claim 5, characterized in that: The application of the SDK to perform business processing includes: Creating a processing thread of the SDK through firmware, and sending a service processing request to the SDK; The SDK schedules the processing thread to traverse the message processing method of the message corresponding to the business processing request in the message processing mapping table, and calls the traversed message processing method to process the business processing request.
15. The software configuration method according to claim 5, characterized in that: The method further comprises: When the SDK is closed, the SDK is deinitialized.
16. The software configuration method according to claim 15, characterized in that: The deinitializing the SDK includes: The message processing method of each configurable module in the SDK is deleted from the message processing mapping table, and the service and object of each configurable module are deleted.
17. A software configuration method, characterized in that: The method comprises: The first electronic device executes the SDK general construction script on the construction file according to the acquired device form, feature set and chip platform information of the IoT device to obtain the SDK of the IoT device; The first electronic device sends the SDK to the second electronic device; The second electronic device obtains the SDK constructed by the first electronic device, and integrates the SDK into the firmware of the IoT device through a firmware integration link; The second electronic device runs the SDK, initializes the SDK, and applies the SDK to perform business processing.
18. The software configuration method according to claim 17, characterized in that: The method further comprises: If it is determined according to the chip platform information that the chip platform of the IoT device is a newly added chip platform, the first electronic device adds a cross-compilation chain of the chip platform; The first electronic device adds the compilation options of the chip platform to the build file of the SDK; The first electronic device adds configuration information of the chip platform; The first electronic device establishes an association between the cross-compile chain of the chip platform and the build file, and establishes an association between the chip platform and the device form.
19. The software configuration method according to claim 17, characterized in that: The method further comprises: The first electronic device responds to the request for updating the characteristic configuration of the device form, runs a configuration tool, and configures and applies the characteristic of the device form; The first electronic device updates a characteristic configuration file of the device form.
20. The software configuration method according to claim 17, characterized in that: The method further comprises: The second electronic device runs a configuration tool, loads the SDK, and configures a feature combination required by the IoT device through the configuration tool; The second electronic device generates a configuration file according to the characteristic combination required by the IoT device; The second electronic device adds the SDK to the firmware of the IoT device according to the configuration file; The second electronic device modifies the link script in the IoT device; The second electronic device adapts the characteristic interface of the SDK; The second electronic device compiles and links the firmware of the IoT device to generate an executable file; The second electronic device runs and debugs the executable file.
21. The software configuration method according to claim 17, characterized in that: The method further comprises: The second electronic device obtains an automatic modification script in the SDK, and configures chip platform parameter information and an SDK identifier insertion position of the IoT device in the automatic modification script; The second electronic device imports the original link script of the chip platform into the automatic modification script; The second electronic device runs the automatic modification script, and inserts the SDK identifier into the original link script according to the SDK identifier insertion position through the automatic modification script to obtain a modified link script; The second electronic device applies the modified link script.
22. The software configuration method according to claim 17, characterized in that: The method further comprises: The second electronic device declares the initialization method of each configurable module of the SDK to a corresponding segment of the SDK's custom symbol identifier, and generates an initialization method table according to the initialization priority.
23. An electronic device, characterized in that: The electronic device comprises a memory and a processor: Wherein, the memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the electronic device executes the software configuration method as described in any one of claims 1 to 4, or executes the software configuration method as described in any one of claims 5 to 16.
24. A chip coupled to a memory in an electronic device, characterized in that: The chip is used to control the electronic device to execute the software configuration method according to any one of claims 1 to 4, or to execute the software configuration method according to any one of claims 5 to 16.
25. A computer storage medium, characterized in that The computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, a processor of the electronic device executes the software configuration method as claimed in any one of claims 1 to 4, or executes the software configuration method as claimed in any one of claims 5 to 16.
Citation Information
Patent Citations
Method and device for constructing unmanned aerial vehicle SDK development platform
CN110688095A
Internet of things access method and system, terminal and computer readable storage medium
CN112565029A
Configuration method and device of Internet of Things system, electronic equipment and storage medium
CN115277778A
Reformer and reforming system of pyrolysis-gas having the same
KR102827774B1
System and method for designing a product and manufacturing a product
US20170300598A1