Disclosure of Invention
Aiming at the problem that mixed-plug communication is realized by a plurality of types of communication boards in the gateway of the Internet of things, the invention provides an optimization scheme for integrating a plurality of communication technologies in the gateway of the Internet of things, and the problems of automatic board identification and data transmission during mixed-plug of the communication module boards are solved through structural design, serial port expansion and a singlechip on the basis of modularly designing the various communication technologies.
The invention discloses a method for realizing mixed insertion of multiple types of communication boards in an Internet of things gateway, which comprises the following specific steps: the gateway is realized through an Internet of things gateway, and the gateway adopts a modularized design and comprises an interface board, a main board and a communication board card; the main board is a system board and is used for providing an expandable serial bus, and the main board is connected with each communication board card through the interface board; the interface board provides sockets comprising standardized connectors, the number of the sockets is configured according to actual needs, and the number of the sockets is smaller than the number of serial buses of the main board; the communication board card comprises communication technology modules corresponding to all communication systems. The communication board card is connected with the interface board through a socket on the interface board. The number of pins of the sockets on the main board and the communication board are the same.
The main board is communicated and connected with the interface board through a serial port bus, and the serial port bus of the main board is connected with the 1 st needle and the 2 nd needle of each socket of the interface board; the interface board is provided with a reading circuit for reading data from the GPIO ports of the singlechip at adjacent positions of the sockets, the reading circuit is connected with the interface board through the sockets, the pin number of the reading circuit is determined by the socket number, and the square of the pin number of the reading circuit is equal to the socket number. The main board provides driving equipment for the serial bus, and the driving equipment is used for inquiring and analyzing parameter information transmitted by the communication board through the serial bus.
Each communication board card is provided with a singlechip, and the singlechip reads GPIO level signals on the interface board to acquire the serial number of the interface board socket which is accessed by the communication board card currently; the singlechip reads GPIO level signals on the interface board again to acquire the type number of the board card which is accessed by the communication board card at present; the acquired interface board socket number and board card type number are integrated into one piece of parameter information by the singlechip, the parameter information is transmitted to the main board through the serial bus, and the main board records and analyzes the parameter information, so that the main board can recognize different communication board cards.
The main board is provided with serial buses with the same number as the communication boards, the serial buses extend to all sockets through the interface board, each bus is connected with only one socket, pins of a first bus connected with a first socket are X and X+1, pins of a second bus connected with a second socket are X+2 and X+3, and so on, pins of an Nth bus connected with an Nth socket are X+2 xN-2 and X+2 xN-1.
The pins on the communication board card are configured in a one-to-one correspondence with the pins of the sockets on the interface board, so that the communication lines corresponding to one communication board card are expanded into expansion lines with the same number as the sockets; when the communication board card is connected with the socket, the corresponding expansion circuit realizes the effective connection of the communication board card and the socket according to the serial bus connection condition on the socket. When the physical network gateway starts data communication, the driving equipment on the main board provides a corresponding data processing mode according to the type of the communication board card on each socket, so that mixed-plug communication of multiple types of communication board cards is realized.
The singlechip adopts an STM32 singlechip.
The driving device on the main board comprises a driving program.
The GPIO level signal is a code of 1 and 0 formed according to the high level and the low level, and the code is the code of the interface board socket.
The beneficial effects of the invention are as follows:
After the method is used for realizing the mixed insertion of the communication boards, the flexibility and expansibility of the equipment are enhanced, and a plurality of identical type boards or single different type boards can be accessed according to the requirements. The method adopts a method of directly expanding the serial port, can be directly connected with a plurality of modules on the current market for use, and has lower research and development cost.
Detailed Description
For a better understanding of the present disclosure, an embodiment is presented herein.
The invention discloses a method for realizing mixed insertion of multiple types of communication boards in an Internet of things gateway, which comprises the following specific steps: the gateway is realized through an Internet of things gateway, and the gateway adopts a modularized design and comprises an interface board, a main board and a communication board card; the main board is a system board and is used for providing an expandable serial bus, and the main board is connected with each communication board card through the interface board; the interface board provides sockets comprising standardized connectors, the number of the sockets is configured according to the actual number, and the number of the sockets is smaller than the number of serial buses of the main board; the communication board card comprises communication technology modules corresponding to all communication systems, and the number of the communication board cards is 1 less than that of the interface board sockets. The communication board card is connected with the interface board through a socket on the interface board. The number of pins of the sockets on the main board and the communication board are the same.
The main board is communicated and connected with the interface board through an expandable serial bus, and the expandable serial bus of the main board is connected with the 1 st needle and the 2 nd needle of each socket; the interface board is provided with a reading circuit for reading data from the GPIO ports of the singlechip at adjacent positions of the sockets, the reading circuit is connected with the interface board through the sockets, the number of pins of the reading circuit is determined by the number of the sockets, and the number of the sockets is equal to the square of the number of pins. The main board provides driving equipment for the serial bus, and the driving equipment is used for inquiring and analyzing parameter information transmitted by the communication board through the serial bus.
Each communication board card is provided with a singlechip, and the singlechip reads GPIO level signals on the interface board to acquire the serial number of the interface board socket which is accessed by the communication board card currently; the singlechip reads GPIO level signals on the interface board again to acquire the type number of the board card which is accessed by the communication board card at present; the single chip microcomputer integrates the acquired socket number and the board card type number into one piece of information, the information is transmitted to the main board through the serial bus, and the main board records the information, so that the recognition of the main board to the communication board card is realized.
The main board is provided with serial buses with the same number as the communication boards, the serial buses extend to all sockets through the interface board, each bus is connected with only one socket, pins of a first bus connected with a first socket are X and X+1, pins of a second bus connected with a second socket are X+2 and X+3, and so on, pins of an Nth bus connected with an Nth socket are X+N and X+N+1.
The pins on the communication board card are configured in a one-to-one correspondence with the pins of the sockets on the interface board, so that the communication lines corresponding to one communication board card are expanded into expansion lines with the same number as the sockets; when the communication board card is connected with the socket, the corresponding expansion circuit realizes the effective connection of the communication board card and the socket according to the serial bus connection condition on the socket. When the physical network gateway starts data communication, the driving equipment on the main board provides a corresponding data processing mode according to the type of the communication board card on each socket, so that mixed-plug communication of multiple types of communication board cards is realized.
The singlechip adopts an STM32 singlechip.
The driving device on the main board comprises a driving program.
The GPIO level signal is a code of 1 and 0 formed according to the high level and the low level, and the code is the code of the interface board socket.
The invention provides an interface socket design and a communication board socket design method, which are used for solving the problems of identification and data transmission of mixed insertion of a communication board, and specifically comprise the following steps: the gateway internal structure is in modularized design and is divided into an interface board, a main board and a communication board card;
the interface board provides standardized connector sockets, as shown in fig. 1, the socket 1 is provided for a main board, other sockets can be used for mixed insertion of communication boards, the number of the sockets can be limited by the number of serial buses expanded by the main board according to the actual design number;
the main board is a system board and is provided with an extended serial bus, and is connected with each communication board card through the interface board;
the communication board cards are provided outside the communication modules respectively and then are connected with the main board through the interface board, and the number of the communication board cards is as follows: interface board socket number-1.
The number of pins of the sockets on the main board and the communication board is consistent, and the number of k single socket pins is determined by actual design;
The main board provides an independent expansion bus, and a communication interface board, such as bus 1 in fig. 1, is connected with pins 1 and 2 of each socket; the main board provides the driving of the bus and can inquire and analyze the parameter information transmitted from the communication board card.
Each communication board card is provided with an STM32 single-chip microcomputer and is connected with the motherboard bus 1 through pins 1 and 2, as shown in fig. 2.
Each socket side is provided with a circuit for the STM32 singlechip GPIO to read, such as GPIO_2 in FIG. 3, and the circuit is connected with the interface board through the socket. The level state in the GPIO reading circuit forms codes of 1 and 0 according to the high and low levels, the codes are the codes of the sockets, the number of pins is determined by the number of the sockets, the number of the sockets is equal to the square of the number of the pins, 4XGPIO can support 16 sockets, 3XGPIO can support 8 socket codes,
Each communication board card is provided with an STM32 singlechip, as shown in figure 3;
the singlechip reads GPIO level signals on the interface board and obtains the number of the currently accessed socket;
the circuit provided by the communication board card and used for being read by the STM32 singlechip GPIO is like GPIO_1 in FIG. 3, and the singlechip obtains the type number by reading the GPIO level signal on the interface board;
The single chip microcomputer integrates the socket number and the board card type number into one piece of information, signals are transmitted to the main board through the bus, and the main board analyzes and stores the information.
The main board expands serial buses with the same number as the communication boards and extends to all sockets through the interface board;
Each bus is connected with only one socket, as shown in fig. 1, a first communication bus (bus 2) is connected with the socket 2, and the connection pins are shown as X & X+1 as shown in 2; the second communication bus (bus 3) is connected with the socket 3, the connection pins are X+2& X+3 as shown in 2, and so on;
The pins on the communication board are designed to extend a communication line into a line corresponding to the socket as shown in fig. 2;
When the communication board card is connected with the socket, the expansion circuit realizes effective connection according to the bus connection condition on the socket.
When the communication board card and the main board perform data interaction, the main board performs corresponding processing according to different board card types, including configuration information, data mutual transmission and the like.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.