Method for identifying device type, server, and computer-readable storage medium
By receiving specific fields in the DHCP request message, the problem of low device recognition accuracy in the prior art is solved, and the precise identification of device type and the improvement of connection rate is achieved.
Patent Information
- Application Number
- CN202210240947.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-10
AI Technical Summary
In the prior art, the accuracy of device type recognition is low. The failure to carry device information in the http packet leads to incomplete identification, the operating system information is not exposed, resulting in inaccurate identification, the http packet fetch hook affects the connection rate, and the type cannot be recognized when the device is not connected to the network.
By receiving the DHCP request message from the target device, use OPTION12, OPTION55, OPTION57 and other fields to determine the device category, including model, operating system and manufacturer information, and accurately determine the device type.
It realizes accurate identification of device types, solves the problems of incomplete identification, inaccurateness and connection rate, and ensures that the types can be identified when the device is not connected to the network.
Smart Images

Figure CN114760279B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular, to a method for identifying a device type, a server, a computer-readable storage medium, and a processor. Background Art
[0002] In the prior art, the device type can be identified by the device information carried in the device's HTTP message, but this identification method has the following shortcomings:
[0003] 1) Many devices do not carry device information in their HTTP messages, resulting in incomplete identification of device types;
[0004] 2) Some devices do not expose operating system information in their HTTP requests, which can lead to inaccurate identification;
[0005] 3) When hooking http messages, it will affect the rate of establishing http connections to a certain extent;
[0006] 4) When the device is not connected to the Internet, there is no HTTP interaction and the type of device cannot be identified. Summary of the invention
[0007] The main purpose of the present application is to provide a method for identifying device types, a server, a computer-readable storage medium and a processor to solve the problem of low accuracy in identifying device types in the prior art.
[0008] To achieve the above-mentioned purpose, according to one aspect of the present application, a method for identifying a device type is provided, comprising: receiving a DHCP request message of a target device to be identified, the DHCP request message comprising a predetermined field, the predetermined field comprising at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field; determining a category of the target device according to the DHCP request message, the category being one of the following: a mobile phone, a tablet, a PC, and an IOT device.
[0009] Optionally, the predetermined field includes the OPTION12 field, the OPTION55 field and the OPTION57 field, and determining the category of the target device according to the DHCP request message includes: determining first association information according to the OPTION12 field; determining second association information according to the OPTION55 field; determining third association information according to the OPTION57 field; determining the category of the target device according to at least one of the first association information, the second association information and the third association information.
[0010] Optionally, the DHCP request message also includes an OPTION60 field, and the category of the target device is determined based on at least one of the first association information, the second association information, and the third association information, including: determining fourth association information based on the OPTION60 field; determining the category of the target device based on at least one of the first association information, the second association information, the third association information, and the fourth association information.
[0011] Optionally, the first association information includes the model of the target device, and determining the first association information according to the OPTION12 field includes: extracting a device model association subfield from the OPTION12 field; and determining the model of the target device according to the device model association subfield.
[0012] Optionally, the second association information includes the type of the operating system of the target device. According to the OPTION55 field, the second association information is determined, including: extracting system request parameters from the OPTION55 field; determining the type of the operating system of the target device according to the system request parameters, and the system request parameters include request content and request order.
[0013] Optionally, the fourth association information includes the manufacturer information of the target device, and determining the fourth association information according to the OPTION60 field includes: determining a manufacturer identifier according to the OPTION60 field; and determining the manufacturer information of the target device according to the manufacturer identifier.
[0014] Optionally, the third association information includes information about whether the target device is an IOT device. The third association information is determined according to the OPTION57 field, including: determining the size of the DHCP data packet acceptable to the target device according to the OPTION57 field; and determining whether the target device is an IOT device according to the size of the DHCP data packet.
[0015] Optionally, determining the category of the target device according to at least one of the first association information, the second association information, the third association information and the fourth association information includes: determining whether the category of the target device can be determined based on the fourth association information alone; if the category of the target device cannot be determined based on the fourth association information alone, determining whether the category of the target device can be determined in combination with the first association information; if the category of the target device is still not determined, determining whether the category of the target device can be determined in combination with the third association information; if the category of the target device is still not determined, determining the category of the target device in combination with the second association information.
[0016] According to another aspect of the present application, a method for identifying a device type is provided, including: a target device sends a DHCP request message to a server; the server receives the DHCP request message, the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field; the server determines the category of the target device according to the DHCP request message, and the category is one of the following: mobile phone, tablet, PC, IOT device.
[0017] According to another aspect of the present application, a server is provided, including: a receiving unit, used to receive a DHCP request message of a target device to be identified, the DHCP request message including a predetermined field, the predetermined field including at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field; a determining unit, used to determine the category of the target device according to the DHCP request message, the category being one of the following: a mobile phone, a tablet, a PC, and an IOT device.
[0018] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0019] According to yet another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the methods when it is run.
[0020] By applying the technical solution of the present application, the category of the target device is accurately determined by receiving a DHCP request message of the target device to be identified, the DHCP request message includes a predetermined field, and then determining the category of the target device according to the DHCP request message. The present invention solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connection, and failing to identify the type of the device when the device is not connected to the Internet and has no HTTP interaction, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 A flow chart of a method for identifying a device type according to an embodiment of the present application is shown;
[0023] Figure 2 A decision tree for determining the category of target recognition according to an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram showing a method of determining the type of a device using OPTION 60 according to an embodiment of the present application is shown;
[0025] Figure 4 A schematic diagram showing a method of determining the type of a device using OPTION 12 according to an embodiment of the present application is shown;
[0026] Figure 5 A flowchart of another method for identifying a device type according to an embodiment of the present application is shown;
[0027] Figure 6 A schematic diagram of a server according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0032] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0033] DHCP (Dynamic Host Configuration Protocol): Dynamic Host Configuration Protocol is an application layer protocol. When the client host IP is set to dynamic acquisition mode, the DHCP server will assign an IP to the client according to the DHCP protocol, so that the client can use this IP to access the Internet.
[0034] According to an embodiment of the present application, a method for identifying a device type is provided.
[0035] Figure 1 FIG. 1 is a flow chart of a method for identifying a device type according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0036] Step S101, receiving a DHCP request message of a target device to be identified, wherein the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field;
[0037] Step S102, determining the category of the target device according to the DHCP request message, the category being one of the following: mobile phone, tablet, PC, IOT device.
[0038] Specifically, the execution subject of this embodiment is the server, which interacts with the target device, obtains the DHCP request message of the target device, and then determines the type of the target device according to the DHCP request message.
[0039] Specifically, IOT devices (Internet of Things) refer to smart devices that can connect to the Internet in addition to mobile phones, tablets, and PCs, such as smart light bulbs, smart sockets, smart speakers, smart cameras, etc.
[0040] In the above scheme, by receiving a DHCP request message of a target device to be identified, the DHCP request message includes a predetermined field, and then determining the category of the target device according to the DHCP request message, the category of the target device is accurately determined. This solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connections, and being unable to identify the type of the device when the device is not connected to the Internet and has no HTTP interaction, etc.
[0041] In one embodiment of the present application, the predetermined field includes the OPTION12 field, the OPTION55 field, and the OPTION57 field. The category of the target device is determined according to the DHCP request message, including: determining the first association information according to the OPTION12 field; determining the second association information according to the OPTION55 field; determining the third association information according to the OPTION57 field; determining the category of the target device according to at least one of the first association information, the second association information, and the third association information. That is, the OPTION12 field, the OPTION55 field, and the OPTION57 field may contain association information related to the signal of the target device. In the case of the association information, the type of the target device is accurately determined according to at least one of the first association information, the second association information, and the third association information.
[0042] In another embodiment of the present application, the DHCP request message further includes an OPTION60 field, and the category of the target device is determined based on at least one of the first association information, the second association information, and the third association information, including: determining the fourth association information based on the OPTION60 field; determining the category of the target device based on at least one of the first association information, the second association information, the third association information, and the fourth association information. In this embodiment, the OPTION12 field, the OPTION55 field, the OPTION60 field, and the OPTION57 field may contain association information related to the signal of the target device. In the case of the association information, the type of the target device is further accurately determined based on at least one of the first association information, the second association information, the third association information, and the fourth association information.
[0043] In a specific embodiment, the first association information includes the model of the target device. According to the OPTION12 field, the first association information is determined, including: extracting the device model association subfield from the OPTION12 field; determining the model of the target device according to the device model association subfield. That is, there is a field related to the identified model in the OPTION12 field, namely the device model association subfield, and then the target identified model is determined according to the device model association subfield. Specifically, for some devices, the OPTION12 field contains the device model information, for example, iphone x, HUAWEI_nova_2_Plus-f1334f.
[0044] In another specific embodiment, the second association information includes the type of the operating system of the target device, and the second association information is determined according to the OPTION55 field, including: extracting a system request parameter from the OPTION55 field; and determining the type of the operating system of the target device according to the system request parameter, wherein the system request parameter includes request content and request order. The types of operating systems include Android system, Windows system, Linux system, and iOS system.
[0045] Specifically, Microsoft uses 249 (0xf9) to request static routing items. 121 (0x79) can be replaced by 249 (0xf9) or both items can be requested at the same time. 114 (0x72) and 95 (0x5f) are request items unique to Apple devices. 114 is used in iOS systems such as iPhone and iPad, and 95 is used in MacBook. In addition, PC devices will request 2c or 2e (NetBIOS over TCP / IP). This item is a set of APIs for communication protocols between PCs, so it can be used to identify PC devices. The request order refers to the request content of this field including multiple sub-items. Even if the sub-items have the same content, different operating systems will have different request orders between sub-items. For example, for sub-items a, b, and c, the request order of operating system X is abc, and the request order of operating system Y is bca.
[0046] In another specific embodiment, the fourth association information includes the manufacturer information of the target device, and determining the fourth association information according to the OPTION60 field includes: determining a manufacturer identifier according to the OPTION60 field; and determining the manufacturer information of the target device according to the manufacturer identifier. For example, it can be determined whether the target device is a device of manufacturer A or a device of manufacturer B according to the manufacturer identifier.
[0047] In another specific embodiment, the third association information includes information about whether the target device is an IOT device. According to the OPTION57 field, the third association information is determined, including: according to the OPTION57 field, determining the size of the DHCP data packet acceptable to the target device; and determining whether the target device is an IOT device according to the size of the DHCP data packet. That is, determining whether the target device is an IOT device according to the size of the DHCP data packet that the target device can receive. That is, at least it can be determined that the target device is not a mobile phone, a tablet, or a PC.
[0048] In a more specific embodiment, determining the category of the target device according to at least one of the first association information, the second association information, the third association information, and the fourth association information includes: determining whether the category of the target device can be determined only according to the fourth association information; if the category of the target device cannot be determined only according to the fourth association information, determining whether the category of the target device can be determined in combination with the first association information; if the category of the target device is still not determined, determining whether the category of the target device can be determined in combination with the fourth association information; if the category of the target device is still not determined, determining the category of the target device in combination with the second association information. That is, first determining the category of the target device according to the fourth association information, if the category of the target device cannot be accurately determined, combining the fourth association information with the first association information to determine the category of the target device, if the category of the target device still cannot be accurately determined, combining the third association information, the first association information, and the fourth association information to determine the category of the target device, if the category of the target device still cannot be accurately determined, combining the third association information, the first association information, the fourth association information, and the second association information to determine the category of the target device to achieve accurate determination of the category of the target device.
[0049] In one embodiment of the present application, the decision tree for determining the category of target recognition is as follows: Figure 2 As shown, first determine the category of target identification based on the OPTION60 keyword (i.e., the OPTION60 field). If it cannot be determined accurately, combine it with the OPTION12 keyword (i.e., the OPTION12 field) to determine it. If it is still uncertain, combine it with the OPTION57 keyword (i.e., the OPTION57 field) to determine it. If it is still uncertain, combine it with the OPTION55 keyword (i.e., the OPTION55 field) to determine whether there is field 12 in the OPTION55 keyword. If there is field 12, it can be determined that it is an IOT device. If there is no field 12, determine whether it is in field 15. If there is no field 15, it can be determined that it is an IOT device, otherwise it is another type of device. Figure 3 As shown in the figure, the OPTION60 keyword may include ndriod, soc or msft. If ndriod is included, it can be preliminarily determined that it is a mobile phone, if soc is included, it can be preliminarily determined that it is an iot device, and if msft is included, it can be preliminarily determined that it is a PC. Figure 4 As shown, the OPTION12 keyword may include fields such as ipad, macbook or desktop, iphone or huawei or galaxy. When the ipad field is included, it can be preliminarily determined that it is an ipad. When the macbook or desktop field is included, it can be preliminarily determined that it is a pc. When the iphone or huawei or galaxy field is included, it can be preliminarily determined that it is a phone.
[0050] In a specific embodiment of the present application, the obtained OPTION12 field, OPTION55 field, and OPTION60 field are shown in Table 1.
[0051] Table 1 OPTION12 field, OPTION55 field, OPTION60 field table
[0052]
[0053]
[0054]
[0055] Another typical embodiment of the present application provides a method for identifying a device type, such as Figure 5 As shown, the following steps are included:
[0056] Step S201, the target device sends a DHCP request message to the server;
[0057] Step S202, the server receives the DHCP request message, the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: OPTION12 field, OPTION55 field, and OPTION57 field;
[0058] Step S203: The server determines the category of the target device according to the DHCP request message, where the category is one of the following: mobile phone, tablet, PC, IOT device.
[0059] In the above scheme, by receiving a DHCP request message sent by a target device, the DHCP request message includes a predetermined field, and then determining the category of the target device according to the DHCP request message, the category of the target device is accurately determined. This solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connections, and being unable to identify the type of the device when the device is not connected to the Internet and has no HTTP interaction, etc.
[0060] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0061] The embodiment of the present application also provides a server. It should be noted that the server in the embodiment of the present application can be used to execute the method for identifying the device type provided in the embodiment of the present application. The server provided in the embodiment of the present application is introduced below.
[0062] Figure 6 Schematic diagram of a server according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0063] The receiving unit 10 is configured to receive a DHCP request message of a target device to be identified, wherein the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field;
[0064] The determination unit 20 is used to determine the category of the target device according to the DHCP request message, where the category is one of the following: mobile phone, tablet, PC, IOT device.
[0065] In the above scheme, the receiving unit receives a DHCP request message of a target device to be identified, the DHCP request message includes a predetermined field, and the determining unit determines the category of the target device according to the DHCP request message, thereby realizing accurate determination of the category of the target device. The above scheme solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connection, and failing to identify the type of the device when the device is not connected to the Internet and has no HTTP interaction, etc.
[0066] In one embodiment of the present application, the predetermined field includes the OPTION12 field, the OPTION55 field, and the OPTION57 field, and the determination unit includes a first determination module, a second determination module, a third determination module, and a fourth determination module. The first determination module is used to determine the first association information according to the OPTION12 field; the second determination module is used to determine the second association information according to the OPTION55 field; the third determination module is used to determine the third association information according to the OPTION57 field; and the fourth determination module is used to determine the category of the target device according to at least one of the first association information, the second association information, the third association information, and the third association information. That is, the OPTION12 field, the OPTION55 field, and the OPTION57 field may contain association information related to the signal of the target device. In the case of the association information, the type of the target device is accurately determined according to at least one of the first association information, the second association information, and the third association information.
[0067] In another embodiment of the present application, the DHCP request message also includes an OPTION60 field, and the fourth determination module includes a first determination submodule and a second determination submodule, the first determination submodule is used to determine the fourth association information according to the OPTION60 field; the second determination submodule is used to determine the category of the target device according to at least one of the first association information, the second association information, the third association information, and the fourth association information. In this embodiment, the OPTION12 field, the OPTION55 field, the OPTION60 field, and the OPTION57 field may contain association information related to the signal of the target device. In the case of the association information, the type of the target device is further accurately determined according to at least one of the first association information, the second association information, the third association information, and the fourth association information.
[0068] In a specific embodiment, the first associated information includes the model of the target device, and the first determination module includes a first extraction submodule and a third determination submodule, wherein the first extraction submodule is used to extract the device model associated subfield from the OPTION12 field; and the third determination submodule is used to determine the model of the target device according to the device model associated subfield. Specifically, for some devices, the OPTION12 field contains the device model information, for example, iphonex, HUAWEI_nova_2_Plus-f1334f.
[0069] In another specific embodiment, the second association information includes the type of the operating system of the target device, and the second determination module includes a second extraction submodule and a fourth determination submodule, the second extraction submodule is used to extract the system request parameter from the OPTION55 field; the fourth determination submodule is used to determine the type of the operating system of the target device according to the system request parameter, and the system request parameter includes the request content and the request order. The types of operating systems include Android system, Windows system, Linux system, and iOS system.
[0070] In another specific embodiment, the fourth association information includes the manufacturer information of the target device, and the first determination submodule is further used to determine the manufacturer identifier according to the OPTION60 field; the first determination submodule is further used to determine the manufacturer information of the target device according to the manufacturer identifier. For example, it can be determined whether the target device is a device of manufacturer A or a device of manufacturer B according to the manufacturer identifier.
[0071] In another specific embodiment, the third association information includes information on whether the target device is an IOT device, and the third determination module includes a fifth determination submodule and a sixth determination submodule, wherein the fifth determination submodule is used to determine the size of the DHCP data packet acceptable to the target device according to the OPTION57 field; and the sixth determination submodule is used to determine whether the target device is an IOT device according to the size of the DHCP data packet. That is, whether the target device is an IOT device is determined according to the size of the DHCP data packet that the target device can receive. That is, it can at least be determined that the target device is not a mobile phone, a tablet, or a PC.
[0072] In a more specific embodiment, the second determination submodule is further used to determine whether the category of the target device can be determined only according to the third association information; the second determination submodule is further used to determine whether the category of the target device can be determined in combination with the first association information when the category of the target device cannot be determined only according to the third association information; the second determination submodule is further used to determine whether the category of the target device can be determined in combination with the fourth association information when the category of the target device is still not determined; the second determination submodule is further used to determine the category of the target device in combination with the second association information when the category of the target device is still not determined. That is, the category of the target device is first determined according to the third association information, and when the category of the target device cannot be accurately determined, the fourth association information is combined with the first association information to determine the category of the target device, and when the category of the target device still cannot be accurately determined, the fourth association information, the first association information and the fourth association information are combined to determine the category of the target device, and when the category of the target device still cannot be accurately determined, the third association information, the first association information, the fourth association information and the second association information are combined to determine the category of the target device to achieve accurate determination of the category of the target device.
[0073] The above-mentioned server includes a processor and a memory. The above-mentioned receiving unit and determining unit, etc. are all stored in the memory as program units. The processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0074] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the accuracy of determining the type of the target device can be improved by adjusting kernel parameters.
[0075] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0076] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for identifying the device type.
[0077] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for identifying a device type is executed when the program is run.
[0078] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0079] Step S101, receiving a DHCP request message of a target device to be identified, wherein the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field;
[0080] Step S102, determining the category of the target device according to the DHCP request message, the category being one of the following: mobile phone, tablet, PC, IOT device. The device in this article may be a server, PC, PAD, mobile phone, etc.
[0081] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0082] Step S101, receiving a DHCP request message of a target device to be identified, wherein the DHCP request message includes a predetermined field, and the predetermined field includes at least one of the following: an OPTION12 field, an OPTION55 field, and an OPTION57 field;
[0083] Step S102, determining the category of the target device according to the DHCP request message, the category being one of the following: mobile phone, tablet, PC, IOT device.
[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0085] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0089] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0090] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0091] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0092] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0093] 1) The method for identifying the device type of the present application realizes accurate determination of the type of the target device by receiving a DHCP request message of the target device to be identified, the DHCP request message includes a predetermined field, and then determining the type of the target device according to the DHCP request message. The method solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connection, and failing to identify the type of the device when the device is not connected to the Internet and there is no HTTP interaction, etc.
[0094] 2) In the server of the present application, the receiving unit receives the DHCP request message of the target device to be identified, the DHCP request message includes a predetermined field, and the determining unit determines the category of the target device according to the DHCP request message, thereby realizing accurate determination of the category of the target device. The present invention solves the problems of incomplete device type identification, easy inaccurate identification, affecting the rate of establishing HTTP connection, and failing to identify the type of the device when the device is not connected to the Internet and has no HTTP interaction, etc.
[0095] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for identifying a device type, characterized in that: include: Receive a DHCP request message from a target device to be identified, the DHCP request message including predetermined fields, the predetermined fields including an OPTION57 field, an OPTION12 field, an OPTION55 field, and an OPTION60 field, wherein the OPTION57 field carries a size of a DHCP data packet acceptable to the target device to be identified; Determine the category of the target device according to the DHCP request message, the category being one of the following: mobile phone, tablet, PC, IOT device; Determining the category of the target device according to the DHCP request message is specifically implemented as follows: Determine first association information according to the OPTION12 field, wherein the first association information includes a model of the target device; Determine second association information according to the OPTION55 field, wherein the second association information includes a type of an operating system of the target device; Determine third association information according to the OPTION57 field, wherein the third association information includes information on whether the target device is an IOT device; Determine fourth association information according to the OPTION60 field, wherein the fourth association information includes manufacturer information of the target device; determining whether the category of the target device can be determined only based on the fourth association information; In a case where the category of the target device cannot be determined only according to the fourth association information, determining whether the category of the target device can be determined in combination with the first association information; If the category of the target device is still not determined, determining whether the category of the target device can be determined by combining the third association information; When the category of the target device is still not determined, the category of the target device is determined in combination with the second association information.
2. The method according to claim 1, characterized in that According to the OPTION12 field, the first association information is determined, including: Extracting a device model associated subfield from the OPTION12 field; The model of the target device is determined according to the device model association subfield.
3. The method according to claim 1, characterized in that According to the OPTION55 field, second association information is determined, including: Extracting system request parameters from the OPTION55 field; The type of the operating system of the target device is determined according to the system request parameters, where the system request parameters include request content and request sequence.
4. The method according to claim 1, characterized in that According to the OPTION60 field, fourth association information is determined, including: Determine a vendor identifier according to the OPTION60 field; The manufacturer information of the target device is determined according to the manufacturer identifier.
5. The method according to claim 1, characterized in that According to the OPTION57 field, the third association information is determined, including: Determine, according to the OPTION57 field, a size of the DHCP data packet acceptable to the target device; Whether the target device is an IOT device is determined according to the size of the DHCP data packet.
6. A method for identifying a device type, characterized in that: include: The target device sends a DHCP request message to the server; The server receives the DHCP request message, wherein the DHCP request message includes predetermined fields, wherein the predetermined fields include an OPTION57 field, an OPTION12 field, an OPTION55 field, and an OPTION60 field, wherein the OPTION57 field carries a size of a DHCP data packet acceptable to the target device to be identified; The server determines the category of the target device according to the DHCP request message, and the category is one of the following: mobile phone, tablet, PC, IOT device; The server determines the type of the target device according to the DHCP request message by: Determine first association information according to the OPTION12 field, wherein the first association information includes a model of the target device; Determine second association information according to the OPTION55 field, wherein the second association information includes a type of an operating system of the target device; Determine third association information according to the OPTION57 field, wherein the third association information includes information on whether the target device is an IOT device; Determine fourth association information according to the OPTION60 field, wherein the fourth association information includes manufacturer information of the target device; determining whether the category of the target device can be determined only based on the fourth association information; In a case where the category of the target device cannot be determined only according to the fourth association information, determining whether the category of the target device can be determined in combination with the first association information; If the category of the target device is still not determined, determining whether the category of the target device can be determined by combining the third association information; When the category of the target device is still not determined, the category of the target device is determined in combination with the second association information.
7. A server, characterized in that: include: a receiving unit, configured to receive a DHCP request message of a target device to be identified, wherein the DHCP request message includes a predetermined field, wherein the predetermined field includes an OPTION57 field, an OPTION12 field, an OPTION55 field, and an OPTION60 field, wherein the OPTION57 field carries a size of a DHCP data packet acceptable to the target device to be identified; A determination unit, configured to determine a category of the target device according to the DHCP request message, wherein the category is one of the following: mobile phone, tablet, PC, IOT device; Wherein, the determining unit specifically implements: Determine first association information according to the OPTION12 field, wherein the first association information includes a model of the target device; Determine second association information according to the OPTION55 field, wherein the second association information includes a type of an operating system of the target device; Determine third association information according to the OPTION57 field, wherein the third association information includes information on whether the target device is an IOT device; Determine fourth association information according to the OPTION60 field, wherein the fourth association information includes manufacturer information of the target device; determining whether the category of the target device can be determined only based on the fourth association information; In a case where the category of the target device cannot be determined only according to the fourth association information, determining whether the category of the target device can be determined in combination with the first association information; If the category of the target device is still not determined, determining whether the category of the target device can be determined by combining the third association information; When the category of the target device is still not determined, the category of the target device is determined in combination with the second association information.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 5.
9. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 5 when running.
