CN109167851B - Method and device for acquiring MAC address - Google Patents

Method and device for acquiring MAC address Download PDF

Info

Publication number
CN109167851B
CN109167851B CN201811089452.6A CN201811089452A CN109167851B CN 109167851 B CN109167851 B CN 109167851B CN 201811089452 A CN201811089452 A CN 201811089452A CN 109167851 B CN109167851 B CN 109167851B
Authority
CN
China
Prior art keywords
mac address
equipment
request
address
acquiring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811089452.6A
Other languages
Chinese (zh)
Other versions
CN109167851A (en
Inventor
杨楠
惠龙云
王海滨
肖成创
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN201811089452.6A priority Critical patent/CN109167851B/en
Publication of CN109167851A publication Critical patent/CN109167851A/en
Application granted granted Critical
Publication of CN109167851B publication Critical patent/CN109167851B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/43615Interfacing a Home Network, e.g. for connecting the client to a plurality of peripherals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a method and a device for acquiring an MAC address, which are used for accurately acquiring the MAC address of each mobile phone connected with a Hisense television. The method for acquiring the MAC address comprises the following steps: a first device discovers a second device in the same local area network through a device discovery protocol, wherein the first device is a device with an iOS operating system, and the second device is a device without the iOS operating system; the first device initiates a network request to the second device, so that the second device obtains the MAC address of the first device from a router in the local area network; and the first equipment receives the MAC address of the first equipment sent by the second equipment.

Description

Method and device for acquiring MAC address
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for acquiring an MAC address.
Background
When the mobile phone is used for connecting Media devices such as a television, for security reasons, it is necessary to ensure that the Media devices such as the television are connected with the mobile phone of a user of the Media devices such as the television, and therefore, the Media Access Control (MAC) address of the mobile phone connected with the television needs to be stored in the Media devices such as the television to calibrate the mobile phone.
The iOS 7 is a mobile phone and tablet computer operating system developed by Apple Inc. in the United states, and due to the reason related to the privacy of iPhone mobile phone users, iOS 7 is shielded by Apple Inc. through technology, so that iOS development cannot acquire iPhone mobile phone MAC addresses. There is a need for a technical solution that can accurately obtain the MAC address of each mobile phone connected to a media device such as a television.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring an MAC address, which are used for accurately acquiring the MAC address of each mobile phone connected with a Hisense television.
On a first device side, a method for acquiring a MAC address provided in an embodiment of the present application includes:
a first device discovers a second device in the same local area network through a device discovery protocol, wherein the first device is a device with an iOS operating system, and the second device is a device without the iOS operating system;
the device discovery protocol can be a self-developed discovery protocol or an existing discovery protocol, and the application uses an existing discovery protocol Digital Network Alliance (DLNA) protocol;
the first device sends a device discovery data packet to the multicast address when starting, if a second device exists in the local area network, the second device returns a description address, and the first device requests the description address to acquire the service capability and the contained control behavior of the second device.
The first device initiates a network request to the second device, so that the second device obtains the MAC address of the first device through a router in the local area network;
and the first equipment receives the MAC address of the first equipment sent by the second equipment.
When the Hai-Xin mobile phone app RemoteNOW is connected with a Hai-Xin television, for safety reasons, the mobile phone of a television owner needs to be connected with the Hai-Xin television, so that the MAC address of the mobile phone connected with the television needs to be stored in the television to calibrate the mobile phone. The method for acquiring the MAC address can accurately acquire the MAC address of each mobile phone connected with the Hitachi television, so that the mobile phone is identified.
Optionally, the network request is a network request of a user datagram protocol UDP or a network request of a transmission control protocol TCP.
Optionally, when the first device is a digital media controller DMC device and the second device is a digital media renderer DMR device, the first device initiates a network request to the second device, which specifically includes:
the first device judges whether the obtained device capability description contains an instruction for obtaining the device MAC address:
the device capability description is represented by information stored in a device capability description file.
When the device capability description acquired by the first device contains an instruction for acquiring the device MAC address, the first device requests the second device for an instruction request for acquiring the first device MAC address.
The first device obtains the device capability description of the second device through the description address returned by the second device.
The DMR is an abbreviation of Digital Media Renderer (Digital Media Renderer), and is a device that can receive, interpret and execute a control instruction. The equipment comprises a plurality of services, each service comprises a plurality of control behaviors, each behavior comprises response information, used parameters, variables and data types thereof, available value ranges and the like, and the control behaviors are mainly used for indicating the capability of the equipment. The DMC is a DMC for short for a Digital Media Controller (Digital Media Controller), and is a device that can discover a DMR device and analyze service and control behaviors of the device, so as to send a control command to the device to achieve a control effect.
On the second device side, a method for acquiring a MAC address provided in an embodiment of the present application includes:
receiving a network request initiated by first equipment, wherein the first equipment is equipment with an iOS operating system;
acquiring an IP address of first equipment;
sending an Address Resolution Protocol (ARP) request to a router to request an MAC address corresponding to the IP address;
the first device cannot acquire the MAC address of the first device including the ARP request due to technical shielding, so that the second device needs to send the ARP request through the router, and the IP address and the MAC address connected to the router device are stored in the router;
receiving the MAC address of the first device sent by the router;
the MAC address of the first device is sent to the first device.
Optionally, when the device discovery protocol uses Universal Plug AND Play (UPNP) of digital living network alliance DLDA, the second device sends the MAC address of the first device to the first device using a DLNA control instruction in the instruction for obtaining the MAC address of the device.
Optionally, when the first device is a DMC device and the second device is a DMR device, the sending, by the second device, the MAC address of the first device to the first device specifically includes:
creating a device description and service function including an extended getMac capability;
according to the embodiment of the application, on the basis of capabilities such as traditional getvolume (acquiring television volume) and the like, the capability description of getMac (acquiring the MAC address of the own device) is expanded, and at the moment, the first device can know that the first device has the capability of returning the MAC address of the own device through the capability description of the device.
Receiving a request of acquiring an equipment MAC address of first equipment;
the second equipment acquires the IP address of the first equipment through a network request initiated by the first equipment;
the second equipment sends an ARP request to the router to request the MAC address corresponding to the IP address of the first equipment;
the second equipment acquires the MAC address of the first equipment through the response of the ARP request;
the second device returns the MAC address of the first device to the first device.
On a first device side, an embodiment of the present application provides an apparatus for acquiring a MAC address:
a discovery unit, configured to discover, by a first device, a second device in the same local area network through a device discovery protocol, where the first device is a device having an iOS operating system;
a sending unit, configured to initiate a network request to a second device by a first device, so that the second device obtains an MAC address of the first device from a router in the local area network;
a receiving unit, configured to receive, by a first device, a MAC address of the first device sent by a second device.
Correspondingly, on the second device side, the embodiment of the present application provides an apparatus for acquiring a MAC address:
a first receiving unit, configured to receive, by a second device, a network request initiated by a first device;
an obtaining unit, configured to obtain, by a second device, an IP address of a first device;
the first sending unit is used for sending an Address Resolution Protocol (ARP) request to the router by the second equipment and requesting the MAC address corresponding to the IP address;
a second receiving unit, configured to receive, by a second device, the MAC address of the first device sent by the router;
and a second sending unit, configured to send the MAC address of the first device to the first device by the second device.
Another embodiment of the present application provides a computing device, which includes a memory and a processor, wherein the memory is used for storing program instructions, and the processor is used for calling the program instructions stored in the memory and executing any one of the above methods according to the obtained program.
Another embodiment of the present application provides a computer storage medium having stored thereon computer-executable instructions for causing a computer to perform any one of the methods described above.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a process for acquiring a MAC address according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a process for acquiring a MAC address provided at a television according to an embodiment of the present application;
fig. 3 is a schematic diagram of a process of obtaining an MAC address provided at a mobile phone end according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a method for acquiring an MAC address provided at a first device according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a method for acquiring an MAC address provided at a second device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for acquiring a MAC address provided at a first device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an apparatus for acquiring a MAC address provided at a second device according to an embodiment of the present application;
fig. 8 is a schematic diagram of a computing device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a method and a device for acquiring an MAC address, which are used for accurately acquiring the MAC address of each mobile phone connected with a Hisense television.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the display sequence of the embodiment of the present application only represents the sequence of the embodiment, and does not represent the merits of the technical solutions provided by the embodiments.
The embodiment of the application provides a method and a device for acquiring an MAC address, and a specific implementation mode is shown in FIG. 1.
In the embodiment of the application, the first device is an iOS mobile phone end, wherein the iOS mobile phone end is a DMC device; the second device is a television terminal, wherein the television terminal is a DMR device.
At the television end, referring to fig. 2, the embodiment specifically includes the following:
step 101: starting the DMR at the television end;
step 102: the television end creates equipment description and service capability, wherein the equipment description and service capability comprises expanded capability of acquiring the MAC address;
step 103: the television end adds itself to the multicast address and waits to be discovered by control equipment such as a mobile phone and the like;
step 104: a television end creates a socket for monitoring, and waits for control equipment such as a mobile phone and the like to send a control instruction to the television end;
the television end obtains the IP address of the DMC equipment through a socket of a control instruction sent to the television end by control equipment such as a mobile phone and the like;
the television end encapsulates the ARP data packet through the IP address and requests the router for the MAC address corresponding to the IP address; after receiving the ARP request, the router searches the ARP cache of the router, and the mobile phone is also in the local area network, so the ARP cache contains the information of the equipment, and the IP address and the MAC address in the information are in one-to-one correspondence;
and the television end receives the MAC address (response of the ARP request) corresponding to the IP address retrieved by the router, transmits the MAC address into the parameters according to the parameter list of the control behavior, and responds to the control request command of the control equipment such as the mobile phone and the like.
In step 102, the specific implementation logic of the extended getMac (Mac to device) capability of the television end is as follows:
the embodiment of the application modifies a television end equipment capability description file rc.xml, wherein the rc.xml file is used for providing partial service capability of a television end (DMR) to a DMC, the service capability of the DMR end is provided for the DMC to access and control in an action form, and an action GetDMCMac is added to rc.xml, and the action form is as follows:
Figure BDA0001803986830000061
Figure BDA0001803986830000071
wherein GetDMCMac represents the current action and comprises three definitions, and the name in the definitions represents a parameter; the direction represents the transmission direction of the parameters, wherein in represents an incoming parameter (incoming at the DMC end), and out represents an outgoing parameter (incoming at the DMR end and used after being analyzed at the DMC end); relatedStateVariable indicates the type of parameter.
The action mainly uses CurrentDMCMac to represent the Mac address of the current request DMC equipment, the type is expressed by DMCMac, and the format is as follows:
Figure BDA0001803986830000072
after the television end DMR is started, the television end DMR is used as a service end and is always in a monitoring state, a monitoring port 38400 is used for processing a control command sent by a DMC end, when the DMC end sends a GetDMCMac command, firstly, the attribute parameters in action are packaged, wherein instanceID and channel are set to be 0, then, a socket request is created, at the moment, the DMR service end in the monitoring state can be connected with the DMC through the socket, after the connection is successful, the DMC end sends the packaged parameters to the DMR service end through the action, and after the DMR service end receives the control command, the DMR service end works as follows:
the television end DMR can acquire the IP address of the mobile phone DMC device through the socket which receives the request control command.
And the television end encapsulates the ARP data packet through the IP address and requests the router for the MAC address corresponding to the IP address.
After receiving the ARP request, the router retrieves its ARP cache because the mobile phone is also in the LAN. Therefore, the ARP cache contains the information of the equipment, and the IP address and the MAC address in the information are in one-to-one correspondence.
And the router returns the searched MAC address corresponding to the IP to the television through an ARP response.
After receiving the response of the ARP request sent by the television, the television takes out the carried MAC address, and at the moment, the television acquires the MAC address of the mobile phone.
The television DMR responds to a request of the mobile phone DMC for obtaining the MAC address of the television DMR, transmits the MAC address into the CurrentDMCMac parameter according to the parameter list of the control behavior, and responds to a control request command.
Xml is a device capability description file, which stores a series of xml nodes in the form of < action > as described above, each < action > node includes some action sub-nodes, the action has some names, directions, in/out and other parameters, different parameters represent different meanings according to the specification of the DLNA protocol, the DMR reads the file at startup, reads the information of the series of < action > and its sub-nodes, and then stores the information, the action information represents services that the device can provide, i.e. device capabilities, and the specification parameter specifies the standard of communication when another device requests to use these capabilities, when the DMC requests the device capability from the DMR, the DMR transfers the action information and the normative parameter to the DMC, and the DMC performs request and communication according to the action information and the DMR.
At the mobile phone end, referring to fig. 3, the embodiment specifically includes the following steps:
step 201: the mobile phone end starts the DMC;
step 202: the mobile phone end sends a device discovery data packet to the multicast address and judges whether DMR devices exist in the local area network or not;
step 203: when step 202 determines that there is a DMR device in the local area network, the DMC requests a description address returned by the description DMR;
step 204: the method comprises the steps that a mobile phone side obtains the service capability and the control behavior of the DMR equipment;
step 205: the mobile phone end checks whether the equipment capability description contains the capability of acquiring the MAC address;
step 206: when the mobile phone terminal determines that the acquired service capability and control behavior of the DMR equipment comprise the getMac capability, the mobile phone terminal sends a getMac instruction to the television terminal; the transmission of the control command (getMac command) depends on a TCP/IP protocol, firstly, a socket is created by a mobile phone end DMC, data connection is carried out between the socket and the socket monitored by a television end DMR, and after the connection is successful, a socket for receiving a request control command is generated by the television end;
step 207: the mobile phone end takes the MAC address of the mobile phone end from the data responded by the television end.
In step 206, the mobile phone sends a getMac command request to the television, and the specific requested data content is in the format of the command request parameter specified by the television, as follows:
<?xml version="1.0"encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:GetDMCMac
xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
<InstanceID>0</InstanceID>
<Channel>Master</Channel>
</u:GetDMCMac>
</s:Body>
</s:Envelope>
after receiving the request, the television receives the logic for acquiring the MAC address of the mobile phone by receiving the getMac command expanded by the television as described above, acquires the MAC address of the mobile phone, responds to the getMac command of the mobile phone, and returns the MAC address to the mobile phone according to the following data format:
Figure BDA0001803986830000101
if the Mac of the mobile phone is successfully acquired, the < CurrentDMCMac > node contains a string of 12-bit hexadecimal numbers, i.e. the Mac address of the mobile phone, such as 0f:98: ef:23:4f: ed.
The mobile phone acquires the MAC address from the data.
To sum up, at the first device side, the embodiment of the present application provides a method for acquiring a MAC address, see fig. 4:
s101, discovering a second device in the same local area network by a first device through a device discovery protocol, wherein the first device is a device with an iOS operating system, and the second device is a device without the iOS operating system;
s102, the first device initiates a network request to the second device, and the network request is used for the second device to obtain a Media Access Control (MAC) address of the first device through a router in the local area network;
s103, the first device receives the MAC address of the first device sent by the second device.
Optionally, the network request is a network request of a user datagram protocol UDP or a network request of a transmission control protocol TCP.
Optionally, when the first device is a digital media controller DMC device and the second device is a digital media renderer DMR device, the first device initiates a network request to the second device, which specifically includes:
the first device judges whether the acquired device capability description contains the capability of the getMac:
when the device capability description acquired by the first device contains the capability of the getMac, the first device sends an instruction request for acquiring the MAC address of the first device to the second device, and acquires the MAC address of the first device.
Correspondingly, on the second device side, an embodiment of the present application provides a method for acquiring a MAC address, see fig. 5:
s201, a second device receives a network request initiated by a first device;
the second equipment acquires the IP address of the first equipment;
the second equipment sends an Address Resolution Protocol (ARP) request to the router to request the MAC address corresponding to the IP address;
the second equipment receives the MAC address of the first equipment sent by the router;
s202, the second equipment sends the MAC address of the first equipment to the first equipment.
Optionally, when the device discovery protocol adopts a universal plug and play UPNP protocol of a digital living network alliance DLDA, the second device sends the MAC address of the first device by adopting a DLNA control command reply message of the getMac.
Optionally, when the first device is a DMC device and the second device is a DMR device, the sending, by the second device, the MAC address of the first device to the first device specifically includes:
the second device creates a device description and service capability, wherein the device description and service capability comprises extended getMac capability;
the second device receives a getMac request of the first device;
the second device takes the IP address of the first device;
the second equipment sends an ARP request to the router to request the MAC address corresponding to the IP address of the first equipment;
the second equipment obtains the MAC address of the first equipment through the response of the ARP request;
the second device returns the MAC address of the first device to the first device.
On the first device side, an apparatus for acquiring a MAC address is provided in an embodiment of the present application, with reference to fig. 6, and includes:
a discovery unit 11, configured to discover, by a first device, a second device in the same local area network through a device discovery protocol, where the first device is a device having an iOS operating system;
a sending unit 12, configured to initiate a network request to a second device by a first device, so that the second device obtains an MAC address of the first device from a router in the local area network;
a receiving unit 13, configured to receive, by a first device, a MAC address of the first device sent by a second device.
Correspondingly, on the second device side, an embodiment of the present application provides an apparatus for acquiring a MAC address, with reference to fig. 7, including:
a first receiving unit 21, configured to receive, by a second device, a network request initiated by a first device;
an obtaining unit, configured to obtain, by a second device, an IP address of a first device;
a first sending unit 22, configured to send an ARP request to a router by a second device, to request an MAC address corresponding to the IP address;
a second receiving unit 23, configured to receive, by the second device, the MAC address of the first device sent by the router;
a second sending unit 24, configured to send the MAC address of the first device to the first device by the second device.
The method and the device are based on the same application concept, and because the principles of solving the problems of the method and the device are similar, the implementation of the device and the method can be mutually referred, and repeated parts are not repeated.
The technical scheme provided by the embodiment of the application can be suitable for various systems, particularly 5G systems. For example, the applicable system may be a global system for mobile communication (GSM) system, a Code Division Multiple Access (CDMA) system, a Wideband Code Division Multiple Access (WCDMA) General Packet Radio Service (GPRS) system, a Long Term Evolution (LTE) system, an LTE Frequency Division Duplex (FDD) system, an LTE Time Division Duplex (TDD), a Universal Mobile Telecommunications System (UMTS), a universal microwave Access (WiMAX) system, a 5G NR system, and the like. These various systems include terminal devices and network devices.
The terminal device referred to in the embodiments of the present application may refer to a device providing voice and/or data connectivity to a user, a handheld device having a wireless connection function, or other processing device connected to a wireless modem. The names of the terminal devices may also be different in different systems, for example, in a 5G system, the terminal devices may be referred to as User Equipments (UEs). Wireless terminal devices, which may be mobile terminal devices such as mobile telephones (or "cellular" telephones) and computers with mobile terminal devices, e.g., mobile devices that may be portable, pocket, hand-held, computer-included, or vehicle-mounted, communicate with one or more core networks via the RAN. Examples of such devices include Personal Communication Service (PCS) phones, cordless phones, Session Initiated Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs), and the like. The wireless terminal device may also be referred to as a system, a subscriber unit (subscriber unit), a subscriber station (subscriber station), a mobile station (mobile), a remote station (remote station), an access point (access point), a remote terminal device (remote terminal), an access terminal device (access terminal), a user terminal device (user terminal), a user agent (user agent), and a user device (user device), which are not limited in this embodiment of the present application.
The network device according to the embodiment of the present application may be a base station, and the base station may include a plurality of cells. A base station may also be referred to as an access point, or a device in an access network that communicates over the air-interface, through one or more sectors, with wireless terminal devices, or by other names, depending on the particular application. The network device may be configured to interconvert received air frames with Internet Protocol (IP) packets as a router between the wireless terminal device and the rest of the access network, which may include an Internet Protocol (IP) communication network. The network device may also coordinate attribute management for the air interface. For example, the network device according to the embodiment of the present application may be a Base Transceiver Station (BTS) in a global system for mobile communications (GSM) or a Code Division Multiple Access (CDMA), may also be a network device (NodeB) in a Wideband Code Division Multiple Access (WCDMA), may also be an evolved network device (eNB or e-NodeB) in a Long Term Evolution (LTE) system, a 5G base station in a 5G network architecture (next generation system), and may also be a home evolved node B (HeNB), a relay node (relay node), a home base station (femto), a pico base station (pico), and the like, which are not limited in the embodiments of the present application.
It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation. In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiment of the present application provides a computing device, which may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. The computing device may include a Central Processing Unit (CPU), memory, input/output devices, etc., the input devices may include a keyboard, mouse, touch screen, etc., and the output devices may include a Display device, such as a Liquid Crystal Display (LCD), a Cathode Ray Tube (CRT), etc.
The memory may include Read Only Memory (ROM) and Random Access Memory (RAM), and provides the processor with program instructions and data stored in the memory. In the embodiments of the present application, the memory may be used for storing a program of any one of the methods provided by the embodiments of the present application.
The processor is used for executing any one of the methods provided by the embodiment of the application according to the obtained program instructions by calling the program instructions stored in the memory.
On the first device side, an apparatus for acquiring a MAC address according to an embodiment of the present application is provided, with reference to fig. 8, and includes:
the processor 600, which is used to read the program in the memory 620, executes the following processes:
a first device discovers a second device in the same local area network through a device discovery protocol, wherein the first device is a device with an iOS operating system;
sending a network request to a second device through a transceiver 610, for enabling the second device to acquire a Media Access Control (MAC) address of the first device from a router in the LAN;
the MAC address of the first device sent by the second device is received by the transceiver 610.
Optionally, the network request is a network request of a user datagram protocol UDP or a network request of a transmission control protocol TCP.
Optionally, when the first device is a digital media controller DMC device and the second device is a digital media renderer DMR device, the first device initiates a network request to the second device, which specifically includes:
the first device judges whether the acquired device capability description contains the capability of the getMac:
when the device capability description acquired by the first device contains the capability of the getMac, the first device sends an instruction request for acquiring the MAC address of the first device to the second device, and acquires the Mac address of the first device.
A transceiver 610 for receiving and transmitting data under the control of the processor 600.
If the device is on the second device side, the processor 600 is configured to call the program instruction stored in the memory 620, and execute, according to the obtained program:
the second equipment receives a network request initiated by the first equipment;
the second equipment acquires the IP address of the first equipment;
the second equipment sends an Address Resolution Protocol (ARP) request to the router to request the MAC address corresponding to the IP address;
the second equipment receives the MAC address of the first equipment sent by the router;
the second device sends the MAC address of the first device to the first device.
Optionally, when the device discovery protocol adopts a universal plug and play UPNP protocol of a digital living network alliance DLDA, the second device sends the MAC address of the first device by adopting a DLNA control command reply message of the getMac.
Optionally, when the first device is a DMC device and the second device is a DMR device, the sending, by the second device, the MAC address of the first device to the first device specifically includes:
the second device creates a device description and service capability, wherein the device description and service capability comprises extended getMac capability;
the second device receives a getMac request of the first device;
the second device takes the IP address of the first device;
the second equipment sends an ARP request to the router to request the MAC address corresponding to the IP address of the first equipment;
the second equipment obtains the MAC address of the first equipment through the response of the ARP request;
the second device returns the MAC address of the first device to the first device.
Embodiments of the present application provide a computer storage medium for storing computer program instructions for an apparatus provided in the embodiments of the present application, which includes a program for executing any one of the methods provided in the embodiments of the present application.
The computer storage media may be any available media or data storage device that can be accessed by a computer, including, but not limited to, magnetic memory (e.g., floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc.), optical memory (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor memory (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs)), etc.
The method provided by the embodiment of the application can be applied to terminal equipment and also can be applied to network equipment.
The Terminal device may also be referred to as a User Equipment (User Equipment, abbreviated as "UE"), a Mobile Station (Mobile Station, abbreviated as "MS"), a Mobile Terminal (Mobile Terminal), or the like, and optionally, the Terminal may have a capability of communicating with one or more core networks through a Radio Access Network (RAN), for example, the Terminal may be a Mobile phone (or referred to as a "cellular" phone), a computer with Mobile property, or the like, and for example, the Terminal may also be a portable, pocket, hand-held, computer-built-in, or vehicle-mounted Mobile device.
A network device may be a base station (e.g., access point) that refers to a device in an access network that communicates over the air-interface, through one or more sectors, with wireless terminals. The base station may be configured to interconvert received air frames and IP packets as a router between the wireless terminal and the rest of the access network, which may include an Internet Protocol (IP) network. The base station may also coordinate management of attributes for the air interface. For example, the Base Station may be a Base Transceiver Station (BTS) in GSM or CDMA, a Base Station (NodeB) in WCDMA, an evolved Node B (NodeB or eNB or e-NodeB) in LTE, or a gNB in 5G system. The embodiments of the present application are not limited.
The above method process flow may be implemented by a software program, which may be stored in a storage medium, and when the stored software program is called, the above method steps are performed.
In summary, the method and the device for acquiring the MAC address provided by the present application are used to accurately acquire the MAC address of each mobile phone connected to the haixin tv, and solve the problem that the iPhone mobile phone cannot be calibrated by the tv when connected to the haixin tv due to the technical shielding of Apple company.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for obtaining a MAC address, the method comprising:
a first device discovers a second device in the same local area network through a device discovery protocol, wherein the first device is a device with an iOS operating system, and the second device is a device without the iOS operating system;
the first device initiates a network request to the second device, so that the second device obtains a Media Access Control (MAC) address of the first device through a router in the local area network;
and the first equipment receives the MAC address of the first equipment sent by the second equipment.
2. The method of claim 1, wherein the network request is a network request of a User Datagram Protocol (UDP) or a network request of a Transmission Control Protocol (TCP).
3. The method of claim 1, wherein when the first device is a Digital Media Controller (DMC) device and the second device is a Digital Media Renderer (DMR) device, the first device initiating the network request to the second device specifically comprises:
the first device judges whether the obtained device capability description contains an instruction for obtaining the device MAC address:
when the device capability description acquired by the first device contains an instruction for acquiring the device MAC address, the first device requests the second device for an instruction request for acquiring the first device MAC address.
4. A method for obtaining a MAC address, the method comprising:
receiving a network request initiated by first equipment, wherein the first equipment is equipment with an iOS operating system;
acquiring an IP address of first equipment;
sending an Address Resolution Protocol (ARP) request to a router to request an MAC address corresponding to the IP address;
receiving the MAC address of the first device sent by the router;
the MAC address of the first device is sent to the first device.
5. The method of claim 4, wherein when the device discovery protocol uses UPNP protocol of DLNA, the second device sends MAC address to the first device using DLNA control command in the command for obtaining MAC address of device.
6. The method according to claim 4, wherein when the first device is a DMC device and the second device is a DMR device, the second device sends the MAC address of the first device to the first device, and specifically includes:
creating equipment description and service functions, wherein the equipment description and service functions comprise an expanded instruction function for acquiring the MAC address of the equipment;
receiving a request of acquiring an equipment MAC address of first equipment;
acquiring an IP address of first equipment through a network request initiated by the first equipment;
the second equipment sends an ARP request to the router to request the MAC address corresponding to the IP address of the first equipment;
the second equipment acquires the MAC address of the first equipment through the response of the ARP request;
the second device returns the MAC address of the first device to the first device.
7. An apparatus for acquiring a MAC address, the apparatus comprising:
a discovery unit, configured to discover, by a first device, a second device in the same local area network through a device discovery protocol, where the first device is a device having an iOS operating system;
a sending unit, configured to initiate a network request to a second device by a first device, so that the second device obtains an MAC address of the first device from a router in the local area network;
a receiving unit, configured to receive, by a first device, a MAC address of the first device sent by a second device.
8. The apparatus of claim 7, wherein when the first device is a DMC device and the second device is a DMR device, the initiating, by the first device, the network request to the second device specifically includes:
the first device judges whether the acquired device capability description contains an instruction for acquiring the MAC address:
when the device capability description acquired by the first device contains an instruction for acquiring the MAC address, the first device sends an instruction request for acquiring the MAC address of the first device to the second device, and the MAC address of the first device is acquired.
9. An apparatus for acquiring a MAC address, the apparatus comprising:
a first receiving unit, configured to receive, by a second device, a network request initiated by a first device;
an obtaining unit, configured to obtain, by a second device, an IP address of a first device;
the first sending unit is used for sending an Address Resolution Protocol (ARP) request to the router by the second equipment and requesting the MAC address corresponding to the IP address;
a second receiving unit, configured to receive, by a second device, the MAC address of the first device sent by the router;
and a second sending unit, configured to send the MAC address of the first device to the first device by the second device.
10. The apparatus of claim 9, wherein the apparatus comprises:
when the first device is a DMC device and the second device is a DMR device, the sending, by the second device, the MAC address of the first device to the first device specifically includes:
the second device creates a device description and service capability, wherein the device description and service capability comprises an expanded instruction for acquiring the MAC address;
the second device receives a getMac request of the first device;
the second equipment acquires the IP address of the first equipment;
the second equipment sends an ARP request to the router to request the MAC address corresponding to the IP address of the first equipment;
the second equipment obtains the MAC address of the first equipment through the response of the ARP request;
the second device returns the MAC address of the first device to the first device.
CN201811089452.6A 2018-09-18 2018-09-18 Method and device for acquiring MAC address Active CN109167851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811089452.6A CN109167851B (en) 2018-09-18 2018-09-18 Method and device for acquiring MAC address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811089452.6A CN109167851B (en) 2018-09-18 2018-09-18 Method and device for acquiring MAC address

Publications (2)

Publication Number Publication Date
CN109167851A CN109167851A (en) 2019-01-08
CN109167851B true CN109167851B (en) 2021-06-29

Family

ID=64879811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811089452.6A Active CN109167851B (en) 2018-09-18 2018-09-18 Method and device for acquiring MAC address

Country Status (1)

Country Link
CN (1) CN109167851B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726679B (en) * 2020-06-12 2022-02-15 海信视像科技股份有限公司 Video playing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701673A (en) * 2013-12-10 2014-04-02 小米科技有限责任公司 LAN (Local Area Network) equipment query method, device and router
WO2015136335A1 (en) * 2014-03-14 2015-09-17 Telefonaktiebolaget L M Ericsson (Publ) Systems and methods related to establishing a temporary trust relationship between a network-based media service and a digital media renderer
CN105306451A (en) * 2015-09-28 2016-02-03 青岛海信电器股份有限公司 Method and device for controlling DLNA (Digital Living Network Alliance) equipment service permission
CN105635337A (en) * 2015-12-31 2016-06-01 山东泰信电子股份有限公司 Method for binding iOS device, iOS device and auxiliary device
CN105744305A (en) * 2016-02-05 2016-07-06 尼尔森网联媒介数据服务有限公司 Monitoring methods and monitoring apparatuses for watching users of digital media terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234522B (en) * 2018-03-01 2021-01-22 深圳市共进电子股份有限公司 Method and device for preventing Address Resolution Protocol (ARP) attack, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701673A (en) * 2013-12-10 2014-04-02 小米科技有限责任公司 LAN (Local Area Network) equipment query method, device and router
WO2015136335A1 (en) * 2014-03-14 2015-09-17 Telefonaktiebolaget L M Ericsson (Publ) Systems and methods related to establishing a temporary trust relationship between a network-based media service and a digital media renderer
CN105306451A (en) * 2015-09-28 2016-02-03 青岛海信电器股份有限公司 Method and device for controlling DLNA (Digital Living Network Alliance) equipment service permission
CN105635337A (en) * 2015-12-31 2016-06-01 山东泰信电子股份有限公司 Method for binding iOS device, iOS device and auxiliary device
CN105744305A (en) * 2016-02-05 2016-07-06 尼尔森网联媒介数据服务有限公司 Monitoring methods and monitoring apparatuses for watching users of digital media terminal

Also Published As

Publication number Publication date
CN109167851A (en) 2019-01-08

Similar Documents

Publication Publication Date Title
US10973082B2 (en) Registration method, session establishment method, terminal, and AMF entity
CA3103305C (en) Network configuration method and communications apparatus
AU2017413023A1 (en) Communication method and related apparatus
EP3128718A1 (en) Service discovery method and electronic device
US20230099786A1 (en) Methods and Apparatus for Provisioning Private Network Devices During Onboarding
EP2672758B1 (en) Methods and apparatuses for easing Internet access by mobile stations associated with a mobile access point
US10506501B2 (en) Service discovery method and device in wireless communication system
EP3648488A1 (en) Method and device for acquiring identifier of terminal device
WO2019075691A1 (en) Method and apparatus for controlling restricted ue capability, and computer storage medium
EP3681182A1 (en) Method, apparatus and device for determining state of terminal device
US20220272577A1 (en) Communication method and communication apparatus
CN109167851B (en) Method and device for acquiring MAC address
US20200403788A1 (en) Information Sending Method, Key Generation Method, and Apparatus
CN115669185A (en) Data transmission method, device and storage medium
JP2024519311A (en) Data acquisition method and system, and device therefor
WO2018032784A1 (en) Data transmission method and terminal
WO2023051428A1 (en) Method and apparatus for information transmission
JP7412442B2 (en) Method and apparatus for session management
US20220353340A1 (en) Communication Method and Communication Apparatus
WO2022027341A1 (en) Wireless communication method and terminal device
US20230354028A1 (en) Method, system, and apparatus for generating key for inter-device communication
RU2783588C2 (en) Network configuration method and communication device
WO2023116556A1 (en) Session switching method and apparatus
WO2022237857A1 (en) Method for determining security protection enabling mode, communication method, and communication apparatus
WO2023040122A1 (en) User group update method and apparatus, and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant after: Hisense Video Technology Co., Ltd

Address before: 266100 Zhuzhou Road, Laoshan District, Shandong, No. 151, No.

Applicant before: HISENSE ELECTRIC Co.,Ltd.

GR01 Patent grant
GR01 Patent grant