Disclosure of Invention
The invention aims to provide a self-adaptive method, a self-adaptive device, self-adaptive equipment and a self-adaptive storage medium of a communication module, and aims to solve the problem that different dialing methods are required to be used for different communication modules in the prior art.
In one aspect, the present invention provides an adaptive method for a communication module, the method comprising the following steps:
after receiving a dial-up connection instruction, automatically identifying and acquiring the ID information of the communication module;
automatically matching an AT instruction set and a customized dialing mode corresponding to the communication module according to the ID information;
carrying out dialing connection operation on the communication module through the AT instruction set according to the network standard and the customized dialing mode;
establishing a dhcp network service;
judging whether a disconnection instruction is received;
if yes, disconnecting the network connection and stopping the dhcp network service;
if not, ending.
Further, before automatically identifying and acquiring the ID information of the communication module, the method further includes the following steps:
an instruction for dial-up connection and an instruction for disconnection are set, respectively.
Further, before determining the AT instruction set and the customized dialing mode of the communication module according to the ID information, the method further includes the following steps:
the ID information of the common communication module and the AT instruction set and the customized dialing mode corresponding to the ID information are stored in the system.
Further, the common communication modules include a 4G communication module and a 5G communication module.
Further, the ID information of the communication module includes a network type, a manufacturer, and a model.
Further, the dial modes include ECM, PPP, and NDIS.
Further, the AT instructions include a general instruction set and a custom instruction set.
In another aspect, the present invention provides an adaptive apparatus for a communication module, the apparatus comprising:
the ID information acquisition module is used for automatically identifying and acquiring the ID information of the communication module;
the customized information acquisition module is used for automatically matching an AT instruction set and a customized dialing mode corresponding to the communication module according to the ID information of the communication module;
the dialing connection module is used for carrying out dialing connection operation on the communication module through the AT instruction set according to a network system and a customized dialing mode;
the disconnection module is used for disconnecting the network connection;
and the Dhcp service module is used for establishing the Dhcp service when the network is connected and stopping the Dhcp service when the network is disconnected.
In another aspect, the present invention further provides an apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the adaptive method for a communication module when executing the computer program.
In another aspect, the present invention further provides a readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps in the adaptive method for a communication module.
The invention has the beneficial effects that: the method comprises the steps of starting dial-up connection on various different communication modules by setting a unified dial-up connection command, determining the network type and the customized dial-up mode of the communication modules by acquiring the ID information of the communication modules, carrying out dial-up connection operation on the communication modules according to the network type and the customized dial-up mode of the communication modules, and simultaneously processing dhcp service, so that a user can conveniently adopt a unified dial-up connection mode on different communication modules, and the convenience of dial-up connection is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The following detailed description of specific implementations of the present invention is provided in conjunction with specific embodiments:
the first embodiment is as follows:
fig. 1 shows an implementation flow of a method for automatically identifying a communication module and dialing according to an embodiment of the present invention, and for convenience of description, only the relevant portions related to the embodiment of the present invention are shown, which is detailed as follows:
the embodiment is based on a Linux embedded system, and the steps comprise:
step S101: after receiving a dial-up connection instruction, automatically identifying and acquiring the ID information of the communication module;
step S102: automatically matching an AT instruction set and a customized dialing mode of the communication module according to the ID information;
step S103: carrying out dialing connection operation on the communication module through an AT instruction set according to a network system and a customized dialing mode;
step S104: establishing a dhcp network service;
step S105: judging whether a disconnection instruction is received;
step S106: if yes, disconnecting the network connection and stopping the dhcp network service;
step S107: if not, ending.
Further, before step S101, the method further includes the steps of:
an instruction for dial-up connection and an instruction for disconnection are set, respectively.
Further, step S102 is preceded by the following steps:
the ID information of the common communication module and the AT instruction set and the customized dialing mode corresponding to the ID information are stored in the system.
Further, the common communication modules include a 4G communication module and a 5G communication module.
Further, in step S101, the ID information of the communication module includes a network type, a manufacturer, and a model.
Further, in step S102, the dialing mode includes ECM, PPP, and NDIS.
Further, the AT instruction includes a general instruction set and a custom instruction set.
Example two:
fig. 2 is a schematic structural diagram of an adaptive apparatus for providing a communication module according to an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown, which includes:
an ID information obtaining module 201, configured to automatically identify and obtain ID information of the communication module;
the customized information acquisition module 202 is used for automatically matching an AT instruction set and a customized dialing mode corresponding to the communication module according to the ID information of the communication module;
the dialing connection module 203 is used for carrying out dialing connection operation on the communication module through the AT instruction set according to a network system and a customized dialing mode;
a disconnection module 204 for disconnecting the network connection;
and the Dhcp service module 205 is used for establishing the Dhcp service when the network is connected and stopping the Dhcp service when the network is disconnected.
In the embodiment of the present invention, each module of the adaptive apparatus of the communication module may be implemented by a corresponding hardware or software module, and each module may be an independent software or hardware module, or may be integrated into a software or hardware module, which is not limited herein.
Example three:
fig. 3 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention, and for convenience of description, only a part related to the embodiment of the present invention is shown, where the part includes:
in an embodiment of the present invention, an apparatus is provided, comprising a memory 301, a processor 302, and a computer program 303 stored in the memory and executable on the processor, which when executed by the processor implements the steps in an embodiment of the adaptive method of the communication module described above, e.g. steps S101 to S107 shown in fig. 1. Alternatively, the computer program, when executed by the processor, implements the functions of the modules in the adaptation means of the communication module described above, for example, the modules 201 to 205 shown in fig. 2.
Example four:
in an embodiment of the present invention, a readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps in an adaptive method embodiment of the communication module described above, for example, steps S101 to S107 shown in fig. 1. Alternatively, the computer program, when executed by the processor, implements the functions of the modules in the above-described apparatus embodiments, such as the functions of the modules shown in fig. 2.
The computer readable storage medium of the embodiments of the present invention may include any entity or device capable of carrying computer program code, a recording medium, such as a ROM/RAM, a magnetic disk, an optical disk, a flash memory, or the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.