Equipment number determination method and system and electronic equipment

By comparing the current hardware information of the device and cached hardware information, a stable device number is generated, and the problem of unstable device number in the prior art is solved, and the accuracy of device identification and management reliability are achieved.

CN120378401APending Publication Date: 2025-07-25GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510620547.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing device number generation solution has problems with insufficient stability, such as the network card address is volatile, the system allocation ID is reset, and random string duplication, making it difficult to generate long-term and stable device numbers.

Method used

By generating a comparison of temporary device numbers and cached device numbers, combining the similarity comparison of current hardware information and cached hardware information, select a unique device number, and use multi-dimensional hardware information such as network card address, hard disk serial number, motherboard serial number and processor number to generate a stable device number.

Benefits of technology

Ensure the uniqueness and stability of the equipment number, prevent frequent changes in the equipment number, prevent equipment from impersonating it, and achieve the accuracy of equipment identification and management reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378401A_ABST
    Figure CN120378401A_ABST
Patent Text Reader

Abstract

The invention relates to the field of equipment information management, in particular to an equipment number determination method and system and electronic equipment, and the method comprises the steps: generating a temporary equipment number according to the current hardware information of the equipment; acquiring cache file information of equipment, and acquiring a cache equipment number of the equipment and cached hardware information according to the cache file information; judging whether the temporary device number is consistent with the cache device number, if yes, taking the cache device number as the unique device number of the device, and if not, comparing the current hardware information with the cached hardware information to obtain a comparison result; and selecting the cache device number or the temporary device number as the unique device number of the device according to the comparison result. The method can be used for generating a unique and stable device number for the device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of device information management, and more particularly, to a method, a system, and an electronic device for determining a device number. Background Art

[0002] Under the background of the rapid development of current Internet technologies, the number of networked devices has increased sharply. To accurately count and identify the actual number of networked devices in use, it is necessary to assign a reliable, stable, and globally unique device number to each networked device used by an application product. In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: Although various technical solutions for generating device numbers have been proposed in the industry, such as using the network card address (MacAddress), the device ID (MachineId) assigned by the system, or a random string (UUID) as the device number, although these methods can ensure the global uniqueness of the device number, they have the problem of insufficient stability. For example, when using the network card address as the device number, if a networked device is configured with multiple network cards or virtual network cards, any change in the network card may cause the device number to change; relying on the device ID assigned by the system as the device number may be reset after the system is reinstalled; using a random string as the device number may result in the generation of duplicate device numbers, lacking uniqueness, and the randomly generated device number has no established generation rule, making it difficult to trace the device number. Therefore, the existing device number generation solutions still have certain defects and need to be further improved. Summary of the Invention

[0003] The present invention provides a method, a system, and an electronic device for determining a device number, which are used to generate a unique and stable device number for a device.

[0004] According to a first aspect of the present application, there is provided a method for determining a device number, the method comprising:

[0005] Generating a temporary device number according to the current hardware information of the device;

[0006] Obtaining the cache file information of the device, and obtaining the cached device number and the cached hardware information of the device according to the cache file information;

[0007] Judging whether the temporary device number is consistent with the cached device number, if so, using the cached device number as the unique device number of the device, if not, comparing the current hardware information with the cached hardware information to obtain a comparison result;

[0008] Selecting the cached device number or the temporary device number as the unique device number of the device according to the comparison result.

[0009] It is understandable that a temporary device number is generated according to the current hardware information of the device, and the temporary device number is compared with the cached device number, and the current hardware information is compared with the cached file information of the device, so as to obtain a unique device number according to the comparison result, which can avoid the variable problems caused by directly using the device number generated by the current hardware information, resulting in the non-uniqueness and instability of the device number; cooperating with the relatively stable cached device number to obtain a unique device number can ensure the accuracy and consistency of device identification, and effectively improve the reliability and efficiency of device management.

[0010] Optionally, the comparing the current hardware information with the cached hardware information to obtain a comparison result includes:

[0011] The current hardware information is the current hardware information corresponding to a preset hardware metric;

[0012] The cached hardware information is the cached hardware information corresponding to the hardware metric;

[0013] Performing a similarity comparison on the current hardware information and the cached hardware information corresponding to the hardware metric to obtain a total similarity value, and using the total similarity value as the comparison result.

[0014] It is understandable that by presetting several key hardware metrics as the comparison dimensions, the attention can be focused on the hardware information corresponding to the hardware metrics, improving the comparison efficiency; and performing a similarity comparison on the current hardware information and the cached hardware information corresponding to the hardware metric to obtain a total similarity value can obtain the similarity degree between the current hardware information and the cached hardware information. Subsequently, this total similarity value can provide a selection voucher for determining the unique device number, accurately judge the change of the device state, provide scientific and reliable data support for the generation of the unique device number, and ensure the accuracy of device identification and the stability of management.

[0015] Optionally, the hardware metrics include two or more of the network card address, hard disk serial number, motherboard serial number, and processor number;

[0016] The performing a similarity comparison on the current hardware information and the cached hardware information corresponding to the hardware metric to obtain a total similarity value includes:

[0017] Respectively performing a similarity comparison on the current hardware information and the cached hardware information corresponding to each hardware metric to obtain the similarity value corresponding to each hardware metric;

[0018] Calculating the similarity values corresponding to each hardware metric to obtain the total similarity value.

[0019] It is understandable that the hardware metrics can include two or more of the network card address, hard disk serial number, motherboard serial number, and processor number, thus avoiding the instability and variability of using only one type of hardware information to generate the device number; by separately comparing the similarity between the current hardware information and the cached hardware information corresponding to each hardware metric, the similarity values of hardware information in different dimensions can be obtained, and the total similarity value can be obtained based on the similarity values corresponding to each hardware metric. The total similarity value includes similar information in multiple dimensions, thereby accurately evaluating the subtle differences in device hardware changes.

[0020] Optionally, corresponding similarity weights and dissimilarity weights are preset for the network card address, hard disk serial number, motherboard serial number, and processor number;

[0021] When the hardware metric includes the network card address, the current hardware information includes the current network card address, and the cached hardware information includes the cached network card address; it is determined whether there is a current network card address that is the same as a cached network card address. If so, the similarity value corresponding to the network card address is obtained according to the similarity weight corresponding to the network card address. If not, the similarity value corresponding to the network card address is obtained according to the dissimilarity weight corresponding to the network card address;

[0022] When the hardware metric includes the hard disk serial number, the current hardware information includes the current hard disk serial number, and the cached hardware information includes the cached hard disk serial number; it is determined whether there is a current hard disk serial number that is the same as a cached hard disk serial number. If so, the similarity value corresponding to the hard disk serial number is obtained according to the similarity weight corresponding to the hard disk serial number. If not, the similarity value corresponding to the hard disk serial number is obtained according to the dissimilarity weight corresponding to the hard disk serial number;

[0023] When the hardware metric includes the motherboard serial number, it is determined whether the current motherboard serial number in the current hardware information is consistent with the cached motherboard serial number in the cached hardware information. If so, the similarity value corresponding to the motherboard serial number is obtained according to the similarity weight corresponding to the motherboard serial number. If not, the similarity value corresponding to the motherboard serial number is obtained according to the dissimilarity weight corresponding to the motherboard serial number;

[0024] When the hardware metric includes the processor number, it is determined whether the current processor number in the current hardware information is consistent with the cached processor number in the cached hardware information. If so, the similarity value corresponding to the processor number is obtained according to the similarity weight corresponding to the processor number. If not, the similarity value corresponding to the processor number is obtained according to the dissimilarity weight corresponding to the processor number.

[0025] It is understandable that, for devices, different hardware has different replacement frequencies, and thus has different effects on the stability of the device number. Therefore, corresponding similarity weights and non-similar weights are set for different hardware indicators to reflect that different hardware indicators have different influences on generating a unique and stable device number. In addition, for the judgment method of more than one network card address and hard disk serial number, it is only necessary to judge whether there is a current network card address / current hard disk serial number in the current hardware information that is the same or consistent with the cached network card address / cache hard disk serial number in the cached hardware information, thereby increasing the probability of consistency and avoiding reducing the total similarity value and frequently changing the device number, thereby destroying the stability and uniqueness of the device number.

[0026] Optionally, selecting the cache device number or the temporary device number as the unique device number of the device according to the comparison result includes:

[0027] Determine whether the total similarity value is greater than a preset similarity threshold. If so, select the cache device number as the unique device number of the device; if not, select the temporary device number as the unique device number of the device, and use the unique device number as the new cache device number to update the cache device number in the cache file.

[0028] It is understandable that, by presetting a similarity threshold, the similarity threshold can be used to determine whether the cached device number or the temporary device number is a unique device number; specifically, determine whether the total similarity value is greater than the similarity threshold. If so, it means that the current device information has not changed much. In order to maintain the stability of the device number, it is necessary to use the cached device number as the unique device number to prevent the unique device number from changing frequently; if not, it means that the current device information has changed a lot and can be considered as a new device different from the one recorded in the cache file. It is necessary to use a temporary device number as the unique device number and update the unique device number as the new cached device number to the cached device number in the cache file to prevent impersonation by different devices and ensure the accuracy of device information.

[0029] Optionally, generating a temporary device number according to current hardware information of the device includes:

[0030] The current hardware information includes two or more of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number; wherein the current network card address includes one or more, and the current hard disk serial number includes one or more;

[0031] Performing a first concatenation of each current hardware information in sequence to obtain a first character string, and generating the temporary device number according to the first character string;

[0032] When there are multiple current network card addresses, the multiple current network card addresses are arranged in a certain order, and then the first current network card address is obtained, and the first current network card address is subjected to the first splicing; when there are multiple current hard disk serial numbers, the multiple current hard disk serial numbers are arranged in a certain order, and then the first current hard disk serial number is obtained, and the first current hard disk serial number is subjected to the first splicing.

[0033] It can be understood that by splicing two or more pieces of current hardware information to generate a temporary device number, it is ensured that the temporary device number is composed of information in two or more dimensions, corresponding to the cached device number, and preventing the frequent change of the device number; using the first current network card address and the first current hard disk serial number for the first splicing can reduce the interference redundancy of data and improve the efficiency of generation and subsequent comparison.

[0034] Optionally, obtaining the cached device number of the device and the cached hardware information according to the cached file information includes:

[0035] The cached hardware information includes two or more of a cached network card address, a cached hard disk serial number, a cached motherboard serial number, and a cached processor number; where the cached network card address includes one or more, and the cached motherboard serial number includes one or more;

[0036] The cached hardware information is sequentially subjected to a second splicing to obtain a second string, and the cached device number is generated according to the second string;

[0037] Wherein, when there are multiple cached network card addresses, the first cached network card address is read from the cached file for the second splicing; when there are multiple cached hard disk serial numbers, the first cached hard disk serial number is read from the cached file for the second splicing.

[0038] It can be understood that by splicing two or more pieces of cached hardware information to generate a cached device number, it is ensured that the cached device number is composed of information in two or more dimensions, corresponding to the temporary device number, and preventing the frequent change of the device number; using the first cached network card address and the first cached hard disk serial number for the second splicing can reduce the interference redundancy of data and improve the efficiency of generation and subsequent comparison.

[0039] Optionally, before obtaining the cached file information of the device, first determine whether the device has a cached file. If so, execute the step of obtaining the cached file information of the device. If not, use the temporary device number as the unique device number of the device, create a new cached file, and write the temporary device number into the cached file as the cached device number.

[0040] It is understandable that by preferentially checking the existence of the device cache file, the generation logic of the unique device number is flexibly processed: if the cache file exists, the cache file information of the device is obtained, and then the unique device number is confirmed according to the cache file information; if not, the temporary device number is directly used as the unique device number, and a cache file is newly created to achieve seamless connection of device management. This dynamic adaptation mechanism not only ensures the rapid identification of new devices but also maintains the stable tracking of existing devices, significantly improving the reliability and adaptability of the method for generating unique device numbers.

[0041] According to a second aspect of the present application, there is provided a device number determination system, the system comprising:

[0042] A temporary device number generation module, configured to generate a temporary device number according to the current hardware information of the device;

[0043] An information acquisition module, configured to acquire the cache file information of the device, and acquire the cached device number and the cached hardware information of the device according to the cache file information;

[0044] A comparison module, configured to determine whether the temporary device number is the same as the cached device number, and if so, use the cached device number as the unique device number of the device, and if not, compare the current hardware information with the cached hardware information to obtain a comparison result;

[0045] A selection module, configured to select the cached device number or the temporary device number as the unique device number of the device according to the comparison result.

[0046] According to a third aspect of the present application, there is provided an electronic device, comprising:

[0047] A memory, configured to store one or more computer programs;

[0048] A processor, when the one or more computer programs are executed by the processor, implementing the method for determining a device number described in the first aspect above.

[0049] According to a fourth aspect of the present application, there is provided a computer-readable storage medium, the computer-readable storage medium storing computer instructions, the computer instructions being used to cause a processor to implement the method for determining a device number described in the first aspect above when executed.

[0050] Based on any of the above aspects, an apparatus number determination method, system, electronic device, and storage medium provided by an embodiment of the present application generate a temporary apparatus number according to the current hardware information of the device; obtain the cache file information of the device, and obtain the cached apparatus number of the device and the cached hardware information according to the cache file information; determine whether the temporary apparatus number is consistent with the cached apparatus number, and if so, use the cached apparatus number as the unique apparatus number of the device, and if not, compare the current hardware information with the cached hardware information to obtain a comparison result; select the cached apparatus number or the temporary apparatus number as the unique apparatus number of the device according to the comparison result; the present application can achieve the following technical effects:

[0051] · Generate a stable and unique apparatus number: Through the present application, a stable and unique apparatus number can be generated for each device, so that the apparatus number can uniquely and stably identify the corresponding device, thereby enabling a server connected to multiple devices to distinguish each device and achieve goals such as counting and identifying the actual number of used devices.

[0052] · Avoid the problem of frequent changes in the apparatus number: Multidimensional hardware information can be used as a component of the hardware number to avoid the problem that the apparatus number changes with the change of a single piece of information; by comparing the similarity between the current hardware information and the cached hardware information, and determining the unique apparatus number according to the comparison result and the total similarity value, the stability of the cached apparatus number can be maintained, and the change of the device hardware information can be monitored at all times to accurately master the status information of the device.

[0053] · Prevent the impersonation problem of different devices: By comparing the similarity between the current device information and the cached device information, the change of the device regarding the hardware can be monitored at all times. When the total similarity is less than the similarity threshold, the unique apparatus number is adjusted to prevent the impersonation problem of devices formed by copying the cache file, so that the server and the like can accurately obtain the information of each device according to the accurate unique apparatus number. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0055] Figure 1 FIG. is a schematic application scenario diagram of an apparatus number determination method provided in this embodiment.

[0056] Figure 2 FIG. is a flowchart of an apparatus number determination method provided in this embodiment.

[0057] Figure 3 Flowchart of a method for obtaining a comparison result provided in this embodiment.

[0058] Figure 4 Flowchart of a method for obtaining a total similarity value provided in this embodiment.

[0059] Figure 5 Schematic diagram of functional modules of a device number determination system provided in this embodiment.

[0060] Figure 6 Schematic diagram of the structure of an electronic device provided in this embodiment. Detailed implementation manners

[0061] The accompanying drawings of this application are only for illustrative purposes and should not be construed as limitations on this application. To better illustrate the following embodiments, some components in the drawings are omitted, enlarged, or reduced, and do not represent the dimensions of actual products; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0062] In order to enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.

[0063] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above accompanying drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0064] Recently, with the rapid development of Internet technology, the number of Internet-connected devices has increased exponentially. In many business scenarios, it is urgent to assign a globally unique, stable, and reliable identifier to each Internet-connected device so that the connected server can accurately count the actual device usage and the connected device status. In the prior art, for devices in the Windows system environment, device numbers are generally generated based on means such as network card addresses (MAC Address), system-assigned device IDs (MachineId), or random strings (UUID). Although global uniqueness can be achieved, there are still significant stability defects: in an environment where a device has multiple network cards / virtual network cards, the network card address in the device is prone to change. If the device number is generated only based on the network card address, the device number will often change as the network card address changes, destroying the stability of the device number; if the device number is generated only based on the system-assigned device ID, there will be a problem that if the system is reinstalled, the system-assigned device ID will be reset, causing the device number to change accordingly; if the device number is generated only based on a random string, since the UUID is randomly generated, there will be a problem that the device number lacks an association with the device. The above-mentioned methods of generating device numbers using existing means are difficult to meet the requirement of generating a long-term stable device number. Therefore, the present invention makes necessary improvements in this regard. This embodiment provides a technical solution that can solve the above problems. The following will describe the specific embodiments of the present application in detail with reference to the accompanying drawings.

[0065] Exemplarily, it is a schematic diagram of an application scenario of a device number determination method provided by an embodiment of the present application. As Figure 1 shown, the application scenario at least includes a server 100 and a terminal 200 that can communicate with the server 100. The server 100 has functions of information processing and device number confirmation; the terminal 200 has information processing functions.

[0066] It can be understood that the server 100 can be an independent electronic device or a cluster composed of multiple electronic devices; the terminal 200 can be a smart phone terminal, a personal computer, a tablet computer, a vehicle-mounted terminal, etc., but is not limited thereto.

[0067] In an implementable manner, the server 100 and the terminal 200 can respectively execute a device number determination method provided by an embodiment of the present application. Alternatively, part of the device number determination method provided by an embodiment of the present application is executed in the server 100 and part is executed in the terminal 200.

[0068] As Figure 2 shown, this embodiment provides a device number determination method, and the method can be divided into the following steps:

[0069] S100. Generate a temporary device number according to the current hardware information of the device;

[0070] It is understandable that the device number, also known as the device ID (Identification), is a unique and stable string number assigned to different devices; in actual network operations, different devices can be distinguished in business through the device number, so as to realize functions such as counting the number of devices.

[0071] It is understandable that the device is connected to several hardware through an interface; in this embodiment, the information of several hardware connected to the device through the interface is obtained as the current hardware information, and the interface can be an internal interface of the device or an external structure. Exemplarily, the current hardware information can be obtained through the COM serial communication port information; this current hardware information can reflect the hardware state actually used by the device, ensuring the authenticity and real-time nature of the device hardware information.

[0072] Generate a temporary device number using the obtained current hardware information, so that the temporary device number can be associated with the current state of the device and have the characteristics of the device. If the temporary device number is selected as the unique device number of the device subsequently, the device can also be uniquely identified.

[0073] Specifically, generating a temporary device number according to the current hardware information of the device includes:

[0074] The current hardware information includes two or more of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number; among them, the current network card address includes one or more, and the current hard disk serial number includes one or more.

[0075] It is understandable that the network card address (MacAddress), also known as the MAC address, is the address used by the device at the media access layer, also called the physical address, hardware address, or link address, which is written inside the network card hardware by the network device manufacturer during production; exemplarily, one of the network card addresses of a certain device can be: 08:00:20:0A:8C:6D.

[0076] It is understandable that the hard disk serial number (Serial Number) is usually a unique identifier assigned by the hard disk manufacturer to each hard disk; this identifier is generally unique and is used to distinguish different hard disks.

[0077] It is understandable that the motherboard serial number is similar to the hard disk serial number and is usually a unique identifier assigned by the motherboard manufacturer to each motherboard; this identifier is also unique and is used to distinguish different motherboards.

[0078] It is understandable that the CPUID (Central Processing Unit Identification) usually refers to the unique identifier inside the processor, which may include some specific register values, such as the information returned by processor instructions, or the serial number provided by the processor manufacturer.

[0079] In this embodiment, the currently obtained hardware information may include two or more of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number, and the information of several hardware metrics is obtained for subsequent generation of a temporary device number; it is understandable that the currently obtained hardware information should correspond one-to-one with the hardware metrics selected for generating the temporary device number. That is, if the motherboard serial number and the processor number are selected as the two dimensions for generating the temporary device number, then the currently obtained hardware information also needs to obtain the current motherboard serial number and the current processor number to perform the step of generating the temporary device number, ensuring the smooth generation of the temporary device number.

[0080] It is understandable that since a device may have multiple network cards and multiple hard disks, it is necessary to correspondingly obtain one or more network card addresses and hard disk serial numbers.

[0081] The respective currently obtained hardware information is sequentially subjected to a first splicing to obtain a first string, and the temporary device number is generated based on the first string;

[0082] In this embodiment, the respective currently obtained hardware information corresponding to the selected hardware metrics is spliced to obtain a first string; preferably, in this embodiment, the first string can be used to generate data of a fixed length as the temporary device number by using a hash algorithm; preferably, the fixed length is set to 32 bits.

[0083] It is understandable that the hash algorithm is a mathematical function that converts input data of any length (such as files, messages, strings, etc.) into a unique value of a fixed length (referred to as a hash value or digest) through specific calculations; the core characteristics of the hash value are determinism (the same input will always generate the same hash) and irreversibility (it is impossible to reverse-engineer the original data from the hash value); it is widely used in fields such as data integrity verification, cryptography, and blockchain.

[0084] In the specific implementation process, when performing the first splicing of two or more of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number, the splicing order can be preset. For example, the first splicing can be performed in the order of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number, or the splicing can also be performed in the order of the current hard disk serial number, the current network card address, the current motherboard serial number, and the current processor number. The specific splicing order is not limited.

[0085] When there are multiple current network card addresses, the multiple current network card addresses are arranged in a certain order, and then the first current network card address is obtained, and the first current network card address is subjected to the first splicing; when there are multiple current hard disk serial numbers, the multiple current hard disk serial numbers are arranged in a certain order, and then the first current hard disk serial number is obtained, and the first current hard disk serial number is subjected to the first splicing.

[0086] In this embodiment, if the device uses multiple network cards or multiple hard disks, when obtaining the current hardware information, multiple current network card addresses or multiple current hard disk serial numbers will also be obtained. To simplify the subsequent comparison process and avoid excessive data volume of the device number, the multiple current network card addresses / hard disk serial numbers are arranged in a certain order to obtain the first current network card address / first current hard disk serial number, and the first current network card address / first current hard disk serial number is used for the first splicing.

[0087] Exemplarily, if the current hardware information includes a current network card address and a current hard disk serial number, and there are multiple current network card addresses and multiple current hard disk serial numbers, when generating the temporary device number, first arrange the multiple current network card addresses in a certain order to obtain the first current network card address, arrange the multiple current hard disk serial numbers in a certain order to obtain the first current hard disk serial number, and then perform the first splicing on the first current network card address and the first current hard disk serial number to obtain the first string.

[0088] Preferably, when obtaining multiple network card addresses, the addresses of virtual network cards may be included; the addresses of virtual network cards have high variability and no corresponding hardware, and poor stability, so the addresses of virtual network cards need to be removed to avoid data instability and excessive data volume.

[0089] Preferably, the multiple current network card addresses or multiple current hard disk serial numbers can be arranged in ascending order, descending order or other arrangement methods, and the arrangement method is not particularly required in this embodiment.

[0090] A preferred implementation manner is that the current hardware information includes a current network card address, a current hard disk serial number, a current motherboard serial number, and a current processor number, and then the first current network card address, the first current hard disk serial number, the current motherboard serial number, and the current processor number are sequentially subjected to the first splicing in a preset splicing order to obtain the first string.

[0091] S200. Obtain the cache file information of the device, and obtain the cache device number of the device and the cached hardware information according to the cache file information;

[0092] Understandably, the cache file of a device is a file that stores device-related hardware information to improve performance and processing efficiency. It is generally stored in the local memory of the device for programs to call. Understandably, the cache file information usually records device-related hardware information, where the device-related hardware information includes but is not limited to the cached network card address, cached hard disk serial number, cached motherboard serial number, and cached processor number.

[0093] In this embodiment, it is necessary to obtain the cache file information in the device and obtain the device cache device number and the cached hardware information in the cache file information. Understandably, the cache device number has been pre-generated according to the cached hardware information and stored in the cache file.

[0094] Specifically, before obtaining the cache file information of the device, first determine whether the device has a cache file. If so, execute the step of obtaining the cache file information of the device. If not, use the temporary device number as the unique device number of the device and create a new cache file, and write the temporary device number into the cache file as the cache device number.

[0095] In this embodiment, there are cases where the cache file in the device is accidentally deleted or the location of the device cache file cannot be found. In the above cases, the device is considered to have no cache file, so the relevant information in the cache file cannot be obtained. Therefore, it is necessary to first determine whether the device has a cache file. If there is a cache file, obtain the device cache file information; if there is no cache file, directly select the temporary device number as the unique device number of the device and create a new cache file, and write the unique device number into the cache file as the cache device number for storage.

[0096] Specifically, obtaining the cache device number of the device and the cached hardware information according to the cache file information includes:

[0097] The cached hardware information includes two or more of the cached network card address, cached hard disk serial number, cached motherboard serial number, and cached processor number; where the cached network card address includes one or more, and the cached motherboard serial number includes one or more;

[0098] In this embodiment, the cached hardware information obtained may include two or more of the cached network card address, the cached hard disk serial number, the cached motherboard serial number, and the cached processor number, and information on several hardware metrics is obtained for generating a cached device number; it is understandable that the cached hardware information obtained should correspond one by one to the hardware metrics selected for generating the cached device number. That is, if the motherboard serial number and the processor number are selected as the two dimensions for generating the cached device number, then the cached motherboard serial number and the cached processor number also need to be obtained in the cached hardware information to ensure the smooth generation of the cached device number.

[0099] It is understandable that since the cached file may record multiple network cards or multiple hard disks, one or more network card addresses or hard disk serial numbers need to be obtained correspondingly.

[0100] The cached hardware information is sequentially subjected to a second splicing to obtain a second string, and the cached device number is generated according to the second string.

[0101] In this embodiment, the cached hardware information corresponding to the selected hardware metrics is subjected to a second splicing to obtain a second string; preferably, in this embodiment, a hash algorithm can be used to generate data of a fixed length from the second string as the cached device number; preferably, the fixed length is set to 32 bits.

[0102] Among them, when there are multiple cached network card addresses, the first cached network card address read from the cached file is subjected to the second splicing; when there are multiple cached hard disk serial numbers, the first cached hard disk serial number read from the cached file is subjected to the second splicing.

[0103] In this embodiment, if the cached file records multiple network card addresses or multiple hard disk serial numbers, then multiple cached network card addresses or multiple cached hard disk serial numbers will also be obtained in the cached hardware information. To simplify the subsequent comparison process and avoid excessive data volume of the device number, and at the same time correspond one by one to the method of generating the temporary device number, the first cached network card address / the first cached hard disk serial number read from the cached file needs to be subjected to a second splicing.

[0104] It is understandable that, compared with the temporary device number, the cached device number has better stability. Because when the information in the cache file involves multiple cached network card addresses or multiple hard disk serial numbers, the first cached network card address / the first hard disk serial number is always used for the second splicing, and there is no need to rearrange and select multiple cached network card addresses or multiple cached hard disk serial numbers. This can ensure that even if a new cached device number is generated, the new cached device number has a high probability of being the same as the old cached device number. For the selection of the cached device number as the unique device number of the device, this unique device number has great stability. Even if the device uses new hardware, the cache file only inserts the new hardware information at the end of the corresponding list, and will not change the first element of the corresponding list, nor will it affect the value of the generated cached device number.

[0105] It is understandable that in order to make the format of the determined unique device number stable, it is necessary to ensure that the hardware information used for the generation of the two optional items (temporary device number and cached device number) is the same, the hardware information for the first splicing and the second splicing and the splicing order of the hardware information are the same, and the methods used for generation are the same. At the same time, it can also ensure that the subsequent comparison between the two can be carried out normally. Exemplarily, if the first splicing is to splice the first current network card address, the first current hard disk serial number, the current motherboard serial number, and the current processor number in sequence to obtain the first string, then the second splicing is to splice the first cached network card address, the first hard disk serial number, the cached motherboard serial number, and the cached processor number read in sequence to obtain the second string. At the same time, the temporary device number is generated according to the first string, and the cached device number is generated according to the second string, both using the hash algorithm.

[0106] In a preferred embodiment, the cached hardware information includes a cached network card address, a cached hard disk serial number, a cached motherboard serial number, and a cached processor number. Then, the first cached network card address, the first hard disk serial number, the cached motherboard serial number, and the cached processor number read are spliced in sequence according to a preset splicing order to obtain the second string, and then the cached device number is generated according to the second string. Since the cached device number is generated based on four types of hardware information: cached network card address, cached hard disk serial number, cached motherboard serial number, and cached processor number, and the network card address, hard disk serial number, motherboard serial number, and processor number are usually essential hardware for the device and have a relatively low replacement frequency, the cached device number generated by combining these four types of hardware information is relatively stable. Then, by comparing based on the cached device number and the temporary device number, the unique device number of the device can be relatively stable, and the problem of device impersonation can be avoided.

[0107] S300. Determine whether the temporary device number is the same as the cached device number. If so, use the cached device number as the unique device number of the device. If not, compare the current hardware information with the cached hardware information to obtain a comparison result.

[0108] In this embodiment, by determining whether the temporary device number is the same as the cached device number, if they are the same, it indicates that the current hardware information during device use and the cached hardware information recorded in the cached file are the same in the corresponding dimensions. The cached device number generated based on the cached hardware information of the cached file can accurately identify the device, and the cached device number can be directly used as the unique device number of the device, which also meets the uniqueness and stability of the device number. If the two are not the same, it means that the cached file of the device may not be updated and the new hardware information is not updated and recorded, or it means that the cached file does not belong to the device, and the cached hardware information of the cached file does not correspond to the hardware during device use. Then, the current hardware information and the cached hardware information need to be further processed to confirm the unique device number, avoiding the problem in the prior art of directly using the information in the cached file to generate a device number and thus impersonating the device.

[0109] Specifically, as Figure 3 shown, the step of comparing the current hardware information with the cached hardware information to obtain a comparison result includes the following steps:

[0110] S310. The current hardware information is the current hardware information corresponding to the preset hardware metrics.

[0111] In this embodiment, it is necessary to obtain the current hardware information corresponding to the device according to the hardware metrics to ensure the accuracy and efficiency of the obtained information and avoid data redundancy.

[0112] It is understandable that several hardware metrics for the comparison need to be confirmed;

[0113] Specifically, the hardware metrics include two or more of the network card address, hard disk serial number, motherboard serial number, and processor number;

[0114] In this embodiment, it is necessary to pre-determine the hardware metrics for comparison, and the hardware metrics can be two or more of the network card address, hard disk serial number, motherboard serial number, and processor number. The network card address, hard disk serial number, motherboard serial number, and processor number are optional hardware information for generating the temporary device number and the cached device number. It is understandable that the corresponding hardware metrics need to be determined according to the hardware information selected for generating the temporary device number and the cached device number. Exemplarily, if the motherboard serial number and the processor serial number are selected as the generated hardware information for the temporary device number and the cached device number, the hardware metrics are determined to be two dimensions of the motherboard serial number and the processor serial number for comparison to ensure the unity of the comparison information.

[0115] S320. The cached hardware information is the cached hardware information corresponding to the hardware metrics;

[0116] In this embodiment, it is necessary to obtain the cached hardware information corresponding to the device according to the hardware metrics, so as to ensure the accuracy and efficiency of the obtained information and avoid data redundancy.

[0117] S330. Compare the current hardware information corresponding to the hardware metrics with the cached hardware information to obtain a total similarity value, and use the total similarity value as the comparison result.

[0118] In this embodiment, it is necessary to compare the current hardware information corresponding to the hardware metrics with the cached hardware information to obtain a total similarity value. The total similarity value reflects the similarity degree of the current hardware information and the cached hardware information in different hardware metrics, and this total similarity value can be used as a judgment basis for obtaining and confirming the unique device number.

[0119] Specifically, as Figure 4 shown, the comparison of the current hardware information corresponding to the hardware metrics with the cached hardware information to obtain a total similarity value includes:

[0120] S331. Respectively compare the current hardware information corresponding to each hardware metric with the cached hardware information to obtain the similarity value corresponding to each hardware metric;

[0121] Specifically, for the network card address, hard disk serial number, motherboard serial number, and processor number, corresponding similarity weights and dissimilarity weights are preset;

[0122] In this embodiment, when determining the unique device number, two or more of the above-mentioned hardware metrics (such as two or more of the network card address, hard disk serial number, motherboard serial number, and processor number) are required. Since the stability (whether it is easy to change) and uniqueness (whether it is easy to repeat) of these hardware metrics are different, this application assigns different weights to these hardware metrics to reflect their contribution degrees to the determination of the unique device number. Specifically, the weights are divided into two categories: similarity weights and dissimilarity weights.

[0123] The similarity weights and dissimilarity weights corresponding to the hardware metrics are both used to represent the contribution degree of the hardware metrics to the total similarity value. Usually, the values of the similarity weights and dissimilarity weights corresponding to the same hardware metric are different. When the current hardware information corresponding to the hardware metric and the cached hardware information are similar, the corresponding similarity weight is used to obtain the corresponding similarity value. And when the current hardware information corresponding to the hardware metric and the cached hardware information are not similar, the corresponding dissimilarity weight is used to obtain the corresponding similarity value. Thus, in the case where the similarities of the hardware metrics are different, the calculation of the total similarity value can be affected by the similarity weights and dissimilarity weights. For example, for the hardware metric of motherboard serial number, if the current motherboard serial number is the same as the cached motherboard serial number, it indicates that the current motherboard serial number and the cached motherboard serial number are similar, and the similarity weight corresponding to the hardware metric of motherboard serial number is assigned and used for the subsequent calculation of the total similarity value. If the current motherboard serial number is different from the cached motherboard serial number, it indicates that the current motherboard serial number and the cached motherboard serial number are not similar, and the dissimilarity weight corresponding to the hardware metric of motherboard serial number is assigned and used for the subsequent calculation of the total similarity value. This method not only assigns weights to different hardware metrics, but also assigns different similarity weights and dissimilarity weights to the same hardware metric, thereby affecting the calculation of the total similarity value to different degrees and improving the accuracy of determining the unique device number.

[0124] In a preferred embodiment, four hardware metrics, namely network card address, hard disk serial number, motherboard serial number, and processor number, are selected as the hardware information for generating the device number, and weight references are set according to the stability and uniqueness of the four hardware metrics. The stability and uniqueness of different hardware metrics are different. Therefore, corresponding similarity weights and dissimilarity weights are preset according to the stability and uniqueness of different hardware metrics. A preferred embodiment is that the similarity weights corresponding to the network card address, hard disk serial number, motherboard serial number, and processor number are the same, the dissimilarity weights corresponding to the network card address and hard disk serial number are the same, the dissimilarity weights corresponding to the motherboard serial number and processor number are the same and different from the dissimilarity weights corresponding to the network card address and hard disk serial number, so as to emphasize the influence of each hardware metric on stability and uniqueness.

[0125] As set in this embodiment, the initial similarity value is 1, and the total similarity value is obtained by processing the initial similarity value according to the similarity weights and dissimilarity weights, as shown in Table 1:

[0126] Table 1

[0127] Hardware Information Stability Uniqueness Similarity Weight Dissimilarity Weight Network Card Address General Good 0 -0.2 Hard Disk Serial Number General Good 0 -0.2 Motherboard Serial Number Good General 0 -0.3 Processor Number Good General 0 -0.3

[0128] It is understandable that there can be multiple network card addresses / hard disk serial numbers. Therefore, the device number may obtain different network card addresses / hard disk serial numbers as splicing data. Generally, the stability of network card addresses / hard disk serial numbers is average. However, each network card address / hard disk serial number has a unique identifier, so the uniqueness of network card addresses / hard disk serial numbers is relatively good; there is only one mainboard serial number / processor number for each device. Therefore, the device number may only obtain the corresponding mainboard serial number / processor number as splicing data. So, the stability of mainboard serial numbers / processor numbers is relatively good. However, once the mainboard / processor is replaced or the mainboard serial number / processor number is maliciously tampered with, the corresponding data will be immediately changed. Therefore, the uniqueness of mainboard serial numbers / processor numbers is relatively good.

[0129] The similarity weights and dissimilarity weights corresponding to the above different hardware information can be adaptively adjusted according to the number of selected hardware indicators. After adjustment, the proportion of each hardware indicator in the total similarity value should be appropriately kept unchanged. There are no special requirements for the adjusted values in this application; the above initial similarity value can be adjusted in combination with the similarity weight and dissimilarity weight. There are no special requirements for data calculation methods such as adding the similarity values of each hardware indicator and / or subtracting the negative values of the similarity values of each hardware indicator in this application.

[0130] When the hardware indicator includes a network card address, the current hardware information includes the current network card address, and the cached hardware information includes the cached network card address; it is judged whether there is a same one between a current network card address and a cached network card address. If so, the similarity value corresponding to the network card address is obtained according to the similarity weight corresponding to the network card address. If not, the dissimilarity value corresponding to the network card address is obtained according to the dissimilarity weight corresponding to the network card address;

[0131] In this embodiment, if there is a same one between a current network card address and a cached network card address, it indicates that the cached file has recorded at least one network card address being used by the device, proving that the cached file belongs to the device. Therefore, it is determined that the current network card address in the current hardware information is consistent with the cached network card address in the cached hardware information, and the similarity value corresponding to the network card address is obtained according to the preset similarity weight. During specific implementation, it can be further judged whether each current network card address corresponds one by one to the cached network card address. If not, the current network card address not recorded in the cached file can be written into the corresponding list in the cached file.

[0132] If all the current network card addresses in the current hardware information cannot match the cached network card addresses in the cached hardware information, it indicates that the cached file may not belong to this device. Then, it is determined that the current network card addresses in the current hardware information are inconsistent with the cached network card addresses in the cached hardware information. And according to the preset non - similarity weight, the similarity value corresponding to the network card address is obtained, and the current network card address is used as the cached network card address to update the corresponding list of the cached file.

[0133] When the hardware metric includes the hard disk serial number, the current hardware information includes the current hard disk serial number, and the cached hardware information includes the cached hard disk serial number; determine whether there is a current hard disk serial number that is the same as a cached hard disk serial number. If so, according to the similarity weight corresponding to the hard disk serial number, the similarity value corresponding to the hard disk serial number is obtained. If not, according to the non - similarity weight corresponding to the hard disk serial number, the similarity value corresponding to the hard disk serial number is obtained.

[0134] In this embodiment, if there is a current hard disk serial number that is the same as a cached hard disk serial number, it indicates that the cached file has recorded at least one currently used hard disk serial number of this device, proving that the cached file belongs to this device. Therefore, it is determined that the current hard disk serial number in the current hardware information is consistent with the cached hard disk serial number in the cached hardware information, and according to the preset similarity weight, the similarity value corresponding to the hard disk serial number is obtained. Specifically in implementation, it can be further determined whether each current hard disk serial number corresponds one - to - one with the cached network card address. If not, the current hard disk serial numbers not recorded in the cached file can be written into the corresponding list of the cached file.

[0135] If all the current hard disk serial numbers in the current hardware information cannot match the cached hard disk serial numbers in the cached hardware information, it indicates that the cached file may not belong to this device. Then, it is determined that the current hard disk serial numbers in the current hardware information are inconsistent with the cached hard disk serial numbers in the cached hardware information. And according to the preset non - similarity weight, the similarity value corresponding to the hard disk serial number is obtained, and the current hard disk serial number is used as the cached hard disk serial number to update the corresponding list of the cached file.

[0136] When the hardware metric includes the motherboard serial number, determine whether the current motherboard serial number in the current hardware information is consistent with the cached motherboard serial number in the cached hardware information. If so, according to the similarity weight corresponding to the motherboard serial number, the similarity value corresponding to the motherboard serial number is obtained. If not, according to the non - similarity weight corresponding to the motherboard serial number, the similarity value corresponding to the motherboard serial number is obtained.

[0137] In this embodiment, if the current motherboard serial number in the current hardware information is the same as the cached motherboard serial number in the cached hardware information, it proves that the cached file belongs to this device. Therefore, it is determined that the current motherboard serial number in the current hardware information is the same as the cached motherboard serial number in the cached hardware information, and the similarity value corresponding to the motherboard serial number is obtained according to the preset similarity weight;

[0138] If all the current motherboard serial numbers in the current hardware information are different from the cached motherboard serial number in the cached hardware information, it indicates that the cached file may not belong to this device. Then it is determined that the current motherboard serial number in the current hardware information is inconsistent with the cached motherboard serial number in the cached hardware information, and the similarity value corresponding to the motherboard serial number is obtained according to the preset dissimilarity weight, and the current motherboard serial number is updated to the corresponding position of the cached file as the cached motherboard serial number.

[0139] When the hardware metric includes the processor number, it is judged whether the current processor number in the current hardware information is the same as the cached processor number in the cached hardware information. If so, the similarity value corresponding to the processor number is obtained according to the similarity weight corresponding to the processor number. If not, the similarity value corresponding to the processor number is obtained according to the dissimilarity weight corresponding to the processor number.

[0140] In this embodiment, if the current processor number in the current hardware information is the same as the cached processor number in the cached hardware information, it proves that the cached file belongs to this device. Therefore, it is determined that the current processor number in the current hardware information is the same as the cached processor number in the cached hardware information, and the similarity value corresponding to the processor number is obtained according to the preset similarity weight;

[0141] If all the current processor numbers in the current hardware information are different from the cached processor number in the cached hardware information, it indicates that the cached file may not belong to this device. Then it is determined that the current processor number in the current hardware information is inconsistent with the cached processor number in the cached hardware information, and the similarity value corresponding to the processor number is obtained according to the preset dissimilarity weight, and the current processor number is updated to the corresponding position of the cached file as the cached processor number.

[0142] S332. Calculate the similarity values corresponding to each of the hardware metrics to obtain the total similarity value.

[0143] In this embodiment, according to the obtained similarity values corresponding to each hardware metric, a mathematical calculation is performed on them to obtain the total similarity value.

[0144] Exemplarily, when the hardware indicators include a network card address, a hard disk serial number, a motherboard serial number and a processor number, the similarity values corresponding to the network card address, the hard disk serial number, the motherboard serial number and the processor number are obtained, and the similarity values corresponding to the network card address, the hard disk serial number, the motherboard serial number and the processor number are added to obtain the total similarity value.

[0145] S400: Select the cache device number or the temporary device number as the unique device number of the device according to the comparison result.

[0146] Specifically, the selecting the cache device number or the temporary device number as the unique device number of the device according to the comparison result includes:

[0147] Determine whether the total similarity value is greater than a preset similarity threshold. If so, select the cache device number as the unique device number of the device; if not, select the temporary device number as the unique device number of the device, and use the unique device number as the new cache device number to update the cache device number in the cache file.

[0148] In this embodiment, it is necessary to preset a similarity threshold according to the influence of different hardware indicators on stability and uniqueness, and use it as one of the judgment bases for selecting a unique device number. Preferably, in conjunction with the above preferred implementation, four hardware indicators, namely, network card address, hard disk serial number, motherboard serial number and processor number, are selected as elements for generating the device number, and different similarity weights and non-similar weights are set for them, and the preset similarity threshold can be 0.4; in other implementations, the similarity threshold can be adjusted accordingly.

[0149] In this embodiment, if the total similarity value is greater than the similarity threshold, it means that the current hardware information is similar to the cached hardware information as a whole, but the hardware information in a few dimensions is not similar. Generally speaking, the cache device number generated by the cached hardware information can uniquely identify the device. Considering that the cache device number is more stable, the cache device number is selected as the unique device number.

[0150] If the total similarity value is less than or equal to the similarity threshold, it means that most of the current hardware information is not similar to the cached hardware information, the cache file may not belong to the device or the cached hardware information has not been updated in time, resulting in inconsistency with the current hardware information, and the cache device number generated by the cached hardware information cannot uniquely identify the device. In this case, a temporary device number that is more relevant to the current hardware information of the device will be selected as the unique device number, and the determined unique device number will be used as the new cache device number to update the cache device number in the cache file.

[0151] This application can avoid the problem that the prior art generates a unique device number using only the information of one hardware metric, resulting in the device number being frequently variable and non-unique. It can also prevent the impersonation problem caused by generating a unique device number only using the information in the cache file. The impersonation problem can be simply achieved, for example, by copying the cache file of device A to device B, and device B can generate the same cache device number as device A to impersonate device A.

[0152] In this application, two or more hardware metrics are used to generate the device number. And through the set comparison method, the temporary device number and the cache device number are compared, which can simultaneously monitor the current running state of the device and the state of the cache file. It can be compatible with the situation where some hardware information of the same device is updated, consider the impact of the updated hardware on the stability and uniqueness of the device number and the change degree of all hardware metrics, and cooperate with the similarity threshold to confirm the unique device number, reducing the frequent change of the device number. At the same time, it is compatible with detecting the impersonation problem between devices. For the cache file copied from other devices, by comparing the current hardware information and the cached information, it is determined whether the cache file belongs to this device. If it is found that the cache file does not belong to this device, the temporary device number more relevant to this device is selected as the unique device number, and the temporary device number is used as the cache device number to update the cache file, thus eliminating the impersonation behavior between devices to a certain extent.

[0153] As Figure 5 shown, the embodiment of this application also provides a device number determination system. Optionally, the system includes:

[0154] A temporary device number generation module 511, an information acquisition module 512, a comparison module 513, and a selection module 514, where:

[0155] The temporary device number generation module 511 is used to generate a temporary device number according to the current hardware information of the device.

[0156] In this embodiment, the temporary device number generation module 511 can be used to execute Figure 2 the step S100 shown. The specific description of the temporary device number generation module 511 can refer to the description of the step S100.

[0157] The information acquisition module 512 is used to acquire the cache file information of the device, and acquire the cache device number of the device and the cached hardware information according to the cache file information.

[0158] In this embodiment, the information acquisition module 512 can be used to execute Figure 2 the step S200 shown. The specific description of the information acquisition module 512 can refer to the description of the step S200.

[0159] A comparison module 513 is configured to determine whether the temporary device number is the same as the cached device number. If so, the cached device number is used as the unique device number of the device. If not, the current hardware information and the cached hardware information are compared to obtain a comparison result.

[0160] In this embodiment, the comparison module 513 can be used to execute Figure 2 the steps S300 shown. For the specific description of the comparison module 513, reference can be made to the description of the steps S300.

[0161] A selection module 514 is configured to select, according to the comparison result, either the cached device number or the temporary device number as the unique device number of the device.

[0162] In this embodiment, the selection module 514 can be used to execute Figure 2 the steps S400 shown. For the specific description of the selection module 514, reference can be made to the description of the steps S400.

[0163] An embodiment of the present application further provides an electronic device, the structure of which is as Figure 6 shown. The electronic device includes a memory 611, a processor 612, a communication module 613, an input / output interface 614, etc. Optionally, the memory 611, the processor 612, the communication module 613, and the input / output interface 614 can be connected and communicate with each other through a bus 615.

[0164] The memory 611 is configured to store one or more computer programs and transmit the code of the computer programs to the processor 612. When the one or more computer programs are executed by the processor 612, a device number determination method in the embodiment of the present application is implemented.

[0165] Optionally, the electronic device can be connected to a network through the communication module 613 to communicate with other devices, such as terminals or servers, through the network to achieve data interaction. The electronic device can be various forms of digital computers, such as, by way of example, desktop computers, servers, workbenches, mainframe computers, or other types of computers. The electronic device can also be various forms of mobile terminals, such as, by way of example, smart phones, tablet computers, wearable devices (such as helmets, glasses, watches, etc.), and other similar mobile terminals.

[0166] Optionally, the electronic device may be connected to required input / output devices, such as a keyboard, a display device, etc., through the input / output interface 614. The electronic device itself may have a display device and may also externally connect other display devices through the input / output interface 614. Optionally, a storage device, such as a hard disk, etc., may also be connected through the input / output interface 614, so that the data in the electronic device can be stored in the storage device, or the data in the storage device can be read, and the data in the storage device can also be stored in the memory 611. It can be understood that the input / output interface 614 may be a wired interface or a wireless interface. According to different actual application scenarios, the devices connected to the input / output interface 614 may be components of the electronic device or external devices connected to the electronic device when needed.

[0167] Optionally, the memory 611 may be a volatile memory and / or a non-volatile memory. The volatile memory may be a random access memory, etc., and the non-volatile memory may be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory, etc.

[0168] Optionally, the computer program stored in the memory 611 may be divided into one or more modules. The one or more modules are stored in the memory 611 and are executed by the processor 612 to complete the method provided by the present embodiment. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the computer program instruction segments are used to describe the execution process of the computer program in the electronic device.

[0169] Optionally, the processor 612 may be various general and / or special processing components with processing and computing capabilities. Some examples of the processor 612 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various dedicated artificial intelligence computing chips, various processors running machine learning model algorithms, and may also be any suitable controller, microcontroller, processor, etc. The processor 612 executes each method and process of the present embodiment. Exemplarily, such as a device number determination method in an embodiment of the present application.

[0170] Optionally, the bus 615 may include a path for transmitting information. According to different functions, the bus 615 may be divided into an address bus, a data bus, a control bus, etc.

[0171] In an alternative implementation, an embodiment of the present application further provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a computer, the computer can execute the methods in the above method embodiments. Part or all of the computer program can be loaded and / or installed on the memory 611 of the electronic device. When the computer program is executed by the processor 612, one or more steps of a method for determining a device number according to an embodiment of the present application can be executed.

[0172] Optionally, the computer-readable storage medium may be a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc.

[0173] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, rather than limitations on the specific implementation manners of the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the claims of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A method for determining a device number, characterized in that, The method includes: Generating a temporary device number according to the current hardware information of the device; Obtaining the cache file information of the device, and obtaining the cached device number and the cached hardware information of the device according to the cache file information; Judging whether the temporary device number is the same as the cached device number. If so, using the cached device number as the unique device number of the device. If not, comparing the current hardware information with the cached hardware information to obtain a comparison result; Selecting the cached device number or the temporary device number as the unique device number of the device according to the comparison result.

2. The method for determining the device number according to claim 1, wherein The comparing the current hardware information with the cached hardware information to obtain a comparison result includes: The current hardware information is the current hardware information corresponding to a preset hardware index; The cached hardware information is the cached hardware information corresponding to the hardware index; Performing a similarity comparison on the current hardware information and the cached hardware information corresponding to the hardware index to obtain a total similarity value, and using the total similarity value as the comparison result.

3. The method for determining a device number according to claim 2, wherein, The hardware index includes two or more of a network card address, a hard disk serial number, a motherboard serial number, and a processor number; The performing a similarity comparison on the current hardware information and the cached hardware information corresponding to the hardware index to obtain a total similarity value includes: Respectively performing a similarity comparison on the current hardware information and the cached hardware information corresponding to each hardware index to obtain a similarity value corresponding to each hardware index; Calculating the similarity values corresponding to each hardware index to obtain the total similarity value.

4. The method for determining the device number according to claim 3, characterized in that Pre-setting corresponding similarity weights and dissimilarity weights for the network card address, the hard disk serial number, the motherboard serial number, and the processor number; When the hardware index includes a network card address, the current hardware information includes a current network card address, and the cached hardware information includes a cached network card address. Judging whether there is a current network card address that is the same as a cached network card address. If so, obtaining the similarity value corresponding to the network card address according to the similarity weight corresponding to the network card address. If not, obtaining the similarity value corresponding to the network card address according to the dissimilarity weight corresponding to the network card address; When the hardware index includes a hard disk serial number, the current hardware information includes a current hard disk serial number, and the cached hardware information includes a cached hard disk serial number. Judging whether there is a current hard disk serial number that is the same as a cached hard disk serial number. If so, obtaining the similarity value corresponding to the hard disk serial number according to the similarity weight corresponding to the hard disk serial number. If not, obtaining the similarity value corresponding to the hard disk serial number according to the dissimilarity weight corresponding to the hard disk serial number; When the hardware index includes a motherboard serial number, judging whether the current motherboard serial number in the current hardware information is the same as the cached motherboard serial number in the cached hardware information. If so, obtaining the similarity value corresponding to the motherboard serial number according to the similarity weight corresponding to the motherboard serial number. If not, obtaining the similarity value corresponding to the motherboard serial number according to the dissimilarity weight corresponding to the motherboard serial number; When the hardware metrics include the processor number, determine whether the current processor number in the current hardware information is consistent with the cached processor number in the cached hardware information. If so, obtain the similarity value corresponding to the processor number according to the similarity weight corresponding to the processor number; if not, obtain the similarity value corresponding to the processor number according to the dissimilarity weight corresponding to the processor number.

5. The method for determining a device number according to any one of claims 2-4, characterized in that, The step of selecting the cached device number or the temporary device number as the unique device number of the device according to the comparison result includes: Determine whether the total similarity value is greater than a preset similarity threshold. If so, select the cached device number as the unique device number of the device; if not, select the temporary device number as the unique device number of the device, and use the unique device number as the new cached device number to update the cached device number in the cached file.

6. The method for determining a device number according to any one of claims 1 to 4, characterized in that, The step of generating a temporary device number according to the current hardware information of the device includes: The current hardware information includes two or more of the current network card address, the current hard disk serial number, the current motherboard serial number, and the current processor number; where the current network card address includes one or more, and the current hard disk serial number includes one or more; Perform a first concatenation on each piece of current hardware information in sequence to obtain a first string, and generate the temporary device number according to the first string; Among them, when there are multiple current network card addresses, arrange the multiple current network card addresses in a certain order and then obtain the first current network card address, and perform the first concatenation on the first current network card address; when there are multiple current hard disk serial numbers, arrange the multiple current hard disk serial numbers in a certain order and then obtain the first current hard disk serial number, and perform the first concatenation on the first current hard disk serial number.

7. The method for determining a device number according to any one of claims 1 to 4, characterized in that, The step of obtaining the cached device number of the device and the cached hardware information according to the cached file information includes: The cached hardware information includes two or more of the cached network card address, the cached hard disk serial number, the cached motherboard serial number, and the cached processor number; where the cached network card address includes one or more, and the cached motherboard serial number includes one or more; Perform a second concatenation on each piece of cached hardware information in sequence to obtain a second string, and generate the cached device number according to the second string; Among them, when there are multiple cached network card addresses, read the first cached network card address from the cached file for the second concatenation; when there are multiple cached hard disk serial numbers, read the first cached hard disk serial number from the cached file for the second concatenation.

8. The method for determining a device number according to any one of claims 1 to 4, characterized in that, Before obtaining the cached file information of the device, first determine whether the device has a cached file. If so, execute the step of obtaining the cached file information of the device; if not, use the temporary device number as the unique device number of the device, create a new cached file, and write the temporary device number into the cached file as the cached device number.

9. An equipment number determination system, characterized in that, The system includes: A temporary device number generation module, configured to generate a temporary device number according to the current hardware information of the device; An information acquisition module, configured to acquire cache file information of a device, and acquire a cache device number of the device and cached hardware information according to the cache file information; A comparison module, configured to determine whether the temporary device number is consistent with the cache device number. If so, use the cache device number as the unique device number of the device. If not, compare the current hardware information with the cached hardware information to obtain a comparison result; A selection module, configured to select the cache device number or the temporary device number as the unique device number of the device according to the comparison result.

10. An electronic device, characterized in that, Comprising: A memory, configured to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implement a device number determination method according to any one of claims 1-8.