A wireless intelligent Internet of Things IoT module SDK adaptation method

By comparing and improving the interface level of the software to be updated to match it with the SDK, the complex problem of existing SDK adaptation methods is solved, and convenient adaptation and reduced maintenance costs are achieved.

CN116737205BActive Publication Date: 2025-02-07SHENZHEN WEIERJIAN TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310743111.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2025-02-07
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

The existing SDK adaptation methods are relatively complex and require additional code to operate, which increases the difficulty and cost of code execution time and subsequent maintenance.

Method used

By obtaining the interface levels of the software to be updated and the SDK, comparing and increasing the interface levels of the software to be updated accordingly, so that it matches the interface levels of the SDK, thereby completing the adaptation. This method does not require additional code.

Benefits of technology

It realizes convenient SDK adaptation, reduces the complexity and execution time of code modification, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737205B_ABST
    Figure CN116737205B_ABST
Patent Text Reader

Abstract

A wireless intelligent Internet of Things (IoT) module SDK adaptation method relates to the field of SDK adaptation; wherein the method comprises: obtaining a first interface level of software to be updated and a second interface level of a first SDK; comparing the first interface level with the second interface level; if the first interface level is smaller than the second interface level, the first interface level is upgraded to the second interface level to complete the adaptation of the software to be updated and the first SDK. The implementation of the technical solution provided by the present application can solve the problem that the SDK adaptation method is relatively complicated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of SDK adaptation, and specifically to a wireless intelligent Internet of Things (IoT) module SDK adaptation method. Background Art

[0002] The Software Development Kit (SDK) is an essential tool for developing Android applications. It contains the application programming interface (API), tools, documents and other resources required by the application, helping developers to develop Android applications more quickly and conveniently.

[0003] Generally speaking, if the interface version of the SDK is consistent with the interface version of the application, the application can call the SDK through the interface and use the SDK's functions; but if they are inconsistent, the SDK's functions cannot be used, that is, the SDK is incompatible; at this time, the staff needs to adapt the SDK or the application, such as dynamically calling the functions in the SDK through the reflection mechanism when the application is running, but this method requires additional code to obtain methods and classes, perform exception handling, and perform type conversion. Furthermore, these operations will increase the execution time of the code and increase the difficulty and cost of subsequent maintenance. That is, the existing SDK adaptation method is relatively complicated.

[0004] Therefore, there is an urgent need for a wireless intelligent Internet of Things IoT module SDK adaptation method. Summary of the invention

[0005] The present application provides a wireless intelligent Internet of Things (IoT) module SDK adaptation method, which can solve the problem that the SDK adaptation method is relatively complicated.

[0006] In the first aspect, the present application provides a wireless intelligent Internet of Things (IoT) module SDK adaptation method, which is applied to a server. The method includes: obtaining a first interface level of the software to be updated and a second interface level of the first SDK; comparing the first interface level with the second interface level; if the first interface level is smaller than the second interface level, upgrading the first interface level to the second interface level to complete the adaptation of the software to be updated and the first SDK.

[0007] By adopting the above technical solution, when the interface level of the software to be updated is so low that it cannot use the SDK with a higher-level interface, the server can complete the adaptation by increasing the software interface level so that the server can use the SDK; this solution does not require adding additional code, and compared to other SDK adaptation methods, this solution can adapt the SDK in a more convenient way.

[0008] Optionally, upgrading the first interface level to the second interface level specifically includes: modifying the manifest file of the software to be updated so that the interface attribute values ​​in the manifest file are increased to the second interface level; wherein the manifest file includes the interface attributes of the software to be updated.

[0009] By adopting the above technical solution, the server improves the interface level that can be supported by the software to be updated by modifying the manifest file, thereby enabling the server to use the functions in the SDK.

[0010] Optionally, after comparing the sizes of the first interface level and the second interface level, it also includes: if the first interface level is greater than the second interface level, obtaining the third interface level of the second SDK; comparing the sizes of the first interface level and the third interface level; if the first interface level is equal to the third interface level, completing the adaptation of the software to be updated and the second SDK.

[0011] By adopting the above technical solution, when the interface level of the software to be updated is higher than that of the SDK, by obtaining other versions of SDK, when the SDK with the same API level as the software to be updated is obtained, the updated software can use the SDK.

[0012] Optionally, before obtaining the first interface level of the software to be updated and the second interface level of the first SDK, it also includes: obtaining the description document of the first SDK; determining whether the first SDK depends on a third-party library through the description document; if it depends on the third-party library, obtaining information about the third-party library from the description document, the information about the third-party library including the name of the third-party library and the first version information of the third-party library; detecting whether the third-party library exists in the software to be updated; if the third-party library does not exist in the software to be updated, introducing the third-party library into the software to be updated.

[0013] By adopting the above technical solution, it is determined whether the SDK needs resources from a third-party library. If necessary, it is determined whether the software to be updated contains the third-party library. If not, the third-party library is obtained so that the functions of the SDK can be used normally.

[0014] Optionally, after detecting whether there is a third-party library in the software to be updated, it also includes: if there is a third-party library in the software to be updated, obtaining the second version information of the third-party library in the software to be updated; confirming whether the first version information is the same as the second version information; if the first version information is not the same as the second version information, deleting the third-party library corresponding to the second version information; and introducing the third-party library corresponding to the first version information into the software to be updated.

[0015] By adopting the above technical solution, it is determined whether the third-party library in the software to be updated is the latest version. If not, the existing third-party library file is deleted, and the latest version of the third-party library is obtained and introduced so that the SDK functions can be used normally.

[0016] Optionally, obtaining the first interface level of the software to be updated and the second interface level of the first SDK specifically includes: searching the maximum supported SDK version attribute from the core configuration file of the software to be updated to obtain the first interface level of the software to be updated; searching the compilation SDK version attribute from the script build file of the first SDK to obtain the second interface level of the first SDK.

[0017] By adopting the above technical solution, the server obtains the API level information supported by the software to be updated through the core configuration file of the software to be updated, and obtains the API level information supported by the SDK through the script construction file to perform API level comparison.

[0018] Optionally, before modifying the manifest file of the software to be updated, the method further includes: using a permission check function to determine whether the server has permission to modify the manifest file of the software to be updated; if the server does not have permission to modify the manifest file of the software to be updated, obtaining permission to modify the manifest of the software to be updated through a permission function.

[0019] By adopting the above technical solution, the server determines whether it has the modification permission before modifying the manifest file. If not, the server obtains the modification permission through the permission function to smoothly perform SDK adaptation.

[0020] In a second aspect, the present application provides a wireless intelligent Internet of Things IoT module SDK adaptation device, the device is a server, and the server includes an acquisition unit and a processing unit;

[0021] An acquisition unit, used to acquire a first interface level of the software to be updated and a second interface level of the first SDK;

[0022] The processing unit is used to compare the sizes of the first interface level and the second interface level; if the first interface level is smaller than the second interface level, the first interface level is upgraded to the second interface level to complete the adaptation of the software to be updated and the first SDK.

[0023] Optionally, the processing unit is used to modify the manifest file of the software to be updated so that the interface attribute value in the manifest file is increased to the second interface level; wherein the manifest file includes the interface attributes of the software to be updated.

[0024] Optionally, the acquisition unit is used to acquire the third interface level of the second SDK if the first interface level is greater than the second interface level; the processing unit is used to compare the first interface level with the third interface level; if the first interface level is equal to the third interface level, the adaptation of the software to be updated and the second SDK is completed.

[0025] Optionally, the acquisition unit is used to obtain the description document of the first SDK; if it depends on a third-party library, the information of the third-party library is obtained from the description document, and the information of the third-party library includes the name of the third-party library and the first version information of the third-party library; the processing unit is used to determine whether the first SDK depends on the third-party library through the description document; detect whether there is a third-party library in the software to be updated; if there is no third-party library in the software to be updated, introduce the third-party library into the software to be updated.

[0026] Optionally, the acquisition unit is used to obtain the second version information of the third-party library in the software to be updated if there is a third-party library in the software to be updated; the processing unit is used to confirm whether the first version information is the same as the second version information; if the first version information is different from the second version information, the third-party library corresponding to the second version information is deleted; and the third-party library corresponding to the first version information is introduced into the software to be updated.

[0027] Optionally, the acquisition unit is used to search the maximum supported SDK version attribute from the core configuration file of the software to be updated to obtain the first interface level of the software to be updated; search the compilation SDK version attribute from the script build file of the first SDK to obtain the second interface level of the first SDK.

[0028] Optionally, the processing unit is used to use a permission check function to determine whether the server has the permission to modify the manifest file of the software to be updated; the acquisition unit is used to obtain the manifest modification permission of the software to be updated through the permission function if the server does not have the permission to modify the manifest file of the software to be updated.

[0029] In a third aspect, the present application provides an electronic device, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the first aspect above or any possible implementation method of the first aspect.

[0030] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor as in the first aspect or any possible implementation method of the first aspect.

[0031] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0032] 1. When the interface level of the software to be updated is so low that it cannot use an SDK with a higher-level interface, the server can complete the adaptation by increasing the software interface level so that the server can use the SDK. This solution does not require changing too much code or adding additional code. Compared with other SDK adaptation methods, this solution can adapt the SDK in a more convenient way.

[0033] 2. When the interface level of the software to be updated is higher than that of the SDK, by obtaining other versions of SDK, when the SDK with the same API level as the software to be updated is obtained, the updated software can use the SDK.

[0034] 3. Determine whether the SDK needs resources from a third-party library. If necessary, determine whether the software to be updated contains the third-party library. If not, obtain the third-party library so that the SDK functions can be used normally. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of a wireless intelligent Internet of Things (IoT) module SDK adaptation method provided in an embodiment of the present application.

[0036] Figure 2 It is a structural diagram of a wireless intelligent Internet of Things IoT module SDK adapter device disclosed in an embodiment of the present application.

[0037] Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0038] Explanation of the reference numerals: 201, acquisition unit; 202, processing unit; 300, electronic device; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION

[0039] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0040] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0041] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0042] The staff performs adaptation operations on the SDK or application, such as dynamically calling the functions in the SDK through the reflection mechanism when the application is running. However, this method requires additional code to obtain methods and classes, handle exceptions, and perform type conversion. Furthermore, these operations will increase the execution time of the code and increase the difficulty and cost of subsequent maintenance. That is, the existing SDK adaptation method is relatively complicated; therefore, this article provides a wireless intelligent Internet of Things IoT module SDK adaptation method.

[0043] The wireless intelligent Internet of Things IoT module SDK adaptation method provided in this application can be referenced Figure 1 , Figure 1 This is a flow chart of a wireless intelligent Internet of Things IoT module SDK adaptation method provided in an embodiment of the present application, which is applied to a server. The present application embodiment specifically takes a terminal device with an Android operating system installed, and the application software on the terminal device uses SDK for updating and development as an example, and the terminal device is the server. The method includes steps S101 to S103.

[0044] S101: Acquire a first interface level of software to be updated and a second interface level of a first SDK.

[0045] In the above steps, the server obtains the supportable interface level of the software to be updated and the interface level of the SDK to be used; in the application, different levels of interfaces (i.e., APIs) provide different degrees of abstraction and encapsulation, so that developers can more conveniently use these APIs to implement specific functions, so different applications have different interface levels, that is, it is necessary to obtain the first interface level of the software to be updated; in the SDK, the interface is also classified according to the different levels of abstraction and complexity of the SDK, so different SDKs have different interface levels, that is, it is necessary to obtain the second interface level of the SDK.

[0046] For example, the server obtains that the interface level of the software to be updated is 8, and the interface level of the SDK to be used is 12.

[0047] In a possible implementation, before step S101, obtain the description document of the first SDK; determine whether the first SDK depends on a third-party library through the description document; if it does, obtain information about the third-party library from the description document, the information about the third-party library including the name of the third-party library and the first version information of the third-party library; detect whether the third-party library exists in the software to be updated; if the third-party library does not exist in the software to be updated, introduce the third-party library into the software to be updated.

[0048] Specifically, the server can obtain the SDK's instruction document from the SDK's official website details page, and can also download the SDK's document package, which includes the SDK's user guide, i.e., the instruction document; after obtaining the instruction document, search for keywords such as dependencies, references, and related libraries in the document, obtain text information near the keywords, and then match the text information with the existing SDK directory library. If the match is successful, the third-party library that the SDK specifically depends on and the version information of the third-party library can be obtained. If the match fails, it is determined that the SDK does not depend on the third-party library, and the interface-level acquisition step can be started; of course, there are other ways for the server to determine whether the SDK depends on a third-party library, such as analyzing and judging the SDK's source code through a static code analyzer or a dependency analysis tool, which can also achieve the effect of automatically detecting the third-party libraries that the SDK depends on.

[0049] After determining that the SDK depends on a third-party library and obtaining the information of the third-party library, the server uses an open source software scanning tool, such as Black Duck or FOSSology, to determine whether the software file to be updated contains the third-party library, and determines whether the third-party library version is consistent with the version recorded in the SDK documentation; if it is included, the interface level acquisition step can be started; if not, the third-party library is downloaded and obtained according to the information of the third-party library, and the introduction relationship of the third-party library is established.

[0050] In the above example, the description document is obtained from the official website of the SDK to be used, the keyword "related library" in the description document is retrieved, and the text within 50 bytes near the keyword "related library" is obtained to match it with the SDK directory library prepared in advance. It is matched that the SDK depends on the Gson library. The Gson library is a JSON parsing library for Java applications. It can convert JSON data into Java objects to facilitate application processing. According to the description document, it is obtained that the SDK depends on version 2.0 of the Gson library; in another case, that is, the case where the SDK does not match a third-party library, the interface level acquisition step is started; then the case of dependence on a third-party library is discussed: use the FOSSology tool to retrieve whether the software file to be updated contains the Gson library. If not, download the Gson library with version 2.0 on the Gson library website, and establish a reference relationship of the Gson library in the file of the software to be updated so that the SDK can call the Gson library.

[0051] In a possible implementation, after detecting whether there is a third-party library in the software to be updated, if there is a third-party library in the software to be updated, obtain the second version information of the third-party library in the software to be updated; confirm whether the first version information is the same as the second version information; if the first version information is not the same as the second version information, delete the third-party library corresponding to the second version information; and introduce the third-party library corresponding to the first version information into the software to be updated.

[0052] Specifically, if the software to be updated already contains a third-party library, check the metadata file in the third-party library data, which contains the version information of the third-party library; if the version information is consistent with the version information recorded in the SDK description document, it means that the software to be updated has introduced a third-party library that meets the SDK requirements, and perform the above-mentioned S101 step; if the version information is inconsistent with the version information recorded in the SDK description document, first delete the original third-party library reference relationship and data, and then download it from the third-party library official website according to the third-party library information recorded in the SDK description document, and establish the introduction relationship of the third-party library.

[0053] In the above example, the server uses the FOSSology tool to search whether the software file to be updated contains the Gson library, and then obtains that the software to be updated already contains the Gson library. Then it checks the metadata file of the existing Gson library and obtains the version information of the referenced Gson library, which is 1.5, which is inconsistent with the version 2.0 recorded in the SDK description document. The reference relationship and data of the Gson library of version 1.5 are deleted, and the Gson library of version 2.0 is downloaded from the official website of the Gson library and a reference relationship of the Gson library is established.

[0054] In a possible implementation, step S101 specifically includes: searching for the maximum supported SDK version attribute from the core configuration file of the software to be updated to obtain the first interface level of the software to be updated; searching for the compilation SDK version attribute from the script build file of the first SDK to obtain the second interface level of the first SDK.

[0055] Specifically, find the android:maxSdkVersion attribute of the core configuration file of the software to be updated (i.e., the AndroidManifest.xml file) to obtain the maximum supported SDK level of the software to be updated, i.e., the first interface level mentioned above. The maximum supported SDK version attribute is the android:maxSdkVersion attribute; obtain the SDK interface level, i.e., the second interface level, from the android:targetSdkVersion attribute of the script build file (i.e., the build.gradle file) of the SDK file.

[0056] S102: Compare the first interface level with the second interface level.

[0057] In the above steps, the interface level supported by the software to be updated is compared with the interface level of the SDK.

[0058] In a possible implementation, after step S102, if the first interface level is greater than the second interface level, the third interface level of the second SDK is obtained; the sizes of the first interface level and the third interface level are compared; if the first interface level is equal to the third interface level, the adaptation of the software to be updated and the second SDK is completed.

[0059] Specifically, if after comparing the interface levels, the interface level of the software to be updated is higher than that of the SDK, considering that the SDK version is relatively low, there may be a new version on the official website, and the new version of the SDK may add new functions or correct errors in the previous version. Therefore, when the SDK version is relatively low, the latest version of the SDK is downloaded from the SDK official website; but the interface level of the downloaded new version of the SDK may change, so the method considers the situation that the interface level of the new version of the SDK is equal to the interface level of the software to be updated, in which case the software to be updated can be used normally and smoothly; when the interface level of the new version of the SDK is greater than that of the software to be updated, S101 to S103 can be performed to adapt the SDK; when the interface of the new version of the SDK is still smaller than that of the software to be updated, it means that the SDK only needs a lower interface level to be used, and because in the Android system, the interface level can be backward compatible, so in this case, the software to be updated can use the SDK, and then the new version of the SDK is no longer repeatedly obtained, otherwise it will cause the situation of constantly obtaining the new version, and this situation can be prevented by limiting the number of times the new SDK version is obtained. Of course, there are other methods, which are not limited here.

[0060] For example, the SDK interface level obtained is 8, and the interface level of the software to be updated is 12. After comparison, the latest version of the SDK is obtained from the SDK official website. The interface level of the latest version of the SDK is 12, which is equal to the interface level of the software to be updated. Then the software to be updated can use the new version of the SDK.

[0061] S103: If the first interface level is lower than the second interface level, the first interface level is upgraded to the second interface level to complete the adaptation between the software to be updated and the first SDK.

[0062] In the above steps, when the interface level of the software to be updated is lower than the interface level of the SDK, the manifest file of the software to be updated is modified to increase the maximum SDK level supported by the software to be updated so as to use an SDK with a higher interface level.

[0063] In a possible implementation, in step S103, the first interface level is upgraded to the second interface level, which specifically includes: modifying the manifest file of the software to be updated so that the interface attribute value in the manifest file is increased to the second interface level; wherein the manifest file includes the interface attributes of the software to be updated.

[0064] Specifically, the interface level of the software to be updated can be improved by following the following steps: modify the AndroidManifest.xml file (i.e., manifest file) of the software to be updated, modify the maxSdkVersion attribute and targetSdkVersion attribute of the uses-sdk tag to the API level required by the SDK to be used, and then modify some code so that the software to be updated can use the SDK file with a high-level interface.

[0065] In a possible implementation, before modifying the manifest file of the software to be updated, a permission check function is used to determine whether the server has permission to modify the manifest file of the software to be updated; if the server does not have permission to modify the manifest file of the software to be updated, the permission to modify the manifest of the software to be updated is obtained through the permission function.

[0066] Specifically, before modifying the manifest file, you also need to check whether you have the permission to modify it, specifically: use the ContextCompat.checkSelfPermission() method (that is, check through the permission function method) to check whether the application has been granted WRITE_EXTERNAL_STORAGE (write permission) permission or READ_EXTERNAL_STORAGE (read permission) permission. If the application has obtained the corresponding permission, the method will return PackageManager.PERMISSION_GRANTED, otherwise it will return PackageManager.PERMISSION_DENIED. The purpose of the judgment is to avoid file reading and writing operations without obtaining permission, which may cause the application to be abnormal or crash; if the application does not obtain the corresponding permission, you can use the ActivityCompat.requestPermissions() method (that is, obtain it through the permission function) to request permission to obtain permission to modify the contents of the manifest file.

[0067] The present application also provides a wireless intelligent Internet of Things IoT module SDK adapter device, which includes an acquisition unit 201 and a processing unit 202, referring to Figure 2 .

[0068] An acquisition unit 201 is used to acquire a first interface level of the software to be updated and a second interface level of the first SDK;

[0069] The processing unit 202 is used to compare the first interface level with the second interface level; if the first interface level is smaller than the second interface level, the first interface level is upgraded to the second interface level to complete the adaptation of the software to be updated and the first SDK.

[0070] In a possible implementation, the processing unit 202 is configured to modify the manifest file of the software to be updated so that the interface attribute value in the manifest file is increased to the second interface level; wherein the manifest file includes the interface attributes of the software to be updated.

[0071] In one possible implementation, the acquisition unit 201 is used to acquire the third interface level of the second SDK if the first interface level is greater than the second interface level; the processing unit 202 is used to compare the first interface level with the third interface level; if the first interface level is equal to the third interface level, the adaptation of the software to be updated and the second SDK is completed.

[0072] In one possible implementation, the acquisition unit 201 is used to obtain the description document of the first SDK; if it depends on a third-party library, the information of the third-party library is obtained from the description document, and the information of the third-party library includes the name of the third-party library and the first version information of the third-party library; the processing unit 202 is used to determine whether the first SDK depends on the third-party library through the description document; detect whether there is a third-party library in the software to be updated; if there is no third-party library in the software to be updated, introduce the third-party library into the software to be updated.

[0073] In one possible implementation, the acquisition unit 201 is used to obtain the second version information of the third-party library in the software to be updated if there is a third-party library in the software to be updated; the processing unit 202 is used to confirm whether the first version information is the same as the second version information; if the first version information is not the same as the second version information, the third-party library corresponding to the second version information is deleted; and the third-party library corresponding to the first version information is introduced into the software to be updated.

[0074] In a possible implementation, the acquisition unit 201 is used to search for the maximum supported SDK version attribute from the core configuration file of the software to be updated to obtain the first interface level of the software to be updated; and search for the compilation SDK version attribute from the script build file of the first SDK to obtain the second interface level of the first SDK.

[0075] In one possible implementation, the processing unit 202 is used to use a permission check function to determine whether the server has the permission to modify the manifest file of the software to be updated; the acquisition unit 201 is used to obtain the manifest modification permission of the software to be updated through the permission function if the server does not have the permission to modify the manifest file of the software to be updated.

[0076] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0077] The present application also discloses a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to perform the SDK adaptation method disclosed in the above specification.

[0078] The present application also discloses an electronic device. Figure 3 , Figure 3 The electronic device 300 may include: at least one processor 301 , at least one communication bus 302 , at least one user interface 303 , a network interface 304 , and a memory 305 .

[0079] The communication bus 302 is used to realize the connection and communication between these components.

[0080] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0081] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0082] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0083] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be optionally at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module and an SDK adaptation application.

[0084] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the SDK adapter application stored in the memory 305. When executed by one or more processors 301, the electronic device 300 executes one or more methods in the above-mentioned embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0085] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0086] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0087] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0088] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0089] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0090] The above are only exemplary embodiments of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other embodiments of the present disclosure.

[0091] This application is intended to cover any variation, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art not described in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A wireless intelligent Internet of Things IoT module SDK adaptation method, characterized in that: Applied to a server, the method comprises: Acquire the first interface level of the software to be updated and the second interface level of the first SDK; the acquiring of the first interface level of the software to be updated and the second interface level of the first SDK specifically includes searching for the maximum supported SDK version attribute from the core configuration file of the software to be updated to acquire the first interface level of the software to be updated; searching for the compilation SDK version attribute from the script construction file of the first SDK to acquire the second interface level of the first SDK; and comparing the sizes of the first interface level and the second interface level; If the first interface level is lower than the second interface level, the first interface level is upgraded to the second interface level, wherein the upgrading of the first interface level to the second interface level specifically includes: modifying the manifest file of the software to be updated so that the interface attribute values ​​in the manifest file are increased to the second interface level; wherein the manifest file includes the interface attributes of the software to be updated; so as to complete the adaptation of the software to be updated with the first SDK.

2. The method according to claim 1, characterized in that After comparing the first interface level with the second interface level, the method further includes: If the first interface level is greater than the second interface level, obtaining the third interface level of the second SDK; Comparing the sizes of the first interface level and the third interface level; If the first interface level is equal to the third interface level, the adaptation of the software to be updated and the second SDK is completed.

3. The method according to claim 1, characterized in that Before obtaining the first interface level of the software to be updated and the second interface level of the first SDK, the method further includes: Get the documentation of the first SDK; Determine whether the first SDK depends on a third-party library through the description document; If the third-party library is relied upon, information about the third-party library is obtained from the description document, where the information about the third-party library includes the name of the third-party library and first version information of the third-party library; Detecting whether the third-party library exists in the software to be updated; If the third-party library does not exist in the software to be updated, the third-party library is introduced into the software to be updated.

4. The method according to claim 3, characterized in that After detecting whether the third-party library exists in the software to be updated, the method further includes: If the third-party library exists in the software to be updated, obtaining second version information of the third-party library in the software to be updated; confirming whether the first version information is the same as the second version information; If the first version information is different from the second version information, deleting the third-party library corresponding to the second version information; A third-party library corresponding to the first version information is introduced into the software to be updated.

5. The method according to claim 1, characterized in that: Before modifying the list file of the software to be updated, the method further includes: Use a permission check function to determine whether the server has permission to modify the manifest file of the software to be updated; If the server does not have the permission to modify the manifest file of the software to be updated, the server obtains the permission to modify the manifest file of the software to be updated through a permission function.

6. A wireless intelligent Internet of Things IoT module SDK adapter, characterized in that: The device is a server, and the server comprises an acquisition unit (201) and a processing unit (202): the acquisition unit (201) is used to acquire a first interface level of the software to be updated and a second interface level of the first SDK; the acquisition of the first interface level of the software to be updated and the second interface level of the first SDK specifically comprises searching for a maximum supported SDK version attribute from a core configuration file of the software to be updated to acquire the first interface level of the software to be updated; searching for a compilation SDK version attribute from a script construction file of the first SDK to acquire the second interface level of the first SDK; The processing unit (202) is used to compare the first interface level with the second interface level; if the first interface level is smaller than the second interface level, the first interface level is upgraded to the second interface level, wherein the upgrading of the first interface level to the second interface level specifically comprises: modifying the list file of the software to be updated so that the interface attribute value in the list file is increased to the second interface level; wherein the list file includes the interface attribute of the software to be updated; To complete the adaptation of the software to be updated and the first SDK.

7. An electronic device, characterized in that: The electronic device (300) comprises a processor (301), a memory (305), a user interface (303) and a network interface (304), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device (300) executes the method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Software development kit calling method and device, electronic equipment and computer readable storage medium

    CN113934438A