WO2017096884A1 - 设备识别的方法和装置 - Google Patents

设备识别的方法和装置 Download PDF

Info

Publication number
WO2017096884A1
WO2017096884A1 PCT/CN2016/089465 CN2016089465W WO2017096884A1 WO 2017096884 A1 WO2017096884 A1 WO 2017096884A1 CN 2016089465 W CN2016089465 W CN 2016089465W WO 2017096884 A1 WO2017096884 A1 WO 2017096884A1
Authority
WO
WIPO (PCT)
Prior art keywords
target file
screen size
mac address
determining
wired
Prior art date
Application number
PCT/CN2016/089465
Other languages
English (en)
French (fr)
Inventor
李英杰
于水龙
任广辉
林玠人
Original Assignee
乐视控股(北京)有限公司
乐视致新电子科技(天津)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 乐视控股(北京)有限公司, 乐视致新电子科技(天津)有限公司 filed Critical 乐视控股(北京)有限公司
Priority to US15/246,566 priority Critical patent/US20170237816A1/en
Publication of WO2017096884A1 publication Critical patent/WO2017096884A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a device identification method and apparatus.
  • Android devices with different functions are constantly integrated into people's lives, such as mobile phones and TVs.
  • a mobile phone is a mobile device, and generally does not always charge, so it is necessary to save electricity; while a television is a non-mobile device, it needs to be charged all the time, and does not need to save electricity; therefore, in order to save power for mobile phones, it is necessary to reduce the work of the mobile phone.
  • the amount for example, the frequency at which the application server sends a heartbeat packet (used to test whether the phone is online) to the mobile phone can be lower than the frequency at which the heartbeat packet (used to test whether the television is online) is sent to the television. Therefore, when an application is used, the application client or the application server first identifies the device and then processes the device accordingly.
  • the Android system device is identified by acquiring the Build information of the device, and determining the device type according to the content in the Build information.
  • the Build information is basic information added by the device manufacturer when the device leaves the factory, such as the device manufacturer name, device model, and device type (for example, the device type is a mobile phone).
  • the basic information contains the device type, you can directly identify whether the device is a mobile phone or another device.
  • the inventors found that at least the following problems exist in the prior art: when there is no device type in the basic information, the device type of the device cannot be accurately identified. Therefore, how to accurately determine the device type of the Android system device, and thus the corresponding processing of the device is a major problem.
  • the embodiment of the invention provides a device identification method and a device for solving the problem that the device type of the device cannot be accurately identified when the Build information has no recording device type in the prior art.
  • an embodiment of the present invention provides a method for device identification, where the method includes:
  • an embodiment of the present invention provides an apparatus for device identification, where the apparatus includes:
  • An acquiring unit configured to acquire a target file and a screen size of the device when the application is started, where the target file is used to record a wired media access control MAC address of the device;
  • a determining unit configured to determine a device type of the device according to the target file acquired by the acquiring unit and the screen size.
  • An embodiment of the present invention provides an apparatus for device identification, where the apparatus includes:
  • a memory configured to store executable instructions of the processor
  • the processor is configured to:
  • the method and device for device identification provided by the embodiment of the present invention can obtain an object file for recording a wired MAC address and a screen size of the device when the application is started, and directly determine the device type of the device according to the target file and the screen size. Therefore, when the device type is not recorded in the Build information, the device type of the device can be accurately determined, thereby improving the accuracy of identifying the device type.
  • FIG. 1 is a flowchart of a method for device identification according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of an apparatus for device identification according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram of another apparatus for device identification according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for device identification. As shown in FIG. 1 , the method includes:
  • the target file is used to record the wired MAC (Media Access Control) address of the device.
  • some devices only have wired network cards, some devices only have wireless network cards, some devices have both wired network cards and wireless network cards, and each network card has a unique MAC address, that is, a wired network card contains one Wired MAC address, a wireless network card contains a wireless MAC address. Since the MAC address of the device is the same as the MAC address of the network card, some devices only have wired MAC addresses, some devices only have wireless MAC addresses, and some devices have both wired MAC addresses and wireless MAC addresses. For example, a mobile phone only has a wireless MAC address, a smart TV has only a wired MAC address, and a desktop computer has both a wired MAC address and a wireless MAC address.
  • the screen size of a mobile phone is generally about 5 inches (that is, the length of the diagonal of the screen)
  • the screen size of a smart TV is generally about 50 inches
  • the screen size of a tablet is generally about 9 inches.
  • the acquired screen size may be the length of the diagonal of the screen, and may also be the length and width of the screen.
  • the application first determines the device type of the device, and then uses the corresponding processing method to meet the needs of the device of the device type. begging.
  • the device type of the device cannot be determined by the wired MAC address in the target file or the screen size alone. It is necessary to combine the two to determine the device type of the device. For example, when it is determined that the current device does not have a wired MAC address, the device may be a mobile phone or a tablet, so it is also necessary to check the screen size of the device, the screen size is 4.5 inches, thereby determining that the device is a mobile phone. Not a tablet.
  • the device in the embodiment of the present invention is mainly an Android system device, but may be other system devices, which is not limited herein.
  • the device identification method provided by the embodiment of the present invention can obtain an object file for recording a wired MAC address and a screen size of the device when the application is started, and directly determine the device type of the device according to the target file and the screen size, thereby When the device type is not recorded in the Build information, the device type of the device can be accurately determined, thereby improving the accuracy of identifying the device type.
  • the specific implementation manner of determining the device type of the device according to the target file and the screen size mentioned in the above step 102 is:
  • the target file contains a wired MAC address and the screen size is zero, it is determined that the device is a set top box; if the target file contains a wired MAC address and the screen size satisfies the first size range, it is determined that the device is a smart TV; if there is no cable in the target file If the MAC address and the screen size satisfy the second size range, it is determined that the device is a mobile phone; if the target file does not have a wired MAC address and the screen size satisfies the third size range, it is determined that the device is a tablet.
  • set-top boxes and smart TVs have wired MAC addresses
  • mobile phones and tablets do not have wired MAC addresses
  • set-top boxes have screen sizes of zero
  • smart TVs have screen sizes.
  • the range is 15-70 inches (first size range)
  • the screen size of the phone ranges from 3-7 inches (second size range)
  • the screen size of the tablet ranges from 8-15 inches (third size range).
  • the device when the target file contains a wired MAC address and the screen size is zero, it can be determined that the device is a set top box; When the device contains a wired MAC address and the screen size is within the range of 15-70 inches, the device can be determined to be a smart TV; when there is no wired MAC address in the target file and the screen size is within 3-7 inches, the device can be determined. For the mobile phone; when there is no wired MAC address in the target file and the screen size is within the range of 8-15 inches, it can be determined that the device is a tablet.
  • the target file contains a wired MAC address. It should be noted that, in general, only the wired MAC address is recorded in the target file, and no other content is recorded. Therefore, when determining whether the target file contains a wired MAC address, it can directly determine whether the target file is empty or not. Contains a wired MAC address. That is to say, when the target file is empty, it is determined that there is no wired MAC address in the target file; when the target file is not empty, it is determined that the target file contains a wired MAC address.
  • the device may be processed according to a preset processing scheme corresponding to the device type.
  • the following two scenarios are taken as examples to describe different processing of different devices:
  • Scenario 1 Mobile devices need (such as mobile phones) to save power, and non-mobile devices (such as smart TVs) do not need to save power.
  • the device type is sent to the application server, and after the application server knows the device type, the heartbeat packet is sent to the device with the application according to the preset frequency corresponding to the device type. To test if the device is online.
  • the preset frequency corresponding to the mobile device may be lower than the preset frequency corresponding to the non-mobile device, thereby reducing the frequency at which the mobile device receives the heartbeat packet and the frequency of sending the response packet, thereby Save electricity.
  • the preset frequency corresponding to the mobile phone is 5 minutes
  • the preset frequency corresponding to the smart TV is 1 second
  • the application server can send a heartbeat packet to the mobile phone every 5 minutes, and send a heartbeat packet to the smart TV every 1 second.
  • Scenario 2 The current application has the function of video calling. When the video is passed, the smart TV needs to have better sound amplification capability than the mobile phone.
  • the sound reinforcement corresponding to the device type may be obtained.
  • another embodiment of the present invention further provides a device for identifying a device.
  • the device includes: an obtaining unit 21 and a determining unit 22. among them,
  • the obtaining unit 21 is configured to acquire a target file and a screen size of the device when the application is started, where the target file is used to record a wired media access control MAC address of the device;
  • the target file acquired by the obtaining unit 21 is used to record the wired MAC address of the device.
  • some devices only have wired network cards, some devices only have wireless network cards, some devices have both wired network cards and wireless network cards, and each network card has a unique MAC address, that is, a wired network card contains one Wired MAC address, a wireless network card contains a wireless MAC address. Since the MAC address of the device is the same as the MAC address of the network card, some devices only have wired MAC addresses, some devices only have wireless MAC addresses, and some devices have both wired MAC addresses and wireless MAC addresses. For example, a mobile phone only has a wireless MAC address, a smart TV has only a wired MAC address, and a desktop computer has both a wired MAC address and a wireless MAC address.
  • the screen size of a mobile phone is generally about 5 inches (that is, the length of the diagonal of the screen)
  • the screen size of a smart TV is generally about 50 inches
  • the screen size of a tablet is generally about 9 inches.
  • the determining unit 22 is configured to determine the device type of the device according to the target file and the screen size acquired by the obtaining unit 21.
  • the determining unit 22 cannot determine the device type of the device by simply using the wired MAC address in the target file or the screen size alone, and the two need to be combined to determine the device type of the device.
  • the apparatus for device identification provided by the embodiment of the present invention can obtain an object file for recording a wired MAC address and a screen size of the device when the application is started, and directly determine the device type of the device according to the target file and the screen size, thereby When the device type is not recorded in the Build information, the device type of the device can be accurately determined, thereby improving the accuracy of identifying the device type.
  • the determining unit 22 includes:
  • the first determining module 221 is configured to determine that the device is a set top box when the target file includes a wired MAC address and the screen size is zero;
  • a second determining module 222 configured to determine that the device is a smart TV when the target file includes a wired MAC address and the screen size meets the first size range;
  • the third determining module 223 is configured to determine that the device is a mobile phone when there is no wired MAC address in the target file and the screen size meets the second size range;
  • the fourth determining module 224 is configured to determine that the device is a tablet when there is no wired MAC address in the target file and the screen size satisfies the third size range.
  • the target file contains a wired MAC address. It should be noted that, in general, only the wired MAC address is recorded in the target file, and no other content is recorded. Therefore, when determining whether the target file contains a wired MAC address, it can directly determine whether the target file is empty or not. Contains a wired MAC address. That is to say, when the target file is empty, it is determined that there is no wired MAC address in the target file; when the target file is not empty, it is determined that the target file contains a wired MAC address.
  • the obtaining unit 21 is configured to acquire an object file from a preset path, and acquire a screen size through a specific interface.
  • the apparatus further includes:
  • the processing unit 23 is configured to process the device according to a preset processing scheme corresponding to the device type determined by the determining unit 22.
  • the processing unit 23 includes:
  • a sending module 231, configured to send the device type to the application server
  • the receiving module 232 is configured to receive a heartbeat packet sent by the application server according to a preset frequency corresponding to the device type.
  • the preset frequency corresponding to the mobile device may be lower than the preset frequency corresponding to the non-mobile device, thereby reducing the frequency at which the receiving module 232 in the mobile device receives the heartbeat packet and transmitting the response packet.
  • the frequency saves electricity.
  • the device is an Android device.
  • the device embodiment corresponds to the foregoing method embodiment.
  • the device embodiment does not describe the details in the foregoing method embodiments one by one, but it should be clear that the device in this embodiment can implement the foregoing method. All the contents of the example.
  • the device for identifying the device includes a memory and a processor, the acquiring unit, the determining unit, and The processing units and the like are all stored in the memory as program units, and the above-described program units stored in the memory are executed by the processor to implement the corresponding functions.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Abstract

一种设备识别的方法和装置,其中方法主要包括:在启动应用程序时,获取目标文件和设备的屏幕尺寸(101),所述目标文件用于记录设备的有线媒体访问控制MAC地址;根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型(102)。与现有技术中当Build信息没有记录设备类型时,无法准确地识别出设备的设备类型相比,该方法能够通过目标文件和屏幕尺寸直接判断当前设备的设备类型,从而提高了设备识别的准确率。

Description

设备识别的方法和装置
本申请基于申请号为2015109171683、申请日为2015年12月10日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明实施例涉及通信技术领域,尤其涉及一种设备识别的方法和装置。
背景技术
随着Android(安卓)系统的发展,不同功能的Android系统设备不断融入人们的生活当中,例如手机和电视等。
在实际应用中,由于不同设备有不同的特点,所以同一应用可能需要对不同设备做不同的处理。例如,手机是可移动设备,一般不会一直充电,所以需要节约用电;而电视是不可移动设备,需要一直充电,不需要节约用电;因此,为了节约手机用电,需要减少手机的工作量,例如应用服务器向手机发送心跳包(用于测试手机是否在线)的频率可以比向电视发送心跳包(用于测试电视是否在线)的频率低。因此,在使用某应用时,该应用客户端或者应用服务器会先对设备进行识别,再对设备进行相应的处理。
现有技术中,对Android系统设备进行识别的方式为:获取设备的Build(构建)信息,根据Build信息中的内容来判断设备类型。其中,Build信息是设备出厂时设备厂商为其添加的基本信息,例如设备厂商名称、设备型号和设备类型(例如设备类型为手机)。当基本信息中包含设备类型时,可以直接识别该设备是手机还是其他设备。在实现本申请过程中,发明人发现现有技术中至少存在如下问题:当基本信息中没有设备类型时,就无法准确地识别出该设备的设备类型。因此,如何准确地判断出Android系统设备的设备类型,从而对该设备进行相应的处理是如今一大难题。
发明内容
本发明实施例提供一种设备识别的方法和装置,用以解决现有技术中当Build信息没有记录设备类型时,无法准确地识别出设备的设备类型的问题。
一方面,本发明实施例提供了一种设备识别的方法,所述方法包括:
在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
另一方面,本发明实施例提供了一种设备识别的装置,所述装置包括:
获取单元,用于在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
确定单元,用于根据所述获取单元获取的所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
本发明实施例提供了一种设备识别的装置,所述装置包括:
处理器,和
存储器,被配置为存储所述处理器的可执行指令;
所述的处理器被配置为:
在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
本发明实施例提供的设备识别的方法和装置,能够在启动应用程序时,获取用于记录有线MAC地址的目标文件以及设备的屏幕尺寸,并根据目标文件和屏幕尺寸直接确定该设备的设备类型,从而在Build信息中没有记录设备类型时,也能够准确地确定出设备的设备类型,进而提高了识别设备类型的准确率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下 面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种设备识别的方法的流程图;
图2为本发明实施例提供的一种设备识别的装置的组成框图;
图3为本发明实施例提供的另一种设备识别的装置的组成框图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种设备识别的方法,如图1所示,该方法包括:
101、在启动应用程序时,获取目标文件和设备的屏幕尺寸。
其中,目标文件用于记录设备的有线MAC(Media Access Control,媒体访问控制)地址。在实际应用中,有的设备只有有线网卡,有的设备只有无线网卡,有的设备既有有线网卡,又有无线网卡,并且每个网卡都有一个唯一的MAC地址,即一个有线网卡含有一个有线MAC地址,一个无线网卡含有一个无线MAC地址。由于设备的MAC地址与网卡的MAC地址相同,所以有的设备只有有线MAC地址,有的设备只有无线MAC地址,有的设备既有有线MAC地址,又有无线MAC地址。例如,手机只有无线MAC地址,智能电视只有有线MAC地址,台式电脑既有有线MAC地址,又有无线MAC地址。
此外,不同类型的设备的屏幕尺寸也不一样。例如,手机的屏幕尺寸一般在5英寸(即屏幕的对角线的长度)左右,智能电视的屏幕尺寸一般在50英寸左右,平板电脑的屏幕尺寸一般在9英寸左右。
需要说明的是,在实际应用中,获取的屏幕尺寸可能为屏幕对角线的长度,也可能为屏幕的长度和宽度。
此外,由于不同设备的需求不同,所以在启动应用程序后,应用会先判断该设备的设备类型,然后采用对应的处理方式满足该设备类型的设备的需 求。
102、根据目标文件和屏幕尺寸,确定设备的设备类型。
其中,在安装有同一应用的不同设备类型的设备当中,可能有至少两种设备含有有线MAC地址,可能有至少两种设备没有有线MAC地址,也有可能有至少两种设备的屏幕尺寸比较相近,因此,在很多情况下,单凭目标文件中的有线MAC地址或者单凭屏幕尺寸是无法确定设备的设备类型,需要将两者相结合,才能确定设备的设备类型。例如,当确定当前设备没有有线MAC地址时,该设备可能是手机,也可能是平板电脑,因此还需要查看一下该设备的屏幕尺寸,屏幕尺寸为4.5英寸,由此可以确定该设备是手机而不是平板电脑。
需要说明的是,本发明实施例中的设备主要是指安卓系统设备,但是也可以为其他系统设备,在此不做限定。
本发明实施例提供的设备识别的方法,能够在启动应用程序时,获取用于记录有线MAC地址的目标文件以及设备的屏幕尺寸,并根据目标文件和屏幕尺寸直接确定该设备的设备类型,从而在Build信息中没有记录设备类型时,也能够准确地确定出设备的设备类型,进而提高了识别设备类型的准确率。
进一步的,在上述步骤102中提及的根据目标文件和屏幕尺寸,确定设备的设备类型的具体实现方式为:
若目标文件中含有有线MAC地址且屏幕尺寸为零,则确定设备为机顶盒;若目标文件中含有有线MAC地址且屏幕尺寸满足第一尺寸范围,则确定设备为智能电视;若目标文件中没有有线MAC地址且屏幕尺寸满足第二尺寸范围,则确定设备为手机;若目标文件中没有有线MAC地址且屏幕尺寸满足第三尺寸范围,则确定设备为平板电脑。
具体的,在机顶盒、智能电视、手机和平板电脑这四种设备当中,机顶盒和智能电视含有有线MAC地址,手机和平板电脑没有有线MAC地址,机顶盒的屏幕尺寸为零,智能电视的屏幕尺寸的范围为15-70英寸(第一尺寸范围),手机的屏幕尺寸的范围为3-7英寸(第二尺寸范围),平板电脑的屏幕尺寸的范围为8-15英寸(第三尺寸范围)。由此可知,当目标文件中含有有线MAC地址且屏幕尺寸为零时,可以确定该设备为机顶盒;当目标文 件中含有有线MAC地址且屏幕尺寸属于15-70英寸范围内时,可以确定该设备为智能电视;当目标文件中没有有线MAC地址且屏幕尺寸属于3-7英寸范围内时,可以确定该设备为手机;当目标文件中没有有线MAC地址且屏幕尺寸属于8-15英寸范围内时,可以确定该设备为平板电脑。
需要说明的是,在一般情况下,目标文件中只记录有线MAC地址,而不会记录其他内容,所以在判断目标文件中是否含有有线MAC地址时,可以直接根据目标文件是否为空来判断是否含有有线MAC地址。也就是说,当目标文件为空时,确定目标文件中没有有线MAC地址;当目标文件不为空时,确定目标文件含有有线MAC地址。
进一步的,一般情况下,不同设备存储有线MAC地址的位置相同(如存储在/sys/class/net/eth0的address文件当中),因此,在获取目标文件时,可以直接根据预设路径查找目标文件。在实际应用中,也有专门获取屏幕尺寸的接口,因此可以通过特定接口获取屏幕尺寸。
进一步的,在上述实施例中提及,不同设备有不同的需求,所以在确定设备的设备类型后,可以根据设备类型对应的预设处理方案,对设备进行处理。下面以以下两种场景为例,对不同设备的不同处理进行介绍:
场景一:可移动设备需要(例如手机)节约用电,不可移动设备(例如智能电视)不需要节约电量。
具体的,当确定设备的设备类型后,需要将设备类型发送给应用服务器,应用服务器获知设备的设备类型后,会根据该设备类型对应的预设频率向安装有该应用的设备发送心跳包,以便测试设备是否在线。
由于可移动设备需要节约用电,所以可移动设备对应的预设频率可以比不可移动设备对应的预设频率低,从而减少可移动设备接收心跳包的频率以及发送响应包的频率,进而起到节约用电的作用。
例如,手机对应的预设频率为5分钟,智能电视对应的预设频率为1秒,即应用服务器可以每隔5分钟向手机发送一次心跳包,每隔1秒向智能电视发送一次心跳包。
场景二:当前应用具有视频通话的功能,在进行视频通过时,智能电视相比于手机需要有更好的扩音能力。
具体的,当确定设备的设备类型后,可以获取该设备类型对应的扩音方 案,并执行该扩音方案,达到相应的扩音效果。
进一步的,依据上述方法实施例,本发明的另一个实施例还提供了一种设备识别的装置,如图2所示,该装置包括:获取单元21和确定单元22。其中,
获取单元21,用于在启动应用程序时,获取目标文件和设备的屏幕尺寸,目标文件用于记录设备的有线媒体访问控制MAC地址;
其中,获取单元21获取的目标文件用于记录设备的有线MAC地址。在实际应用中,有的设备只有有线网卡,有的设备只有无线网卡,有的设备既有有线网卡,又有无线网卡,并且每个网卡都有一个唯一的MAC地址,即一个有线网卡含有一个有线MAC地址,一个无线网卡含有一个无线MAC地址。由于设备的MAC地址与网卡的MAC地址相同,所以有的设备只有有线MAC地址,有的设备只有无线MAC地址,有的设备既有有线MAC地址,又有无线MAC地址。例如,手机只有无线MAC地址,智能电视只有有线MAC地址,台式电脑既有有线MAC地址,又有无线MAC地址。
此外,不同类型的设备的屏幕尺寸也不一样。例如,手机的屏幕尺寸一般在5英寸(即屏幕的对角线的长度)左右,智能电视的屏幕尺寸一般在50英寸左右,平板电脑的屏幕尺寸一般在9英寸左右。
确定单元22,用于根据获取单元21获取的目标文件和屏幕尺寸,确定设备的设备类型。
其中,在安装有同一应用的不同设备类型的设备当中,可能有至少两种设备含有有线MAC地址,可能有至少两种设备没有有线MAC地址,也有可能有至少两种设备的屏幕尺寸比较相近因此,在很多情况下,确定单元22单凭目标文件中的有线MAC地址或者单凭屏幕尺寸是无法确定设备的设备类型,需要将两者相结合,才能确定设备的设备类型。
本发明实施例提供的设备识别的装置,能够在启动应用程序时,获取用于记录有线MAC地址的目标文件以及设备的屏幕尺寸,并根据目标文件和屏幕尺寸直接确定该设备的设备类型,从而在Build信息中没有记录设备类型时,也能够准确地确定出设备的设备类型,进而提高了识别设备类型的准确率。
进一步的,如图3所示,确定单元22,包括:
第一确定模块221,用于当目标文件中含有有线MAC地址且屏幕尺寸为零时,确定设备为机顶盒;
第二确定模块222,用于当目标文件中含有有线MAC地址且屏幕尺寸满足第一尺寸范围时,确定设备为智能电视;
第三确定模块223,用于当目标文件中没有有线MAC地址且屏幕尺寸满足第二尺寸范围时,确定设备为手机;
第四确定模块224,用于当目标文件中没有有线MAC地址且屏幕尺寸满足第三尺寸范围时,确定设备为平板电脑。
需要说明的是,在一般情况下,目标文件中只记录有线MAC地址,而不会记录其他内容,所以在判断目标文件中是否含有有线MAC地址时,可以直接根据目标文件是否为空来判断是否含有有线MAC地址。也就是说,当目标文件为空时,确定目标文件中没有有线MAC地址;当目标文件不为空时,确定目标文件含有有线MAC地址。
进一步的,获取单元21,用于从预设路径下获取目标文件,以及通过特定接口获取屏幕尺寸。
进一步的,如图3所示,该装置进一步包括:
处理单元23,用于根据确定单元22确定的设备类型对应的预设处理方案,对设备进行处理。
进一步的,如图3所示,处理单元23,包括:
发送模块231,用于将设备类型发送给应用服务器;
接收模块232,用于接收应用服务器根据设备类型对应的预设频率发送的心跳包。
由于可移动设备需要节约用电,所以可移动设备对应的预设频率可以比不可移动设备对应的预设频率低,从而减少可移动设备中的接收模块232接收心跳包的频率以及发送响应包的频率,进而起到节约用电的作用。
进一步的,设备为安卓系统设备。
该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。
上述设备识别的装置包括存储器和处理器,上述获取单元、确定单元和 处理单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (13)

  1. 一种设备识别的方法,其特征在于,所述方法包括:
    在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
    根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
  2. 根据权利要求1所述的方法,其特征在于,根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型,包括:
    若所述目标文件中含有有线MAC地址且所述屏幕尺寸为零,则确定所述设备为机顶盒;
    若所述目标文件中含有有线MAC地址且所述屏幕尺寸满足第一尺寸范围,则确定所述设备为智能电视;
    若所述目标文件中没有有线MAC地址且所述屏幕尺寸满足第二尺寸范围,则确定所述设备为手机;
    若所述目标文件中没有有线MAC地址且所述屏幕尺寸满足第三尺寸范围,则确定所述设备为平板电脑。
  3. 根据权利要求1所述的方法,其特征在于,获取目标文件和设备的屏幕尺寸,包括:
    从预设路径下获取所述目标文件,以及通过特定接口获取屏幕尺寸。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,在确定所述设备的设备类型之后,所述方法进一步包括:
    根据所述设备类型对应的预设处理方案,对所述设备进行处理。
  5. 根据权利要求4所述的方法,其特征在于,根据所述设备类型对应的预设处理方案,对所述设备进行处理,包括:
    将所述设备类型发送给应用服务器;
    接收所述应用服务器根据所述设备类型对应的预设频率发送的心跳包。
  6. 根据权利要求4所述的方法,其特征在于,所述设备为安卓系统设备。
  7. 一种设备识别的装置,其特征在于,所述装置包括:
    获取单元,用于在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
    确定单元,用于根据所述获取单元获取的所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
  8. 根据权利要求7所述的装置,其特征在于,所述确定单元,包括:
    第一确定模块,用于当所述目标文件中含有有线MAC地址且所述屏幕尺寸为零时,确定所述设备为机顶盒;
    第二确定模块,用于当所述目标文件中含有有线MAC地址且所述屏幕尺寸满足第一尺寸范围时,确定所述设备为智能电视;
    第三确定模块,用于当所述目标文件中没有有线MAC地址且所述屏幕尺寸满足第二尺寸范围时,确定所述设备为手机;
    第四确定模块,用于当所述目标文件中没有有线MAC地址且所述屏幕尺寸满足第三尺寸范围时,确定所述设备为平板电脑。
  9. 根据权利要求7所述的装置,其特征在于,所述获取单元,用于从预设路径下获取所述目标文件,以及通过特定接口获取屏幕尺寸。
  10. 根据权利要求7-9中任一项所述的装置,其特征在于,所述装置进一步包括:
    处理单元,用于根据所述确定单元确定的所述设备类型对应的预设处理方案,对所述设备进行处理。
  11. 根据权利要求10所述的装置,其特征在于,所述处理单元,包括:
    发送模块,用于将所述设备类型发送给应用服务器;
    接收模块,用于接收所述应用服务器根据所述设备类型对应的预设频率发送的心跳包。
  12. 根据权利要求10所述的装置,其特征在于,所述设备为安卓系统设备。
  13. 一种设备识别的装置,其特征在于,所述装置包括:
    处理器,和
    存储器,被配置为存储所述处理器的可执行指令;
    所述的处理器被配置为:
    在启动应用程序时,获取目标文件和设备的屏幕尺寸,所述目标文件用于记录设备的有线媒体访问控制MAC地址;
    根据所述目标文件和所述屏幕尺寸,确定所述设备的设备类型。
PCT/CN2016/089465 2015-12-10 2016-07-08 设备识别的方法和装置 WO2017096884A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/246,566 US20170237816A1 (en) 2015-12-10 2016-08-25 Method and electronic device for identifying device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510917168.3A CN105867899A (zh) 2015-12-10 2015-12-10 设备识别的方法和装置
CN201510917168.3 2015-12-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/246,566 Continuation US20170237816A1 (en) 2015-12-10 2016-08-25 Method and electronic device for identifying device

Publications (1)

Publication Number Publication Date
WO2017096884A1 true WO2017096884A1 (zh) 2017-06-15

Family

ID=56624076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/089465 WO2017096884A1 (zh) 2015-12-10 2016-07-08 设备识别的方法和装置

Country Status (3)

Country Link
US (1) US20170237816A1 (zh)
CN (1) CN105867899A (zh)
WO (1) WO2017096884A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413716B (zh) * 2017-08-15 2022-05-17 厦门雅迅网络股份有限公司 一种识别设备类型的方法及终端
CN109582549A (zh) * 2017-09-28 2019-04-05 北京国双科技有限公司 一种设备类型的识别方法及装置
CN110262857A (zh) * 2019-06-20 2019-09-20 郑州悉知信息科技股份有限公司 一种前端响应方法及装置
CN111272067A (zh) * 2020-01-21 2020-06-12 上海悦易网络信息技术有限公司 手机检测方法及设备
CN111385360B (zh) * 2020-03-05 2023-09-05 深信服科技股份有限公司 终端设备的识别方法、装置及计算机可读存储介质
CN113568668A (zh) * 2021-06-30 2021-10-29 北京达佳互联信息技术有限公司 信息识别方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101067819A (zh) * 2007-06-07 2007-11-07 北京大学 网页资源发布方法和发布系统
CN102984151A (zh) * 2012-11-26 2013-03-20 北京奇虎科技有限公司 向计算终端提供图片数据的方法及服务器
JP2013074362A (ja) * 2011-09-27 2013-04-22 Nec Corp 仮想マシン管理装置、仮想マシン管理方法、及びプログラム
US8532628B2 (en) * 2006-06-16 2013-09-10 Fmr Llc Registering actionable alerts
CN104079680A (zh) * 2014-06-30 2014-10-01 珠海市君天电子科技有限公司 设备的识别方法和装置
CN104639667A (zh) * 2014-12-31 2015-05-20 北京奇虎科技有限公司 一种基于mac地址的设备识别方法、装置和系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7324462B1 (en) * 2002-07-25 2008-01-29 3Com Corporation Methods for discovering devices within a wireless network
US7317693B1 (en) * 2003-05-12 2008-01-08 Sourcefire, Inc. Systems and methods for determining the network topology of a network
WO2007035918A2 (en) * 2005-09-21 2007-03-29 Qwikker, Inc. Device-aware content delivery
US20090119678A1 (en) * 2007-11-02 2009-05-07 Jimmy Shih Systems and methods for supporting downloadable applications on a portable client device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8532628B2 (en) * 2006-06-16 2013-09-10 Fmr Llc Registering actionable alerts
CN101067819A (zh) * 2007-06-07 2007-11-07 北京大学 网页资源发布方法和发布系统
JP2013074362A (ja) * 2011-09-27 2013-04-22 Nec Corp 仮想マシン管理装置、仮想マシン管理方法、及びプログラム
CN102984151A (zh) * 2012-11-26 2013-03-20 北京奇虎科技有限公司 向计算终端提供图片数据的方法及服务器
CN104079680A (zh) * 2014-06-30 2014-10-01 珠海市君天电子科技有限公司 设备的识别方法和装置
CN104639667A (zh) * 2014-12-31 2015-05-20 北京奇虎科技有限公司 一种基于mac地址的设备识别方法、装置和系统

Also Published As

Publication number Publication date
US20170237816A1 (en) 2017-08-17
CN105867899A (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2017096884A1 (zh) 设备识别的方法和装置
US20170163580A1 (en) Interactive method and device for playback of multimedia
US20160044269A1 (en) Electronic device and method for controlling transmission in electronic device
EP3287866A1 (en) Electronic device and method of providing image acquired by image sensor to application
US8984186B2 (en) Augmenting capabilities of a host device
US20150156300A1 (en) Method for filtering spam in electronic device and the electronic device
US9569607B2 (en) Security verification method and apparatus
CN103019913B (zh) 一种移动终端及其硬件异常提示方法、系统
WO2016155379A1 (zh) 动态获取app界面控件数据的方法、设备以及系统
US9612886B2 (en) Method and device for monitoring API function scheduling in mobile terminal
US9331915B1 (en) Dynamic network traffic mirroring
WO2018103405A1 (zh) 识别接入点和热点的方法及相关产品
US20220391489A1 (en) Data processing method and apparatus, computer device, and storage medium
CN105430247A (zh) 一种利用摄像设备拍摄照片的方法与设备
WO2017185652A1 (zh) 实现分享文件的方法及电子设备
WO2017101126A1 (zh) 一种监控系统的数据存储方法及系统
US9948732B2 (en) Method for providing status messaging service in electronic device and the electronic device thereof
US20150049901A1 (en) Method and electronic device for controlling content integrity
US20140188975A1 (en) Transmission apparatus, transmission method, and program
US20170171339A1 (en) Advertisement data transmission method, electrnoic device and system
US10212215B2 (en) Apparatus and method for providing metadata with network traffic
US10200864B2 (en) Method and device for managing wireless access point
CN109660579B (zh) 数据处理方法、系统及电子设备
US10171543B2 (en) Media streaming method and electronic device thereof
US9843527B2 (en) Method for processing data and an electronic device thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16872084

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16872084

Country of ref document: EP

Kind code of ref document: A1