Disclosure of Invention
In view of the above, the present invention provides a charging and writing device and a charging and writing method for an intelligent tour guide machine, so as to solve the problem that when the number of tour guide machines is large, and internal resources of the tour guide machine are updated, all the resources need to be deleted and copied again, and useless work is repeated.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
an intelligent tour guide machine charging and writing device comprises a TF writing module, a PC writing module, a differential switch module, a gate module and an interface module;
the TF write-in module comprises a main control single chip microcomputer, an operation module and a TF card interface, wherein the main control single chip microcomputer is connected with the TF card interface, the TF card interface is connected with a TF card, the operation module is connected with the control end of the main control single chip microcomputer, the output end of the main control single chip microcomputer is connected with the input end of the differential switch module, the PC write-in module is bidirectionally connected with the main control single chip microcomputer, and the output end of the PC write-in module is connected with the differential switch module;
the interface module includes a plurality ofly, and every interface module includes a plurality of guide machine interfaces, and every guide machine interface is connected with the guide machine, and every interface module is connected with a gate module, gate module input is connected with differential switch module.
Further, the differential switch module is a differential switch.
Further, the PC write-in module includes UART communication submodule, HUB expander, the UART communication submodule is connected with master control singlechip, the UART communication submodule is connected with HUB expander one end, the computer is connected to the bus end of HUB expander.
Further, the UART communication sub-module employs, but is not limited to, a USB to UART conversion circuit.
Furthermore, each interface module comprises eight tour guide machine interfaces, and the gating device module adopts an 8-path USB gating device.
Furthermore, the TF write-in module further comprises an indicator light for displaying the write-in state of the TF write-in module, and the indicator light is connected with the main control single chip microcomputer.
Further, the operation module is, but not limited to, a key module.
A charging and writing method for an intelligent tour guide machine comprises the following steps:
s1, initializing the system after the equipment is powered on;
s2, judging whether the system needs to be upgraded or not, and reinitializing the system after the upgrade is finished;
s3, pressing a working mode key, selecting the working mode through a keyboard scanning program, and pressing a start key to start the system to work;
s4, after the system is started, the single chip microcomputer judges whether the current working mode is the charging mode;
s5, if the charging mode is the charging mode, charging is carried out, after the charging is finished or a stop key is pressed, the system quits the charging mode, and the system returns to the entrance of the selected working mode;
s6, when the system detects that the current working mode is a non-charging mode, the single chip microcomputer detects whether a TF card is inserted, and then the working mode of the system is selected;
and S7, judging and selecting the working mode of the system by the single chip microcomputer, copying files of the tour guide machine connected with the charging port, and returning to the working mode entrance after the charging port is executed.
Further, the operation mode in the step S3 includes a charging mode and a non-charging mode;
if the charging mode in step S5 is the charging mode, the charging process is as follows: 5V power supply of 16 USB interfaces is turned on through MOSFET, and the tour guide machine is charged, and the indicator lamp is lighted to indicate the state.
Further, the working modes of the system in the step S6 include a TF mode and a PC mode;
the procedure of detecting whether there is a TF card inserted in step S6 is as follows: detecting whether a TF card is inserted, and if the TF card is detected, gating the differential switch to the single chip microcomputer, wherein the system works in a TF mode; if no TF card is detected, the differential switch is gated to the HUB, while the system is operating in PC mode.
Further, the charging port of step S7 executes the following process: under TF mode, sequentially gating USB charging ports in sequence, if a tour guide machine is arranged in the charging port, copying files from the TF card to the tour guide machine, if no tour guide machine is arranged in the charging port, skipping until 16 charging ports are executed, and returning to the selected working mode inlet;
and under the PC mode, sequentially gating the USB charging ports in sequence, copying files from the PC to the tour guide machine if the tour guide machine is arranged in the charging port, skipping if the tour guide machine is not arranged in the charging port until the execution of 16 charging ports is finished, and returning to the inlet of the selected working mode.
Compared with the prior art, the intelligent tour guide machine charging and writing device has the following advantages:
the charging and writing-in equipment and the charging and writing-in method realize the intellectualization of system upgrade and resource update of the tour guide machine, particularly can carry out the system upgrade and the resource update on the tour guide machine through the TF card, do not need to be connected with a PC for operation, support one-key batch operation, support an unattended mode and save a large amount of time and labor input for users.
Detailed Description
It should be noted that the embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in the orientation or positional relationship indicated in the drawings, which are merely for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be construed as limiting the invention. Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first," "second," etc. may explicitly or implicitly include one or more of that feature. In the description of the invention, the meaning of "a plurality" is two or more unless otherwise specified.
In the description of the invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted", "connected" and "connected" are to be construed broadly, e.g. as being fixed or detachable or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the creation of the present invention can be understood by those of ordinary skill in the art through specific situations.
The invention will be described in detail with reference to the following embodiments with reference to the attached drawings.
As shown in fig. 1 to 4, an intelligent tour guide machine charging and writing device includes a TF writing module, a PC writing module, a differential switch module, a gate module, and an interface module;
the TF write-in module comprises a main control single chip microcomputer, an operation module and a TF card interface, wherein the main control single chip microcomputer is connected with the TF card interface, the TF card interface is connected with a TF card, the operation module is connected with the control end of the main control single chip microcomputer, the output end of the main control single chip microcomputer is connected with the input end of the differential switch module, the PC write-in module is bidirectionally connected with the main control single chip microcomputer, and the output end of the PC write-in module is connected with the differential switch module;
the interface module includes a plurality ofly, and every interface module includes a plurality of guide machine interfaces, and every guide machine interface is connected with the guide machine, and every interface module is connected with a gate module, gate module input is connected with differential switch module.
The differential switch module is a differential switch.
The PC write-in module comprises a UART communication submodule and a HUB expander, the UART communication submodule is connected with the master control single chip microcomputer, the UART communication submodule is connected with one end of the HUB expander, and the bus end of the HUB expander is connected with a computer.
The UART communication sub-module adopts but is not limited to a USB-to-UART conversion circuit.
Each interface module comprises eight tour guide machine interfaces, and the gate module adopts an 8-path USB gate.
The TF write-in module comprises an indicator light for displaying the write-in state of the TF write-in module, and the indicator light is connected with the master control single chip microcomputer.
The operation module is not limited to a key module.
The differential switch model is as follows: TS3USB 221A; the gate is an 8-path USB gate;
when the equipment works in a TF working mode, a master control single chip microcomputer chip reads a file list in a TF card, when the equipment works in a full writing mode of the TF card, the master control single chip microcomputer controls 8 paths of USB gate devices to gate charging ports 1-16 one by one, and then files in the TF card are copied to 16 tour guides one by one;
when the equipment works in a TF card comparison writing mode, the main control single chip controls 8 paths of USB strobes to strobe the charging ports 1-16 one by one, then the tour guide machine and the file list in the TF card are compared, and files needing to be updated in the TF card are copied to the tour guide machine.
When the equipment works in a PC working mode, the main control single chip microcomputer chip is connected with the HUB through the U-turn chip and is connected with the PC through the HUB, when the equipment works in a PC all-write-in mode, the main control single chip microcomputer controls 8 paths of USB strobes to strobe the charging ports 1-16 one by one, and then files at the PC end are copied to 16 tour guides one by one. When the equipment works in a PC comparison writing mode, the master control single chip controls 8 paths of USB strobes to strobe the charging ports 1-16 one by one, then the tour guide machine and the PC end file list are compared, and files needing to be updated at the PC end are copied to the tour guide machine.
When the equipment works in the system upgrading mode of the tour guide machine, the main control single chip controls the 8-path USB gating devices to gate the charging ports 1-16 one by one, and then the program of the tour guide machine is upgraded one by one.
As shown in fig. 2, a charging and writing method for an intelligent tour guide machine includes the following steps:
s1, initializing the system after the equipment is powered on;
s2, judging whether the system needs to be upgraded or not, and reinitializing the system after the upgrade is finished;
s3, pressing a working mode key, selecting the working mode through a keyboard scanning program, and pressing a start key to start the system to work;
s4, after the system is started, the single chip microcomputer judges whether the current working mode is the charging mode;
s5, if the charging mode is the charging mode, charging is carried out, after the charging is finished or a stop key is pressed, the system quits the charging mode, and the system returns to the entrance of the selected working mode;
s6, when the system detects that the current working mode is a non-charging mode, the single chip microcomputer detects whether a TF card is inserted, and then the working mode of the system is selected;
and S7, judging and selecting the working mode of the system by the single chip microcomputer, copying files of the tour guide machine connected with the charging port, and returning to the working mode entrance after the charging port is executed.
The operation mode in the step S3 includes a charging mode and a non-charging mode;
if the charging mode in step S5 is the charging mode, the charging process is as follows: 5V power supply of 16 USB interfaces is turned on through MOSFET, and the tour guide machine is charged, and the indicator lamp is lighted to indicate the state.
The working modes of the system in the step S6 include a TF mode and a PC mode;
the procedure of detecting whether there is a TF card inserted in step S6 is as follows: detecting whether a TF card is inserted, and if the TF card is detected, gating the differential switch to the single chip microcomputer, wherein the system works in a TF mode; if no TF card is detected, the differential switch is gated to the HUB, while the system is operating in PC mode.
The step S7 is executed by the charging port as follows: under TF mode, sequentially gating USB charging ports in sequence, if a tour guide machine is arranged in the charging port, copying files from the TF card to the tour guide machine, if no tour guide machine is arranged in the charging port, skipping until 16 charging ports are executed, and returning to the selected working mode inlet;
and under the PC mode, sequentially gating the USB charging ports in sequence, copying files from the PC to the tour guide machine if the tour guide machine is arranged in the charging port, skipping if the tour guide machine is not arranged in the charging port until the execution of 16 charging ports is finished, and returning to the inlet of the selected working mode.
The specific working process is as follows:
101. after the equipment is powered on, firstly, initializing operation is carried out, and the GD32 single chip microcomputer and peripheral equipment are initialized;
102. judging whether an upgrading firmware exists in the TF card, if so, upgrading the system, and reinitializing the operation after the system is upgraded; if the firmware is not upgraded, entering a working state;
103. pressing a working mode key, selecting a working mode through a keyboard scanning program, and pressing a start key to start the system to work;
104. after the system starts to work, the single chip microcomputer firstly judges whether the current working mode is a charging mode, if the current working mode is the charging mode, a 5V power supply with 16 USB interfaces is turned on through the MOSFET to charge the tour guide machine, and meanwhile, an indicator lamp is lightened to indicate the state;
105. after the charging of the tour guide machine is completed or a stop key is pressed, the system exits from the charging mode and returns to the entrance of the selected working mode;
106. after the system starts to work, if the current working mode is a non-charging mode, whether a TF card is inserted is detected, if the TF card is detected, the differential switch is gated to the GD32 single chip microcomputer, and at the moment, the system works in the TF mode; if the TF card is not detected, the differential switch is gated to the HUB, and the system works in the PC mode at the moment;
107. under TF mode, sequentially gating USB charging ports in sequence, if a tour guide machine is arranged in the charging port, copying files from the TF card to the tour guide machine, if no tour guide machine is arranged in the charging port, skipping until 16 charging ports are executed, and returning to the selected working mode inlet;
108. and under the PC mode, sequentially gating the USB charging ports in sequence, copying files from the PC to the tour guide machine if the tour guide machine is arranged in the charging port, skipping if the tour guide machine is not arranged in the charging port until the execution of 16 charging ports is finished, and returning to the inlet of the selected working mode.
And (3) comparing copy algorithms:
201. setting a file folder designated by a TF card or a PC as a source file folder, and setting a tour guide machine as a target file folder;
202. acquiring information of a first file from a source folder according to a file storage address, wherein the information comprises a file name and modification time; and searching whether the target folder contains the file or not, copying the file to the target folder if the target folder does not contain the file, and skipping if not.
203, acquiring information of a second file from the source folder according to the file storage address, and repeatedly executing the step 202;
204. until all file comparisons in the source folder are completed.
205. Acquiring information of a first file from a target folder according to a file storage address, wherein the information comprises a file name and modification time; searching whether the source folder contains the file or not, if the source folder does not contain the file, deleting the file from the target folder, and otherwise, skipping;
206. acquiring information of a second file from the source folder according to the file storage address, and repeatedly executing the step 205;
207. until all files in the target folder are compared;
208. the comparative copy work is complete.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and should not be taken as limiting the invention, so that any modifications, equivalents, improvements and the like, which are within the spirit and principle of the present invention, should be included in the scope of the present invention.