CN110138892B - Method and device for determining equipment regional information - Google Patents
Method and device for determining equipment regional information Download PDFInfo
- Publication number
- CN110138892B CN110138892B CN201910467141.7A CN201910467141A CN110138892B CN 110138892 B CN110138892 B CN 110138892B CN 201910467141 A CN201910467141 A CN 201910467141A CN 110138892 B CN110138892 B CN 110138892B
- Authority
- CN
- China
- Prior art keywords
- region information
- address
- target equipment
- target
- mac address
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-2 addresses, e.g. medium access control [MAC] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/69—Types of network addresses using geographic information, e.g. room number
Landscapes
- Telephonic Communication Services (AREA)
Abstract
When the method for determining the equipment region information determines the region information, due to the fact that the IP address configuration of a network provider changes due to the change of routing strategies, when the IP address allocated to the intelligent equipment changes, at least one IP address in a preset period can be obtained, the at least one IP address comprises the changed IP address, the target IP address is determined according to the at least one IP address, current region information is obtained, the region information of the target equipment is determined through a historical relation comparison table and the current region information, and the accuracy of the obtained region information is improved. In addition, the regional information of the target equipment cannot be changed immediately when the IP address is changed, and the regional information of the target equipment cannot be changed frequently.
Description
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for determining device region information.
Background
With the development of information science and technology, the number of intelligent devices is rapidly increasing, so that a customer needs to manage the intelligent devices, wherein the intelligent devices comprise an intelligent television, an intelligent water meter and the like. When the intelligent device is managed, the region information of the intelligent device needs to be known, so that resources in a region corresponding to the region information are called according to the region information of the intelligent device, and the intelligent device is correspondingly processed. The intelligent television is taken as an example for explanation, a manufacturer of the intelligent television needs to acquire region information of the intelligent device, and the intelligent television is maintained according to technical maintenance personnel resources in a region corresponding to the region information, or after acquiring the region information of the intelligent device, an advertiser of the intelligent television can judge a specific region of advertisement exposure thrown on the intelligent device according to the region information so as to determine a region throwing effect of the advertisement.
In the prior art, through an Internet Protocol (IP) address connected to an intelligent device, region information corresponding to the intelligent device is determined according to a national unified IP segment partition region table. However, in this method, since the IP address configuration of the network provider changes due to the change of the routing policy, even if the routing policy has a low probability of changing and a short time of changing, the IP address allocated to the intelligent device also changes, so that the region information corresponding to the intelligent device determined according to the IP segment partition region table also changes accordingly, and the intelligent device is generally fixedly installed and the region information thereof is fixed, so that the accuracy of the region information corresponding to the intelligent device determined according to the method is low, the error is large, and further, the maintenance of the intelligent device is performed according to the region information with low accuracy, which results in high maintenance cost.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method and an apparatus for determining device region information, so as to improve accuracy of obtained device region information, reduce errors, and reduce maintenance cost of the device region information.
In a first aspect, an embodiment of the present application provides a method for determining device regional information, where the method includes:
acquiring historical data of target equipment, wherein the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address of the target equipment in communication within a preset time period;
determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address;
determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment;
and obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information.
In some embodiments of the application, the obtaining the region information of the target device based on the MAC address of the target device, the current region information corresponding to the MAC address of the target device, and a pre-stored historical relationship comparison table between the MAC address and the region information includes:
searching the MAC address of the target equipment in the historical relation comparison table;
if so, searching historical region information corresponding to the MAC address of the target equipment in the historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment from the current region information and the historical region information according to a set information determination rule.
In some embodiments of the present application, the method further comprises:
and if the MAC address of the target equipment is not found in the historical relationship comparison table, taking the current region information corresponding to the MAC address of the target equipment as the region information of the target equipment.
In some embodiments of the present application, the determining, from the at least one IP address, a target IP address corresponding to a MAC address of the target device includes:
counting the number of times of communication by using the IP address aiming at each IP address in at least one IP address;
and selecting the IP address with the most communication times as a target IP address corresponding to the MAC address of the target equipment.
In some embodiments of the present application, after determining the region information of the target IP address and obtaining the current region information corresponding to the MAC address of the target device, the method further includes:
and according to the set detection rule, detecting the accuracy of the pre-stored historical relationship comparison table of the MAC address and the region information.
In some embodiments of the present application, the detecting, according to the set detection rule, the accuracy of the historical relationship comparison table of the pre-stored MAC address and the region information includes:
selecting a preset number of MAC addresses from the historical relationship comparison table;
detecting the accuracy of the region information corresponding to each MAC address in a preset number of MAC addresses to obtain the accuracy of the preset number of MAC addresses;
and if the accuracy obtained by detection is greater than the set accuracy threshold, determining that the historical relationship comparison table passes the detection.
In a second aspect, an embodiment of the present application further provides an apparatus for determining device region information, where the apparatus includes:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring historical data of target equipment, and the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address of the target equipment in communication within a preset time period;
the IP address determining module is used for determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address;
the information determining module is used for determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment;
and the region information obtaining module is used for obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information.
In some embodiments of the present application, the region information obtaining module is specifically configured to:
searching the MAC address of the target equipment in the historical relation comparison table;
if so, searching historical region information corresponding to the MAC address of the target equipment in the historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment from the current region information and the historical region information according to a set information determination rule.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the machine-readable instructions, when executed by the processor, perform the steps of the method for determining device zone information according to the first aspect, or any one of the possible embodiments of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the steps of the method for determining device region information in the first aspect, or any possible implementation manner of the first aspect.
The embodiment of the application provides a method and a device for determining equipment region information, wherein the method for determining the equipment region information comprises the steps of firstly obtaining historical data of target equipment, wherein the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address of the target equipment in communication within a preset time period; secondly, determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address; then determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment; and finally, obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information. When the method for determining the device region information determines the region information, if the IP address configuration of a network provider changes due to the change of a routing strategy, so that the IP address allocated to the intelligent device changes, at least one IP address in a preset period is obtained, the at least one IP address comprises the changed IP address, a target IP address is determined according to the at least one IP address, the current region information is obtained, the region information of the target device is determined through a historical relationship comparison table and the current region information, and the accuracy of the obtained region information is improved. In addition, the regional information of the target equipment cannot be changed immediately when the IP address is changed, and the regional information of the target equipment cannot be changed frequently, but the regional information of the target equipment is determined by the method provided by the application, so that the maintenance cost of the equipment is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart illustrating a method for determining device regional information according to an embodiment of the present disclosure;
fig. 2 shows a flowchart for obtaining the region information of the target device based on the MAC address of the target device, the current region information corresponding to the MAC address of the target device, and a pre-stored historical relationship comparison table between the MAC address and the region information according to the embodiment of the present application;
fig. 3 is a schematic structural diagram illustrating an apparatus for determining device regional information according to an embodiment of the present application;
fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Icon: 301-an obtaining module; 302-IP address determination module; 303-an information determination module; 304-a region information obtaining module; 400-an electronic device; 401-a processor; 402-a memory; 403-bus; 4021-a memory; 4022-external memory.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
In consideration of the prior art, the region information corresponding to the intelligent device is judged according to the national unified IP section partition region table through the IP address connected with the intelligent device. However, in this method, since the IP address configuration of the network provider changes due to the change of the routing policy, even if the routing policy has a low probability of changing and a short time of changing, the IP address allocated to the intelligent device also changes, so that the region information corresponding to the intelligent device determined according to the IP segment partition region table also changes accordingly, and the intelligent device is generally fixedly installed and the region information thereof is fixed, so that the accuracy of the region information corresponding to the intelligent device determined according to the method is low, the error is large, and further, the maintenance of the intelligent device is performed according to the region information with low accuracy, which results in high maintenance cost. Based on this, the embodiments of the present application provide a method and an apparatus for determining device region information, which can improve accuracy of obtained device region information, reduce errors, and reduce maintenance cost of devices, and are described below by embodiments.
To facilitate understanding of the present embodiment, a method for determining device region information disclosed in the embodiments of the present application will be described in detail first.
Example one
An embodiment of the present application provides a method for determining device region information, and refer to a flowchart of a method for determining device region information shown in fig. 1, where the method includes steps S101 to S104; specifically, the method comprises the following steps:
s101, historical data of the target device is obtained, wherein the historical data comprises a Media Access Control (MAC) address of the target device and at least one Internet Protocol (IP) address of the target device in communication within a preset time period.
In the embodiment of the present application, the history data of the target device may be acquired at a fixed time per month, for example, the history data of the target device may be acquired at No. 1 per month. The historical data includes the MAC address of the target device and at least one IP address communicated by the target device within a preset time period. Illustratively, the preset time period may be history data of 6 months before the acquisition date, for example, if the history data of the target device is acquired in number 7/1 in 2018, at least one IP address of the target device communicated from number 1/1 in 2018 to number 30/6 in 2018 is acquired. The preset time period may be set according to actual conditions, which is not specifically limited in the present application.
In a specific implementation, the MAC address of each of the multiple devices to be managed may be acquired, and the MAC addresses of the multiple devices may be stored in an address list. The target device is any one of a plurality of devices to be managed.
S102, determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address.
In the concrete implementation, the target IP address corresponding to the MAC address of the target equipment is determined by the following method:
first, for each of at least one IP address, the number of communications using the IP address is counted.
In the embodiment of the application, in a preset time period, for each IP address in at least one IP address, the number of times of communication of the IP address is counted to obtain the number of times of communication of each IP address in at least one IP address.
And secondly, selecting the IP address with the most communication times as a target IP address corresponding to the MAC address of the target equipment.
During specific implementation, according to the number of times of communication performed by each IP address in the obtained at least one IP address, the IP address with the largest number of times of communication is selected as a target IP address corresponding to the MAC address of the target device. Therefore, when the IP address configuration of the network provider changes due to short-time routing strategy change, and the IP address allocated to the target device changes, the IP address allocated to the intelligent device for communication in a preset time period is counted, and the IP address with the largest communication frequency is selected as the target IP address corresponding to the MAC address of the target device, so that the regional information corresponding to the target IP address can be determined according to the IP section partition regional table, the influence of regional information change caused by the fluctuation of the IP address allocated for communication can be effectively avoided, the accuracy of determining the regional information corresponding to the intelligent device is improved, the intelligent device is maintained according to the regional information with higher accuracy, and the maintenance cost can be effectively reduced.
S103, determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target device.
In the embodiment of the application, the region information corresponding to the IP address can be obtained according to the target IP address, and the region information is the current region information corresponding to the MAC address of the target device. The region information is address information. For example, the region information corresponding to the IP address may be beijing.
And S104, obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information.
In specific implementation, referring to fig. 2, an embodiment of the present application provides a specific manner for obtaining the region information of the target device based on the MAC address of the target device, current region information corresponding to the MAC address of the target device, and a pre-stored historical relationship comparison table between the MAC address and the region information, including steps S201 to S204.
S201, searching the MAC address of the target device in the historical relationship comparison table.
S202, if the historical region information corresponding to the MAC address of the target device is found, the historical region information corresponding to the MAC address of the target device is found in the historical relation comparison table.
In specific implementation, if the MAC address of the target device is not found in the historical relationship comparison table, the current region information corresponding to the MAC address of the target device is used as the region information of the target device. And if the MAC address of the target equipment is found in the historical relation comparison table, obtaining historical region information corresponding to the MAC address of the target equipment.
S203, detecting whether the current region information is the same as the historical region information.
S204, if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment; and if the current region information and the historical region information are different, determining the region information of the target equipment according to the set information determination rule.
Illustratively, if the current geographic information corresponding to the MAC address of the target device is beijing, and the corresponding historical geographic information is beijing, the beijing is the geographic information corresponding to the MAC address of the target device. If the current region information corresponding to the MAC address of the target device is beijing and the corresponding historical region information is tianjin, the region information of the target device needs to be determined from the current region information and the historical region information according to the set information determination rule.
Specifically, the information determination rule includes one or more of the following rules: and a first rule, changing the preset time period, and re-acquiring historical data of the target device, wherein the historical data comprises the MAC address of the target device and at least one IP address communicated by the target device in the changed preset time period. When the time period is changed, the time length of the time period can be changed. Continuing with the example in S101, if the preset time period before the change is from 2018 year 1 month 1 to 2018 year 6 month 30, the time period after the change may be from 2017 year 7 month 1 to 2018 year 6 month 30, and the time length of the preset time period is changed from 6 months to 12 months. And repeating the steps S102-S104 to obtain the region information of the target equipment. And a second rule, determining the region information of the target equipment in a manual investigation mode.
In the embodiment of the application, the construction process of the historical relationship comparison table is as follows:
first, for each of a plurality of devices to be managed, history data of the device is acquired, the history data including: a device MAC address of the device, and at least one IP address communicated by the device over a historical period of time.
In specific implementation, the time period corresponding to the historical time period is different from the preset time period. Continuing with the example in S101, if the preset time period is from 2018 year 1 month 1 to 2018 year 6 month 30, the historical time period may be from 2017 year 12 month 1 to 2018 year 5 month 30. Specifically, the historical time period may be determined according to actual needs.
Secondly, a target IP address corresponding to the equipment MAC address is determined from at least one IP address, and the region information corresponding to the equipment MAC address is obtained according to the region information of the target IP address. The method for determining the target IP address corresponding to the device MAC address from the at least one IP address is the same as that in S102, and is not described herein again.
And finally, repeating the process to obtain the equipment MAC address of each equipment in the plurality of equipment to be managed and the region information corresponding to each equipment MAC address. In a plurality of devices to be managed, the device MAC address of each device and the region information corresponding to each device MAC address form a historical relationship comparison table.
As an optional embodiment, after determining the region information of the target IP address and obtaining the current region information corresponding to the MAC address of the target device, the method further includes:
and according to the set detection rule, detecting the accuracy of the pre-stored historical relationship comparison table of the MAC address and the region information.
In the embodiment of the application, the accuracy of the historical relationship comparison table is detected, and if the historical relationship comparison table is accurate, the regional information of the target device is determined by using the historical relationship comparison table.
During specific implementation, according to a set detection rule, a specific mode for detecting the accuracy of a pre-stored historical relationship comparison table of the MAC address and the region information includes:
first, a preset number of MAC addresses are selected from the history comparison table.
For example, the preset number may be determined according to the total number of the MAC addresses stored in the history relation comparison table, for example, 80% of the total number is selected as the preset number, and if the total number of the stored MAC addresses is 100, the number of the selected MAC addresses is 80, where the preset number may be determined according to actual needs. Further, a preset number of MAC addresses may be randomly selected from the historical relationship comparison table, or may be selected from the historical relationship comparison table according to a stored sequence, where the selection mode may be determined according to an actual situation.
Secondly, detecting the accuracy of the region information corresponding to each MAC address in the preset number of MAC addresses to obtain the accuracy of the preset number of MAC addresses.
For example, a device address list may be obtained, and the accuracy of the geographical information corresponding to each MAC address in the preset number of MAC addresses is detected through the obtained device address list, so as to obtain the accuracy of the preset number of MAC addresses, for example, if the preset number is 80 and the geographical information corresponding to 8 MAC addresses in the 80 MAC addresses is accurate, the accuracy of the preset number of MAC addresses is 10%. The device address list comprises device MAC addresses and distribution addresses corresponding to the device MAC addresses, and is generated by a manufacturer of the device according to the device MAC addresses recorded during device distribution and the distribution addresses corresponding to the device MAC addresses. Or, the accuracy of the region information corresponding to each MAC address in the preset number of MAC addresses may also be detected manually.
And finally, if the accuracy obtained by detection is greater than the set accuracy threshold, determining that the historical relationship comparison table passes the detection.
Illustratively, the accuracy threshold may be set according to actual requirements, for example, if the accuracy threshold is 80% and the detected accuracy is 90%, the historical relationship check table passes the detection. If the accuracy obtained by detection is 70%, the detection is not passed, and the historical relationship comparison table is inaccurate.
And if the historical relation comparison table is inaccurate, extracting the inaccurate equipment MAC address and the corresponding region information in the historical relation comparison table, and analyzing the real condition of at least one IP address corresponding to the inaccurate equipment MAC address according to the extracted inaccurate equipment MAC address and the corresponding region information. And simultaneously, changing the historical time period in the historical relationship comparison table construction process, and reconstructing the historical relationship comparison table according to the historical time period after the change and the historical relationship comparison table construction process. Or, the detected MAC address corresponding to the region information is changed in an inaccurate MAC address by a manual change mode, the region information corresponding to the MAC address in the historical relationship comparison table is changed by the region information corresponding to the MAC address in the equipment address list, or the region information corresponding to the MAC address in the historical relationship comparison table is changed by the region information corresponding to the MAC address obtained by manual research, so that the accuracy of the historical relationship comparison table is larger than the set accuracy threshold.
When the method for determining the equipment region information determines the region information, if the IP address configuration of a network provider changes due to the change of a routing strategy, so that the IP address allocated to the intelligent equipment changes, at least one IP address in a preset period is obtained, the at least one IP address comprises the changed IP address, a target IP address is determined according to the at least one IP address, current region information is obtained, the region information of the target equipment is determined through a historical relationship comparison table and the current region information, and the accuracy of the obtained region information is improved. In addition, the regional information of the target equipment cannot be changed immediately when the IP address is changed, and the regional information of the target equipment cannot be changed frequently, but the regional information of the target equipment is determined by the method provided by the application, so that the maintenance cost of the equipment is reduced.
Based on the same inventive concept, the embodiment of the present application further provides a device for determining device region information corresponding to the method for determining device region information, and because the principle of solving the problem of the device in the embodiment of the present application is similar to that of the method for determining device region information in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Example two
An embodiment of the present application provides an apparatus for determining device region information, and as shown in fig. 3, the apparatus for determining device region information is a schematic structural diagram, where the apparatus includes:
an obtaining module 301, configured to obtain historical data of a target device, where the historical data includes a media access control MAC address of the target device and at least one internet protocol IP address of the target device communicating within a preset time period;
an IP address determining module 302, configured to determine, from at least one IP address, a target IP address corresponding to a MAC address of a target device;
the information determining module 303 is configured to determine region information of the target IP address to obtain current region information corresponding to the MAC address of the target device;
a region information obtaining module 304, configured to obtain region information of the target device based on the MAC address of the target device, current region information corresponding to the MAC address of the target device, and a pre-stored historical relationship comparison table between the MAC address and the region information.
As an optional embodiment, the region information obtaining module is specifically configured to:
searching the MAC address of the target equipment in a historical relation comparison table;
if the historical relationship is found, searching historical region information corresponding to the MAC address of the target equipment in a historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment according to the set information determination rule.
As an optional embodiment, the region information obtaining module is further specifically configured to:
and if the MAC address of the target equipment is not found in the historical relation comparison table, taking the current region information corresponding to the MAC address of the target equipment as the region information of the target equipment.
As an optional embodiment, the IP address determining module is specifically configured to:
counting the number of times of communication by using the IP address aiming at each IP address in at least one IP address;
and selecting the IP address with the most communication times as a target IP address corresponding to the MAC address of the target equipment.
As an alternative embodiment, the apparatus further comprises: an accuracy detection module;
and the accuracy detection module is used for detecting the accuracy of the pre-stored historical relationship comparison table of the MAC address and the region information according to the set detection rule.
As an optional embodiment, the accuracy detection module is specifically configured to:
selecting a preset number of MAC addresses from a historical relation comparison table;
detecting the accuracy of the region information corresponding to each MAC address in the preset number of MAC addresses to obtain the accuracy rate of the preset number of MAC addresses;
and if the detected accuracy is greater than the set accuracy threshold, determining that the historical relationship comparison table passes the detection.
The apparatus for determining device region information provided in the embodiment of the present application has the same technical features as the method for determining device region information provided in the first embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
EXAMPLE III
Based on the same technical concept, the embodiment of the application also provides the electronic equipment. Referring to fig. 4, a schematic structural diagram of an electronic device 400 provided in the embodiment of the present application includes a processor 401, a memory 402, and a bus 403. The memory 402 is used for storing execution instructions and includes a memory 4021 and an external memory 4022; the memory 4021 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 401 and data exchanged with the external memory 4022 such as a hard disk, the processor 401 exchanges data with the external memory 4022 through the memory 4021, and when the electronic device 400 operates, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:
acquiring historical data of target equipment, wherein the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address communicated by the target equipment within a preset time period;
determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address;
determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment;
and obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information.
In one possible design, the instructions that may be executed by processor 401 further include:
searching the MAC address of the target equipment in the historical relation comparison table;
if so, searching historical region information corresponding to the MAC address of the target equipment in the historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment from the current region information and the historical region information according to a set information determination rule.
In one possible design, the instructions that may be executed by processor 401 further include:
and if the MAC address of the target equipment is not found in the historical relationship comparison table, taking the current region information corresponding to the MAC address of the target equipment as the region information of the target equipment.
In one possible design, the instructions that may be executed by processor 401 further include:
counting the number of times of communication by using the IP address aiming at each IP address in at least one IP address;
and selecting the IP address with the most communication times as a target IP address corresponding to the MAC address of the target equipment.
In one possible design, the instructions that may be executed by processor 401 further include:
and according to the set detection rule, detecting the accuracy of the pre-stored historical relationship comparison table of the MAC address and the region information.
In one possible design, the instructions that may be executed by processor 401 further include:
selecting a preset number of MAC addresses from the historical relationship comparison table;
detecting the accuracy of the region information corresponding to each MAC address in a preset number of MAC addresses to obtain the accuracy of the preset number of MAC addresses;
and if the accuracy obtained by detection is greater than the set accuracy threshold, determining that the historical relationship comparison table passes the detection.
Example four
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method for determining device regional information in any of the above embodiments.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, or the like, and when a computer program on the storage medium is executed, the steps of the method for determining the device region information can be executed, so as to improve the accuracy of the obtained device region information, reduce errors, and reduce the maintenance cost of the device region information.
The computer program product for performing the method for determining the device region information provided in the embodiment of the present application includes a computer-readable storage medium storing a nonvolatile program code executable by a processor, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, and is not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) 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.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (9)
1. A method for determining device geographical information, the method comprising:
acquiring historical data of target equipment, wherein the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address communicated by the target equipment within a preset time period;
determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address;
determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment;
obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information;
the determining a target IP address corresponding to the MAC address of the target device from the at least one IP address includes:
counting the number of times of communication by using the IP address aiming at each IP address in at least one IP address;
and selecting the IP address with the most communication times as a target IP address corresponding to the MAC address of the target equipment.
2. The method as claimed in claim 1, wherein the obtaining the region information of the target device based on the MAC address of the target device, the current region information corresponding to the MAC address of the target device, and a pre-stored historical relationship lookup table between the MAC address and the region information comprises:
searching the MAC address of the target equipment in the historical relation comparison table;
if so, searching historical region information corresponding to the MAC address of the target equipment in the historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment from the current region information and the historical region information according to a set information determination rule.
3. The method of claim 2, further comprising:
and if the MAC address of the target equipment is not found in the historical relationship comparison table, taking the current region information corresponding to the MAC address of the target equipment as the region information of the target equipment.
4. The method of claim 1, wherein after determining the region information of the target IP address and obtaining the current region information corresponding to the MAC address of the target device, the method further comprises:
and according to the set detection rule, detecting the accuracy of the pre-stored historical relationship comparison table of the MAC address and the region information.
5. The method according to claim 4, wherein the detecting the accuracy of the pre-stored historical relationship lookup table of the MAC address and the geographic information according to the set detection rule comprises:
selecting a preset number of MAC addresses from the historical relationship comparison table;
detecting the accuracy of the region information corresponding to each MAC address in a preset number of MAC addresses to obtain the accuracy of the preset number of MAC addresses;
and if the accuracy obtained by detection is greater than the set accuracy threshold, determining that the historical relationship comparison table passes the detection.
6. An apparatus for determining device geographical information, the apparatus comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring historical data of target equipment, and the historical data comprises a Media Access Control (MAC) address of the target equipment and at least one Internet Protocol (IP) address of the target equipment in communication within a preset time period;
the IP address determining module is used for determining a target IP address corresponding to the MAC address of the target equipment from at least one IP address;
the information determining module is used for determining the region information of the target IP address to obtain the current region information corresponding to the MAC address of the target equipment;
the region information obtaining module is used for obtaining the region information of the target equipment based on the MAC address of the target equipment, the current region information corresponding to the MAC address of the target equipment and a pre-stored historical relationship comparison table of the MAC address and the region information;
the IP address determining module further comprises:
the statistical module is used for counting the times of communication by utilizing the IP address aiming at each IP address in at least one IP address;
and the determining module is used for selecting the IP address with the most communication times as the target IP address corresponding to the MAC address of the target equipment.
7. The apparatus of claim 6, wherein the region information obtaining module is specifically configured to:
searching the MAC address of the target equipment in the historical relation comparison table;
if so, searching historical region information corresponding to the MAC address of the target equipment in the historical relationship comparison table;
detecting whether the current region information is the same as the historical region information;
if the current region information is the same as the region information of the target equipment, taking the current region information as the region information of the target equipment;
and if the current region information and the historical region information are different, determining the region information of the target equipment from the current region information and the historical region information according to a set information determination rule.
8. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the method for determining device zone information according to any one of claims 1 to 5.
9. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, performs the steps of the method for determining device geographical information according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910467141.7A CN110138892B (en) | 2019-05-31 | 2019-05-31 | Method and device for determining equipment regional information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910467141.7A CN110138892B (en) | 2019-05-31 | 2019-05-31 | Method and device for determining equipment regional information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110138892A CN110138892A (en) | 2019-08-16 |
CN110138892B true CN110138892B (en) | 2021-12-07 |
Family
ID=67583301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910467141.7A Active CN110138892B (en) | 2019-05-31 | 2019-05-31 | Method and device for determining equipment regional information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110138892B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110661903B (en) * | 2019-10-12 | 2022-12-06 | 苏州浪潮智能科技有限公司 | Cloud platform route management method and device |
CN113516503B (en) * | 2021-05-19 | 2022-08-16 | 湖南快乐阳光互动娱乐传媒有限公司 | Advertisement delivery region calibration method and related equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105100292A (en) * | 2014-05-12 | 2015-11-25 | 阿里巴巴集团控股有限公司 | Method and apparatus of determining position of terminal |
CN106997544A (en) * | 2016-01-25 | 2017-08-01 | 秒针信息技术有限公司 | A kind of method and apparatus for monitoring outdoor advertising |
CN108282508A (en) * | 2017-01-06 | 2018-07-13 | 阿里巴巴集团控股有限公司 | Determination method and device, information-pushing method and the device in geographical location |
CN109218170A (en) * | 2018-10-18 | 2019-01-15 | 杭州安恒信息技术股份有限公司 | A kind of IP address-based mail abnormal login detecting method and system |
-
2019
- 2019-05-31 CN CN201910467141.7A patent/CN110138892B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105100292A (en) * | 2014-05-12 | 2015-11-25 | 阿里巴巴集团控股有限公司 | Method and apparatus of determining position of terminal |
CN106997544A (en) * | 2016-01-25 | 2017-08-01 | 秒针信息技术有限公司 | A kind of method and apparatus for monitoring outdoor advertising |
CN108282508A (en) * | 2017-01-06 | 2018-07-13 | 阿里巴巴集团控股有限公司 | Determination method and device, information-pushing method and the device in geographical location |
CN109218170A (en) * | 2018-10-18 | 2019-01-15 | 杭州安恒信息技术股份有限公司 | A kind of IP address-based mail abnormal login detecting method and system |
Also Published As
Publication number | Publication date |
---|---|
CN110138892A (en) | 2019-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10929879B2 (en) | Method and apparatus for identification of fraudulent click activity | |
CN111178760B (en) | Risk monitoring method, risk monitoring device, terminal equipment and computer readable storage medium | |
CN109039819B (en) | Time delay statistical method, device, system and storage medium | |
CN110781605B (en) | Advertisement putting model testing method and device, computer equipment and storage medium | |
CN108876464B (en) | Cheating behavior detection method and device, service equipment and storage medium | |
CN110545292B (en) | Abnormal flow monitoring method and device | |
CN107038108B (en) | Software testing method and device | |
CN111858482B (en) | Attack event tracing and tracing method, system, terminal and storage medium | |
CN110138892B (en) | Method and device for determining equipment regional information | |
CN110086643B (en) | Risk identification method, terminal and storage medium | |
CN106445796A (en) | Cheating channel automatic detection method and device | |
CN113485931B (en) | Test method, test device, electronic equipment and computer readable storage medium | |
CN109951466B (en) | Port flow monitoring method and device, electronic equipment and machine-readable storage medium | |
CN110609780A (en) | Data monitoring method and device, electronic equipment and storage medium | |
CN111240954A (en) | Memory leak detection method, device and equipment | |
CN111061588A (en) | Method and device for locating database abnormal source | |
CN109634822B (en) | Function time consumption statistical method and device, storage medium and terminal equipment | |
CN110134219B (en) | Application program background power consumption processing method and device | |
CN107241347B (en) | Advertisement traffic quality analysis method and device | |
CN108833215A (en) | Calculate method, the network equipment and the computer storage medium of aggregation network delay | |
CN110943887B (en) | Probe scheduling method, device, equipment and storage medium | |
CN111597093B (en) | Exception handling method, device and equipment thereof | |
CN117061335A (en) | Cloud platform equipment health management and control method and device, storage medium and electronic equipment | |
CN110955587A (en) | Method and device for determining equipment to be replaced | |
CN110768904B (en) | Service communication detection method, device, terminal and storage medium for power communication network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |