CN107257392B - Method and device for setting equipment serial number and computer readable storage medium - Google Patents

Method and device for setting equipment serial number and computer readable storage medium Download PDF

Info

Publication number
CN107257392B
CN107257392B CN201710477664.0A CN201710477664A CN107257392B CN 107257392 B CN107257392 B CN 107257392B CN 201710477664 A CN201710477664 A CN 201710477664A CN 107257392 B CN107257392 B CN 107257392B
Authority
CN
China
Prior art keywords
equipment
parameter information
information
identification code
serial number
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.)
Active
Application number
CN201710477664.0A
Other languages
Chinese (zh)
Other versions
CN107257392A (en
Inventor
惠丽莎
姜国定
田改
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201710477664.0A priority Critical patent/CN107257392B/en
Publication of CN107257392A publication Critical patent/CN107257392A/en
Application granted granted Critical
Publication of CN107257392B publication Critical patent/CN107257392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3015Name registration, generation or assignment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/30Managing network names, e.g. use of aliases or nicknames
    • H04L61/3005Mechanisms for avoiding name conflicts

Abstract

The invention discloses a method and a device for setting a serial number of equipment and a computer readable storage medium, wherein the method comprises the following steps: responding a serial number setting request sent by equipment to be allocated, wherein the serial number setting request carries equipment identification code information and additional parameter information of the equipment to be allocated; judging whether the equipment identification code information is matched with identification code information of stored equipment in a preset data table or not; when the equipment identification code information is matched with identification code information of stored equipment in a preset data table, judging whether the additional parameter information is matched with additional verification parameter information of the stored equipment matched with the equipment identification code information; and when the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, setting an equipment serial number corresponding to the equipment to be distributed. The invention solves the problem that the equipment serial number is not unique because the equipment serial number is distributed by adopting single data at present.

Description

Method and device for setting equipment serial number and computer readable storage medium
Technical Field
The present invention relates to the field of intelligent devices, and in particular, to a method and an apparatus for setting a serial number of a device, and a computer-readable storage medium.
Background
With the advent of the information age, more and more interactions between servers and intelligent devices are available. When the server performs device management and message pushing on the smart devices, different devices need to be distinguished through the unique device serial number of each smart device, but according to the statistical result of the server, the device serial numbers between different smart devices are not unique before the devices leave the factory, because the device serial numbers are allocated according to single data, such as UUID, before the devices leave the factory, and the single data for allocating the device serial numbers may be repeated.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method and a device for setting an equipment serial number and a computer readable storage medium, and aims to solve the technical problem that the equipment serial number is not unique.
In order to achieve the above object, the present invention provides a method for setting a serial number of a device, comprising the steps of:
responding a serial number setting request sent by equipment to be allocated, wherein the serial number setting request carries equipment identification code information and additional parameter information of the equipment to be allocated;
judging whether the equipment identification code information is matched with identification code information of stored equipment in a preset data table or not;
when the equipment identification code information is matched with identification code information of stored equipment in a preset data table, judging whether the additional parameter information is matched with additional verification parameter information of the stored equipment matched with the equipment identification code information;
and when the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, setting an equipment serial number corresponding to the equipment to be distributed.
Preferably, the additional parameter information includes first parameter information, where the first parameter information is one of Media Access Control (MAC) address information, equipment factory area information, and Universal Unique Identifier (UUID) information;
the step of judging whether the additional parameter information matches the additional verification parameter information of the stored device matching the device identification code information includes:
and judging whether first additional verification parameter information consistent with the first parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information so as to determine whether the additional verification parameter information of the stored equipment matched with the additional parameter information of the equipment identification code information is matched.
Preferably, the additional parameter information includes second parameter information, where the second parameter information is one of Media Access Control (MAC) address information, equipment factory area information, and Universal Unique Identifier (UUID) information;
the step of judging whether first additional authentication parameter information consistent with the first parameter information exists in the additional authentication parameter information of the stored device matched with the device identification code information to determine whether the additional authentication parameter information of the stored device matched with the device identification code information is matched with the additional authentication parameter information of the stored device further comprises:
when the consistent first additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether second additional verification parameter information consistent with the second parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
Preferably, the additional parameter information includes third parameter information, where the third parameter information is one of Media Access Control (MAC) address information, equipment factory area information, and Universal Unique Identifier (UUID) information;
the step of judging whether there is second additional authentication parameter information consistent with the second parameter information in the additional authentication parameter information of the stored device matched with the device identification code information to determine whether the additional authentication parameter information of the stored device matched with the device identification code information is matched with the additional authentication parameter information of the stored device further includes:
when the consistent second additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether third additional verification parameter information consistent with the third parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
Preferably, after the step of determining whether the device identification code information matches with identification code information of a stored device in a preset data table, the method further includes:
and when the equipment identification code information is not matched with the identification code information of the stored equipment in a preset data table, setting an equipment serial number corresponding to the equipment to be distributed.
Preferably, the step of judging whether the additional verification parameter information of the stored device, of which the additional parameter information matches the device identification code information, matches further includes:
and if the additional parameter information is matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, acquiring the equipment serial number of the stored equipment matched with the equipment identification code information in a preset data table.
Preferably, the step of setting the device serial number corresponding to the device to be allocated further includes:
and storing the equipment identification code information, the additional parameter information, the set equipment serial number and the corresponding relation between the set equipment serial number and the equipment identification code information and the additional parameter information into a preset data table.
In addition, to achieve the above object, the present invention provides an apparatus for setting a serial number of a device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the device serial number setting method as described above.
Preferably, the device serial number setting means is a server.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an equipment serial number setting program, which when executed by a processor, implements the steps of the above equipment serial number setting method.
The method and the device for setting the serial number of the equipment and the computer readable storage medium provided by the embodiment of the invention respond to the serial number setting request sent by the equipment to be allocated, wherein the serial number setting request carries the equipment identification code information and the additional parameter information of the equipment to be allocated; judging whether the equipment identification code information is matched with identification code information of stored equipment in a preset data table or not; when the equipment identification code information is matched with identification code information of stored equipment in a preset data table, judging whether the additional parameter information is matched with additional verification parameter information of the stored equipment matched with the equipment identification code information; and when the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, setting an equipment serial number corresponding to the equipment to be distributed. Therefore, the matching condition of the equipment identification code information and the additional parameter information is combined to set the equipment serial number corresponding to the equipment to be distributed, and the problem that the equipment serial number is not unique due to the fact that the equipment serial number is distributed by adopting single data at present is solved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for setting a serial number of a device according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for setting a serial number of a device according to a first embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for setting a serial number of a device according to a second embodiment of the present invention;
FIG. 5 is a detailed flowchart of step S30 in the third embodiment of the method for setting serial number of equipment according to the present invention;
fig. 6 is a detailed flowchart of step S30 in the fourth embodiment of the method for setting the serial number of the device according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of an apparatus serial number setting device in various embodiments of the present invention, where the apparatus serial number setting device 100 may be a server, and includes a communication module 10, a memory 20, a processor 30, and other components. Those skilled in the art will appreciate that the equipment serial number setting apparatus shown in fig. 1 may also include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein, the processor 30 is connected to the memory 20 and the communication module 10, respectively, and the memory 20 stores thereon a computer program, which is executed by the processor 30 at the same time. The communication module 10 actively detects or passively receives request information sent by a terminal, and then sends the request information to the processor 30.
The communication module 10 may be connected to an external device through a network. The communication module 10 may receive a request from an external communication device, and may also send an event, an instruction, and information of the device serial number setting apparatus to the external communication device. The external communication equipment can be electronic equipment such as a television, a mobile phone, a tablet personal computer, monitoring equipment and the like.
The memory 20 may be used to store software programs as well as various data. The memory 20 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a parameter information matching function) required for at least one function, and the like; the storage data area may store data created from the use of the device serial number setting means (such as additional authentication parameter data) and the like. Further, the memory 20 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 30, which is a control center of the device serial number setting apparatus, connects various parts of the entire device serial number setting apparatus by using various interfaces and lines, and performs various functions and processes of the device serial number setting apparatus by running or executing software programs and/or modules stored in the memory 20 and calling data stored in the memory 20, thereby performing overall monitoring of the device serial number setting apparatus. Processor 30 may include one or more processing units; preferably, the processor 30 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 30.
Although not shown in fig. 1, the device serial number setting apparatus may further include a circuit control module, which is used for being connected to a mains supply, implementing power control, ensuring normal operation of other components, and the like.
Those skilled in the art will appreciate that the configuration of the equipment serial number setting device shown in fig. 1 does not constitute a limitation of the equipment serial number setting device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
Based on the hardware structure, various embodiments of the method of the invention are provided.
Referring to fig. 2, in an additional embodiment of the method for setting the serial number of the device of the present invention, the method for setting the serial number of the device includes the steps of:
step S10, responding to a serial number setting request sent by a device to be allocated, wherein the serial number setting request carries the device identification code information and the additional parameter information of the device to be allocated;
step S20, judging whether the equipment identification code information is matched with the identification code information of the stored equipment in a preset data table; if yes, go to step S30;
step S30, judging whether the additional parameter information matches with the additional verification parameter information of the stored device matched with the device identification code information; if not, go to step S40;
step S40, an equipment serial number corresponding to the equipment to be allocated is set.
It should be noted that the device serial number is a unique identification number for all devices, and needs to have uniqueness, where all devices may burn the device serial number before leaving the factory, and the device serial number after leaving the factory cannot be erased. In this embodiment, the device serial number setting apparatus is in communication connection with the device to be allocated through the communication module; wherein, the device serial number setting device can be a server; the device to be assigned with the device serial number may be an android system-based smart television, or may be a tablet computer, a mobile phone, or other smart hardware. The device serial number setting apparatus is specifically described below as a server.
The method comprises the steps that a serial number setting request is reported to a server by equipment to be allocated, the server responds to the serial number setting request reported by the equipment to be allocated, and equipment identification code information (device-ID) and additional parameter information are extracted from the serial number setting request. The additional parameter information may include at least one of Media Access Control (MAC) address information, factory area information (locate) of the device, and Universal Unique Identifier (UUID) information.
The mapping relation between the identification code information and the additional verification parameter information of different stored devices and the device serial number is pre-established in the memory of the server, and further, the device serial number can be conveniently inquired and extracted and can be stored in a data table mode. For example:
Figure BDA0001328188170000061
wherein dnum represents the equipment serial number, and device _ id, MAC, locale and UUID respectively represent identification code information, MAC address information, equipment factory area information and UUID information.
The processor matches the equipment identification code information with the identification code information of stored equipment in the data table after extracting the equipment identification code information and the additional parameter information of the equipment to be distributed, which are carried in the serial number setting request, if the equipment identification code information is successfully matched with the identification code information of the stored equipment, the identification code information consistent with the equipment identification code information exists in the existing mapping relation, and in order to ensure the uniqueness of the equipment serial number, the equipment serial number cannot be distributed only by adopting the equipment identification code information, whether the additional parameter information except the equipment identification code information is matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information can be further judged.
If the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, the equipment serial number related information of the currently matched equipment does not exist in the data table, and the matched equipment is not the stored equipment of the data table, so that the equipment serial number corresponding to the equipment to be allocated can be set by referring to an equipment serial number setting rule, and the set equipment serial number is fed back to the equipment. In addition, the set device serial number, the device identification code information and the additional parameter information, and the corresponding relationship between the device identification code information and the additional parameter information and the set device serial number can be stored in the data table.
It should be noted that, the operation method for setting the device serial number corresponding to the device to be allocated may be set according to actual needs, and it may be assumed that a latest device serial number of a device already stored in the data table is a, and a rule for establishing a new device serial number is that the latest device serial number is added by n, and then the newly set device serial number is a + n, where n is not equal to 0, optionally, n is 1, and then the server may feed back the newly set device serial number a + n to the device to be allocated through the communication module.
At present, the method for setting the serial number of the device is to allocate the serial number of the device according to single data before the device leaves a factory, and burn the serial number of the device in the device. The scheme of the embodiment combines the equipment identification code information and the additional parameter information of the equipment to be distributed, and the equipment identification code information and the additional verification parameter information of the same existing equipment in the data table are combined for matching, so that the uniqueness of the equipment serial number is ensured, and the normal operation of equipment message pushing and management is prevented from being influenced.
Referring again to fig. 2, when the determination result of the step S20 is "no", the step S40 may be directly performed.
Because the equipment identification code information is not matched with the identification code information of the equipment stored in the data table, the equipment serial number which does not exist in the pre-established mapping relation and corresponds to the equipment identification code information can be obtained, the equipment serial number which corresponds to the equipment to be distributed can be set, then the corresponding relation among the equipment mark code information, the additional parameter information and the newly set equipment serial number is established, and finally the corresponding relation is stored in the data table. The condition that the equipment identification code information is not matched with the preset identification code information is perfected, and the condition of different equipment serial numbers is adapted by combining other matching schemes.
Further, referring to fig. 3, after the determination result of step S30 is yes, the following steps may be further performed:
step S50, acquiring the device serial number of the stored device matched with the device identification code information in the preset data table.
When the additional parameter information of the to-be-allocated device matches the additional verification parameter information of the stored device matched with the device identification code information, the mapping relation of the current to-be-allocated device exists in a data table, and the mapping relation belongs to the stored device, and at this time, the device serial number of the stored device matched with the device identification code information can be inquired from the data table to serve as the device serial number corresponding to the current to-be-allocated device. The condition can be suitable for the condition that the equipment serial number needs to be retrieved, and the accuracy of the equipment serial number retrieved by the user is ensured.
Further, referring to fig. 4, a second embodiment of the method for setting an equipment serial number according to the present invention is provided based on a first embodiment of the method for setting an equipment serial number according to the present invention, in this embodiment, the additional parameter information includes first parameter information, and the first parameter information is one of media access control MAC address information, equipment factory area information, and universally unique identifier UUID information;
the step S30 includes:
step S31, determining whether there is first additional authentication parameter information that is consistent with the first parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information of the device identification code information matches.
It should be noted that the MAC address information is a media access control address, is used to define the location of the network device, is determined by the network card of the device, is fixed before the device leaves the factory, and has uniqueness. The specific meaning of the equipment factory area information may be set according to actual needs, for example, the specific meaning may be expressed according to an equipment production place, and if the production place of the equipment is beijing, the local of the equipment is Bei' jing; the method can also be expressed according to a device production place code, such as 01 for Beijing, 02 for Shenzhen, and 03 for Dian. The UUID information is all elements in the distributed system, has uniqueness, and consists of current date and time, a clock sequence and a globally unique IEEE machine identification number.
In this embodiment, when the device identification code information matches the identification code information of the stored device in the database, the stored device with which the device identification code information matches does not have the first additional verification parameter information that is consistent with the first parameter information, which indicates that the additional verification information of the stored device with which the additional parameter information matches the device identification code information does not match, and the device to be allocated does not belong to the stored device in the data table, and the device serial number has not been allocated by the server. The following specifically describes the device factory area information as the first parameter information.
If the serial number setting request of the device 1 includes the following information:
the device 1:
"action":“DeviceActive”;
"device":{device_id":"9b00c1d70e96000db76d1e799fc5bb994819e20e",
"locale":"Xi’an",
the information in the data sheet is as follows:
Figure BDA0001328188170000091
according to the table and the information of the device 1, firstly, whether the device identification code information of the device 1 is matched with the identification code information of the stored device in the data table is judged, and the device identification code information of the device 1 is obtained after comparison and is the same as the identification code information of the stored device in the data table, namely, the device identification code information is matched with the device serial number of '111119' in the data table; then, judging that the equipment factory area information ' Xi ' an ' of the equipment 1 is consistent with the locale of the equipment with the equipment serial number of ' 111119 '; it can be found that the factory area information of the device with the device serial number "111119" is the Qingdao, and is not matched with the device 1; the server will set a corresponding device serial number for device 1, for example the device serial number for device 1 may be 111120. The server can also establish a new mapping relation according to the equipment identification code information and the equipment field area information of the equipment 1.
According to the scheme, the first parameter information which is at least one of the MAC address information, the equipment delivery area information and the UUID information is combined with the equipment identification code information to serve as a basis for distributing the equipment serial number, so that the uniqueness of the equipment serial number is ensured.
Further, referring to fig. 5, a third embodiment of the method for setting an equipment serial number according to the present invention is provided based on a second embodiment of the method for setting an equipment serial number according to the present invention, in this embodiment, the additional parameter information includes second parameter information, and the second parameter information is one of media access control MAC address information, equipment factory area information, and universally unique identifier UUID information;
the step S30 includes:
step S31, determining whether there is first additional authentication parameter information that is consistent with the first parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information of the device identification code information matches; if yes, go to step S32;
step S32, determining whether there is second additional authentication parameter information that is consistent with the second parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information of the device identification code information matches.
It should be noted that the first additional parameter is different from the second additional parameter, and the second additional parameter information may be detected when the identification code information and the first additional verification parameter information of the same stored device in the data table correspond to the device identification code information and the first additional parameter information of the device in a one-to-one correspondence. When second additional verification parameter information consistent with the second additional parameters exists in the same stored device, the device to be allocated which is being matched at the moment is proved to exist in the data table and belong to the stored device, and the device serial number of the stored device can be directly obtained or a third additional parameter can be judged; and when the devices to be distributed are not matched, the devices to be distributed are proved to be not existed in the data table originally, and the device serial numbers can be distributed to the devices. According to the scheme, the equipment serial number is distributed to the equipment by combining the equipment identification code information, the first additional parameter information and the second additional parameter information of the equipment to be distributed, different equipment is further distinguished, and uniqueness of the equipment serial number is provided.
Further, referring to fig. 6, a fourth embodiment of the method for setting an equipment serial number according to the present invention is provided based on a third embodiment of the method for setting an equipment serial number according to the present invention, in this embodiment, the additional parameter information includes third parameter information, and the third parameter information is one of media access control MAC address information, equipment factory area information, and universally unique identifier UUID information;
the step S30 includes:
step S31, determining whether there is first additional authentication parameter information that is consistent with the first parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information of the device identification code information matches; if yes, go to step S32;
step S32, determining whether there is second additional authentication parameter information that is consistent with the second parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information of the device identification code information matches; if yes, go to step S33;
step S33, determining whether there is third additional authentication parameter information that is consistent with the third parameter information in the additional authentication parameter information of the stored device that matches the device identification code information, to determine whether the additional authentication parameter information of the stored device that matches the additional parameter information matches the identification code information.
In this embodiment, the first additional parameter, the second additional parameter, and the third additional parameter are different, and actually, a set of parameters for reference is added on the basis of the third embodiment, and the serial numbers of different devices to be allocated are set by combining the three sets of additional parameter information with the device identification code information, so that the selectivity of the serial numbers of the devices is enhanced, and the situation that the serial numbers of the devices are not unique is prevented.
It should be noted that, when three sets of additional parameter information and device identification code information correspond to three sets of additional verification parameter information and identification code information of the same stored device in the data table one by one, the mapping relationship of the device to be allocated is considered to exist in the data table, and the corresponding device serial number is directly acquired and fed back to the device to be allocated.
The following specifically explains that the first additional parameter information is Mac address information, the second additional parameter information is equipment factory area information, and the third additional parameter information is UUID information.
The original data table is as follows, where dnum is the device serial number.
Figure BDA0001328188170000111
Figure BDA0001328188170000121
The device 1 reports a serial number setting request (device _ id, mac, local, uuid) to the server to request allocation of the device serial number. The device identification code information device _ id of the device 1 is 9B00C1d70e96-000db76d1e799fc5bb994819e20e, the MAC address information is 00:2C:1B:3F:02: DC, and the device factory area information Xi' an.
The server extracts the device _ id parameter reported by the equipment 1 and judges whether the device _ id of the equipment 1 has consistent device _ id in the data table 1; as can be seen from the data in table 1, the device serial numbers 111116, 111117, 111118, and 111119 of the stored devices in device 1 match the device _ id of device 1. That is, at this time, the device _ id of the device 1 is already reserved, and whether the mac of the device with the device serial numbers 111116, 111117, 111118, and 111119 matches the mac of the device 1 is determined using the mac as the first additional parameter information, and it can be seen that the mapping relationships with the device serial numbers 111116, 111117, and 111118 among the four mapping relationships satisfy this condition. At this time, the unique device serial number cannot be matched, so that in the mapping relation among the device serial numbers 111116, 111117 and 111118, the locale of the device 1 is used as second additional parameter information to judge whether the locale of the device 1 is consistent with the locales of the device serial numbers 111116, 111117 and 111118; it can be found that there are two groups of mapping relationships satisfying the three identification parameter conditions, so that uuid of the device 1 needs to be used as third additional parameter information, and in two groups of mapping relationships where mac, device _ id, and locale are all consistent, if uuid of any one of the two groups of mapping relationships is consistent with the device 1, the device serial number in the group of mapping relationship consistent with the device 1 is the device serial number of the device 1; if uuid in the two mapping relationships is not consistent with uuid of device 1, generating a device serial number according to the condition that Dnum is (device _ id, mac, local, uuid) ═ count +1, where count is the last device serial number value in the data table, and the generated device serial number Dnum is 1111120.
Referring to fig. 1 and fig. 2 again, in an embodiment, the device serial number setting apparatus 100 includes a communication module 10, a memory 20, and a processor 30, where the device serial number setting apparatus 100 may be a server, the processor 30 is connected to the memory 20 and the communication module 10, respectively, and the memory 20 stores a computer program thereon. When executed by the processor 30, the computer program implements the steps of the method for setting the serial number of the device in any of the embodiments, and specifically includes:
responding a serial number setting request sent by equipment to be allocated, wherein the serial number setting request carries equipment identification code information and additional parameter information of the equipment to be allocated;
judging whether the equipment identification code information is matched with identification code information of stored equipment in a preset data table or not;
when the equipment identification code information is matched with identification code information of stored equipment in a preset data table, judging whether the additional parameter information is matched with additional verification parameter information of the stored equipment matched with the equipment identification code information;
and when the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, setting an equipment serial number corresponding to the equipment to be distributed.
Further, the computer program when executed by the processor 30 further realizes the steps of:
and judging whether first additional verification parameter information consistent with the first parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information so as to determine whether the additional verification parameter information of the stored equipment matched with the additional parameter information of the equipment identification code information is matched.
Further, the computer program when executed by the processor 30 further realizes the steps of:
when the consistent first additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether second additional verification parameter information consistent with the second parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
Further, the computer program when executed by the processor 30 further realizes the steps of:
when the consistent second additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether third additional verification parameter information consistent with the third parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
Further, the computer program when executed by the processor 30 further realizes the steps of:
and when the equipment identification code information is not matched with the identification code information of the stored equipment in a preset data table, setting an equipment serial number corresponding to the equipment to be distributed.
Further, the computer program when executed by the processor 30 further realizes the steps of:
and if the additional parameter information is matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, acquiring the equipment serial number of the stored equipment matched with the equipment identification code information in a preset data table.
Further, the computer program when executed by the processor 30 further realizes the steps of:
and storing the equipment identification code information, the additional parameter information, the set equipment serial number and the corresponding relation between the set equipment serial number and the equipment identification code information and the additional parameter information into a preset data table.
The present invention also proposes a computer-readable storage medium having stored thereon a server control program which, when executed by a processor, implements all the steps of the above-described device serial number setting method.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
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.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for setting the serial number of equipment is characterized by comprising the following steps:
responding a serial number setting request sent by equipment to be allocated, wherein the serial number setting request carries equipment identification code information and additional parameter information of the equipment to be allocated;
judging whether the equipment identification code information is matched with identification code information of stored equipment in a preset data table or not;
when the equipment identification code information is matched with identification code information of stored equipment in a preset data table, judging whether the additional parameter information is matched with additional verification parameter information of the stored equipment matched with the equipment identification code information;
when the additional parameter information is not matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, setting an equipment serial number corresponding to the equipment to be distributed;
the additional parameter information includes first parameter information, and the step of judging whether the additional parameter information matches with the additional verification parameter information of the stored device matched with the device identification code information includes:
and judging whether first additional verification parameter information consistent with the first parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information so as to determine whether the additional verification parameter information of the stored equipment matched with the additional parameter information of the equipment identification code information is matched.
2. The apparatus of claim 1, wherein the first parameter information is one of MAC address information, factory area information of the apparatus, and UUID information of a universally unique identifier.
3. The apparatus serial number setting method according to claim 2, wherein the additional parameter information includes second parameter information, the second parameter information being one of media access control MAC address information, factory area information of the apparatus, and UUID information of a universally unique identifier;
the step of judging whether first additional authentication parameter information consistent with the first parameter information exists in the additional authentication parameter information of the stored device matched with the device identification code information to determine whether the additional authentication parameter information of the stored device matched with the device identification code information is matched with the additional authentication parameter information of the stored device further comprises:
when the consistent first additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether second additional verification parameter information consistent with the second parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
4. The apparatus serial number setting method according to claim 3, wherein the additional parameter information includes third parameter information, the third parameter information being one of Media Access Control (MAC) address information, factory area information of the apparatus, and Universally Unique Identifier (UUID) information;
the step of judging whether there is second additional authentication parameter information consistent with the second parameter information in the additional authentication parameter information of the stored device matched with the device identification code information to determine whether the additional authentication parameter information of the stored device matched with the device identification code information is matched with the additional authentication parameter information of the stored device further includes:
when the consistent second additional verification parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, judging whether third additional verification parameter information consistent with the third parameter information exists in the additional verification parameter information of the stored equipment matched with the equipment identification code information, and determining whether the additional verification parameter information of the stored equipment matched with the equipment identification code information is matched.
5. The method for setting serial number of device as claimed in claim 1, wherein said step of determining whether the device identification code information matches the identification code information of the stored device in the preset data table further comprises:
and when the equipment identification code information is not matched with the identification code information of the stored equipment in a preset data table, setting an equipment serial number corresponding to the equipment to be distributed.
6. The device serial number setting method according to any one of claims 1 to 5, wherein the step of determining whether the additional authentication parameter information of the stored device, of which the additional parameter information matches the device identification code information, matches further comprises:
and if the additional parameter information is matched with the additional verification parameter information of the stored equipment matched with the equipment identification code information, acquiring the equipment serial number of the stored equipment matched with the equipment identification code information in a preset data table.
7. The method for setting the serial number of the device according to any one of claims 1 to 5, wherein the step of setting the serial number of the device corresponding to the device to be allocated further comprises:
and storing the equipment identification code information, the additional parameter information, the set equipment serial number and the corresponding relation between the set equipment serial number and the equipment identification code information and the additional parameter information into a preset data table.
8. An apparatus for setting a serial number of a device, the apparatus comprising: memory, processor and computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the device serial number setting method according to any one of claims 1 to 7.
9. The device serial number setting apparatus according to claim 8, wherein the device serial number setting apparatus is a server.
10. A computer-readable storage medium, characterized in that an equipment serial number setting program is stored thereon, which when executed by a processor implements the steps of the equipment serial number setting method according to any one of claims 1 to 7.
CN201710477664.0A 2017-06-21 2017-06-21 Method and device for setting equipment serial number and computer readable storage medium Active CN107257392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710477664.0A CN107257392B (en) 2017-06-21 2017-06-21 Method and device for setting equipment serial number and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710477664.0A CN107257392B (en) 2017-06-21 2017-06-21 Method and device for setting equipment serial number and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107257392A CN107257392A (en) 2017-10-17
CN107257392B true CN107257392B (en) 2021-03-30

Family

ID=60023713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710477664.0A Active CN107257392B (en) 2017-06-21 2017-06-21 Method and device for setting equipment serial number and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107257392B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108848506A (en) * 2018-07-11 2018-11-20 河南华码信息科技有限公司 The method of smart machine ID is obtained on a kind of line
CN109145022B (en) * 2018-08-15 2022-01-11 Oppo(重庆)智能科技有限公司 Writing method, device and storage medium for network identity of mobile equipment
CN109145021B (en) * 2018-08-15 2021-08-17 Oppo(重庆)智能科技有限公司 Mobile equipment network identity identification rewriting method, device and storage medium
CN110971717B (en) * 2018-09-30 2023-06-06 美的集团股份有限公司 Intelligent equipment identity identification code burning method and system, intelligent equipment and server
CN109254789B (en) * 2018-09-30 2023-06-20 美的集团股份有限公司 Intelligent device electric control firmware programming method and system, intelligent device and server
CN111199395A (en) * 2018-11-20 2020-05-26 千寻位置网络有限公司 Control method and device for equipment charging and charging system
CN109729158B (en) * 2018-12-19 2021-09-28 深圳市酷开网络科技股份有限公司 Method, system and storage medium for generating equipment ID identification information
CN111376257A (en) * 2018-12-29 2020-07-07 深圳市优必选科技有限公司 Steering engine ID repetition detection method and device, storage medium and robot
CN110572285B (en) * 2019-09-02 2022-02-25 深圳市丰润达科技有限公司 Device code writing method, device code writing device and readable storage medium
CN111432031B (en) * 2020-04-17 2022-06-03 支付宝(杭州)信息技术有限公司 Internet of things equipment identity information generation method and device and electronic equipment
CN112114829A (en) * 2020-09-11 2020-12-22 上海庆科信息技术有限公司 Burning management method, device, platform and storage medium
CN112394955A (en) * 2020-12-07 2021-02-23 佛吉亚歌乐电子(丰城)有限公司 Vehicle-mounted terminal identification code burning method
CN112788545A (en) * 2020-12-29 2021-05-11 武汉联影智融医疗科技有限公司 Binding method, computer device and storage medium
CN114168910A (en) * 2022-02-14 2022-03-11 成都万创科技股份有限公司 Android equipment serial number generation equipment and method
CN115037719A (en) * 2022-05-27 2022-09-09 上海哔哩哔哩科技有限公司 Code sending method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BE1009389A6 (en) * 1995-06-02 1997-03-04 Atea Nv Method for detecting and compensating for MISQUALIFIED MISSING AND CELLS IN ASYNCHRONOUS TRANSFER MODE (ATM).
JP4644514B2 (en) * 2005-04-11 2011-03-02 勝樹 横山 Identification code assigning apparatus and program
CN104811931B (en) * 2014-01-23 2019-01-08 腾讯科技(深圳)有限公司 A kind of mobile terminal unique identification distribution system and method
CN104463460B (en) * 2014-12-03 2019-02-26 北京国双科技有限公司 Processing method and processing device for the waiting information that network data is launched

Also Published As

Publication number Publication date
CN107257392A (en) 2017-10-17

Similar Documents

Publication Publication Date Title
CN107257392B (en) Method and device for setting equipment serial number and computer readable storage medium
CN107995215B (en) Control method and device of intelligent household equipment and cloud platform server
WO2018149221A1 (en) Device management method and network management system
CN100527752C (en) DHCP address allocation method
CN107463124B (en) Intelligent air equipment and control method and device thereof, server and storage medium
CN108039969B (en) Network automatic configuration method, device, system, storage medium and target computer
CN107707684B (en) Indoor unit address allocation method, switching device and computer readable storage medium
CN107659677B (en) IP address automatic configuration device and method based on BMC
CN105791254B (en) Network request processing method and device and terminal
CN104378455A (en) IP address distribution method and device
CN102082685A (en) Network configured method and system of embedded device
CN104113435A (en) Method and device for generating identifier
CN110633130B (en) Virtual memory management method and device based on memory hot plug technology
CN112001636A (en) Equipment operation state information acquisition method and related equipment
CN103905232A (en) Virtual-machine management system and method
CN103312708A (en) Lease file based IP (internet protocol) setting method and system
CN105635326A (en) Network equipment and IP address assignment method
CN111400039A (en) Control method and device of cloud platform, cloud platform system and electronic equipment
CN107277188B (en) Method, client, server and service system for determining IP address attribution information
CN113326104B (en) Method, system and device for modifying internal configuration of virtual machine
CN110659272A (en) Data cleaning method and system
CN109871220B (en) Method and system for updating registration state of electronic device
CN112416542A (en) Distributed task system, management method and device and computer equipment
CN113708957B (en) Configuration method, terminal device and medium for server BMC
CN109582680B (en) Business processing method based on new product development, electronic device and readable storage medium

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
GR01 Patent grant
GR01 Patent grant