CN115883150A - Device information writing method, device, storage medium and electronic device - Google Patents
Device information writing method, device, storage medium and electronic device Download PDFInfo
- Publication number
- CN115883150A CN115883150A CN202211476076.2A CN202211476076A CN115883150A CN 115883150 A CN115883150 A CN 115883150A CN 202211476076 A CN202211476076 A CN 202211476076A CN 115883150 A CN115883150 A CN 115883150A
- Authority
- CN
- China
- Prior art keywords
- serial number
- equipment
- server
- things
- target internet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a device information writing method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring a first equipment serial number from a server; the first equipment serial number is sent to the target Internet of things equipment through the wireless communication module, and a second equipment serial number returned by the target Internet of things equipment is received; and sending the second equipment serial number to the server side for matching and checking to obtain a first checking result. The invention solves the technical problem of low equipment serial number writing efficiency caused by complex equipment serial number writing process in the related technology.
Description
Technical Field
The invention relates to the field of Internet of things, in particular to a method and a device for writing equipment information, a storage medium and an electronic device.
Background
With the rapid development of the internet of things technology, in order to better identify and track the internet of things devices, a unique device Serial Number (SN) needs to be written into each internet of things device.
In the related technology, a manual writing mode is usually adopted, a batch of equipment serial numbers are generated in advance according to a coding rule of a manufacturer, and then a worker inputs the equipment serial numbers into a main control chip of the internet of things equipment by using specific writing software.
In manual writing, the writing environment is complex to set up, e.g., requiring the connection of write lines or requiring a specialized fixture. In addition, when the writing requirement of the whole machine exists, the whole machine needs to be disassembled, so that the writing process of the serial number of the equipment is complex, and the writing efficiency is low.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for writing equipment information, a storage medium and an electronic device, which are used for at least solving the technical problem of low equipment serial number writing efficiency caused by a complex writing process of an equipment serial number in the related technology.
According to an embodiment of the present invention, there is provided an apparatus information writing method including: the method comprises the steps that a first equipment serial number is obtained from a server, wherein the server is used for respectively generating a corresponding equipment serial number for each piece of the plurality of pieces of Internet of things equipment which leave a factory according to a preset rule, and the first equipment serial number is a serial number to be written, which is matched with target Internet of things equipment; the method comprises the steps that a first equipment serial number is sent to a target Internet of things device through a wireless communication module, and a second equipment serial number returned by the target Internet of things device is received, wherein the second equipment serial number is a serial number written in the target Internet of things device locally; and sending the second equipment serial number to a server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment or not.
Optionally, the obtaining the first device serial number from the server includes: establishing socket communication connection with a server; a first device serial number is obtained from a server via a socket communication connection.
Optionally, the device information writing method further includes: establishing wireless communication connection with the wireless communication module; and acquiring the equipment attribute information of the target Internet of things equipment through wireless communication connection.
Optionally, the obtaining the first device serial number from the server via the socket communication connection includes: reporting the device attribute information to a server via a socket communication connection; and acquiring a first equipment serial number corresponding to the equipment attribute information issued by the server through the socket communication connection.
Optionally, the device information writing method further includes: and displaying prompt information corresponding to the first verification result, wherein the prompt information is used for prompting that the first equipment serial number is successfully written into the target Internet of things equipment when the first verification result shows that the first equipment serial number is the same as the second equipment serial number, and prompting that the first equipment serial number is failed to be written when the first verification result shows that the first equipment serial number is different from the second equipment serial number.
Optionally, the wireless communication module is used for sending a serial control command to the target internet of things device through a serial connection mode, wherein the information carried in the serial control command includes: the serial port control command is used for controlling the target Internet of things equipment to write the first equipment serial number.
Optionally, sending the second device serial number to the server for matching verification, and obtaining a first verification result includes: the second equipment serial number is sent to the server through the socket communication connection, so that the server performs matching check on the first equipment serial number and the second equipment serial number to obtain a first check result; and receiving a first verification result fed back by the server through the socket communication connection.
Optionally, the device information writing method further includes: acquiring first updating information from a server, wherein the first updating information is used for updating firmware of a main control chip on target Internet of things equipment; the first updating information is sent to the target Internet of things equipment through the wireless communication module, and second updating information returned by the target Internet of things equipment is received, wherein the second updating information is updating information of local firmware of the target Internet of things equipment; and sending the second updating information to the server side for matching and checking to obtain a second checking result, wherein the second checking result is used for indicating whether the first updating information is successfully updated to the firmware.
According to an embodiment of the present invention, there is also provided an apparatus for writing device information, including: the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first equipment serial number from a server, the server is used for respectively generating a corresponding equipment serial number for each piece of the outgoing equipment of the Internet of things in a plurality of pieces of Internet of things equipment according to a preset rule, and the first equipment serial number is a serial number to be written, which is matched with a target Internet of things equipment; the first communication module is used for sending the first equipment serial number to the target Internet of things equipment through the wireless communication module and receiving a second equipment serial number returned by the target Internet of things equipment, wherein the second equipment serial number is a serial number written in the target Internet of things equipment locally; and the second communication module is used for sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment.
Optionally, the obtaining module is further configured to: establishing socket communication connection with a server; a first device serial number is obtained from a server via a socket communication connection.
Optionally, the obtaining module is further configured to: establishing wireless communication connection with the wireless communication module; and acquiring the equipment attribute information of the target Internet of things equipment through wireless communication connection.
Optionally, the obtaining module is further configured to: reporting the device attribute information to a server via a socket communication connection; and acquiring a first equipment serial number corresponding to the equipment attribute information issued by the server through the socket communication connection.
Optionally, the device information writing apparatus further includes: and the display module is used for displaying prompt information corresponding to the first verification result, wherein the prompt information is used for prompting that the first equipment serial number is successfully written into the target Internet of things equipment when the first verification result shows that the first equipment serial number is the same as the second equipment serial number, and prompting that the first equipment serial number is failed to be written when the first verification result shows that the first equipment serial number is different from the second equipment serial number.
Optionally, the second communication module is further configured to: the second equipment serial number is sent to the server through the socket communication connection, so that the server performs matching verification on the first equipment serial number and the second equipment serial number to obtain a first verification result; and receiving a first verification result fed back by the server through the socket communication connection.
Optionally, the device information writing apparatus further includes: the processing module is used for acquiring first updating information from the server, wherein the first updating information is used for updating the firmware of the main control chip on the target Internet of things equipment; the first updating information is sent to the target Internet of things equipment through the wireless communication module, and second updating information returned by the target Internet of things equipment is received, wherein the second updating information is updating information of local firmware of the target Internet of things equipment; and sending the second updating information to the server side for matching and checking to obtain a second checking result, wherein the second checking result is used for indicating whether the first updating information is successfully updated to the firmware.
According to an embodiment of the present invention, there is further provided a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to be executed by a processor to perform the device information writing method in any one of the above.
According to an embodiment of the present invention, there is also provided an electronic apparatus including a memory and a processor, the memory storing therein a computer program, the processor being configured to execute the computer program to perform the device information writing method in any one of the above.
In at least some embodiments of the present invention, a first device serial number is obtained from a server, and then the first device serial number is sent to a target internet of things device through a wireless communication module, and a second device serial number returned by the target internet of things device is received, and finally the second device serial number is sent to the server for matching verification, so as to obtain a first verification result, thereby achieving a purpose of simplifying a writing process of the device serial number, and thus achieving a technical effect of improving writing efficiency of the device serial number, and further solving a technical problem of low writing efficiency of the device serial number due to a complex writing process of the device serial number in related technologies.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart of a device information writing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a device information writing system according to one embodiment of the present invention;
fig. 3 is a schematic diagram of a device information writing method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of another device information writing method according to an embodiment of the present invention;
fig. 5 is a block diagram of a device information writing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a device information writing method, it should be noted that the steps shown in the flowchart of the figure may be executed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that here.
The method embodiment may be performed in a device information writing system. The device information writing system includes: write in customer end, server, thing networking device and wireless module of writing in.
Specifically, the writing client may be a client where the device serial number writing tool is located. The server may be an equipment serial number local generation server, and may generate the equipment serial number according to a specific rule. The internet of things equipment can be intelligent household equipment, for example: intelligent door locks, intelligent air conditioners, intelligent illuminating lamps and the like; the internet of things equipment can also be intelligent industrial equipment, for example: intelligent robots, intelligent scanners, and the like. The above-mentioned wireless module of writing into can be for the thing networking device provides wireless communication's module, for example, wireless network (WiFi) module, bluetooth Low Energy (BLE) module.
The internal main structures of the Internet of things equipment, the write-in client, the server and the wireless write-in module are basically similar. The internal main structure of the internet of things device will be described as an example, and the internal main structures of the write-in client, the server, and the wireless write-in module will not be described again.
The internet of things device may include one or more processors (the processors may include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processing (DSP) chip, a Microprocessor (MCU), a Programmable logic device (FPGA), a Neural-Network Processor (NPU), a Tensor Processing Unit (TPU), an Artificial Intelligence (AI) type Processor, and the like), and a memory for storing data. Optionally, the internet of things device may further include a transmission device for a communication function, an input/output device, and a display device. It will be understood by those skilled in the art that the foregoing structural description is merely illustrative and not restrictive on the structure of the internet of things device. For example, the internet of things device may also include more or fewer components than the structural description above, or have a different configuration than the structural description above.
The memory may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the device information writing method in the embodiment of the present invention, and the processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implements the device information writing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the internet of things device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the internet of things device. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The Display device may be, for example, a touch screen type Liquid Crystal Display (LCD) and a touch Display (also referred to as a "touch screen" or "touch Display screen"). The liquid crystal display may enable a user to interact with a user interface of the internet of things device. In some embodiments, the internet of things device has a Graphical User Interface (GUI) with which a User can interact by touching finger contacts and/or gestures on a touch-sensitive surface, where the human-machine interaction function optionally includes the following interactions: executable instructions for creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, emailing, call interfacing, playing digital video, playing digital music, and/or web browsing, etc., for performing the above-described device information writing methods, are configured/stored in one or more processor-executable computer program products or readable storage media.
In this embodiment, a device information writing method operating in the write client is provided, and fig. 2 is a flowchart of a device information writing method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S22, a first equipment serial number is obtained from a server, wherein the server is used for respectively generating a corresponding equipment serial number for each piece of Internet of things equipment in a plurality of pieces of Internet of things equipment which leave a factory according to a preset rule, and the first equipment serial number is a serial number to be written, which is matched with a target Internet of things equipment;
step S24, the first equipment serial number is sent to the target Internet of things equipment through the wireless communication module, and a second equipment serial number returned by the target Internet of things equipment is received, wherein the second equipment serial number is a serial number written in the target Internet of things equipment locally;
and S26, sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment or not.
Specifically, the server locally generates a server for the device serial number, and may generate a corresponding device serial number for each of the plurality of pieces of internet-of-things devices leaving the factory according to a preset rule. For example, the device serial number local generation server generates corresponding device serial numbers 20221115180001Lk0001, SN20221115180002Lk0002, \\ 8230, and SN20221115181000Lk1000 for 1000 outgoing intelligent door locks according to preset rules.
The wireless communication module is a module for providing wireless communication for internet of things equipment, for example, a wireless network (WiFi) module, a Bluetooth Low Energy (BLE) module.
The method comprises the steps that an equipment serial number to be written of the Internet of things equipment is obtained from an equipment serial number local generation server, the equipment serial number to be written of the Internet of things equipment is sent to the Internet of things equipment through a wireless communication module, and a serial number which is locally written in the Internet of things equipment and is returned by the Internet of things equipment is received.
For example, the device serial number to be written 20221115180001Lk0001 of the intelligent door lock 1 is obtained from the device serial number local generation server, the device serial number to be written 20221115180001Lk0001 of the intelligent door lock 1 is sent to the intelligent door lock 1 through the WiFi module, and the serial number to be written 20221115180001Lk0001 of the intelligent door lock 1 written locally is received and returned by the intelligent door lock 1.
The returned sequence number written in locally by the internet of things equipment is sent to the local equipment sequence number generation server for matching and checking, and whether the sequence number to be written in of the internet of things equipment is consistent with the sequence number written in locally by the internet of things equipment returned by the internet of things equipment is judged, so that whether the sequence number to be written in of the internet of things equipment is successfully written in the internet of things equipment can be determined.
For example, the returned sequence number 20221115180001Lk0001 written locally by the intelligent door lock 1 is sent to the device sequence number local generation server for matching verification, and it is determined that the sequence number 20221115101 Lk0001 to be written of the intelligent door lock 1 matches the sequence number 20221115180001Lk0001 written locally by the intelligent door lock 1 returned locally by the intelligent door lock 1, so that it can be determined that the sequence number 20221115180001Lk0001 to be written of the intelligent door lock 1 is successfully written into the intelligent door lock 1.
For another example, the returned sequence number 20221115180001Lk0002 written locally by the intelligent door lock 1 is sent to the device sequence number local generation server for matching check, and it is determined that the sequence number to be written 20221115180001Lk0001 of the intelligent door lock 1 does not match the sequence number to be written 20221115180001Lk0002 written locally by the intelligent door lock 1 returned locally by the intelligent door lock 1, so that it can be determined that the sequence number to be written 20221115180001Lk0001 of the intelligent door lock 1 is not written into the intelligent door lock 1 successfully.
Based on the above steps S22 to S26, the first device serial number is obtained from the server, and then the first device serial number is sent to the target internet of things device via the wireless communication module, and the second device serial number returned by the target internet of things device is received, and finally the second device serial number is sent to the server for matching and checking, so as to obtain a first checking result, thereby achieving the purpose of simplifying the writing process of the device serial number, and further achieving the technical effect of improving the writing efficiency of the device serial number, and further solving the technical problem of low writing efficiency of the device serial number due to the complex writing process of the device serial number in the related art.
Optionally, in step S22, the obtaining the first device serial number from the server includes:
step S221, establishing socket communication connection with a server;
step S222, a first device serial number is acquired from the server via the socket communication connection.
Specifically, a Socket (Socket) connection is established with the device serial number local generation server, and a serial number to be written, which is matched with the internet of things device, is acquired from the device serial number local generation server through the Socket connection.
Based on the above steps S221 to S222, the device serial number can be locally generated by establishing a socket communication connection with the server and then acquiring the first device serial number from the server through the socket communication connection, so that the security of the device serial number can be ensured.
Optionally, the device information writing method further includes:
step S211, establishing wireless communication connection with the wireless communication module;
step S212, device attribute information of the target Internet of things device is acquired through wireless communication connection.
Specifically, the device attribute information may include Media Access Control (MAC) address and other information.
Through establishing wireless communication connection with the wireless communication module, the equipment attribute information of the equipment of the Internet of things can be acquired. For example, by establishing a WiFi connection with the WiFi module, the MAC address of the smart door lock 1 can be obtained.
Based on the above steps S211 to S212, the wireless communication connection is established with the wireless communication module, and then the device attribute information of the target internet of things device is obtained through the wireless communication connection, the device attribute information of the internet of things device can be simply and quickly obtained through the wireless communication connection, and the internet of things device and the write-in client need not to be connected through the connection line, the device serial number can be written in for the Circuit Board at the Printed Circuit Board Assembly (PCBA) stage in a wireless manner, and the device attribute information of the internet of things device can be obtained when the device serial number is written in under the environment of the complete machine, without disassembling the complete machine, so that the write-in efficiency of the device serial number can be improved.
Optionally, in step S222, the obtaining the first device serial number from the server via the socket communication connection includes:
step S2221, reporting the device attribute information to the server through the socket communication connection;
step S2222, obtain, via the socket communication connection, a first device serial number corresponding to the device attribute information issued by the server.
Specifically, the device attribute information of the internet of things device can be reported to the device serial number local generation server through the socket communication connection, and then the serial number to be written corresponding to the device attribute information of the internet of things device is acquired from the device serial number local generation server through the socket communication connection.
For example, the MAC address of the smart door lock 1 may be reported to the device serial number local generation server through the socket communication connection, and then the serial number to be written 20221115180001Lk0001 corresponding to the MAC address of the smart door lock 1 is acquired from the device serial number local generation server through the socket communication connection.
Based on the steps S2221 to S2222, the device attribute information is reported to the server via the socket communication connection, and then the first device serial number corresponding to the device attribute information issued by the server is obtained via the socket communication connection, so that the device attribute information of the internet of things device can be reported and the serial number to be written can be obtained simply and quickly via the socket communication connection, and the reporting of the device attribute information and the obtaining of the serial number to be written do not need to be performed via the connection line, so that the writing efficiency of the device serial number can be improved.
Optionally, the device information writing method further includes:
and S27, displaying prompt information corresponding to the first verification result, wherein the prompt information is used for prompting that the first equipment serial number is successfully written into the target Internet of things equipment when the first verification result shows that the first equipment serial number is the same as the second equipment serial number, and prompting that the first equipment serial number is failed to be written when the first verification result shows that the first equipment serial number is different from the second equipment serial number.
Specifically, when the serial number to be written corresponding to the device attribute information of the internet of things device is the same as the locally written serial number of the internet of things device, prompt information is displayed for prompting that the serial number to be written is successfully written into the internet of things device; and when the serial number to be written corresponding to the equipment attribute information of the equipment of the Internet of things is different from the locally written serial number of the equipment of the Internet of things, displaying prompt information for prompting that the serial number to be written fails to be written.
Based on the step S27, whether the device serial number is successfully written into the internet of things device can be prompted by displaying the prompt information corresponding to the first verification result.
Optionally, the wireless communication module is used for sending a serial control command to the target internet of things device through a serial connection mode, wherein the information carried in the serial control command includes: the first equipment serial number and the serial port control command are used for controlling the target Internet of things equipment to write in the first equipment serial number.
Specifically, the serial port connection may be a Universal Asynchronous Receiver/Transmitter (UART) connection. The wireless communication module can send a serial port control command including a serial number to be written into the internet of things device in a serial port connection mode so as to control the internet of things device to write the serial number to be written into the internet of things device.
For example, the WiFi module may send a serial port control command including the serial number 20221115180001Lk0001 to be written to the intelligent door lock 1 through the UART connection, so as to control the intelligent door lock 1 to write the serial number 20221115180001Lk0001 to be written to.
Optionally, in step S26, sending the second device serial number to the server for matching verification, and obtaining a first verification result includes:
step S261, sending the second device serial number to the server via the socket communication connection, so that the server performs matching check on the first device serial number and the second device serial number to obtain a first check result;
step S262, receiving the first verification result fed back by the server via the socket communication connection.
Specifically, the sequence number written locally by the internet of things device is sent to the device sequence number local generation server through socket communication connection, so that the device sequence number local generation server judges whether the sequence number to be written matched by the internet of things device is the same as the sequence number written locally by the internet of things device.
For example, the sequence number 20221115180001Lk0001 written locally by the intelligent door lock 1 is sent to the device sequence number local generation server through Socket communication connection, and then the device sequence number local generation server determines that the sequence number 20221115180001Lk0001 to be written matched with the intelligent door lock 1 is the same as the sequence number 20221115180001Lk0001 written locally by the intelligent door lock 1, and then receives information of "the sequence number to be written matched with the intelligent door lock 1 is the same as the sequence number written locally by the intelligent door lock 1" fed back by the device sequence number local generation server through Socket communication connection.
Based on the above steps S261 to S262, the second device serial number is sent to the server through the socket communication connection, so that the server performs matching check on the first device serial number and the second device serial number to obtain a first check result, and then receives the first check result fed back by the server through the socket communication connection, and whether the device serial number is successfully written into the internet of things device can be determined.
Optionally, the device information writing method further includes:
step S281, obtaining first update information from the server, where the first update information is used to update a firmware of a main control chip on the target internet of things device;
step S282, sending the first update information to the target internet of things device through the wireless communication module, and receiving second update information returned by the target internet of things device, where the second update information is update information of a local firmware of the target internet of things device;
step S283, sending the second update information to the server for matching verification, so as to obtain a second verification result, where the second verification result is used to indicate whether the first update information is successfully updated to the firmware.
Specifically, firmware updating information is acquired from the local generation server of the equipment serial number so as to update the firmware of the main control chip on the internet of things equipment, the firmware updating information is sent to the internet of things equipment through the wireless communication module, updating information of the local firmware returned by the internet of things equipment is received, whether the firmware updating information is the same as the updating information of the local firmware returned by the internet of things equipment is judged, and whether the firmware updating information is successfully updated to the firmware of the main control chip on the internet of things equipment is judged.
For example, the firmware update information is acquired from the device serial number local generation server, where the firmware update information includes a new version of firmware, so as to update an old version of firmware of the main control chip on the smart door lock 1, and then the firmware update information is sent to the smart door lock 1 through the WiFi module, and the update information of the local firmware returned by the smart door lock 1 is received, where the update information of the local firmware includes a new version of firmware, and then it is determined that the firmware update information is the same as the update information of the local firmware returned by the smart door lock 1, and thus it can be determined that the new version of firmware is successfully updated to the firmware of the main control chip on the smart door lock 1.
Based on the above steps S281 to S283, the first update information is acquired from the server, and then the first update information is sent to the target internet of things device via the wireless communication module, and the second update information returned by the target internet of things device is received, and finally the second update information is sent to the server for matching check, so as to obtain a second check result, the firmware update information can be locally acquired in a wireless update manner, and the firmware of the main control chip on the internet of things device can be locally updated, so that the safety of the firmware update information can be ensured, and meanwhile, the method is also suitable for updating the firmware of the main control chip on the internet of things device in the whole machine.
According to the equipment information writing method provided by at least part of embodiments of the invention, the first equipment serial number is obtained from the server, the first equipment serial number is sent to the target Internet of things equipment through the wireless communication module, the second equipment serial number returned by the target Internet of things equipment is received, and finally the second equipment serial number is sent to the server for matching and checking to obtain the first checking result. In addition, the equipment serial number is locally generated by the equipment serial number local generation server, and the generated equipment serial number is sent to the write-in client through local Socket connection, so that the safety of the equipment serial number can be ensured. Furthermore, the first updating information is obtained from the server, then the first updating information is sent to the target Internet of things equipment through the wireless communication module, the second updating information returned by the target Internet of things equipment is received, finally the second updating information is sent to the server for matching and checking, a second checking result is obtained, and the firmware updating information can be written into the Internet of things equipment.
The above-described device information writing method will be further described with reference to the drawings.
Fig. 2 is a schematic diagram of an apparatus information writing system according to an embodiment of the present invention, and as shown in fig. 2, the apparatus information writing system mainly includes four parts, namely an internet of things apparatus, a wireless communication module, a writing client, and a server, where the internet of things apparatus and the wireless communication module communicate with each other through a serial port connection, the wireless communication module and the writing client communicate with each other through a wireless communication connection, and the writing client and the server communicate with each other through a socket communication connection.
Fig. 3 is a schematic diagram of a device information writing method according to an embodiment of the present invention, and as shown in fig. 3, the device information writing method has the following workflow:
step S301, starting a socket communication service;
step S302, establishing serial port connection;
step S303, establishing wireless communication connection;
step S304, the write-in client is used as a client of socket communication to establish socket communication connection with the server;
step S305, reporting the device attribute information of the target Internet of things device;
step S306, forwarding the equipment attribute information of the target Internet of things equipment;
step S307, reporting the device attribute information of the target Internet of things device through socket communication connection;
step S308, a first equipment serial number corresponding to the equipment attribute information of the target Internet of things equipment is issued through socket communication connection;
step S309, forwarding the first equipment serial number;
step S310, sending a serial port control command, wherein the information carried in the serial port control command comprises: the serial port control command is used for controlling the target Internet of things equipment to write the first equipment serial number;
step S311, writing a first equipment serial number;
step S312, returning a second equipment serial number;
step S313, forwarding the second equipment serial number;
step S314 of transmitting the second device serial number via the socket communication connection;
step S315, carrying out matching verification on the first equipment serial number and the second equipment serial number to obtain a first verification result;
step S316, sending a first verification result via the socket communication connection;
step S317, displaying a prompt message corresponding to the first verification result.
In the working process of the equipment information writing method, the first equipment serial number is obtained from the server, the first equipment serial number is sent to the target Internet of things equipment through the wireless communication module, the second equipment serial number returned by the target Internet of things equipment is received, and finally the second equipment serial number is sent to the server to be matched and checked to obtain a first checking result.
The following describes in detail the workflow of the device information writing method by taking a device serial number writing scenario as an example:
firstly, a local generation server of the equipment serial number starts Socket communication service, a UART connection is established between the intelligent door lock 1 and a WiFi module, a WiFi connection is established between the WiFi module and a write-in client, and the write-in client is used as a Socket communication client to establish Socket communication connection with the local generation server of the equipment serial number;
secondly, the intelligent door lock 1 reports the MAC address of the intelligent door lock 1 to a reporting WiFi module through serial port connection, the WiFi module forwards the received MAC address of the intelligent door lock 1 to a write-in client through WiFi connection, and after the write-in client receives the MAC address of the intelligent door lock 1, the MAC address of the intelligent door lock 1 is reported to an equipment serial number local generation server through Socket communication connection;
furthermore, after the device serial number local generation server receives the MAC address of the smart door lock 1, a to-be-written serial number 20221115180001Lk0001 corresponding to the MAC address of the smart door lock 1 is issued to the write-in client through Socket communication connection, after the write-in client receives the to-be-written serial number 20221115180001Lk0001, the to-be-written serial number 20221115180001Lk0001 is forwarded to the WiFi module through WiFi connection, and after the WiFi module receives the to-be-written serial number 20221115180001Lk0001, a serial port control command is sent to the smart door lock 1 through UART connection, wherein the serial port control command includes the to-be-written serial number 20221115180001Lk0001, so that the smart door lock 1 writes the to-be-written serial number 20221115180001Lk0001;
then, the intelligent door lock 1 writes a serial number 20221115180001Lk0001 to be written in according to a serial port control command, and returns a locally written serial number 20221115180001lk0001 to the WiFi module, the WiFi module forwards the received locally written serial number 20221115180001Lk0001 of the intelligent door lock 1 to a writing client, and the writing client sends the locally written serial number 20221115180001Lk0001 of the intelligent door lock 1 to the device serial number local generation server through Socket communication connection after receiving the locally written serial number 20221115180001Lk0001 of the intelligent door lock 1;
finally, the device serial number local generation server determines that the serial number to be written 20221115180001Lk0001 is the same as the locally written serial number 20221115180001Lk0001 of the smart door lock 1, and sends information that the serial number to be written 20221115180001Lk0001 is the same as the locally written serial number 20221115180001Lk0001 of the smart door lock 1 to the write client through the Socket communication connection, and the write client receives the information and then displays that "the serial number to be written 20221115180001Lk0001 has been successfully written into the smart door lock 1".
Fig. 4 is a schematic diagram of another device information writing method according to an embodiment of the present invention, and as shown in fig. 4, the device information writing method has a workflow:
step S401, starting a socket communication service;
step S402, establishing serial port connection;
step S403, establishing wireless communication connection;
step S404, the write-in client is used as a client of socket communication to establish socket communication connection with the server;
step S405, reporting device attribute information of the target Internet of things device;
step S406, forwarding the device attribute information of the target Internet of things device;
step S407, reporting device attribute information of the target Internet of things device through socket communication connection;
step S408, issuing first updating information, wherein the first updating information is used for updating the firmware of the main control chip on the target Internet of things equipment;
step S409, forwarding the first updating information;
step S410, sending first updating information;
step S411, updating the firmware on the main control chip on the target Internet of things equipment according to the first updating information;
step S412, second updating information is returned, wherein the second updating information is updating information of the local firmware of the target Internet of things equipment;
step S413, forwarding the second update information;
step S414, sending second updating information;
step S415, performing matching check on the second updated information to obtain a second check result.
In the working process of the equipment information writing method, the first updating information is obtained from the server, the first updating information is sent to the target Internet of things equipment through the wireless communication module, the second updating information returned by the target Internet of things equipment is received, finally the second updating information is sent to the server for matching and checking, a second checking result is obtained, the firmware updating information can be obtained locally in a wireless updating mode, the firmware of the main control chip on the Internet of things equipment can be updated locally, and therefore the safety of the firmware updating information can be ensured, and meanwhile the equipment information writing method is suitable for updating the firmware of the main control chip on the Internet of things equipment in the whole machine.
The following will describe in detail the workflow of the device information writing method by taking a device firmware update scenario as an example:
firstly, a Socket communication service is started by an equipment serial number local generation server, UART connection is established between an intelligent door lock 1 and a WiFi module, wiFi connection is established between the WiFi module and a write-in client, and Socket communication connection is established between the write-in client as a Socket communication client and the equipment serial number local generation server;
secondly, the intelligent door lock 1 reports the MAC address of the intelligent door lock 1 to a reporting WiFi module through serial port connection, the WiFi module forwards the received MAC address of the intelligent door lock 1 to a write-in client through WiFi connection, and after the write-in client receives the MAC address of the intelligent door lock 1, the MAC address of the intelligent door lock 1 is reported to an equipment serial number local generation server through Socket communication connection;
furthermore, the equipment serial number local generation server issues firmware update information to a write-in client, wherein the issued firmware update information comprises new firmware to update old firmware of a main control chip on the intelligent door lock 1, after the write-in client receives the issued firmware update information, the issued firmware update information is forwarded to a WiFi module through WiFi connection, and after the WiFi module receives the issued firmware update information, the issued firmware update information is sent to the intelligent door lock 1 through UART connection;
then, the intelligent door lock 1 updates the firmware of the main control chip according to the issued firmware updating information, and returns the firmware updating information including local updating of the intelligent door lock 1 to the WiFi module through UART connection, wherein the local updating firmware updating information includes new firmware, and the WiFi module forwards the local updating firmware updating information to the write-in client through WiFi connection after receiving the local updating firmware updating information returned by the intelligent door lock 1;
and finally, the writing client sends the locally updated firmware updating information returned by the intelligent door lock 1 to the server through Socket communication connection, and then the server judges that the firmware updating information sent by the equipment serial number local generation server is the same as the locally updated firmware updating information returned by the intelligent door lock 1, thereby indicating that the firmware of the main control chip on the intelligent door lock 1 is updated successfully.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling the write client to execute the method according to the embodiments of the present invention.
In this embodiment, an apparatus for writing device information is further provided, where the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a device information writing apparatus according to an embodiment of the present invention, and as shown in fig. 5, the apparatus includes: the obtaining module 501 is configured to obtain a first device serial number from a server, where the server is configured to generate a corresponding device serial number for each of a plurality of pieces of internet-of-things devices leaving a factory according to a preset rule, and the first device serial number is a serial number to be written, which is matched with a target internet-of-things device; the first communication module 502 is configured to send the first device serial number to the target internet of things device via the wireless communication module, and receive a second device serial number returned by the target internet of things device, where the second device serial number is a serial number written locally by the target internet of things device; the second communication module 503 is configured to send the second device serial number to the server for matching verification, so as to obtain a first verification result, where the first verification result is used to indicate whether the first device serial number is successfully written into the target internet of things device.
Optionally, the obtaining module 501 is further configured to: establishing socket communication connection with a server; a first device serial number is obtained from a server via a socket communication connection.
Optionally, the obtaining module 501 is further configured to: establishing wireless communication connection with the wireless communication module; and acquiring the equipment attribute information of the target Internet of things equipment through wireless communication connection.
Optionally, the obtaining module 501 is further configured to: reporting the device attribute information to a server via a socket communication connection; and acquiring a first equipment serial number corresponding to the equipment attribute information issued by the server through the socket communication connection.
Optionally, the device information writing apparatus further includes: the display module 504 is configured to display prompt information corresponding to the first check result, where the prompt information is used to prompt that the first device serial number is successfully written into the target internet of things device when the first check result indicates that the first device serial number is the same as the second device serial number, and prompt that the first device serial number is unsuccessfully written when the first check result indicates that the first device serial number is different from the second device serial number.
Optionally, the second communication module 503 is further configured to: the second equipment serial number is sent to the server through the socket communication connection, so that the server performs matching check on the first equipment serial number and the second equipment serial number to obtain a first check result; and receiving a first verification result fed back by the server through the socket communication connection.
Optionally, the device information writing apparatus further includes: the processing module 505 is configured to obtain first update information from a server, where the first update information is used to update a firmware of a main control chip on a target internet of things device; the first updating information is sent to the target Internet of things equipment through the wireless communication module, and second updating information returned by the target Internet of things equipment is received, wherein the second updating information is updating information of local firmware of the target Internet of things equipment; and sending the second updating information to the server side for matching and checking to obtain a second checking result, wherein the second checking result is used for indicating whether the first updating information is successfully updated to the firmware.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention further provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is configured to, when executed by a processor, perform the steps of any of the above method embodiments.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
the method comprises the steps that S1, a first equipment serial number is obtained from a server, wherein the server is used for generating a corresponding equipment serial number for each piece of Internet of things equipment in a plurality of pieces of Internet of things equipment which leave a factory according to preset rules, and the first equipment serial number is a serial number to be written, which is matched with target Internet of things equipment;
s2, sending the first equipment serial number to target Internet of things equipment through a wireless communication module, and receiving a second equipment serial number returned by the target Internet of things equipment, wherein the second equipment serial number is a local written serial number of the target Internet of things equipment;
and S3, sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment or not.
Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps of any of the above method embodiments.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
the method comprises the steps that S1, a first equipment serial number is obtained from a server, wherein the server is used for generating a corresponding equipment serial number for each piece of Internet of things equipment in a plurality of pieces of Internet of things equipment which leave a factory according to preset rules, and the first equipment serial number is a serial number to be written, which is matched with target Internet of things equipment;
s2, sending the first equipment serial number to the target Internet of things equipment through the wireless communication module, and receiving a second equipment serial number returned by the target Internet of things equipment, wherein the second equipment serial number is a serial number written in the target Internet of things equipment locally;
and S3, sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment or not.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing the writing client to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (11)
1. An apparatus information writing method, comprising:
the method comprises the steps that a first equipment serial number is obtained from a server, wherein the server is used for respectively generating a corresponding equipment serial number for each piece of the plurality of pieces of Internet of things equipment which leave a factory according to a preset rule, and the first equipment serial number is a serial number to be written, which is matched with target Internet of things equipment;
sending the first equipment serial number to the target Internet of things equipment through a wireless communication module, and receiving a second equipment serial number returned by the target Internet of things equipment, wherein the second equipment serial number is a serial number written in the target Internet of things equipment locally;
and sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment or not.
2. The device information writing method according to claim 1, wherein acquiring the first device serial number from the server includes:
establishing a socket communication connection with the server;
obtaining the first device serial number from the server via the socket communication connection.
3. The device information writing method according to claim 2, characterized in that the device information writing method further comprises:
establishing wireless communication connection with the wireless communication module;
and acquiring the equipment attribute information of the target Internet of things equipment through the wireless communication connection.
4. The device information writing method according to claim 3, wherein acquiring the first device serial number from the server via the socket communication connection includes:
reporting the device attribute information to the server via the socket communication connection;
and acquiring the first equipment serial number corresponding to the equipment attribute information issued by the server through the socket communication connection.
5. The device information writing method according to claim 1, characterized in that the device information writing method further comprises:
and displaying prompt information corresponding to the first verification result, wherein the prompt information is used for prompting that the first equipment serial number is successfully written into the target Internet of things equipment when the first verification result shows that the first equipment serial number is the same as the second equipment serial number, and prompting that the first equipment serial number is failed to be written into the target Internet of things equipment when the first verification result shows that the first equipment serial number is different from the second equipment serial number.
6. The device information writing method according to claim 1, wherein the wireless communication module is configured to send a serial control command to the target internet of things device in a serial connection manner, and information carried in the serial control command includes: the serial port control command is used for controlling the target Internet of things equipment to write in the first equipment serial number.
7. The device information writing method according to claim 2, wherein sending the second device serial number to the server for matching verification, and obtaining the first verification result includes:
sending the second equipment serial number to the server through the socket communication connection, so that the server performs matching check on the first equipment serial number and the second equipment serial number to obtain a first check result;
receiving the first check result fed back by the server through the socket communication connection.
8. The device information writing method according to claim 1, characterized in that the device information writing method further comprises:
acquiring first updating information from the server, wherein the first updating information is used for updating the firmware of a main control chip on the target Internet of things equipment;
sending the first updating information to the target Internet of things equipment through the wireless communication module, and receiving second updating information returned by the target Internet of things equipment, wherein the second updating information is updating information of local firmware of the target Internet of things equipment;
and sending the second updating information to the server side for matching check to obtain a second check result, wherein the second check result is used for indicating whether the first updating information is successfully updated to the firmware.
9. An apparatus for writing device information, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring a first equipment serial number from a server, the server is used for respectively generating a corresponding equipment serial number for each piece of the delivered multiple pieces of internet of things equipment according to a preset rule, and the first equipment serial number is a serial number to be written, which is matched with a target internet of things equipment;
the first communication module is used for sending the first equipment serial number to the target internet of things equipment through a wireless communication module and receiving a second equipment serial number returned by the target internet of things equipment, wherein the second equipment serial number is a serial number written in the target internet of things equipment locally;
and the second communication module is used for sending the second equipment serial number to the server side for matching and checking to obtain a first checking result, wherein the first checking result is used for indicating whether the first equipment serial number is successfully written into the target Internet of things equipment.
10. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to, when executed by a processor, perform the device information writing method according to any one of claims 1 to 8.
11. An electronic apparatus comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the device information writing method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211476076.2A CN115883150A (en) | 2022-11-23 | 2022-11-23 | Device information writing method, device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211476076.2A CN115883150A (en) | 2022-11-23 | 2022-11-23 | Device information writing method, device, storage medium and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115883150A true CN115883150A (en) | 2023-03-31 |
Family
ID=85760723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211476076.2A Pending CN115883150A (en) | 2022-11-23 | 2022-11-23 | Device information writing method, device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115883150A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116719977A (en) * | 2023-06-16 | 2023-09-08 | 深圳亮钻科技有限公司 | Sequence number writing method, device, equipment and medium |
-
2022
- 2022-11-23 CN CN202211476076.2A patent/CN115883150A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116719977A (en) * | 2023-06-16 | 2023-09-08 | 深圳亮钻科技有限公司 | Sequence number writing method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112073471B (en) | Control method and device of equipment, storage medium and electronic device | |
CN110875850B (en) | Firmware upgrading method and system, readable storage medium and terminal equipment | |
CN105259806B (en) | Controller upgrading method and system, master controller and slave controller | |
CN102932695A (en) | Remote control method, intelligent terminal and intelligent remote control system | |
CN111651180B (en) | Firmware updating method and device, processor and intelligent gateway equipment | |
CN111245714A (en) | Access method and device of home gateway module, storage medium and electronic device | |
CN104170520A (en) | Sharing user information through secondary displays | |
CN115883150A (en) | Device information writing method, device, storage medium and electronic device | |
CN114007235A (en) | Scene rule writing method and device, storage medium, processor and electronic equipment | |
CN105629786A (en) | Method and device for sending household electrical appliance control order | |
CN112083936B (en) | Module burning authorization tracking system, burning task creating method and device | |
CN112034807B (en) | Module burning authorization tracking system, module burning method and device | |
CN112019409B (en) | Equipment distribution network processing method, equipment distribution network processing device and electronic equipment | |
CN111683372B (en) | Attribute information processing method, attribute information processing device, processor and terminal | |
CN114679477A (en) | Method and device for burning information, terminal equipment and wired burning system | |
CN107273102A (en) | The generation method and device of mobile applications | |
CN1791884B (en) | Method of manufacturing recyclable electronic products and electronic products obtained by the method | |
CN105739694A (en) | Wearable equipment, interaction method thereof and terminal | |
CN112034808B (en) | Module burning authorization tracking system, module burning information adjusting method and device | |
CN112052019B (en) | Module burning authorization tracking system, module burning method and device | |
CN101998691B (en) | Method, system and device for data transmission | |
CN112055090A (en) | Module burning authorization tracking system, module burning method and device | |
CN101729672B (en) | Management method and system of multifunction mobile equipment | |
CN111209613A (en) | Rapid design method and system of intelligent product | |
CN112034806B (en) | Module burning authorization tracking system, module burning method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |