Detailed Description
As shown in fig. 1, this embodiment relates to a vehicle-mounted intelligent wireless network reverse control system, which includes: the system comprises a mobile interaction unit positioned at a user end, an instruction receiving unit positioned at a server end, an instruction checking unit, an instruction forwarding unit, an instruction information storage unit, a vehicle-mounted application processing unit positioned at a vehicle-mounted control end and a Zigbee networking unit, wherein: the user sets a control instruction through the mobile interaction unit and sends the control instruction to the server, the instruction is sequentially received, verified and forwarded to the vehicle-mounted control end through the server, the vehicle-mounted application processing unit receives the control instruction from the server, and the Zigbee networking unit controls the vehicle internal parts according to the type of the instruction.
The vehicle-mounted APU and the Zigbee networking adopt a UART (Universal Asynchronous Receiver/Transmitter) mode for communication.
The mobile interaction unit comprises: user login interface, user control interface, wherein: the user login interface is used for verifying the user verification information, so that illegal operation of a user vehicle by others is avoided; the user control interface is used for user instruction forwarding.
The user instruction comprises: an in-car air conditioner control instruction and a door control instruction.
As shown in fig. 2, the verification means: the user login interface continuously scans the control, analyzes and compares the command when the user sends a control command, different functions are realized through different set commands, command forwarding is realized if the analysis is successful, and the command is forwarded to the server side for forwarding through the okHttp transmission protocol.
The system comprises an instruction receiving unit, an instruction checking unit, an instruction forwarding unit and an instruction information storage unit in the server, wherein: the command receiving unit receives requests and responses of a user through an okHttp protocol, the command verification unit verifies a command possibly causing messy codes due to external environment interference in the transmission process, the command forwarding unit analyzes and encapsulates the verified command and forwards the verified command to the vehicle-mounted APU, the command information storage unit stores control command information of a server in a cloud database, corresponding historical records are checked in real time through a browser or a UI interface, and each historical record stores a corresponding control command type, a control command function and a control timestamp.
As shown in fig. 3, the verification refers to: the instruction receiving unit receives the data packet from the APP terminal, the instruction verifying unit analyzes the instruction, and stores the instruction to the local database to check the control instruction sent to the vehicle each time, and the instruction after successful analysis is forwarded to the APU module in the vehicle through encapsulation.
The verification means that: and performing field verification on each field of the received control instruction according to a specified specific instruction format protocol, wherein different instruction functions correspond to different data formats and are used as prejudgment operation for avoiding triggering of wrong instructions.
The vehicle-mounted application processing unit in the vehicle-mounted control end receives and verifies the encapsulated data from the server end and transfers the encapsulated data to the coordinator through a serial port for forwarding, wherein: the server modules in the receiving and verifying parts are consistent, the purpose is to fully ensure the data security of each module, the forwarding part is realized by the APU (auxiliary Power Unit) switching to the coordinator through the serial port, and the module realizes the receiving and preprocessing of the server side instruction and simultaneously forwards the instruction to the coordinator node of the Zigbee networking unit connected through the serial port.
The Zigbee networking unit receives the instruction from the vehicle-mounted application processing unit, and performs routing forwarding and component control, and comprises: the coordinator node is used for controlling instruction verification and instruction forwarding, the terminal nodes and the routing nodes, the transmission modes of communication among the nodes comprise a point-to-point mode and a broadcast mode, the coordinator node finds the corresponding terminal nodes through different routing nodes according to the instruction types in each instruction data packet, and the mapping relation between the instruction types and the addresses of the terminal control nodes is stored in the coordinator node; and the terminal node mounts different components according to different application services and performs component control.
As shown in fig. 4, the component control means: a coordinator node of the ZigBee finds a target terminal node by routing and addressing the target node, the node receives a corresponding instruction to realize the instruction, and an operation motor is operated to rotate positively and negatively, and is started or stopped.
The coordinator node, the routing node and the terminal node are divided into the following network addresses: 0x0000, 0x0001-0x7FFF and 0x8000-0xFFFF, the network topology is as shown in FIG. 5, different terminal nodes correspond to different network addresses, so the control application of each node mounting is different, and the corresponding node addresses are also different. As shown in the figure, when the application service on which the terminal node 0x8000 is hung is an air conditioner switch, the mapping relation between the control instruction format of the air conditioner and the address 0x8000 of the terminal node where the air conditioner is located is stored in the coordinator node, and the coordinator performs routing forwarding according to the found target node address by comparing the received instruction format with the mapping table, so that the control of a certain node is accurately realized. The relationship between the control instruction format and the target node address mapping table in this scenario is shown in table 1.
TABLE 1 control Command to target Address mapping Table
Type of instruction
|
Instruction function
|
Target address
|
Air
|
On/Off
|
0x8000
|
Door
|
On/Off
|
0x8001
|
Air_Adjust
|
Up/Down
|
0x8000
|
Window
|
Up/Down
|
0x8002 |
According to the scheme for controlling the vehicle-mounted Zigbee wireless network, the command of the vehicle-mounted Zigbee wireless network control method is likely to cause packet loss due to interference of wireless environmental factors in the transmission process, so that the control function is likely to be lost, and even the terminal control module is out of control. Therefore, the control command received by the terminal node needs to be checked in advance, and as shown in table 2, the data packet is an air conditioner switch control data packet, and the data header of the data packet is identified as "header". Each terminal node realizes different control functions through different mounted control devices, so that a corresponding control instruction is stored in a terminal node processing unit, the control instruction received by the terminal node is checked in advance, if the control instruction is successful, a corresponding controller is executed, and if the control instruction is failed, a failure control mechanism is adopted.
TABLE 2 air-conditioner switch data packet
Data head
|
Type of control
|
Control function
|
Check bit
|
0xAA
|
0x01
|
0x01
|
CRC |
The failure control mechanism comprises:
1) and (4) discarding feedback: after the received command fails to be verified, the control command is immediately discarded, and meanwhile, a prompt data packet with control failure is fed back upwards and forwarded to the APU through the coordinator, the APU sends back the prompt data packet to the server side, and finally the prompt data packet is fed back to a UI (user interface) of a user to prompt the user of operation failure information.
2) And (3) failed retransmission: and after the received command fails to be checked, sending a section of feedback data packet to the coordinator, automatically retransmitting the feedback data packet after the coordinator receives the feedback, setting an upper limit of retransmission times, and discarding the control command if the continuous retransmission fails and simultaneously feeding the control command back to the user side.
The components include, but are not limited to, a motor module for realizing an air conditioner switch and a remote switch lock, and the motor module preferably adopts a five-wire four-phase stepping motor with the model number of 28 BYJ. The driving mode is that the electric pulse is converted into the angular displacement to realize the rotation, the angular displacement is controlled by controlling the number of the pulses, so that the purpose of accurate positioning is achieved, the rotating speed of the motor is controlled by controlling the pulse frequency, and the purpose of speed regulation is achieved. Specifically, the energization pattern for the five-wire four-phase motor is shown in table 2 below, which is a counterclockwise rotation phase sequence diagram.
As shown in table 3, by energizing each line of the five-wire four-phase motor according to the above-mentioned phase sequence rule, the motor can be rotated counterclockwise by one rotation to simulate the control of the opening angle of the door in the vehicle, and the opening angle of the door can be controlled by controlling the rotation angle of the motor. Similarly, when the motor is required to rotate clockwise by a certain angle, the level can be set through the clockwise rotation meter of the motor, so that the purpose of clockwise rotation is achieved.
TABLE 3 drive mode of the motor
As shown in table 4, in this embodiment, for example, the stepping motor simulates control of an air conditioner in a vehicle, the instruction shown in table 3 is set by the user side, and is forwarded to the service side through the okHttp protocol, and the service side analyzes the obtained instruction, and forwards the instruction to the vehicle-mounted APU, and stores the instruction in the local database.
TABLE 4 instruction control Table
As shown in table 5, the APP side control instruction is forwarded to the server, and the type of the control instruction, the instruction function, and the instruction issue time are stored correspondingly.
TABLE 5 Server side instruction reception
Recording ID
|
Type of instruction
|
Instruction function
|
Instruction time
|
1
|
Air
|
On/Off
|
Current_Time
|
2
|
Door
|
On/Off
|
Current_Time
|
﹒﹒﹒
|
﹒﹒﹒
|
﹒﹒﹒
|
﹒﹒﹒
|
n
|
Air_Adjust
|
Up/Down
|
Current_Time |
On the basis of networking, firstly recording the transmission times of a data packet for each terminal node, and setting a fixed upper limit of the transmission times for terminating transmission; secondly, all data packets received by the coordinator are identified, the times of receiving the data packets conforming to the sensor data format are recorded, and finally the packet loss rate of the whole network is obtained
Wherein: send refers to the number of packets that each terminal of Zigbee needs to send, hive refers to the total number of packets received by the coordinator node of Zigbee, and n is how many terminal nodes are as sending points.
And counting the time consumption from the APP end to the server, then to the APU, and finally to the in-vehicle terminal control link, sending an instruction from the APP end, receiving and forwarding the instruction to the APU by the server, and finally, addressing and controlling a certain terminal node in the vehicle through the coordinator. MCU for controlling time delaydelay+SERVERdelay+APPdelayWherein: MCU represents the time of sending signal from coordinator node to a certain terminal node, SERVER represents the time of receiving signal from APP terminal and forwarding to APU at service terminal, and the last APP is the time of sending command from user to receiving signal at service terminal.
This embodiment simulation APP remote control car in-vehicle motor, statistics are from user's time of sending the instruction to the instruction execution, are seen from the table, and the average scope of this time delay is in the second level, can satisfy the user basically and experience the control of terminal in the car, has simulated the instruction in laboratory environment and has sent the server from the APP end, and rethread APU receives the transfer, conveys to terminal control link in the car to the realization is to the control scene of certain node. One android mobile phone, one data center server, one in-vehicle module APU (model), and one zigbee networking module (coordinator node: one, routing nodes: 2, and control nodes: 3).
As shown in table 6, for statistical data of transmission and reception of data packets between the coordinator and the target terminal node in an experimental scenario, it is seen from the table that packet loss rates of four groups of experimental data are not more than one percent, and basically no packet loss occurs at the lowest time, and the packet loss rate reaches 0.6% at the highest time, and the generated data packet loss may cause Wi-Fi network interference in the same frequency band in a laboratory environment.
Table 6Zigbee packet loss ratio
Number of terminal control nodes
|
Sending (packet number)
|
Receiving (packet number)
|
Packet loss ratio (%)
|
3
|
100
|
100
|
0
|
3
|
200
|
200
|
0
|
3
|
500
|
498
|
0.4
|
3
|
1000
|
994
|
0.6 |
As shown in table 7, mobility of the in-vehicle control part is fully considered for four sets of system control delay results measured in an experimental scene, wherein the in-vehicle control components are distributed differently under each set of conditions, and each set of results is a delay average value obtained by continuously sending 10 control instructions in the same time period.
TABLE 7 System control delay
Type of instruction
|
On
|
Off
|
1
|
0.97s
|
1.07s
|
2
|
1.32s
|
1.36s
|
3
|
1.15s
|
1.85s
|
4
|
1.27s
|
1.42s |
The foregoing embodiments may be modified in many different ways by those skilled in the art without departing from the spirit and scope of the invention, which is defined by the appended claims and all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.