Disclosure of Invention
The invention aims to provide a wifi key burning system and a wifi key burning method, which are compatible with a multi-type key format by requiring different key data formats according to different cloud platform schemes, and solve the problems that the existing household appliance production line cannot unify versions of burning software, so that production operation is difficult and production efficiency is influenced.
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 scanning instrument;
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 in a serial port mode;
the key management server is used for creating and storing a key template file, is responsible for analyzing the key file, and stores the analyzed key information into a database to which the key management server belongs;
burning software is installed in the local computer and used for downloading key information from the key management server periodically, 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 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;
and the code scanning instrument is used for scanning the bar code/two-dimensional code on the product, analyzing the MAC address, the cloud platform identification and the product model contained in the bar code/two-dimensional code, and sending the bar code/two-dimensional code to the local computer.
The invention relates to a wifi secret key burning method, which comprises the following steps:
step S1: logging in a key management server and creating a key template file;
step S2: importing a file for 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, composing a data packet example format according to the key in the template file, splicing key composition fields into an actual key data packet, 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, product production time is avoided, key information meeting the product production quantity requirement is downloaded from the key management server and stored in a local database;
step S4: the code scanner scans and analyzes a bar code/two-dimensional code on a product, wherein the bar code/two-dimensional code at least comprises an MAC address corresponding to a 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 UDP communication is established; in a local database, a cloud platform identifier and a product model are used as query conditions to query a group of unused key data packets, and the key data packets are sent to a wifi module;
step S6: the wifi module receives the key data packet, writes the key data packet into a flash, and feeds back a write-in 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 is successful, setting the use state of the group of keys as used in a local database;
if the burning fails, the state of the group of keys in the database is kept unchanged.
Preferably, in step S1, the key template file types include, but are not limited to: excel, txt, word; the key template file needs to include but is not limited to: cloud platform, product model, key composition field, key composition data packet example.
Preferably, in step S2, the key information includes: the cloud platform, the product model and the key form fields.
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 packets are spliced according to the template format, the local computer downloads batch keys from the key management server, the code scanner scans the product bar code and analyzes the product bar code and then transmits the product bar code to the local computer, the key data packets are sent to the wifi module, and the result is fed back to the local computer for burning, so that a burning scheme compatible with various types of key formats is realized, the online production efficiency of products is improved, and the maintenance cost of software versions is reduced.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention is a wifi key burning system, which includes 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 in a serial port mode;
the key management server is used for creating and storing a key template file, is responsible for analyzing the key file, and stores the analyzed key information into a database to which the key management server belongs;
burning software is installed in the local computer and used for downloading key information from the key management server periodically, 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 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;
and the code scanning instrument is used for scanning the bar code/two-dimensional code on the product, analyzing the MAC address, the cloud platform identification and the product model contained in the bar code/two-dimensional code, and sending the bar code/two-dimensional code to the local computer.
The invention relates to a wifi secret key burning method, which comprises the following steps:
step S1: logging in a key management server and creating a key template file;
step S2: importing a file for 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, composing a data packet example format according to the key in the template file, splicing key composition fields into an actual key data packet, 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, product production time is avoided, key information meeting the product production quantity requirement is downloaded from the key management server and stored in a local database;
step S4: the code scanner scans and analyzes a bar code/two-dimensional code on a product, wherein the bar code/two-dimensional code at least comprises an MAC address corresponding to a 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 UDP communication is established; in a local database, a cloud platform identifier and a product model are used as query conditions to query a group of unused key data packets, and the key data packets are sent to a wifi module;
step S6: the wifi module receives the key data packet, writes the key data packet into a flash, and feeds back a write-in 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 is successful, setting the use state of the group of keys as used in a local database;
if the burning fails, the state of the group of keys in the database is kept unchanged.
In step S1, the key template file types include, but are not limited to: excel, txt, word; the key template file needs to include but is not limited to: cloud platform, product model, key composition field, key composition data packet example.
In step S2, the key information includes: the cloud platform, the product model and the key form fields.
One specific application of this embodiment is:
a key burning method is realized by using a wifi key burning system, and the method comprises the following procedures:
step S1: logging in a key management server, and creating a key template file with the name FriSecTemplate1, wherein the template file types are as follows: excel, the template file contains: a cloud platform, a product model, a key composition field and a key composition data packet example; illustrating the contents of the template file, such as: cloud platform: cloud, product model, ProductModel, Key composition field: ModelKey, DeviceSecret, Key composition packet example: { "ModelKey": "AAA", "DeviceSecret": BBB "};
step S2: from external storage, such as: the U disk imports a file for storing a key into a key management server, selects a corresponding key template FriSecTemplate1, and the key management server analyzes the key file according to a template format to obtain key information, wherein the key information comprises: the cloud platform, the product model and the key composition field, and according to the example format of the key composition data packet in the template file, splicing the key composition field into an actual key data packet, and storing the actual key data packet in a database to which the key management server belongs; by way of example, such as: the cloud platform parsed from the key file: meilingcloud, product model number: fridge550, where a set of keys constitutes the actual value of each field, ModelKey: a1b2c3, DeviceSecret: z6lT0oT36Lq1 blatPsGVG 9s6o07Yzoxn, spliced into a key data packet according to the key data packet example format: { "ModelKey": "a1b2c3", "DeviceSecret": z6lT0oT36Lq1blOTPsGVV9s6o07Yzoxn "};
step S3: the local computer is provided with burning software, and the production time of the product is staggered, such as: downloading a sufficient amount of key information from the key management server 1 every morning at 2:00, and storing the key information in a local database;
step S4: the code scanner scans and analyzes a bar code/two-dimensional code on a product, wherein the bar code/two-dimensional code comprises an MAC address corresponding to a 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 UDP communication is established; in the local database, a cloud platform identifier, such as MeilingClound and 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": z6lT0oT36Lq1blOTPsGVV9s6o07Yzoxn "}, which is sent to the wifi module 3;
step S6: the wifi module receives the key data packet, writes the key data packet into a flash, and feeds back a write-in result to the local computer;
step S7: the local computer receives and prompts the key burning result fed back by the wifi module, and if burning is successful, the using state of the group of keys is set to be used in the local database; if the burning fails, the state of the group of keys in the database is kept unchanged.
It should be noted that, in the above system embodiment, each included unit is only divided according to functional logic, but is not limited to the above division as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
In addition, it is understood by those skilled in the art that all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing associated hardware, and the corresponding program may be stored in a computer-readable storage medium.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments 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 utilize the invention. The invention is limited only by the claims and their full scope and equivalents.