Analysis of WeChat One Type One Code Implementation

Wechat One Type One Code Realization Analysis of



the principle of arikiss distribution network
1. APP enters the arikiss distribution network mode, and sends broadcast messages (WIFI account and password) to the designated port in promiscuous mode
2. The product presses the button to let the WIFI module enter the promiscuous mode to receive APP messages The broadcast message, get the WIFI account and password, and enter to connect to the router.
3. After the WIFI module is connected to the router, it broadcasts the successful connection information to a certain port.
4. After the APP receives the information of successful connection to a certain port, the configuration interface will pop up.
5. Connect the router to this WIFI module. The principle of



one
machine , one code device binding
2. The server of the connected product adds (if it is the first time) a device information record to the database .
3. The APP scans the QR code to obtain a message containing the product's unique code and sends it to the application server.
4. The application server sends the unique code to the server that connects the product, and the server that connects the product returns the device number of the unique code to the application server.
5. After the application server receives the device number, the association with the user number is stored in the database.
6. This completes the function of binding the user to the device.


The principle of near field discovery function
1. The product is powered on, upload the product unique code (which contains the product unique model number) to the WIFI module 2. The WIFI module
goes to the product server to obtain the product ID (product_id) obtained in the public account with the unique model number.
3. The APP enters the near field discovery function and broadcasts the information of the device reporting information to the router.
4. The WIFI module with near-block discovery capability will receive the information broadcasted by the APP, and return a packet with the product unique code and product_id to the APP
. Whether the parameter information is consistent or not, the device will be displayed on the APP if they are consistent.

Another way
1. After getting the product unique code in response, the APP sends it to the server to get the product_id. If the product_id is consistent with the parameter product_id when entering the near field discovery, the device will be displayed on the APP.



One type one code device binding principle
1. APP scans a two-dimensional code, the application server jumps to another two-dimensional code according to the two-dimensional code information (this two-dimensional code is used for one type one code device binding )
2. Long press another QR code that appears on the APP (this QR code is a QR code generated after adding the one-type, one-code device information to the official account, which contains the official account, device type, product ID (product_id) device description, etc.). Skip to the configuration network and device discovery interface.
3. If the device is not connected to the Internet, it will start the arikiss distribution network. If you choose to skip the arikiss distribution network, you will enter the near field discovery function under the same router.
4. After discovering the product, the user clicks the device to be bound, and the APP will send the device binding information to the
WeChat server. The above configuration) sends the binding notification information, and the application server receives the binding information and then processes the binding logic of the application itself.
6. Unbinding is performed by the application server sending the unbinding information to the WeChat server. Of course, the unbinding application server can also receive the unbinding notification information on the WeChat application APP.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326734167&siteId=291194637
one
ONE