Software configuration method and related device
By building an SDK for IoT devices and integrating firmware using a configurable static library, the security issues of communication protocols for terminal device manufacturers caused by IoT device manufacturers obtaining SDK source code are resolved, thereby improving the security of private data and the compatibility of the SDK.
Patent Information
- Application Number
- CN202410118875.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-01-26
AI Technical Summary
When IoT device manufacturers obtain the SDK source code from terminal device manufacturers, the security of the terminal device manufacturers' internal communication protocols is reduced, and their private data is threatened.
An SDK for IoT devices is built using a first electronic device. The SDK is then sent to a second electronic device for firmware integration using a configurable static library approach, avoiding direct open source code and ensuring the security of communication protocols for terminal device manufacturers.
It improves the private data security of terminal equipment manufacturers, enhances the adaptability and integration efficiency of SDK, and reduces dependence on terminal equipment manufacturers.
Smart Images

Figure CN119271256B_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
[0002] With the development of Internet of Things (IoT) technology, the application of audio devices, wearable devices and other Internet of Things devices is becoming more and more widespread. Internet of Things devices usually need to interact with the application programs of other terminal devices such as smart phones to realize corresponding functions. However, Internet of Things devices and other terminal devices may come from different manufacturers, and the Internet of Things devices are configured with a software development kit (SDK) corresponding to the terminal device, and a feature module is configured in the software development kit, so as to interact with the terminal device application.
[0003] In the related art, the terminal device manufacturer usually opens the source code to the Internet of Things device manufacturer for the Internet of Things device manufacturer to customize the configuration of the feature module and the SDK, so that the SDK is adapted to the firmware and features of the Internet of Things device. However, the source code contains the internal communication protocol of the terminal device manufacturer, and if the source code is opened to the Internet of Things device manufacturer, the security of the internal communication protocol of the terminal device manufacturer cannot be guaranteed, resulting in a reduction in the security of the private data of the terminal device manufacturer. SUMMARY
[0004] In view of the above, it is necessary to provide a software configuration method and related equipment to solve the above problem of opening the SDK source code to the Internet of Things device manufacturer for the Internet of Things device manufacturer to customize the configuration of the SDK, which reduces the security of the private data of the terminal device manufacturer.
[0005] In a first aspect, the present application provides a software configuration method applied to a first electronic device, the method comprising: obtaining device form, feature set and chip platform information of an Internet of Things device; executing an SDK universal 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 an SDK of the Internet of Things device; and sending the SDK to a second electronic device, the second electronic device integrating the SDK in the firmware of the Internet of Things device through firmware integrated linking, and running the SDK in the Internet of Things device.
[0006] Through the technical solution, the opposite device manufacturer of the Internet of Things device packs the characteristic set of the Internet of Things device into an SDK in the form of a configurable static library through the first electronic device, and then opens the SDK to the Internet of Things device manufacturer for further configuration and firmware integration, without opening the source code of the characteristic module to the Internet of Things device manufacturer, thereby ensuring the security of the internal communication protocol of the terminal device manufacturer and improving the security of the private data of the terminal device manufacturer.
[0007] In a possible implementation, the method further includes: determining whether the chip platform of the Internet of Things device is a newly added chip platform according to 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 a compilation option of the chip platform to a build file of the SDK; adding 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 technical solution, the information of the newly added chip platform can be added in the first electronic device, so that the SDK built can adapt to different chip platforms, thereby enhancing the adaptability of the SDK.
[0009] In a possible implementation, the method further includes: determining whether the characteristic configuration of the device form needs to be updated; if the characteristic configuration of the device form needs to be updated, responding to an update request for the characteristic configuration of the device form, running a configuration tool to configure and apply the characteristics of the device form; and updating the characteristic configuration file of the device form.
[0010] Through the technical solution, the characteristic set corresponding to the device form can be updated, thereby enhancing the scalability of the static characteristic library in the SDK.
[0011] In a possible implementation, the method further includes: determining whether a characteristic customization request sent by the second electronic device is received; if the characteristic customization request sent by the second electronic device is received, responding to the characteristic customization request sent by the second electronic device, running a configuration tool, importing a characteristic requirement list of the Internet of Things device, configuring a characteristic combination required by the Internet of Things device; modifying a characteristic switch and a static parameter configuration of a characteristic according to the requirement of the Internet of Things device; and generating a characteristic configuration file corresponding to accessing the Internet of Things device according to the modified characteristic switch and the static parameter configuration of the characteristic.
[0012] Through the technical solution, the opposite device manufacturer of the Internet of Things device can perform customized configuration of characteristics, without the Internet of Things device manufacturer performing self-defined configuration of characteristics, thereby improving the efficiency of integrating the SDK in the Internet of Things device.
[0013] In a second aspect, the embodiments of the present application provide a software configuration method applied to a second electronic device, the method comprising: obtaining an SDK constructed by a first electronic device, integrating the SDK in firmware of an Internet of Things device through firmware integration linkage; running the SDK, initializing the SDK; and applying the SDK to process business.
[0014] Through the above technical solution, the Internet of Things device manufacturer can obtain the pre-constructed SDK and further configure and integrate the firmware of the SDK. In this way, the counterpart manufacturer of the Internet of Things device does not need to open the source code of the feature module to the Internet of Things device manufacturer, thereby ensuring the security of the internal communication protocol of the terminal device manufacturer and improving the security of the private data of the terminal device manufacturer. The Internet of Things device manufacturer can also configure and integrate the firmware of the SDK, thereby enhancing the adaptability of the SDK to the Internet of Things device.
[0015] In a possible implementation, the integrating the SDK in the firmware of the Internet of Things device through firmware integration linkage comprises: running a configuration tool, loading the SDK, configuring a required feature combination of the Internet of Things device through the configuration tool; generating a configuration file according to the required feature combination of the Internet of Things device; adding the SDK to the firmware of the Internet of Things device according to the configuration file; modifying a linkage script in the Internet of Things device; adapting a feature interface of the SDK; compiling and linking the firmware of the Internet of Things device to generate an executable file; and running and debugging the executable file.
[0016] Through the above technical solution, the Internet of Things device manufacturer can integrate the SDK in the firmware of the Internet of Things device through firmware integration, so that the SDK is adapted to the Internet of Things device, thereby improving the running efficiency of the SDK.
[0017] In a possible implementation, the modifying the linkage script in the Internet of Things device comprises: obtaining an automatic modification script in the SDK, configuring chip platform parameter information and an SDK identifier insertion position of the Internet of Things device in the automatic modification script; importing an original linkage script of the chip platform in the automatic modification script; running the automatic modification script, inserting an SDK identifier into the original linkage script according to the SDK identifier insertion position through the automatic modification script to obtain a modified linkage script; and applying the modified linkage script.
[0018] Through the above technical solution, the automatic modification script provided by the SDK is used to insert the SDK identifier into the original linkage script of the Internet of Things device, 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 in the running process of the SDK.
[0019] In a possible implementation, the modifying the link script in the Internet of Things device comprises: modifying an original link script of the chip platform; and inserting an SDK identifier into the original link script according to the SDK identifier insertion position.
[0020] By the above technical solution, the Internet of Things device manufacturer can modify the link script of the platform by itself, and insert the identifier in the link script according to the requirement of the SDK.
[0021] In a possible implementation, the method further comprises: declaring an initialization method of each configurable module of the SDK to a corresponding segment of a symbol identifier customized by the SDK, and generating an initialization method table according to the priority of initialization.
[0022] By the above technical solution, the self-registration of the configurable module can be implemented, and the initialization method does not need to be called explicitly, but only needs to be declared at the initialization method definition by a predetermined manner, and the initialization method will be executed in the running process of the SDK.
[0023] In a possible implementation, the initializing the SDK comprises: 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] By the above technical solution, the initialization of each configurable module can effectively guarantee the normal running of the SDK.
[0025] In a possible implementation, the adding the message processing method of each configurable module to the message processing mapping table comprises: setting an ID and a 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] By 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 in the message processing process, and further improve the message processing efficiency.
[0027] In a possible implementation, the adding the message processing method of each configurable module to the message processing mapping table comprises: setting an ID and a message processing method of each protocol instruction in the configurable module; taking the ID of each protocol instruction as an index value; and adding the message processing methods of all protocol instructions in the configurable module to the message processing mapping table.
[0028] Through the technical solution, the message processing methods of all protocol instructions in the configurable module can be added to the message processing mapping table as a whole, thereby improving the registration efficiency of the message processing methods.
[0029] In a possible implementation, the initializing of the SDK comprises decoupling a plurality of configurable modules in the SDK through a public service mechanism or a weak mechanism.
[0030] Through the technical solution, the plurality of configurable modules in the SDK are decoupled, so that the maintainability and scalability of the SDK are enhanced.
[0031] In a possible implementation, the application of the SDK for business processing comprises creating a processing thread of the SDK through firmware and sending a business processing request to the SDK; and the SDK schedules the processing thread to traverse a message processing method of a message corresponding to the business processing request in the message processing mapping table, and invokes the message processing method obtained through the traversal to process the business processing request.
[0032] Through the 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, so that the processing efficiency of the business processing request is effectively improved.
[0033] In a possible implementation, the method further comprises deinitializing the SDK when the SDK is closed.
[0034] Through the technical solution, when the SDK is closed, the SDK is deinitialized, so that system resources can be released in time, system resources are avoided from being occupied, and the running of other functions of the device is affected.
[0035] In a possible implementation, the deinitializing of the SDK comprises deleting a message processing method of each configurable module in the SDK from the message processing mapping table, deleting a service of each configurable module, and deleting an object of each configurable module.
[0036] Through the technical solution, each configurable module in the SDK is deinitialized, so that the system resources are completely released after the SDK is closed.
[0037] In a third aspect, the embodiments of the present application further provide a software configuration method, which comprises: a first electronic device executing an SDK universal build script on a build file according to obtained device form, characteristic set and chip platform information of an Internet of Things device, to obtain an SDK of the Internet of Things device; the first electronic device sending the SDK to a second electronic device; the second electronic device obtaining the SDK built by the first electronic device, and integrating the SDK in firmware of the Internet of Things device through firmware integrated linking; the second electronic device running the SDK, initializing the SDK, and applying the SDK for business processing.
[0038] Through the above technical solution, the Internet of Things device manufacturer can obtain the pre-built SDK and further configure and firmware-integrate the SDK. In this way, the counterpart manufacturer of the Internet of Things device does not need to open the source code of the characteristic module to the Internet of Things device manufacturer, thereby ensuring the security of the internal communication protocol of the terminal device manufacturer and improving the security of the private data of the terminal device manufacturer. The Internet of Things device manufacturer can also configure and firmware-integrate the SDK, thereby enhancing the adaptability of the SDK to the Internet of Things device.
[0039] In a possible implementation, the method further comprises: if it is determined according to 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 a compilation option of the chip platform to a 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-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 in the first electronic device, so that the built SDK can adapt to different chip platforms, thereby enhancing the adaptability of the SDK.
[0041] In a possible implementation, the method further comprises: the first electronic device responding to an update request of the characteristic configuration of the device form, running a configuration tool, and configuring and applying the characteristics of the device form; and the first electronic device updating the characteristic configuration file of the device form.
[0042] Through the above technical solution, the characteristic set corresponding to the device form can be updated, thereby enhancing the scalability of the static characteristic library in the SDK.
[0043] In a possible implementation, the method further includes: the second electronic device runs a configuration tool, loads the SDK, and configures a combination of required features of the Internet of Things device through the configuration tool; the second electronic device generates a configuration file according to the combination of required features of the Internet of Things device; the second electronic device adds the SDK to firmware of the Internet of Things device according to the configuration file; the second electronic device modifies a link script in the Internet of Things device; the second electronic device adapts a feature interface of the SDK; the second electronic device performs compilation and linking on the firmware of the Internet of Things device to generate an executable file; and the second electronic device performs run-time debugging on the executable file.
[0044] Through the technical solution, the Internet of Things device manufacturer can integrate the SDK into the firmware of the Internet of Things device in a firmware integration manner, so that the SDK is adapted to the Internet of Things device, and the running efficiency of the SDK is improved.
[0045] In a possible implementation, the method further includes: 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 Internet of Things device in the automatic modification script; the second electronic device imports an original link script of the chip platform in the automatic modification script; the second electronic device runs the automatic modification script, inserts an 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 the second electronic device applies the modified link script.
[0046] Through the technical solution, the automatic modification script provided by the SDK is used to insert the SDK identifier into the original link script of the Internet of Things device, so that a self-registration mechanism of a configurable module in the SDK can be implemented, and the initialization efficiency of the configurable module in the SDK running process is improved.
[0047] In a possible implementation, the method further includes: the second electronic device declares an initialization method of each configurable module of the SDK to a corresponding segment of a symbol identifier customized by the SDK according to an initialization priority, and generates an initialization method table.
[0048] Through the technical solution, the self-registration of the configurable module can be implemented, the initialization method does not need to be explicitly called, and only needs to be declared at the initialization method definition through a predetermined manner, and the initialization method will be executed in the SDK running process.
[0049] In a fourth aspect, the present application provides an electronic device, comprising a memory and a processor, wherein the memory is configured to store program instructions; and the processor is configured to read and execute the program instructions stored in the memory, so as to cause the electronic device to perform the software configuration method.
[0050] In a fifth aspect, the present application provides a chip coupled with a memory in an electronic device, wherein the chip is configured to control a processor of the electronic device to perform the software configuration method.
[0051] In a sixth aspect, the present application provides a computer storage medium, wherein the computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, the processor of the electronic device is caused to perform the software configuration method.
[0052] In addition, the technical effects brought by the fourth aspect to the sixth aspect can be referred to the description of the method of each design in the method part, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 FIG. 1 is a schematic diagram of an interaction framework of an Internet of Things device and a mobile phone application according to an embodiment of the present application.
[0054] Figure 2 FIG. 3 is a software architecture diagram of an electronic device according to an embodiment of the present application.
[0055] Figure 3 FIG. 5 is a structural schematic diagram of a software configuration system according to an embodiment of the present application.
[0056] Figure 4 FIG. 7 is a flowchart of a software configuration method according to an embodiment of the present application.
[0057] Figure 5 FIG. 9 is a schematic diagram of an SDK feature library according to an embodiment of the present application.
[0058] Figure 6 FIG. 11 is a schematic diagram of the overall architecture of an SDK according to an embodiment of the present application.
[0059] Figure 7 FIG. 13 is a flowchart of constructing an SDK according to an embodiment of the present application.
[0060] Figure 8 FIG. 15 is a flowchart of integrating a firmware set into a SDK according to an embodiment of the present application.
[0061] Figure 9 FIG. 17 is a schematic diagram of an interface of a configuration tool according to an embodiment of the present application.
[0062] Figure 10is a flowchart of modifying a link script in an SDK provided by an embodiment of the present application.
[0063] Figure 11 is a flowchart of an SDK running provided by an embodiment of the present application.
[0064] Figure 12 is a flowchart of configuration parameter initialization provided by an embodiment of the present application.
[0065] Figure 13 is a schematic diagram of a configurable module self-registration mechanism provided by an embodiment of the present application.
[0066] Figure 14 is a flowchart of module initialization provided by an embodiment of the present application.
[0067] Figure 15 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] Figure 16 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] Figure 17 is a flowchart of module deinitialization provided by an embodiment of the present application.
[0070] Figure 18 is a schematic diagram of a registration public service mechanism provided by an embodiment of the present application.
[0071] Figure 19 is a schematic diagram of a Weak mechanism provided by an embodiment of the present application.
[0072] Figure 20 is a flowchart of constructing an SDK provided by another embodiment of the present application.
[0073] Figure 21 is a flowchart of customizing a configuration SDK provided by an embodiment of the present application.
[0074] Figure 22 is a flowchart of integrating a firmware set link SDK provided by another embodiment of the present application.
[0075] Figure 23 is a flowchart of a software configuration method provided by an embodiment of the present application.
[0076] Figure 24 is a flowchart of constructing an SDK in the cloud provided by an embodiment of the present application.
[0077] Figure 25 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] Figure 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 for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. 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 design schemes. 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 commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only 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 mean A or B. "And / or" in this application is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can mean: 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 features in the embodiments can be combined with each other.
[0081] With the development of IoT technology, the application of IoT devices such as audio devices and wearable devices is becoming increasingly widespread. For example, audio devices include wireless headphones and wireless speakers, while wearable devices include smart watches and smart bracelets. IoT devices often need to interact with applications on other terminal devices such as smartphones to realize their corresponding functions. For example, audio devices need to obtain audio data from mobile applications for playback, and wearable devices need to transmit collected user activity data (such as walking and running) to mobile applications so that the mobile phone can manage user activity data or perform corresponding business processing based on user activity data.
[0082] However, the Internet of Things devices and other terminal devices (i.e., counterpart devices in communication connection with the Internet of Things devices) are usually from different manufacturers, and the Internet of Things devices are configured with SDKs corresponding to the other terminal devices and configured with corresponding feature modules in the software development kits to interact with the other terminal device applications. In order to support the third-party Internet of Things devices to access the terminal device manufacturer's ecosystem, the terminal device manufacturer needs to build SDKs and open the SDKs to the Internet of Things device manufacturers. In order to enable the Internet of Things devices with different chip platforms, different device forms, and different business feature requirements to access different terminal device applications, the built SDKs need to provide software configurability for the Internet of Things devices to integrate and use.
[0083] Referring to Figure 1 Fig. 1 shows an interaction framework between an Internet of Things device and a terminal device application provided by an embodiment of the present application. The Internet of Things devices supported by the SDK include, but are not limited to, audio devices and wearable devices. The SDK supports integration of multiple chip platforms, provides support for multiple business features, supports interfacing with multiple terminal device applications, and supports extension. For example, the mobile phone application includes a smart space application, an audio manager application, a sports health application, a Synergy multi-device collaboration application, etc. The supported business features include device information query, state query and subscription, data communication capability, request service, message notification, basic application service, and extended application service. The basic application service includes device authentication, proximity discovery, firmware update, log upload, and file transfer. The extended application service includes weather, heart rate, watch face, music, card package, and earphone search.
[0084] After the terminal device manufacturer provides the SDK to the Internet of Things device manufacturer, the Internet of Things device manufacturer can customize the configuration of the SDK, such as customizing the configuration of the feature modules in the SDK, so that the SDK is adapted to the firmware and features of the Internet of Things device. In the related art, the terminal device manufacturer usually opens the source code (such as the source code of the feature modules or the source code of the SDK) to the Internet of Things device manufacturer. However, the source code contains the internal communication protocol of the terminal device manufacturer, and if the source code is opened to the Internet of Things 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 the Internet of Things device manufacturer and thus failing to guarantee the security of the internal communication protocol of the terminal device manufacturer, thereby reducing the security of the private data of the terminal device manufacturer, an embodiment of the present application provides a software configuration method that opens the feature modules to the devices of the third-party manufacturer in the form of a configurable static library, thereby guaranteeing the security of the internal communication protocol of the terminal device manufacturer and further guaranteeing the security of the private data of the terminal device manufacturer. The software configuration method of the embodiment of the present application is applied to an electronic device, and the following will be described in combination with Figure 2An electronic device is illustrated.
[0086] Referring to Figure 2 FIG. 1 is a software architecture diagram of an electronic device according to an embodiment of the disclosure. The software architecture diagram is provided for an electronic device according to an embodiment of the disclosure. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. For example, the Android system is divided into four layers, from top to bottom, an application layer 101, a framework layer 102, an Android runtime and system library 103, a hardware abstraction layer 104, a kernel layer 105, and a hardware layer 106.
[0087] The application layer 101 can include a series of application packages. For example, the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, device control service, and the like.
[0088] The framework layer 102 provides an application programming interface (API) and a programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions. For example, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0089] 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, and intercept the screen, and the like. The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, and the like. The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures. The phone manager is used to provide the communication function of the electronic device. For example, the management of the call state (including connection, hang-up, and the like). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like. The notification manager enables the application to display notification information in the status bar, which can be used to convey a type of message that can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of the download, message reminders, and the like. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, and can also be a notification in the form of a dialog window appearing on the screen. For example, a text message is prompted in the status bar, a prompt sound is emitted, the electronic device vibrates, the indicator light flashes, and the like.
[0090] The Android Runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0091] The application layer 101 and the framework layer 102 run in the virtual machine. The virtual machine executes the java files of the application layer and the framework layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection and the like.
[0092] The system library 103 can include a plurality of functional modules. For example, a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL) and the like.
[0093] The surface manager is used to manage the display subsystem, and provides the fusion of 2D and 3D layers for a plurality of applications. The media library supports a plurality of commonly used audio, video format playback and recording, and static image files and the like. The media library can support a plurality of audio and video coding formats, for example: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG and the like. The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing and the like. 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 contains 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, 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 processes, memory, device drivers, files and network systems of the system, and determines the performance and stability of the system. For example, the kernel can determine the operation time of an application program on a certain part of hardware.
[0097] The kernel layer 105 includes programs closely related to hardware, such as interrupt handling programs and device drivers, and also includes basic, common, and high-frequency running modules, such as clock management modules, process scheduling modules, and the like, and also includes critical data structures. The kernel layer can be set in the processor or fixed 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 Figure 3 , which is a schematic diagram of the structure of a 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 the SDK, such as a personal computer, a server, a smartphone, etc. The second electronic device 12 is an electronic device of an IoT device manufacturer, such as various IoT devices, or a personal computer, a server, a smartphone, etc.
[0100] See Figure 4 FIG. 1 is a flowchart of a software configuration method provided in an embodiment of the present application. The method is applied to a software configuration system, and the software configuration method includes:
[0101] S101: Obtain the device form, feature set, and chip platform information of the IoT device, and build an SDK based on 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 on other terminal devices, it can request access to the ecosystem of other terminal device manufacturers. Other terminal devices can interact with IoT devices through applications to exchange data or instructions. Ecosystem refers to a complete ecosystem established and maintained by a device manufacturer, 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 building a complete ecosystem.
[0103] In order 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. Among them, 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, a first electronic device receives product information sent by a second electronic device, obtains the device form, feature set, and chip platform information of the IoT device from the product information, selects a corresponding feature library based on the device form, and executes an SDK general build script on the build file based on the chip platform information to construct an SDK corresponding to the IoT device. The build file includes a proprietary communication protocol, basic services, a basic framework, third-party components, a feature library, an operating system adaptation file, a configuration tool, an API (Application Programming Interface), and so on.
[0105] See 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 pairing-free 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 Figure 6As shown in the figure, the SDK provided by an embodiment of the present application is a whole architecture schematic diagram. When the SDK is integrated in the firmware of the Internet of Things device, it includes a communication protocol module, a processing thread module, a basic service module, a third-party component module, a wearable device characteristic module, an audio device characteristic module, a basic framework module, an operating system adaptation layer, and a configuration tool. The SDK is connected with the firmware of the Internet of Things device through an API, and is connected with a 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 application programs, the Internet of Things device can interact with the multiple application programs of the peer device through the SDK, and the Internet of Things device can also interact with a cloud service through the peer device. In order to show the whole architecture of the SDK, Figure 6 The SDK shown in the figure contains all functional modules. In actual application, the functional modules of the SDK are adapted to the characteristics of the corresponding Internet of Things device.
[0107] Referring to Figure 7 As shown in the figure, a flowchart of constructing the SDK provided by an embodiment of the present application is shown.
[0108] S1011, device form, characteristic set, and chip platform information of the Internet of Things device are acquired.
[0109] In an embodiment of the present application, the Internet of Things 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, characteristic set, and chip platform information. The characteristic set can contain all characteristics currently possessed by the corresponding Internet of Things device, or can contain characteristics required by the Internet of Things device manufacturer for a specific Internet of Things device. The chip platform information includes but is not limited to: chip platform model, operating system information, cross-compile chain, and compile options.
[0110] S1012, whether the chip platform of the Internet of Things device is a newly added chip platform is judged according to the chip platform information. If the chip platform of the Internet of Things device is a newly added chip platform, the process performs S1013; if the chip platform of the Internet of Things device is not a newly added chip platform, the process performs S1017.
[0111] In an embodiment of the present application, the 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 obtained chip platform information matches the pre-stored chip platform information in the first electronic device. If the same chip platform information as the obtained chip platform information can be matched in the pre-stored chip platform information in the first electronic device, it is determined that the chip platform of the Internet of Things device is not a newly added chip platform. If the same chip platform information as the obtained chip platform information cannot be matched in the pre-stored chip platform information in the first electronic device, it is determined that the chip platform of the Internet of Things device is a newly added chip platform.
[0112] S1013, adding a cross-compilation chain of the chip platform.
[0113] In an embodiment of the present application, if the chip platform of the Internet of Things device is a newly added chip platform, the cross-compilation chain in the chip platform information of the Internet of Things 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 at least includes 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, adding a compilation option of the chip platform to a build file of the SDK.
[0115] In an embodiment of the present application, the compilation option is a parameter and option passed to the compiler during the compilation process, which is used to specify the behavior of the compiler and the characteristics of the generated executable file.
[0116] S1015, adding configuration information of the chip platform.
[0117] In an 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 an embodiment of the present application, by specifying the cross-compiler chain of the chip platform, the association between the cross-compiler chain of the chip platform and the build file is established, the newly added chip platform compilation chain information is added to the SDK build process. By establishing the association between the cross-compiler chain of the chip platform and the build file, when the build file is compiled currently and subsequently, the build file is converted into executable code on the chip platform by using the cross-compiler chain corresponding to the chip platform. By specifying the device form corresponding to the chip platform, the association between the chip platform and the device form is established. By establishing the association between the chip platform and the device form, the SDK of different chip platforms can be built in the case of known device form.
[0120] S1017, it is judged 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 flow executes S1018; if the characteristic configuration of the device form does not need to be updated, the flow executes S1020.
[0121] In an embodiment of the present application, the characteristic set of the Internet of Things device is compared with the characteristic library in the first electronic device, it is judged whether the characteristic set of the Internet of Things device contains a new characteristic (for example, a newly added characteristic), if it is determined that the characteristic set of the Internet of Things device contains a new characteristic, it is determined that the characteristic configuration of the device form needs to be updated; if it is determined that the characteristic set of the Internet of Things device does not contain a new characteristic, it is determined that the characteristic configuration of the device form does not need to be updated.
[0122] S1018, the configuration tool is run to configure and apply the characteristics of the device form.
[0123] In an embodiment of the present application, the configuration tool is run, the new characteristic in the characteristic set of the Internet of Things device is added to the characteristic library of the first electronic device by the configuration tool, the new characteristic is configured, and the configuration is applied. Wherein, the characteristic configuration includes characteristic switch configuration, parameter configuration, condition logic configuration, default value configuration and permission control configuration, etc.
[0124] S1019, the characteristic configuration file of the device form is updated.
[0125] In an embodiment of the present application, the configuration of the new characteristic is added to the characteristic configuration file of the corresponding device form, so as to update the characteristic configuration file of the device form.
[0126] S1020, according to the chip platform of the Internet of Things device, the SDK general build script is executed on the build file, and the SDK of the Internet of Things device is built.
[0127] In an embodiment of the present application, when the SDK is constructed in the first electronic device, a configuration tool is run, the feature configuration corresponding to the device form is checked, the chip platform for which the SDK is needed to be constructed is selected, the SDK general construction script is executed on the construction file, and thus the SDK of the Internet of Things device is constructed, and the constructed SDK corresponds to the selected chip platform. The construction file includes a plurality of functional modules, the plurality of functional modules include a private communication protocol, a basic service, a basic framework, a third-party component, a feature library, an operating system adaptation file, a configuration tool, an API, and the like. The feature library is a configurable static feature library.
[0128] In an embodiment of the present application, after the construction of the SDK of the Internet of Things device is completed, the SDK is published externally, for example, the SDK is sent to the second electronic device through a wired network or a wireless network, or is published on a developer website or a cloud of the first electronic device manufacturer, and the Internet of Things 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 counterpart device manufacturer of the Internet of Things device packs the feature set of the Internet of Things device into the SDK in the form of a configurable static library through the first electronic device, and then opens the SDK to the Internet of Things device manufacturer for further configuration and firmware integration, without opening the source code of the feature module to the Internet of Things device manufacturer, thereby guaranteeing the security of the internal communication protocol of the terminal device manufacturer and improving the security of the private data of the terminal device manufacturer.
[0130] S102, the SDK is acquired, and the SDK is integrated in the firmware of the Internet of Things device through firmware integration linkage.
[0131] In an 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 the SDK is acquired, the second electronic device executes firmware integration linkage on the SDK, runs a configuration tool, modifies a linkage script, and completes the tailoring configuration of the SDK, that is, the custom configuration.
[0132] Referring to Figure 8 FIG. 4 shows a flowchart of firmware integration linkage of the SDK provided by an embodiment of the present application. Figure 8 The method shown in FIG. 4 is applied in the second electronic device.
[0133] S1021, a configuration tool is run, the SDK is loaded, and the feature combination needed by the Internet of Things device is configured through the configuration tool.
[0134] In an embodiment of the present application, the configuration tool is installed in the second electronic device, and includes a path input box of the SDK or an insertion option of the SDK. The SDK can be loaded by inputting the storage path of the SDK in the path input box, or the SDK can be found and loaded by triggering the insertion option.
[0135] Referring to Figure 9 As shown in the figure, the interface of the configuration tool provided in an embodiment of the present application. After loading the SDK in the configuration tool, the interface of the configuration tool displays a list of characteristics of the SDK, and the user can select the required characteristics of the Internet of Things device in the list of characteristics. For example, the device form of the Internet of Things device is a wireless earphone, and the list of characteristics of the SDK includes active noise reduction, custom card, earphone search, log upload, multi-connection, online upgrade, pairing-free, and wearing detection. The user can select active noise reduction, earphone search, online upgrade, and wearing detection as the required characteristic combination of the wireless earphone.
[0136] S1022, generating a configuration file according to the required characteristic combination of the Internet of Things device.
[0137] In an embodiment of the present application, after the user completes the selection of the required characteristic combination of the Internet of Things device, the selected characteristic combination is saved, and the configuration tool generates a configuration file according to the required characteristic combination of the Internet of Things device in response to the user's save operation.
[0138] S1023, adding the SDK to the firmware of the Internet of Things device according to the configuration file.
[0139] In an embodiment of the present application, during the firmware construction process of the Internet of Things device, the required SDK of the Internet of Things device is linked to the firmware in combination with the configuration file. Among them, the characteristic library in the SDK is filtered in combination with the configuration file, the required characteristic combination of the Internet of Things device is retained, the required SDK of the Internet of Things device is obtained, the required SDK of the Internet of Things device is linked to the firmware of the Internet of Things device, thereby adding the required SDK of the Internet of Things device to the firmware of the Internet of Things device, and the required characteristic combination of the Internet of Things device is integrated in the SDK in the form of a static characteristic library.
[0140] S1024, modifying the link script in the Internet of Things device.
[0141] In one embodiment of the present application, a linker script (file suffixed with "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, specifying how the code segments in the input file are placed in the output file, and controlling the layout of the various sections in the output file within 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 SDK's feature interface.
[0143] In one embodiment of the present application, a feature interface is adapted based on a reference sample code (demo). The second electronic device pre-stores the reference sample code, which is a sample code that already implements basic functions. Based on the reference sample code, the interface is modified or expanded so that the interface meets the characteristics of the corresponding service feature. After the feature interface is adapted, the firmware can access the features 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 IoT device firmware into executable target code files. During the compilation phase, the compiler translates the source code into machine code or intermediate code specific to the target platform. Furthermore, the compiler performs lexical, syntactic, and semantic analysis on the source code to generate the 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. During the linking phase, the linker resolves symbol references in different target files into actual addresses and resolves duplicate symbol definitions and dependencies. The linker also combines the code and data segments in the target files into the final memory layout and generates the executable file.
[0147] S1027: Debug 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 implemented by running the executable file.
[0149] The above embodiments of the present application enable an Internet of Things device manufacturer to customize the static characteristic library of the SDK through the second electronic device, enhance the adaptability of the SDK to the Internet of Things device and its firmware, and improve the data interaction efficiency between the Internet of Things device and the opposite device.
[0150] Referring to Figure 10 As shown in the figure, the flowchart of modifying the linking script in the Internet of Things device is provided in an embodiment of the present application.
[0151] S201, an automatic modification script in the SDK is obtained, and the chip platform parameter information of the Internet of Things device and the SDK identifier insertion position are configured in the automatic modification script.
[0152] In an embodiment of the present application, the automatic modification script in the SDK is obtained and run, and the configuration of the chip platform parameter information of the Internet of Things device and the SDK identifier insertion position is modified in the automatic modification script. The chip platform parameter information includes the chip bit number, such as 32 bits, 64 bits, etc., and the SDK identifier data can be aligned with the linking script according to the chip bit number, so as to determine the insertion position of the SDK identifier in the linking script. The SDK identifier includes the initialization entry identifier, the initialization exit identifier, the deinitialization entry identifier, and the deinitialization exit identifier of the configurable module, and 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, the original linking script of the chip platform is imported into the automatic modification script.
[0154] In an embodiment of the present application, the path input bar of the original linking script is included in the automatic modification script, and the original linking script can be imported by inputting the storage path of the original linking script in the path input bar.
[0155] S203, the automatic modification script is run, and the SDK identifier is inserted into the original linking script according to the SDK identifier insertion position through the automatic modification script, so as to obtain the modified linking script.
[0156] In an embodiment of the present application, after the original linking script of the chip platform is imported, the automatic modification script is run, the initialization entry identifier is inserted into the initialization address of the configurable module in the original linking script, and the initialization exit identifier is inserted into the deinitialization address of the configurable module in the original linking script, so as to modify the original linking script and obtain the modified linking script.
[0157] S204, the modified linking script is applied.
[0158] In an embodiment of the present application, in the running stage of the SDK, the application modifies the linking script, determines the position of the SDK identifier, finds the configurable module in the SDK according to the position of the SDK identifier, and initializes the configurable module.
[0159] In another embodiment of the present application, the second electronic device can directly open the original linking script of the chip platform and modify the original linking script without running the automatic modification script in the SDK, and inserts the SDK identifier into the original linking script according to the insertion position of the SDK identifier.
[0160] The above embodiments of the present application modify the linking script, add a custom symbol in the linking script, so that the feature module (or configurable module) in the static feature library of the SDK can be added by using the self-registration mechanism. In addition, the SDK provides a script for automatically adding the symbol for the Internet of Things device manufacturers to use, which facilitates the manufacturers to quickly modify the linking script.
[0161] S103, running the SDK and initializing the SDK.
[0162] Referring to FIG. 3, Figure 11 FIG. 3 is a flowchart of the running process of the SDK provided by an embodiment of the present application. S301, the second electronic device runs the SDK by running the firmware, and after the firmware is run, the SDK is initialized; S302, the SDK is initialized with configuration parameters; S303, the SDK is initialized with a basic framework and a basic service; S304, the SDK is initialized with a configurable module; S305, the firmware creates a processing thread, and sends a to-be-processed event or a service processing request to the SDK, for example, the to-be-processed event includes message reporting, service request, message receiving, 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 to-be-processed event to a message processing mapping table; S308, the message processing method of the message of the to-be-processed event is obtained from the message processing mapping table, and the to-be-processed event is processed by using the message processing method, for example, processing message reporting, processing service request, processing timing event, etc.; S309, when the firmware is closed, the SDK is de-initialized; S310, the SDK is de-initialized with the configurable module; S311, the SDK is de-initialized with the basic framework and the basic service.
[0163] In an embodiment of the present application, in 304, the SDK initializes the configurable framework module, the configurable common service module and the 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, the configurable common service module and the configurable framework module between the deinitialization entry identifier and the deinitialization exit identifier by traversing the deinitialization method table.
[0164] Referring to Figure 12 FIG. 2 shows a flowchart of configuration parameter initialization provided by an embodiment of the present application. In an embodiment of the present application, the 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, thereby generating the characteristic static parameters. For example, the SDK initialization configuration includes the configuration of the characteristic parameters such as the Bluetooth transmission rate and the interval time of sending data.
[0165] In an embodiment of the present application, as shown in Figure 6 The basic framework of the SDK includes the linked list, the message queue, the security function, the serialization, the channel management, the ring buffer, the timer and the CRC check, and the basic service of the SDK includes the data security management, the proximity discovery, the reconnection pop-up window, the device management, the device authentication, the protocol analysis and the common service module.
[0166] In an embodiment of the present application, the configurable module includes the configurable framework module, the configurable common service module and the configurable specific service module, and the configurable framework module, the configurable common service module and the configurable specific service module can further include the corresponding sub-modules, and the configurable module initialization includes the configurable framework module initialization, the configurable common service module initialization and the configurable specific service module initialization.
[0167] Referring to Figure 13 FIG. 4 shows a schematic diagram of the self-registration mechanism of the configurable module provided by an embodiment of the present application. The self-registration mechanism refers to that the initialization method does not need to be called explicitly, but only needs to be declared at the initialization method definition by a predetermined way, and the initialization method will be executed in the SDK running process. The self-registration mechanism of the SDK uses the custom symbol segment, places the methods that need to be called in the running time into the segment, forms a method table, and traverses the method table in the SDK running process, and calls the functions in the method table, thereby achieving 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 achieved 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 for the configurable modules, which records the initialization priority of the configurable modules. For example, the configurable framework module has the highest initialization priority, the configurable public service module has the second highest initialization priority, and the configurable specific service module has the lowest initialization priority. The initialization priorities of multiple submodules in each configurable module can be the same, or corresponding initialization priorities can be set in the initialization entry identifier as required.
[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 Figure 14 As shown, it is a flowchart of module initialization provided by an 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: Create a service for each configurable module.
[0175] In an embodiment of the present application, a service interface is defined to determine the functions and methods provided by each configurable module; the service interface is implemented by writing a class; the service is registered in a link script through the service interface, and a service instance is created, thereby completing the creation of the service.
[0176] S403, adding the message processing method of each configurable module to the message processing mapping table.
[0177] Referring to Figure 15 FIG. 4 shows a flowchart of adding the message processing method of a module to a message processing mapping table according to 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 an embodiment of the present application, the protocol instruction is a set of instructions or protocols that specify the communication mode and data exchange format between configurable modules, including command format, data format, communication flow, error handling mode, security specification, version management, etc. Each feature module processes a message by executing the protocol instruction. The ID of the protocol instruction is a unique identifier of the protocol instruction, used to identify different protocol instructions. The message processing method is a specific operation performed by the configurable module when a specific protocol instruction is received, such as instruction parsing, business logic execution, error handling, response generation, communication, etc.
[0180] S4032, converting the ID of each protocol instruction into an index value.
[0181] In an embodiment of the present application, each protocol instruction of a module is registered in the message processing mapping table. 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 an embodiment of the present application, the message processing mapping table is a hash table used to store the mapping table of the ID of the protocol instruction and the corresponding message processing method. The index value of the protocol instruction and the key value pair of the corresponding message processing method are established, the key value pair is inserted in the message processing mapping table, thereby adding the message processing method of each protocol instruction to the message processing mapping table.
[0184] S4034, determining 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 flow ends; if any protocol instruction has not been added to the message processing mapping table, the flow returns to execute S4032.
[0185] The above embodiment of the present application adds the message processing method of the protocol instruction into the message processing mapping table by using the hash algorithm, reduces the traversal complexity of the message processing method, and improves the running efficiency of the SDK.
[0186] Referring to Figure 16 As shown in the figure, the flow chart is provided for adding the message processing method of the module into the message processing mapping table according to another embodiment of the present application.
[0187] S4035, the ID of each protocol instruction of the configurable module is taken as the index value.
[0188] In an embodiment of the present application, all the protocol instructions and the corresponding message processing methods of the characteristic module are registered into the message processing mapping table. First, the ID of each protocol instruction is determined as the index value.
[0189] S4036, the message processing methods of all the protocol instructions in the configurable module are added into the message processing mapping table.
[0190] In an embodiment of the present application, the index value of the protocol instruction and the key value of the corresponding message processing method are established, all the key value pairs are inserted into the message processing mapping table, thereby adding the message processing methods of all the protocol instructions in the configurable module into the message processing mapping table.
[0191] S104, the SDK is applied to process the business.
[0192] In an embodiment of the present application, the firmware creates the processing thread of the SDK, and sends the 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 by the message processing method obtained by the traversal. For example, the business processing request includes message reporting, service request, message receiving, etc.
[0193] In an embodiment of the present application, the method further includes: when the SDK is closed, the SDK is de-initialized. The de-initialization of the SDK includes the de-initialization of the configurable module, the de-initialization of the basic framework and the de-initialization of the basic service. As shown in the figure, the de-initialization entry identifier includes the de-initialization method table of the configurable module, and records the de-initialization priority of the configurable module. The de-initialization priority of the configurable module is opposite to the initialization priority. Figure 11
[0194] Referring to Figure 17 As shown in the figure, the flow chart is provided for adding the message processing method of the module into the message processing mapping table according to another 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 comprises decoupling the plurality of configurable modules in the SDK.
[0197] In an embodiment of the present application, the plurality of configurable modules in the SDK are decoupled through a registration public service mechanism. Refer to Figure 18 As shown in the figure, the registration public service mechanism provided by an embodiment of the present application is a schematic diagram. The service of a second business module (for example, business module A in the figure) associated with a first business module (for example, business module B in the figure) is registered to a public service module, and the first business module obtains the service of the second business module from the public service module at runtime. Wherein, the association between the first business module and the second business module means that the first business module has a strong dependency relationship with the second business module, and in the case of not being decoupled, the service of the first business module needs to be connected with the second business module to be implemented. Through the registration public service mechanism, the service of the first business module can also be implemented without being connected with the second business module.
[0198] In an embodiment of the present application, the plurality of configurable modules in the SDK are decoupled through a Weak mechanism. Refer to Figure 19 As shown in the figure, the Weak mechanism provided by an embodiment of the present application is a schematic diagram. The Weak method module establishes a weak reference between the first business module and the second business module associated with the first business module. The first business module calls the Weak method of the Weak method module to execute the weak implementation at runtime. The Weak method module can also execute the strong implementation from the second business module by linking the Weak method. The Weak mechanism allows one module to reference the object of another module through weak reference or weak pointer, but does not increase the reference count of the object, thereby avoiding the problem of circular reference and realizing the decoupling between modules.
[0199] Through the above embodiments of the present application, the plurality of configurable modules in the SDK are fully decoupled, so that the business layer of the SDK is reasonable, and the maintainability and scalability of the SDK are enhanced.
[0200] In another embodiment of the present application, the feature configuration can also be performed by the first electronic device. Refer to Figure 20 As shown in the figure, the flowchart of constructing the SDK provided by another embodiment of the present application is a schematic diagram.
[0201] S601, obtaining the device form, feature set and chip platform information of the Internet of Things device.
[0202] S602, determining whether the chip platform of the Internet of Things device is a newly added chip platform according to the chip platform information. If the chip platform of the Internet of Things device is a newly added chip platform, the process proceeds to S603; if the chip platform of the Internet of Things device is not a newly added chip platform, the process proceeds to S607.
[0203] S603, adding a cross-compile chain of the chip platform.
[0204] S604, adding a compilation option of the chip platform to a build file of the SDK.
[0205] S605, adding configuration information of the chip platform.
[0206] S606, establishing an association between the cross-compile chain and the build file of the chip platform, and establishing an association between the chip platform and the device form.
[0207] S607, determining 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 proceeds to S608; if the characteristic configuration of the device form does not need to be updated, the process proceeds to S610.
[0208] S608, running a configuration tool to configure and apply the characteristics of the device form.
[0209] S609, updating a characteristic configuration file of the device form.
[0210] S610, customizing the SDK.
[0211] S611, determining a general build script of the SDK corresponding to the chip platform, executing the general build script of the SDK on the build file, and obtaining the SDK of the Internet of Things device.
[0212] Referring to Figure 21 FIG. 7 shows a flowchart of a process of customizing the SDK according to an embodiment of the present application.
[0213] S701, determining whether a characteristic customization request sent by the second electronic device is received. If the characteristic customization request sent by the second electronic device is received, the process proceeds to S702; if the characteristic customization request sent by the second electronic device is not received, the process ends.
[0214] In an embodiment of the present application, it is determined whether the characteristic customization request is contained in the SDK build request sent by the second electronic device. If the characteristic customization request is contained in the SDK build request sent by the second electronic device, it indicates that the Internet of Things device manufacturer has a demand for customizing the SDK.
[0215] S702, running a configuration tool, importing a characteristic requirement list of the Internet of Things device manufacturer, and configuring a characteristic combination required by the Internet of Things device.
[0216] S703, modifying the feature switch and the static parameter configuration according to the requirement of the Internet of Things device manufacturer.
[0217] S704, generating a feature configuration file corresponding to the Internet of Things device according to the modified feature switch and the static parameter configuration of the feature.
[0218] Referring to Figure 22 Fig. 1 shows a flowchart of the firmware integrated linkage SDK provided by another embodiment of the present application.
[0219] S801, adding the SDK to the firmware of the Internet of Things device.
[0220] In an embodiment of the present application, the SDK is copied into the directory structure of the firmware, so as to add the SDK to the firmware of the Internet of Things device.
[0221] S802, modifying the linkage script in the Internet of Things device.
[0222] S803, adapting the feature interface of the SDK.
[0223] S804, compiling and linking the firmware of the Internet of Things device to generate an executable file.
[0224] S805, running and debugging the executable file.
[0225] Referring to Figure 23 Fig. 2 shows a whole flowchart of the software configuration method provided by an embodiment of the present application.
[0226] The hardware device manufacturer (the manufacturer of the device connected with the Internet of Things device) constructs the SDK through the first electronic device, compiles the constructed SDK, sets the device form and chip platform of the Internet of Things device, and sends the constructed SDK to the second electronic device of the Internet of Things device manufacturer. For example, the constructed SDK contains all supported feature library sets, including the basic feature library, the music application library, the alarm clock application library, the watch face application library, the weather application library, etc. The second electronic device of the Internet of Things device manufacturer executes the firmware integrated linkage SDK, configures the SDK, checks the required feature libraries, for example, the required feature libraries include the basic feature library, the music application library, the alarm clock application library, the watch face application library. The linkage SDK includes modifying the linkage script, inserting the identifier, and linking the file. After the firmware integrated linkage SDK is completed, the SDK running flow is executed, and in the running stage of the SDK, the feature parameters are configured, and the SDK initialization is performed, including the initialization of each configurable module.
[0227] Referring to Figure 24 Fig. 3 shows a flowchart of the cloud constructed SDK provided by an embodiment of the present application.
[0228] The IoT device vendor uploads the chip platform information to the cloud server through the second electronic device, selects the device form and the required characteristic information, and the cloud generates platform configuration information and vendor configuration information, and checks the platform configuration information and the vendor configuration information. If the platform configuration information and the vendor configuration information do not pass the check, the cloud sends an error prompt to the second electronic device, and the second electronic device re-submits after checking and correcting. If the platform configuration information and the vendor configuration information pass the check, the latest version of the SDK is obtained, the platform configuration information and the vendor configuration information are loaded to the SDK build system, the SDK build system builds the SDK corresponding to the chip platform, the device form and the vendor, judges whether the SDK is successfully built, and if the SDK is successfully built, the SDK is released for the second electronic device to download. If the SDK is not successfully built, an error checking script is run to determine the error cause and generate and release an error report for the second electronic device to download and view. The above embodiments of the present application can realize the automatic construction of the SDK in the cloud server.
[0229] Referring to Figure 25 Fig. 2 shows a flowchart of the second electronic device accessing the SDK of the first electronic device according to an embodiment of the present application.
[0230] The second electronic device sends an ecological access request, creates an IoT device product, configures the product function, and provides the chip platform information of the product. It is judged whether the existing SDK has supported the chip platform of the product. If the existing SDK has supported 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 a 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 and linkage of the SDK. The first electronic device and the second electronic device perform joint debugging verification, solve the joint debugging problem, and after the joint debugging problem is solved, it is determined that the SDK verification is passed. Then, the first electronic device releases the formal version of the SDK, for example, the formal version of the SDK can be released in a gray release manner, test activities and authentication tests are performed, and after the authentication is passed, the SDK is commercially released.
[0231] The embodiment of the present application further provides an electronic device 100, referring to Figure 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, and 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, an in-vehicle device, a smart home device, and / or a smart city device, and the specific type of the electronic device 100 is not specially limited in the embodiments of the present application.
[0232] The electronic device 100 can 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, a headset interface 170D, a sensor module 180, a key 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 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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 can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0234] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (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 can be independent devices or integrated in one or more processors.
[0235] The controller can generate operation control signals according to the instruction operation code and the timing signal, complete the control of fetching and executing instructions.
[0236] The processor 110 can also be provided with a memory for storing instructions and data. In an embodiment of the present application, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are used repeatedly by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0237] In an embodiment of the present application, the processor 110 can include one or more interfaces. The interfaces can 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 an embodiment of the present application, the processor 110 can contain multiple sets of I2C bus. 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 an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and realize the touch function of the electronic device 100.
[0239] The I2S interface can be used for audio communication. In an embodiment of the present application, the processor 110 can contain multiple sets of I2S bus. The processor 110 can be coupled to the audio module 170 through the I2S bus, and realize the communication between the processor 110 and the audio module 170. In an embodiment of the present application, the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, and realize the function of answering the phone through the Bluetooth earphone.
[0240] The PCM interface can also be used for audio communication, which samples, quantizes and encodes analog signals. In an embodiment of the present application, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In an embodiment of the present application, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, and realize the function of answering the phone through the Bluetooth earphone. The I2S interface and the PCM interface can both be used for audio communication.
[0241] The UART interface is a universal serial data bus, which is used 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 an embodiment of the present application, the UART interface is usually 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, and realizes the Bluetooth function. In an embodiment of the present application, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, and realize the function of playing music through the Bluetooth earphone.
[0242] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In an embodiment of the present application, the processor 110 and the camera 193 communicate through the CSI interface to realize the photographing function of the electronic device 100. The processor 110 and the display screen 194 communicate through 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 an embodiment of the present application, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
[0244] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices 100, such as AR devices, and the like.
[0245] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.
[0246] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 while also supplying power to the electronic device 100 through the power management module 141.
[0247] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In some embodiments, the power management module 141 can also be disposed in the processor 110. In some embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0248] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.
[0249] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some embodiments, the antennas can be used in combination with a tuning switch.
[0250] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G and the like applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter, amplify, and the like the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor and radiate the signals as electromagnetic waves through the antenna 1. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the function modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.
[0251] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a microphone 170B, etc.), or displays an image or a video through the display 194. In an embodiment of the present application, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and can be disposed in the same device as the mobile communication module 150 or other functional modules.
[0252] The wireless communication module 160 can provide a wireless communication solution including a wireless local area network (WLAN) (such as a wireless fidelity (Wi-Fi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like, which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification thereon, and radiate the signal as an electromagnetic wave via the antenna 2.
[0253] In an embodiment of the present application, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can 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, etc. The GNSS can include Global Positioning System (GPS), Global Navigation Satellite System (GLONASS), Beidou Navigation Satellite System (BDS), Quasi-Zenith Satellite System (QZSS), and / or Satellite Based Augmentation Systems (SBAS).
[0254] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor configured for software of the Internet of Things device, and is connected with the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations, for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0255] The display screen 194 is configured to display images, videos, and the like. 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 (AMOLED), a Flex Light-Emitting Diode (FLED), a Miniled, a Microled, a Micro-OLED, a Quantum Dot Light Emitting Diodes (QLED), or the like. In an embodiment of the present application, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0256] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.
[0257] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, 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 the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In an embodiment of the present application, the ISP can be arranged in the camera 193.
[0258] The camera 193 is configured 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 light signal into an electrical signal, which is then transmitted to the ISP to convert it 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 a standard RGB, YUV, or the like format image signal. In an embodiment of the present application, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.
[0259] The digital signal processor is used to process digital signals, which can process not only digital image signals but also other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0260] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0261] The NPU is a neural network (Neural-Network, NN) computing processor, which can quickly process input information by learning from the structure of biological neural networks, such as the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognitive applications such as image recognition, face recognition, voice recognition, and text understanding.
[0262] The internal memory 121 can include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0263] The random access memory can 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, such as the fifth generation DDR SDRAM commonly referred to as DDR5 SDRAM), etc.
[0264] The non-volatile memory can include magnetic disk storage devices, flash memories.
[0265] The flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operation principle, Single-Level Cell (SLC), Multi-Level Cell (MLC), Triple-Level Cell (TLC), Quad-Level Cell (QLC), etc. according to the storage unit potential order, and 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 an operating system or other programs running, and can also be used to store data of users and application programs, etc.
[0267] The non-volatile memory can also store executable programs and store data of users and application programs, etc., which can be loaded in advance into the random access memory for direct reading and writing by the processor 110.
[0268] The external memory interface 120 can be used to connect an external non-volatile memory to realize the expansion of 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 realize the data storage function. For example, files such as music and video are saved 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 a plurality of instructions, and when the plurality of instructions are executed by the processor 110, the screen display detection method executed on the electronic device 100 in the above-mentioned embodiments can be implemented to realize the screen display detection function of the electronic device 100.
[0270] The electronic device 100 can realize the audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0271] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In an embodiment of the present application, the audio module 170 can be disposed in the processor 110, or some of the functional modules of the audio module 170 can be disposed in the processor 110.
[0272] The speaker 170A, also referred to as a "loudspeaker", is configured 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 referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.
[0274] The microphone 170C, also referred to as a "microphone", "sound transducer", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by holding the mouth close to the microphone 170C, and input the sound signal into the 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, in addition to collecting sound signals, noise reduction functions can also be realized. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, to realize the collection of sound signals, noise reduction, and also to identify the source of the sound, to realize the function of directional recording, etc.
[0275] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
[0276] The keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs, and generate key signal inputs related to user settings and function control of the electronic device 100.
[0277] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations acting on different regions of the display screen 194. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0278] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.
[0279] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, and N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. The same SIM card interface 195 can simultaneously insert multiple cards. 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 storage cards. The electronic device 100 interacts with a network through the SIM card to realize functions such as calling and data communication. In an embodiment of the present application, the electronic device 100 uses an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100. An embodiment of the present application also provides a computer storage medium, and the computer storage medium stores computer instructions. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the related method steps to realize the software configuration method in the above embodiment.
[0280] An embodiment of the present application also provides a computer program product, which, when executed on a computer, causes the computer to execute the related steps to realize the software configuration method in the above embodiment.
[0281] In addition, an embodiment of the present application also provides a device, which can be a chip, a component or a module. The device can include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device is running, the processor can execute the computer execution instructions stored in the memory to enable the chip to execute the software configuration method in the above method embodiments.
[0282] The electronic device, the computer storage medium, the computer program product or the chip provided in the embodiment are used for executing the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be repeated here.
[0283] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0284] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another device, or some features can be omitted or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0285] The units described as separate components can or can not be physically separate, and the components shown as units can be one physical unit or multiple physical units, that is, can be located in one place or can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0286] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0287] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application or the essential part or all or part of the technical solutions that make contributions to the prior art can be embodied in the form of a software product. The software product is stored in a storage medium and includes a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0288] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions 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 factors, feature sets, and chip platform information for IoT devices; Execute a software development kit SDK general build script on the build file according to the device form, feature set, and chip platform information of the IoT device 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 Internet of Things device through a firmware integration link, and runs the SDK in the Internet of Things device, including: configuring the feature combination required by the Internet of Things device, generating a configuration file based on the required feature combination, linking the SDK to the firmware of the Internet of Things device based on the configuration file, modifying the link script in the Internet of Things device, adapting the feature interface of the SDK, compiling and linking the firmware of the Internet of Things device, and generating an executable file.
2. The software configuration method according to claim 1, wherein: 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; Add 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, wherein: The method further comprises: In response to a request to update the characteristic configuration of the device form, running a configuration tool to configure and apply the characteristics of the device form; Update the feature profile for the device form factor.
4. The software configuration method according to claim 1, wherein: The method further comprises: In response to the feature customization request sent by the second electronic device, running a configuration tool, importing a feature requirement list of the IoT device, and configuring a feature combination required by the IoT device; Modify the feature switches and static parameter configurations of features based on the requirements of the IoT device; Generate a feature configuration file corresponding to the IoT device based on the modified feature switch and the static parameter configuration of the feature.
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 a first electronic device, and integrating the SDK into the firmware of an IoT device through a firmware integration link, including: configuring a feature combination required by the IoT device, generating a configuration file based on the required feature combination, linking the SDK to the firmware of the IoT device based on the configuration file, modifying a link script in the IoT device to adapt a feature interface of the SDK, and compiling and linking the firmware of the IoT device to generate an executable file; Running the SDK and initializing the SDK; Apply the SDK to perform business processing.
6. The software configuration method according to claim 5, wherein: Integrating the SDK into the firmware of the IoT device through a firmware integration link further includes: The executable file is run and debugged.
7. The software configuration method according to claim 6, wherein: Modifying the link script in the IoT device includes: Obtain an automatic modification script in the SDK, and configure 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, thereby obtaining a modified link script; Apply the modified linker script.
8. The software configuration method according to claim 6, wherein: 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, wherein: 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, wherein: Initializing the SDK includes: Create an object of each configurable module of the SDK, create a service for each configurable module, and add a message processing method of each configurable module to a message processing mapping table.
11. The software configuration method according to claim 10, wherein: 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; 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, wherein: 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; Use the ID of each protocol instruction 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, wherein: 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, wherein: The application of the SDK for 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, wherein: The method further comprises: When the SDK is closed, the SDK is deinitialized.
16. The software configuration method according to claim 15, wherein: Deinitializing the SDK includes: Delete the message processing method of each configurable module in the SDK from the message processing mapping table, and delete the service and object of each configurable module.
17. A software configuration method, characterized in that: The method comprises: The first electronic device executes the SDK general build script on the build 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 built by the first electronic device, and integrates the SDK into the firmware of the IoT device through a firmware integration link, including: configuring a feature combination required by the IoT device, generating a configuration file based on the required feature combination, linking the SDK to the firmware of the IoT device based on the configuration file, modifying a link script in the IoT device to adapt the feature interface of the SDK, and compiling and linking the firmware of the IoT device to generate an executable file; The second electronic device runs the SDK, initializes the SDK, and applies the SDK to perform service processing.
18. The software configuration method according to claim 17, wherein: 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 option 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, wherein: 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 characteristics 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, wherein: The method further comprises: The second electronic device runs and debugs the executable file.
21. The software configuration method according to claim 17, wherein: 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, wherein: 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 symbolic 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 configured 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 according to any one of claims 1 to 22.
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 22.
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, the processor of the electronic device executes the software configuration method according to any one of claims 1 to 22.
Citation Information
Patent Citations
Internet of things access method and system, terminal and computer readable storage medium
CN112565029A