Disclosure of Invention
The invention aims to provide a method for realizing compatibility of Internet of things equipment with multiple modules, which can realize that a user provides data of application scenes of different communication modules for third-party software under the condition of not configuring an entity communication module, and is beneficial to design of a display page, test of a use scene and the like of the third-party software according to the Internet of things equipment; meanwhile, the invention also discloses a system based on the method.
The problem that the application program is frequently updated when a new module is added or a supported module is maintained is solved, and the software scheme is required to have enough expandability; the software solution also requires sufficient compatibility due to the need to support as many modules as possible. Manual operations are reduced when a new module is supported, and the software scheme needs to be sufficiently automated and simplified.
There are requirements that do not necessarily require debugging and testing through physical modules when iterating modular applications. In order to solve the problem of frequently disassembling the device and replacing the module unnecessarily, the software scheme needs to provide a virtualized module, and the virtualized module appears to the device to have part of the functions of the physical module, such as obtaining the basic information, network status, signal strength, etc. of the module through the virtual module.
In addition, the software scheme also needs remote deployment and local deployment, provides an operation page and an information display page.
In order to achieve the purpose, the invention provides the following technical scheme: a method for realizing compatibility of multiple modules for Internet of things equipment comprises the following steps:
step 1: the method comprises the steps that client software receives an API calling request of an application program; the client software is loaded on the Internet of things equipment;
step 2: determining an API interface corresponding to the API call request, and acquiring configuration data of a corresponding function of the virtual communication module from server software; the configuration information of the virtual communication module corresponding to the Internet of things equipment is stored in a server in advance, the configuration information comprises a plurality of configuration data, and the configuration data of each function corresponds to the API (application program interface) one by one;
and step 3: and sending the configuration data to the application program through the API interface.
In the method for enabling the internet of things device to be compatible with multiple modules, before the step 1, a module initialization step is further included, and the method includes the following substeps:
substep 11: accessing the cloud platform, determining the type of the configuration information configured by the cloud platform, and if the configuration information configured by the cloud platform is the configuration information of the virtual communication module, performingstep 13; if the configuration information configured by the cloud platform is the configuration information of the entity communication module, performingstep 12;
substep 12: reading configuration information of an entity communication module of the Internet of things equipment and configuration information of an entity communication module of the cloud platform, judging whether the configuration information of the entity communication module of the Internet of things equipment needs to be updated, if so, updating the configuration information of the entity communication module of the Internet of things equipment and initializing the entity communication module, and if not, initializing the entity communication module;
substep 13: and generating a plurality of API interfaces, wherein the API interfaces correspond to configuration data in the configuration information of the entity communication module or the virtual communication module one by one.
In the method for realizing compatibility of the internet of things equipment with the multiple modules, the configuration information of the virtual communication module and the configuration information of the entity communication module stored in the cloud platform are associated with the SN code of the internet of things equipment;
the specific method for pre-storing the configuration information of the virtual communication module corresponding to the Internet of things equipment in the server comprises the following steps:
and the user accesses the cloud platform, searches and configures the configuration information of the virtual communication module according to the SN code of the Internet of things equipment, and stores the configuration information.
In the method for making the internet of things device compatible with the multiple modules, when the application program needs to change the configuration data in the application or test process, the method is implemented by the following steps:
and the user accesses the cloud platform, searches and modifies configuration data in the configuration information of the virtual communication module according to the SN code of the Internet of things equipment, and stores the configuration information.
In the method for the internet of things device to be compatible with the multiple modules, the user accesses the cloud platform through the http protocol, and the client software and the cloud platform as well as the application program and the client software are communicated through the TCP/IP protocol.
In the method for enabling the internet of things equipment to be compatible with the multiple modules, the server is a local server or a cloud platform.
Meanwhile, the invention also discloses a virtual communication module simulation system of the Internet of things equipment, which comprises the Internet of things equipment and a server, wherein the server stores configuration information of the virtual communication module, and the configuration information comprises a plurality of configuration data;
the Internet of things equipment comprises the following modules:
an API interface generation module: the API interface is used for generating and corresponding to the configuration data;
an API call request receiving module: the API calling request is used for receiving the application program;
a configuration data acquisition module: the virtual communication module is used for acquiring configuration data, corresponding to the API call request, of the virtual communication module from the server side according to the API call request;
a data feedback module: for sending configuration data to the application via the API interface.
In the virtual communication module simulation system of the internet of things device, the server includes:
a database: the system comprises a virtual communication module, a network management module and a server, wherein the virtual communication module is used for storing configuration information of the virtual communication module, and the configuration information corresponds to an SN (service number) code of the Internet of things equipment;
a data processing module: and the data acquisition module is used for sending the configuration data in the configuration information to the data acquisition module according to the request of the configuration data acquisition module.
In the virtual communication module simulation system of the internet of things device, the server further includes:
a configuration information modification module: for modifying configuration data contained in the configuration information in the database.
In the virtual communication module simulation system of the internet of things device, the server further includes:
module selection module: the system comprises a physical communication module or a virtual communication module used for setting the use of the Internet of things equipment by a user;
if the Internet of things equipment is set to use the entity communication module, the data feedback module sends configuration data of the entity communication module to client software through an API (application programming interface);
and if the Internet of things equipment is set to use the virtual communication module, the data feedback module sends the configuration data acquired by the configuration data acquisition module to the client software through the API.
Compared with the prior art, the invention has the beneficial effects that:
by the method, when the equipment uses a new module or maintains the used module, the program of the equipment end does not need to be updated, and the equipment can support the new module and maintain the used module only by configuring the new module or modifying the configuration of the used module on the platform, so that the development time is saved, and the development efficiency is improved.
When the debugging and the test do not depend on the requirement of the entity module, the time for disassembling and replacing the module can be reduced by virtue of the virtualization module of the platform, and the consumption of manpower and the consumption of time are reduced.
When the test depends on the requirement of the module environment, the coverage rate of the test can be increased by virtue of the virtualization module of the platform, and frequent mobile equipment is not needed to finish the test.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
As shown in fig. 1, a method for making an internet of things device compatible with multiple modules includes the following steps:
step 1: the method comprises the steps that client software receives an API calling request of an application program; the client software is loaded on the Internet of things equipment;
the application program can be an application program loaded on the Internet of things equipment or an application program which is developed by other manufacturers and loaded on other entities;
the application program communicates with the client software through a TCP/IP protocol, and the client software provides a plurality of API interfaces for the application program to call;
generally, each function and feature of the communication module (whether it is a virtual communication module or a physical communication module) corresponds to an API interface, such as: communication with the module by what means, module basic information (module version number, module IEMI), SIM card related information, module network status, module dial-up, module send sms, module voice call, module power management, module soft reset, module special handling, and other personalized information or operations.
Step 2: determining an API interface corresponding to the API call request, and acquiring configuration data of a corresponding function of the virtual communication module from server software; the configuration information of the virtual communication module corresponding to the Internet of things equipment is stored in a server in advance, the configuration information comprises a plurality of configuration data, and the configuration data of each function corresponds to the API (application program interface) one by one;
the functions described herein include not only the communication function of the module, but also the basic status functions such as the basic information of the module, including but not limited to: communication with the module by what means, module basic information (module version number, module IEMI), SIM card related information, module network status, module dial-up, module send sms, module voice call, module power management, module soft reset, module special handling, and other personalized information or operations.
The corresponding configuration data are: the module is communicated with by what way, a command for obtaining basic information of the module (the version number of the module and the IEMI of the module), a command for obtaining related information of the SIM card, a command for obtaining network state of the module, a command for dialing up the network by the module, a command for sending a short message by the module, a command for voice communication of the module, a command for managing power supply of the module, a command for soft resetting of the module, a command for special processing of the module and other personalized information or script files.
The acquisition from the server software is carried out through a TCP/IP protocol, and the server software also has a corresponding API interface for the client software to call so as to acquire the configuration data.
And step 3: and sending the configuration data to the application program through the API interface.
The application program can obtain the configuration data, not only can design and adjust the page layout of the application program, but also can be used for other tests, such as:
the application program is a communication mode switching function, a user can configure the signal state of the virtual communication module on the cloud platform to be excellent, then the signal state of the virtual communication module configured on the cloud platform by the user is poor, and whether the switching of the application program to 3G, 4G or different operators is carried out according to the design is tested at the moment.
As a preference of this embodiment, before the step 1, a module initialization step is further included, which includes the following sub-steps:
substep 11: accessing the cloud platform, determining the type of the configuration information configured by the cloud platform, and if the configuration information configured by the cloud platform is the configuration information of the virtual communication module, performingstep 13; if the configuration information configured by the cloud platform is the configuration information of the entity communication module, performingstep 12;
that is to say, when the internet of things device is started, the internet of things device should go to the cloud platform for access, determine whether the selected entity communication module set by the user is the virtual communication module, and if the selected entity communication module is the virtual communication module, the entity communication module carried by the user is not used. If the module is an entity communication module, the self-contained entity communication module is directly adopted for debugging the application program.
Substep 12: reading configuration information of an entity communication module of the Internet of things equipment and configuration information of an entity communication module of the cloud platform, judging whether the configuration information of the entity communication module of the Internet of things equipment needs to be updated, if so, updating the configuration information of the entity communication module of the Internet of things equipment and initializing the entity communication module, and if not, initializing the entity communication module;
substep 13: and generating a plurality of API interfaces, wherein the API interfaces correspond to configuration data in the configuration information of the entity communication module or the virtual communication module one by one.
More preferably, the configuration information of the virtual communication module and the configuration information of the entity communication module stored in the cloud platform are both associated with the SN code of the internet of things device;
the specific method for pre-storing the configuration information of the virtual communication module corresponding to the Internet of things equipment in the server comprises the following steps:
and the user accesses the cloud platform, searches and configures the configuration information of the virtual communication module according to the SN code of the Internet of things equipment, and stores the configuration information.
More specifically, when an application needs to change configuration data during application or test, the method is implemented as follows:
and the user accesses the cloud platform, searches and modifies configuration data in the configuration information of the virtual communication module according to the SN code of the Internet of things equipment, and stores the configuration information.
When the configuration data is changed, the API interface is not changed, and when the application program calls the API interface again, the configuration data is correspondingly changed, the process is noninductive, and manual adjustment is not needed at the application program end.
In this embodiment, a user accesses the cloud platform through an http protocol, client software and the cloud platform as well as an application program and the client software communicate with each other through a TCP/IP protocol, and the server is a local server or a cloud platform, preferably a cloud platform.
Example 2
Referring to fig. 2, a virtual communication module simulation system of an internet of things device 1 includes the internet of things device 1 and aserver 2, where theserver 2 stores configuration information of a virtual communication module, and the configuration information includes a plurality of configuration data;
the internet of things device 1 comprises the following modules:
API interface generation module 11: the API interface is used for generating and corresponding to the configuration data;
the API call request receiving module 12: the API calling request is used for receiving the application program;
the configuration data acquisition module 13: the system comprises aserver 2 and a server, wherein the server is used for acquiring configuration data of a virtual communication module from theserver 2 according to an API call request, wherein the configuration data corresponds to the API call request;
the data feedback module 14: for sending configuration data to the application via the API interface.
Theserver 2 includes:
the database 21: the system comprises a virtual communication module, a network device 1 and a server, wherein the virtual communication module is used for storing configuration information of the virtual communication module, and the configuration information corresponds to an SN (service number) code of the network device 1;
the data processing module 22: the data acquisition module is used for sending the configuration data in the configuration information to the data acquisition module according to the request of the configurationdata acquisition module 13;
the configuration information modification module 23: for modifying configuration data contained in the configuration information in thedatabase 21;
module selection module 24: the system comprises a communication module, a communication module and a communication module, wherein the communication module is used for setting the use of an entity communication module or a virtual communication module by the Internet of things equipment 1 by a user;
if the internet of things device 1 is set to use the entity communication module, thedata feedback module 14 sends the configuration data of the entity communication module to the client software through the API interface;
if the internet of things device 1 is set to use the virtual communication module, thedata feedback module 14 sends the configuration data acquired by the configurationdata acquisition module 13 to the client software through the API interface.
In the using process, a user accesses themodule selecting module 24 by adopting an HTTP (hyper text transport protocol) protocol through a webpage to determine whether the Internet of things equipment 1 uses an entity communication module or a virtual communication module;
when the entity communication module is used, the application program calls the configuration data through the API interface, and thedata feedback module 14 sends the configuration data of the entity communication module to the client software through the API interface;
when the virtual communication module is used, the application program calls the configuration data through the API interface, and thedata feedback module 14 sends the configuration data of the virtual communication module to the client software through the API interface;
the API callrequest receiving module 12 determines an API call request, and the configurationdata obtaining module 13 obtains configuration data of the virtual communication module corresponding to the API call request from thedata processing module 22 of theserver 2 according to the API call request;
when the application program needs to change the configuration data during the application or test process, the configuration data contained in the configuration information in thedatabase 21 is modified by the configurationinformation modification module 23. The configurationdata obtaining module 13 sends the modified configuration data to the application program through thedata feedback module 14 when the API call is made.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.