Disclosure of Invention
The invention provides an industrial personal computer Internet of things control method, an industrial personal computer Internet of things control device and a computer readable medium.
The invention provides a first aspect of an industrial personal computer Internet of things control method, which comprises the following steps:
when the controller detects that the communication module is abnormal in network, at least one of the communication module, the power supply circuit or the SIM card selecting module is controlled to attempt to restore communication according to a preset strategy; the SIM card selecting module comprises a plurality of SIM cards;
the communication module sends a request to a server to detect whether normal communication is detected when attempting to recover communication according to the preset strategy each time;
and if the communication module does not normally communicate, circularly executing the attempt to recover the communication according to the preset strategy until the communication module normally communicates.
Optionally, the controlling at least one of the communication module, the power supply circuit or the SIM card selecting module to attempt to resume communication according to a preset policy includes:
controlling the communication module to reset software, controlling the power supply circuit to restart, and controlling the SIM card selection module to switch SIM cards of different operators;
and is sequentially and circularly executed in the order described above.
Optionally, the SIM card selecting module includes:
a plurality of communication carrier provided SIM cards, the SIMs being operable for wireless communication; such as at least two of a telecommunications SIM card, a mobile SIM card, a cradle SIM card.
Optionally, when the controller detects that the communication module has network abnormality, the method includes:
the controller sends a periodic heartbeat instruction delayed according to minutes, and if the data feedback is received within a preset time, the controller judges that the line is on; if feedback is not received, the controller sends a periodic heartbeat instruction delayed according to minutes again, and the preset time can receive the feedback at the moment, and the controller judges that the device is online; if the feedback is not received for the second time, the controller sends a period heartbeat instruction delayed according to minutes for the third time, and if the feedback can be received, the controller determines that the line is on; if no feedback is received for the third time, the network is considered to be abnormal.
Optionally, the method for controlling the internet of things of the industrial personal computer further comprises the following steps:
and pushing the data which cannot be correctly sent by the industrial personal computer in a message queue mode, giving a time stamp, and orderly sending according to the sequence of the time stamp after waiting for normal communication.
The second aspect of the invention provides an internet of things control device of an industrial personal computer, which comprises:
the control module is used for controlling at least one of the communication module, the power supply circuit or the SIM card selecting module to attempt to restore communication according to a preset strategy when the controller detects that the communication module has network abnormality; the SIM card selecting module comprises a plurality of SIM cards;
the detection module is used for sending a request to the server to detect whether the communication is normal or not when the communication module tries to recover the communication according to the preset strategy each time;
and the circulation module is used for circularly executing the attempt to recover the communication according to the preset strategy if the communication module does not normally communicate until the communication module normally communicates.
Optionally, the control module includes:
the control subunit is used for controlling the communication module to carry out software reset, controlling the power supply circuit to restart and controlling the SIM card selection module to switch SIM cards of different operators; and is sequentially and circularly executed in the order described above.
Optionally, the control module includes:
the abnormality judging unit is used for judging that the controller is online by sending a periodic heartbeat instruction delayed according to minutes and receiving data feedback if the data feedback is received within preset time; if feedback is not received, the controller sends a periodic heartbeat instruction delayed according to minutes again, and the preset time can receive the feedback at the moment, and the controller judges that the device is online; if the feedback is not received for the second time, the controller sends a period heartbeat instruction delayed according to minutes for the third time, and if the feedback can be received, the controller determines that the line is on; if no feedback is received for the third time, the network is considered to be abnormal.
Optionally, the industrial personal computer internet of things control device further includes:
and the storage unit is used for pushing the data which cannot be correctly sent by the industrial personal computer to stack in a message queue mode, giving a time stamp, and orderly sending the data according to the sequence of the time stamp after waiting for normal communication.
In a third aspect of the present invention, a computer readable medium is provided, on which a computer program is stored, which when executed by a processor implements the aforementioned industrial personal computer internet of things control method.
The technical scheme provided by the invention solves the network disconnection problem caused by the single network communication limitation, the equipment operation environment of a telecom operator and the operation policy. The network condition is automatically judged, the communication module is preferably selected for reset, the software realizes the switching of different operators, the network communication problem is solved, and the communication is stable.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of an embodiment of an internet of things control method of an industrial personal computer according to an embodiment of the invention. The industrial personal computer Internet of things control method comprises the following steps:
step S100: when the controller detects that the communication module is abnormal in network, at least one of the communication module, the power supply circuit or the SIM card selecting module is controlled to attempt to restore communication according to a preset strategy; the SIM card selecting module comprises a plurality of SIM cards.
In this embodiment, the controller adopts an MCU (Microcontroller Unit; micro control unit) which is connected with the communication module by an electric control signal, can control the power supply by a power supply circuit, and can realize the function of switching a plurality of SIM cards at the same time, and can be realized by controlling the SIM card selection module.
Since the reasons for communication abnormality of the communication module may be various, countermeasures can be set according to a priori knowledge. For example, it is common that the communication module has a poor signal, and the communication module may be first reset by software control. Or because the industrial personal computer has problems, the communication module can be restarted by a power-off mode. Or because of reasons of telecommunication service providers, such as insufficient SIM flow, arrearage and the like, the method can be realized by switching the SIM card.
Wherein, the detection of whether the communication module is abnormal can be realized by the following ways:
the controller sends a periodic heartbeat instruction delayed according to minutes, and if the data feedback is received within a preset time, the controller judges that the line is on; if feedback is not received, the controller sends a periodic heartbeat instruction delayed according to minutes again, and the preset time can receive the feedback at the moment, and the controller judges that the device is online; if the feedback is not received for the second time, the controller sends a period heartbeat instruction delayed according to minutes for the third time, and if the feedback can be received, the controller determines that the line is on; if no feedback is received for the third time, the network is considered to be abnormal.
For example: the controller determines that the line is on by sending a periodic heartbeat command delayed by minutes and receiving data feedback if the data feedback is within 3 seconds. If no feedback is received, the controller sends a periodic heartbeat instruction delayed according to minutes again, and if the feedback can be received within 3 seconds, the controller is judged to be online; if feedback is not received for the second time, the controller sends a periodic heartbeat instruction delayed according to minutes for the third time, and if feedback can be received, the controller determines that the device is online; if no feedback is received for the third time, it is considered offline.
Step S200: and the communication module sends a request to the server to detect whether the communication is normal or not when attempting to recover the communication according to the preset strategy each time.
Step S300: and if the communication module does not normally communicate, circularly executing the attempt to recover the communication according to the preset strategy until the communication module normally communicates.
Specifically, the communication module is controlled to carry out software reset, the power supply circuit is controlled to restart, and the SIM card selection module is controlled to switch SIM cards of different operators; and is sequentially and circularly executed in the order described above.
In an embodiment, when the controller finds that the communication module generates network abnormality and cannot realize data communication, the controller firstly resets the module through software, waits for the module to restart successfully, and then sends a request to the server to see whether normal communication is possible. If normal communication is enabled, the keep-alive service is completed. If the communication cannot be realized, the communication module can be reset by controlling the power supply circuit, and after the module is restarted successfully, a request is sent to the server to see whether the communication can be normally performed. If normal communication is enabled, the keep-alive service is completed. If the hard restart is not capable of normally communicating, the power supply of the communication module is firstly disconnected, then the SIM cards of different operators are switched, and then the module is electrified, so that the switching of different operators is realized. And after the module is restarted successfully, sending a request to the server to see whether normal communication can be performed. The above operation is repeated until the communication is normal.
The SIM card selecting module comprises: a SIM card provided by a communications carrier, the SIM being operable for wireless communications; such as at least two of a domestic operator provided telecommunications SIM card, a mobile SIM card, a corporate SIM card; it will of course be appreciated that a SIM card provided by a foreign communications carrier may also be included. When the SIM card is switched, the SIM card can be orderly switched according to the switching sequence of the SIM card of the operator set by the equipment deployment party.
Further, when the industrial personal computer networking is problematic, the data of the device still has outgoing requirements, namely, the data of the device cannot be normally sent out after being connected with the server. Then the data that is not sent out needs to be processed; therefore, the method for controlling the internet of things of the industrial personal computer further comprises the following steps, as shown in fig. 2:
step S100: when the controller detects that the communication module is abnormal in network, at least one of the communication module, the power supply circuit or the SIM card selecting module is controlled to attempt to restore communication according to a preset strategy; the SIM card selecting module comprises a plurality of SIM cards;
step S200: the communication module sends a request to a server to detect whether normal communication is detected when attempting to recover communication according to the preset strategy each time;
step S300: if the communication module does not normally communicate, circularly executing the attempt to recover the communication according to the preset strategy until the communication module normally communicates;
step S400: and pushing the data which cannot be correctly sent by the industrial personal computer in a message queue mode, giving a time stamp, and orderly sending according to the sequence of the time stamp after waiting for normal communication.
The technical scheme provided by the invention solves the network disconnection problem caused by the single network communication limitation, the equipment operation environment of a telecom operator and the operation policy. The network condition is automatically judged, the communication module is preferably selected for reset, the software realizes the switching of different operators, the network communication problem is solved, and the communication is stable.
As shown in fig. 3, the present invention further provides an internet of things control device of an industrial personal computer, where the device includes:
the control module 100 is configured to control at least one of the communication module, the power supply circuit, or the SIM card selection module to attempt to resume communication according to a preset policy when the controller detects that the communication module has network abnormality; the SIM card selecting module comprises a plurality of SIM cards;
the detection module 200 is configured to send a request to the server to detect whether the communication is normal or not when the communication module attempts to resume the communication according to the preset policy each time;
and the circulation module 300 is configured to circulate and execute the attempt to resume communication according to the preset policy if the communication module does not normally communicate until the communication module normally communicates.
In this embodiment, the controller adopts an MCU (Microcontroller Unit; micro control unit) which is connected with the communication module by an electric control signal, can control the power supply by a power supply circuit, and can realize the function of switching a plurality of SIM cards at the same time, and can be realized by controlling the SIM card selection module.
Since the reasons for communication abnormality of the communication module may be various, countermeasures can be set according to a priori knowledge. For example, it is common that the communication module has a poor signal, and the communication module may be first reset by software control. Or because the industrial personal computer has problems, the communication module can be restarted by a power-off mode. Or because of reasons of telecommunication service providers, such as insufficient SIM flow, arrearage and the like, the method can be realized by switching the SIM card.
The control module 100 includes:
the control subunit is used for controlling the communication module to carry out software reset, controlling the power supply circuit to restart and controlling the SIM card selection module to switch SIM cards of different operators; and is sequentially and circularly executed in the order described above.
The control module 100 further includes:
the abnormality judging unit is used for judging that the controller is online by sending a periodic heartbeat instruction delayed according to minutes and receiving data feedback if the data feedback is received within preset time; if feedback is not received, the controller sends a periodic heartbeat instruction delayed according to minutes again, and the preset time can receive the feedback at the moment, and the controller judges that the device is online; if the feedback is not received for the second time, the controller sends a period heartbeat instruction delayed according to minutes for the third time, and if the feedback can be received, the controller determines that the line is on; if no feedback is received for the third time, the network is considered to be abnormal.
Controlling the communication module to reset software, controlling the power supply circuit to restart, and controlling the SIM card selection module to switch SIM cards of different operators; and is sequentially and circularly executed in the order described above.
In an embodiment, when the controller finds that the communication module generates network abnormality and cannot realize data communication, the controller firstly resets the module through software, waits for the module to restart successfully, and then sends a request to the server to see whether normal communication is possible. If normal communication is enabled, the keep-alive service is completed. If the communication cannot be realized, the communication module can be reset by controlling the power supply circuit, and after the module is restarted successfully, a request is sent to the server to see whether the communication can be normally performed. If normal communication is enabled, the keep-alive service is completed. If the hard restart is not capable of normally communicating, the power supply of the communication module is firstly disconnected, then the SIM cards of different operators are switched, and then the module is electrified, so that the switching of different operators is realized. And after the module is restarted successfully, sending a request to the server to see whether normal communication can be performed. The above operation is repeated until the communication is normal.
The industrial personal computer thing allies oneself with controlling means still include:
and the storage unit is used for pushing the data which cannot be correctly sent by the industrial personal computer to stack in a message queue mode, giving a time stamp, and orderly sending the data according to the sequence of the time stamp after waiting for normal communication.
The present invention also provides a computer readable medium having stored thereon a computer program which when executed by a processor implements the method described in the above embodiments.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the system of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.