Search

CN-121981136-A - Method for quickly writing serial numbers of Linux equipment

CN121981136ACN 121981136 ACN121981136 ACN 121981136ACN-121981136-A

Abstract

The invention belongs to the field of intelligent home, in particular to a method for quickly writing serial numbers of Linux equipment, which comprises the following steps that S1, an upper computer of a printing room generates and prints equipment SN code stickers in batches, and then an operator pastes the equipment SN code stickers onto corresponding Linux equipment bodies; and S3, the upper computer automatically scans connectable Linux equipment in the local area network and displays an equipment list, an operator scans an SN bar code on a machine body of the Linux equipment by using the code scanning gun, and the code scanning gun sends SN data to the upper computer. According to the invention, the printing, code pasting, code scanning and writing links are integrated to form a complete automatic link, the code scanning gun and the upper computer cooperatively operate to realize the writing after code pasting, the problem of error manual input and equipment information mismatch is avoided, and the production consistency, the tracing accuracy and the working efficiency are improved.

Inventors

  • LI HANGSHENG

Assignees

  • 厦门狄耐克智能科技股份有限公司

Dates

Publication Date
20260505
Application Date
20251128

Claims (6)

  1. 1. The method for quickly writing the serial number of the Linux equipment is characterized by comprising the following steps of: s1, generating and printing equipment SN code stickers in batches by a printing room upper computer, and then pasting the equipment SN code stickers on corresponding Linux equipment bodies by operators; S2, after the upper computer software is started, the upper computer is connected with a code scanning gun through a serial port; s3, automatically scanning connectable Linux equipment in a local area network by an upper computer and displaying an equipment list, scanning an SN bar code on a machine body of the Linux equipment by an operator by using a code scanning gun, and transmitting SN data to the upper computer by the code scanning gun; S4, after receiving the SN number data, the upper computer automatically connects with the target Linux equipment through an adb command, then an operator clicks a sending button, the upper computer executes a writing command, the upper computer commands adb-S < equipment IP: port > shell 'kv set SN < SN >' to write the SN number into the private partition of the equipment, and a writing result is returned to the upper computer; And S5, returning a result by the upper computer reading command, checking the writing state, judging that the programming is successful if the output contains the SN number and has no error, otherwise, prompting error information, executing adb disconnect disconnection after the programming is finished, and recording a writing log.
  2. 2. The method for quickly writing in serial numbers of Linux devices according to claim 1, wherein in the step S2, the code scanning gun is connected with an upper computer through a virtual serial port mode.
  3. 3. The method for quickly writing in serial numbers of Linux devices according to claim 1, wherein in S3, the upper computer automatically scans in the local area network by calling the system to scan the local network card IP and asynchronously detects the communicable devices in the local area network.
  4. 4. The method for quickly writing in serial numbers of Linux devices according to claim 1, wherein in S5, after completing writing, the host computer automatically executes an adb disconnect command, and the interface prompts "disconnected devices" and clears SN information in the input box.
  5. 5. The method for quickly writing serial numbers of Linux devices according to claim 1, wherein in S2, the upper computer software is developed based on c# language and is provided with serial communication, network scanning, ADB command execution, data verification and log recording modules.
  6. 6. The method for quickly writing in serial numbers of Linux devices according to claim 1, wherein in S4, kv set SN is a device custom-written SN command, and the private partition refers to a separate partition of the Linux device for storing device information data.

Description

Method for quickly writing serial numbers of Linux equipment Technical Field The invention relates to the technical field of intelligent home, in particular to a method for quickly writing serial numbers of Linux equipment. Background In the existing Linux device production and test links, a unique serial number (SN number) is generally required to be configured for each device to achieve identification and quality tracing. The conventional production line generally pastes labels to a machine body of the equipment manually after printing SN bar code stickers in batches in a printing room, and the serial number (SN number) of the equipment is usually required to be manually input by a stage or written in by an independent debugging tool. The traditional method has the problems of low operation efficiency, high manual error rate, non-uniform interfaces and the like, particularly in a production line environment, the production period can be obviously increased by manually inputting the SN number one by one, in addition, the code scanning gun is widely applied to bar code and two-dimensional code input on a production site, but an automatic cooperative mechanism with equipment network writing is lacked, so that a method for quickly writing the serial number of the Linux equipment is provided. Disclosure of Invention The method for quickly writing the serial number of the Linux equipment solves the problems existing in the prior art. In order to achieve the above purpose, the present invention adopts the following technical scheme: A method for quickly writing serial numbers of Linux equipment comprises the following steps: s1, generating and printing equipment SN code stickers in batches by a printing room upper computer, and then pasting the equipment SN code stickers on corresponding Linux equipment bodies by operators; S2, after the upper computer software is started, the upper computer is connected with a code scanning gun through a serial port; s3, automatically scanning connectable Linux equipment in a local area network by an upper computer and displaying an equipment list, scanning an SN bar code on a machine body of the Linux equipment by an operator by using a code scanning gun, and transmitting SN data to the upper computer by the code scanning gun; S4, after receiving the SN number data, the upper computer automatically connects with the target Linux equipment through an adb command, then an operator clicks a sending button, the upper computer executes a writing command, the upper computer commands adb-S < equipment IP: port > shell 'kv set SN < SN >' to write the SN number into the private partition of the equipment, and a writing result is returned to the upper computer; And S5, returning a result by the upper computer reading command, checking the writing state, judging that the programming is successful if the output contains the SN number and has no error, otherwise, prompting error information, executing adb disconnect disconnection after the programming is finished, and recording a writing log. Preferably, in the step S2, the code scanning gun is connected with the upper computer through a virtual serial port mode. Preferably, in the step S3, the automatic scanning mode of the upper computer in the local area network is that the upper computer invokes the system to scan the local network card IP and asynchronously detects the communicable equipment in the local area network. Preferably, in the step S5, after the programming is completed, the upper computer automatically executes an adb disconnect command, and the interface prompts that the device is disconnected, and clears SN information in the input box. Preferably, in the step S2, the upper computer software is developed based on the c# language, and includes a serial port communication module, a network scanning module, an ADB command execution module, a data verification module, and a log recording module. Preferably, in the step S4, the kv set SN is a command for the device to write SN number in a custom manner, and the private partition refers to an independent partition opened by the Linux device for storing device information data. Compared with the prior art, the invention integrates the links of printing, code pasting, code scanning and writing to form a complete automatic link, and the cooperative operation of the code scanning gun and the upper computer realizes the writing after code pasting, thereby avoiding the problems of manual input errors and equipment information mismatching and improving the production consistency, the traceability accuracy and the working efficiency. Drawings Fig. 1 is a flowchart of a method for quickly writing serial numbers of Linux devices according to the present invention. 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