Disclosure of Invention
The invention aims to provide a wifi key burning system and a wifi key burning method, which are compatible with a burning method of multiple types of key formats by aiming at different key data formats required by different cloud platform schematics, and solve the problems that the existing household appliance production line cannot uniformly version burning software, production operation is difficult and production efficiency is affected.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention relates to a wifi key burning system, which comprises a key management server, a local computer, a wifi module and a code scanner;
the key management server is connected with the local computer through a wired or wireless network; the local computer is connected with the wifi module in a wireless communication mode; the local computer is connected with the code scanner through a serial port mode;
the key management server is used for creating and storing a key template file and is responsible for analyzing the key file, and the analyzed key information is stored in a database to which the key management server belongs;
the local computer is internally provided with burning software, and is used for periodically downloading key information from a key management server and storing the key information in a local database, receiving the MAC address, the cloud platform identifier and the product model transmitted by the code scanner, inquiring the local database to acquire a group of key information, and then transmitting the key information to the wifi module;
the wifi module is used for receiving key information sent by the local computer and writing the key information into the flash;
the code scanner is used for scanning the bar code/two-dimensional code on the product, resolving the contained MAC address, cloud platform identification and product model, and sending the MAC address, the cloud platform identification and the product model to the local computer.
The invention discloses a wifi key burning method, which comprises the following steps:
step S1: logging in to a key management server and creating a key template file;
step S2: importing a file storing a key to a key management server, selecting a corresponding key template, analyzing the key file by the key management server according to a template format, analyzing key information, splicing key composition fields into an actual key data packet according to a key composition data packet example format in the template file, and storing the actual key data packet in a database to which the key management server belongs;
step S3: the local computer is provided with burning software, avoids the production time of products, downloads key information meeting the production quantity requirement of the products from the key management server, and stores the key information in a local database;
step S4: the bar code/two-dimensional code on the product is scanned and analyzed by the code scanner, wherein the bar code/two-dimensional code comprises an MAC address corresponding to the wifi module, a cloud platform identifier to be connected with the product, and a product model, and is transmitted to a local computer in a serial port communication mode;
step S5: the local computer is connected with a hot spot released by the wifi module in a wireless mode, namely an MAC address transmitted by the scanner, and establishes UDP communication; inquiring a group of unused key data packages in a local database by taking a cloud platform identifier and a product model as inquiry conditions, and sending the key data packages to a wifi module;
step S6: the wifi module receives the key data packet, writes the key data packet into the flash, and feeds back the writing result to the local computer;
step S7: the local computer receives and prompts a key burning result fed back by the wifi module;
if the burning succeeds, the using state of the group of keys is set as used in a local database;
if the burning fails, the state of the group key in the database is kept unchanged.
Preferably, in the step S1, the key template file type includes: excel, txt, word; the key template file needs to include: cloud platform, product model, key composition field, key composition packet example.
Preferably, in the step S2, the key information includes: cloud platform, product model, key composition field.
The invention has the following beneficial effects:
according to the invention, the key template file is created in the key management server, the key file is imported and matched with the key template, the key data package is spliced according to the template format, the local computer downloads a batch of keys from the key management server, the barcode scanner scans the bar codes of the products and analyzes the bar codes and then transmits the bar codes to the local computer, the key data package is sent to the wifi module, and the result is fed back to the local computer for burning, so that a burning scheme compatible with multiple key formats is realized, the online production efficiency of the products is improved, and meanwhile, the maintenance cost of software versions is reduced.
Of course, it is not necessary for any one product to practice the invention to achieve all of the advantages set forth above at the same time.
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 be within the scope of the invention.
Referring to fig. 1, the invention provides a wifi key burning system, which comprises a key management server, a local computer, a wifi module and a code scanner;
the key management server is connected with the local computer through a wired or wireless network; the local computer is connected with the wifi module in a wireless communication mode; the local computer is connected with the code scanner through a serial port mode;
the key management server is used for creating and storing a key template file and responsible for analyzing the key file, and storing the analyzed key information in a database to which the key management server belongs;
the local computer is internally provided with burning software, and is used for periodically downloading key information from a key management server and storing the key information in a local database, receiving the MAC address, the cloud platform identifier and the product model transmitted by the code scanner, inquiring the local database to acquire a group of key information, and then transmitting the key information to the wifi module;
the wifi module is used for receiving the key information sent by the local computer and writing the key information into the flash;
the code scanner is used for scanning the bar code/two-dimensional code on the product, analyzing the contained MAC address, cloud platform identification and product model, and sending the MAC address, the cloud platform identification and the product model to the local computer.
The invention discloses a wifi key burning method, which comprises the following steps:
step S1: logging in to a key management server and creating a key template file;
step S2: importing a file storing a key to a key management server, selecting a corresponding key template, analyzing the key file by the key management server according to a template format, analyzing key information, splicing key composition fields into an actual key data packet according to a key composition data packet example format in the template file, and storing the actual key data packet in a database to which the key management server belongs;
step S3: the local computer is provided with burning software, avoids the production time of products, downloads key information meeting the production quantity requirement of the products from the key management server, and stores the key information in a local database;
step S4: the bar code/two-dimensional code on the product is scanned and analyzed by the code scanner, wherein the bar code/two-dimensional code comprises an MAC address corresponding to the wifi module, a cloud platform identifier to be connected with the product, and a product model, and is transmitted to a local computer in a serial port communication mode;
step S5: the local computer is connected with a hot spot released by the wifi module in a wireless mode, namely an MAC address transmitted by the scanner, and establishes UDP communication; inquiring a group of unused key data packages in a local database by taking a cloud platform identifier and a product model as inquiry conditions, and sending the key data packages to a wifi module;
step S6: the wifi module receives the key data packet, writes the key data packet into the flash, and feeds back the writing result to the local computer;
step S7: the local computer receives and prompts a key burning result fed back by the wifi module;
if the burning succeeds, the using state of the group of keys is set as used in a local database;
if the burning fails, the state of the group key in the database is kept unchanged.
In step S1, the key template file type includes: excel, txt, word; the key template file needs to contain: cloud platform, product model, key composition field, key composition packet example.
In step S2, the key information includes: cloud platform, product model, key composition field.
One specific application of this embodiment is:
a key burning method realized by a wifi key burning system comprises the following steps:
step S1: logging in to a key management server, and creating a key template file named FriSecTemplate1, wherein the template file is of the type: excel, template file contains: cloud platform, product model, key composition field, key composition packet example; illustrating template file content, such as: cloud platform: closed, product model, key composition field: modelKey, deviceSecret, key composition packet example: { "ModelKey": "AAA", "DeviceSecret": "BBB";
step S2: from an external memory, such as: the USB flash disk, import the file to store key to the key management server, and choose the correspondent key template FriSecTemplate1, the key management server analyzes the key file according to the template format, analyze out the key information, include: the cloud platform, the product model and the key composition field are spliced into an actual key data packet according to the key composition data packet example format in the template file, and the actual key data packet is stored in a database to which the key management server belongs; examples are as follows: cloud platform parsed from key file: meilingclosed, product model: fridge550, in which a set of keys make up the actual values of the fields, modelKey: a1b2c3, deviceSecret
Z6lT0oT36Lq1blOTPsGV 9s6o07Yzoxn, splice into the key data packet according to the key data packet example format: { "ModelKey": "a1b2c3", "DeviceSecret": "z6lT0oT36Lq1 blitpsGV 9s6o07Yzoxn" };
step S3: the local computer is provided with burning software, and the production time of the product is staggered, for example: downloading a sufficient amount of key information from the key management server 1 every day in the morning 2:00, and storing the key information in a local database;
step S4: the bar code/two-dimensional code on the product is scanned and analyzed by the code scanner, wherein the bar code/two-dimensional code comprises an MAC address corresponding to the wifi module, a cloud platform identifier to be connected with the product, and a product model, and is transmitted to a local computer in a serial port communication mode;
step S5: the local computer is connected with a hot spot released by the wifi module in a wireless mode, namely an MAC address transmitted by the scanner, and establishes UDP communication; in the local database, a cloud platform identifier, such as MeilingClound, a product model, such as Fridge550, is used as a query condition to query a group of unused key data packets, such as: { "ModelKey": "a1b2c3", "DeviceSecret": "z6lT0oT36Lq1blOTPsGV 9s6o07Yzoxn" }, send to wifi module 3;
step S6: the wifi module receives the key data packet, writes the key data packet into the flash, and feeds back the writing result to the local computer;
step S7: the local computer receives and prompts a key burning result fed back by the wifi module, and if the burning is successful, the using state of the group of keys is set as used in a local database; if the burning fails, the state of the group key in the database is kept unchanged.
It should be noted that, in the above system embodiment, each unit included is only divided according to the functional logic, but not limited to the above division, so long as the corresponding function can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
In addition, those skilled in the art will appreciate that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program to instruct related hardware, and the corresponding program may be stored in a computer readable storage medium.
The preferred embodiments of the invention disclosed above are intended only to assist in the explanation of the invention. The preferred embodiments are not exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. The invention is limited only by the claims and the full scope and equivalents thereof.