CN110324845B - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN110324845B
CN110324845B CN201910640020.8A CN201910640020A CN110324845B CN 110324845 B CN110324845 B CN 110324845B CN 201910640020 A CN201910640020 A CN 201910640020A CN 110324845 B CN110324845 B CN 110324845B
Authority
CN
China
Prior art keywords
log data
address information
information
data set
position information
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
CN201910640020.8A
Other languages
Chinese (zh)
Other versions
CN110324845A (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.)
Miaozhen Information Technology Co Ltd
Original Assignee
Miaozhen Information 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 Miaozhen Information Technology Co Ltd filed Critical Miaozhen Information Technology Co Ltd
Priority to CN201910640020.8A priority Critical patent/CN110324845B/en
Publication of CN110324845A publication Critical patent/CN110324845A/en
Application granted granted Critical
Publication of CN110324845B publication Critical patent/CN110324845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The method and the device for resource allocation firstly determine the position information of the area to be allocated corresponding to the resource, obtain a target IP address information set corresponding to the position information, obtain log data corresponding to each IP address information, form a target log data set, then update the log data without the position information by using the log data with the position information according to the equipment address and the IP address in the obtained target log data set, and realize reasonable allocation of the resource according to the position information of the target log data set and the position information of the area to be allocated corresponding to the resource when the resource allocation is carried out according to the updated target log data set.

Description

Resource allocation method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for resource allocation.
Background
The high-speed development of network information can enable a user to receive a large amount of resource information, but the user needs to manually match the resource information needed by the user in the large amount of resource information, much time of the user is wasted in the matching process of the resource information, the matching of the resource information is not always the most satisfactory scheme of the user, and therefore the resource information needs to be classified and then pertinently transmitted to the user side.
When the resource information is classified and pertinently transmitted to the user side, the resource information type required by the user side needs to be accurately analyzed according to the specific position information of the user side, and when the specific position information of the user side does not exist, the resource information type required by the user side cannot be accurately analyzed only according to the IP address of the user, so that the resources cannot be reasonably distributed.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for resource allocation, so as to achieve reasonable allocation of resources.
In a first aspect, an embodiment of the present application provides a method for resource allocation, where the method includes:
determining the position information of a region to be allocated corresponding to resources, and acquiring a target IP address information set corresponding to the position information;
acquiring log data corresponding to each IP address information in the target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information;
dividing the target log data set into a first log data set and a second log data set according to whether the position information in the log data is empty or not;
acquiring first equipment address information and first position information corresponding to first IP address information according to first log data in the first log data set;
acquiring the first equipment address information and second log data corresponding to the first IP address information from the second log data set, and updating the position information in the second log data by using the first position information;
and performing resource allocation on the area to be allocated corresponding to the resource based on the first log data set and the updated second log data set.
In an embodiment of the application, after dividing the target log data set into a first log data set whose location information is not empty and a second log data set whose location information is empty, before acquiring, according to the first log data in the first log data set, first device address information and first location information corresponding to first IP address information, the method further includes:
judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not;
deleting the position information of the first log data which does not conform to the preset format, storing the first log data with the position information deleted to the second log data set, and deleting the first log data in the first log data set.
In an embodiment of the application, the obtaining, from the second log data set, the first device address information and second log data corresponding to the first IP address information, and updating, by using the first location information, location information in the second log data includes:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining the first device address information and first position information corresponding to the first IP address information based on the obtained log data, and updating the position information in the second log data by using the first position information.
In an embodiment of the present application, the merging the device address information and the IP address information in the first log data set and the second log data set includes:
sequentially extracting equipment address information and IP address information corresponding to the equipment address information from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
In an embodiment of the application, after the obtaining of the first device address information and the log data corresponding to the first IP address information, the method further includes:
calculating the number of the corresponding log data;
the obtaining of the first device address information and the first location information corresponding to the first IP address information based on the obtained log data includes:
when the number of the log data is one, obtaining the first equipment address information and first position information corresponding to the first IP address information based on the obtained log data;
and when the number of the log data is more than or equal to two, calculating to obtain the first equipment address information and first position information corresponding to the first IP address information based on the acquired log data.
In an embodiment of the application, the calculating to obtain the first device address information and the first location information corresponding to the first IP address information based on the obtained multiple pieces of log data includes:
acquiring all position information of the plurality of log data, and marking in a map respectively;
when the number of the marked position information is two, connecting the two position information into a line segment in the map, calculating midpoint position information of the line segment, and marking as the first position information corresponding to the first equipment address information and the first IP address information;
and when the number of the marked position information is more than three, sequentially connecting the plurality of position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording as the first position information corresponding to the first equipment address information and the first IP address information.
In an embodiment of the application, the allocating resources to the area to be allocated corresponding to the resources based on the first log data set and the updated second log data set includes:
acquiring the first log data set, the position information of all log data in the updated second log data set and the time information corresponding to all equipment addresses;
calculating the overlapping area of the position areas corresponding to all the position information and the area to be allocated corresponding to the resource;
acquiring user characteristics corresponding to the equipment address according to each equipment address of the overlapping area and time information corresponding to the equipment address;
and allocating the resources according to the acquired user characteristics.
In a second aspect, an embodiment of the present application provides an apparatus of a method for resource allocation, where the apparatus includes:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for determining the position information of a region to be allocated corresponding to resources and acquiring a target IP address information set corresponding to the position information;
the second acquisition module is used for acquiring log data corresponding to each IP address information in the target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information;
the judging module is used for dividing the target log data set into a first log data set and a second log data set according to whether the position information in the log data is empty or not;
a third obtaining module, configured to obtain, according to the first log data in the first log data set, first device address information and first location information corresponding to the first IP address information;
the updating module is used for acquiring the first equipment address information and second log data corresponding to the first IP address information from the second log data set, and updating the position information in the second log data by using the first position information;
and the allocation module is used for allocating the resources to the area to be allocated corresponding to the resources based on the first log data set and the updated second log data set.
In an embodiment of the application, after the determining module and before the third obtaining module, the apparatus is further configured to:
judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not;
deleting the position information of the first log data which does not conform to the preset format, storing the first log data with the position information deleted to the second log data set, and deleting the first log data in the first log data set.
In an embodiment of the application, the update module, when configured to obtain, from the second log data set, second log data corresponding to the first device address information and the first IP address information, and update location information in the second log data by using the first location information, is configured to:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining first position information corresponding to the first device address information and the first IP address information based on the obtained log data, and updating position information in the second log data by using the first position information.
In an embodiment of the present application, the update module, when configured to perform union processing on the device address information and the IP address information in the first log data set and the second log data set, is configured to:
sequentially extracting equipment address information and IP address information corresponding to the equipment address information from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
In an embodiment of the application, after the updating module is configured to obtain the first device address information and the log data corresponding to the first IP address information, the updating module is further configured to:
calculating the number of the corresponding log data;
the update module, when configured to obtain the first device address information and the first location information corresponding to the first IP address information based on the acquired log data, is configured to:
when the number of the log data is one, obtaining the first equipment address information and first position information corresponding to the first IP address information based on the obtained log data;
and when the number of the log data is more than or equal to two, calculating to obtain the first equipment address information and first position information corresponding to the first IP address information based on the acquired log data.
In an embodiment of the application, the update module, when configured to calculate and obtain the first device address information and the first location information corresponding to the first IP address information based on the obtained multiple pieces of log data, is configured to:
acquiring all position information of the plurality of log data, and marking the position information in a map respectively;
when the number of the marked position information is two, connecting the two position information into a line segment in a map, calculating midpoint position information of the line segment, and marking as the first equipment address information and first position information corresponding to the first IP address information;
and when the number of the marked position information is more than three, sequentially connecting the position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording the gravity center position information as the first position information corresponding to the first equipment address information and the first IP address information.
In an embodiment of the application, when the allocation module is configured to allocate a resource to the to-be-allocated area corresponding to the resource based on the first log data set and the updated second log data set, the allocation module is configured to:
acquiring the first log data set, the position information of all log data in the updated second log data set and the time information corresponding to all equipment addresses;
calculating the overlapping area of the position areas corresponding to all the position information and the area to be allocated corresponding to the resource;
acquiring user characteristics corresponding to the equipment address according to each equipment address of the overlapping area and time information corresponding to the equipment address;
and allocating the resources according to the acquired user characteristics.
In a third aspect, an embodiment of the present application further provides an electronic device, including: 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 running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a fourth aspect, this application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
According to the resource allocation method provided by the embodiment of the application, according to the device address and the IP address in the acquired target log data set, the log data without the position information is updated by using the log data with the position information, and when the resource allocation is performed according to the updated target log data set, the reasonable allocation of the resource can be realized according to the position information of the target log data set and the position information of the area to be allocated corresponding to the resource.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned objects, features and advantages of the present application comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings needed to be used in the detailed description of the present application or the prior art description will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart illustrating a method for resource allocation according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for updating location information in second log data according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram illustrating an apparatus for resource allocation 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.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present application. 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.
For the convenience of understanding the present embodiment, a method for allocating resources disclosed in the embodiments of the present application will be described in detail first.
Example one
Referring to fig. 1, a schematic flowchart of a method for resource allocation provided in an embodiment of the present application is shown, where the method includes the following steps:
s101, determining the position information of the area to be allocated corresponding to the resource, and acquiring a target IP address information set corresponding to the position information.
Exemplarily, assuming that the area to be allocated corresponding to the resource is a qualified spring cell, the location information of the qualified spring cell is determined by locating the qualified spring cell in the map, the qualified spring cell is determined to be located in Tianjin according to the obtained specific location information of the qualified spring cell, and an IP address information set of Tianjin is obtained from a preset IP address information set, and is a target IP address information set.
Optionally, after the location information of the cell in the scheduled spring is determined, an IP field corresponding to the location information may be further obtained, and a target IP address information set corresponding to the location information is obtained through a mapping relationship between a preset IP address set and the IP field, where each piece of IP address information in the target IP address information set is address information corresponding to a stable area such as a residential home user, a school institution user, and an enterprise user.
S102, obtaining log data corresponding to each IP address information in a target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information.
Here, the number of log data corresponding to each piece of IP address information in the target IP address information set may be one, or may be multiple, and the specific number of log data may be adjusted according to an actual application scenario, which is not limited herein.
S103, according to whether the position information in the log data is empty or not, dividing the target log data set into a first log data set of which the position information is not empty and a second log data set of which the position information is empty.
Illustratively, after the target log data set is acquired, the position information in the log data a in the target log data set is 39 ° 52 '48 ", the position information in the log data B is 40 ° 57' 48", and the log data C does not have position information, so that the log data a and the log data B are regarded as log data whose position information is not empty, and the log data C is regarded as log data whose position information is empty.
In a specific embodiment, after the target log data set is divided into a first log data set whose location information is not null and a second log data set whose location information is null, a data format corresponding to location information where log data may exist in the first log data set whose location information is not null does not conform to a preset format, for example, the location information of the log data D is 00 ° 00' 00 ″, and does not conform to the preset format, so that it is necessary to further determine the first log data set whose division location information is not null.
Judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not; and deleting the position information of the first log data which does not conform to the preset format, storing the first log data after the position information is deleted into the second log data set, and deleting the first log data in the first log data set.
S104, acquiring first device address information and first position information corresponding to the first IP address information according to the first log data in the first log data set.
S105, acquiring the first device address information and second log data corresponding to the first IP address information from the second log data set, and updating the position information in the second log data by using the first position information.
Here, the method for updating the location information in the second log data is described in detail after the method for allocating resources is described, and is not described herein again.
And S106, performing resource allocation on the to-be-allocated area corresponding to the resource based on the first log data set and the updated second log data set.
As shown in fig. 2, a schematic flowchart of a method for updating location information in second log data according to an embodiment of the present application is provided, where the method includes:
s201, merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information.
Specifically, equipment address information and IP address information corresponding to the equipment address information are sequentially extracted from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
Illustratively, the device address information of the log data a in the second log data set is x, the IP address information corresponding to the device address information x is y, the device address information of the log data B is m, the IP address information corresponding to the device address information m is n, the device address information of the log data C is p, the IP address information corresponding to the device address information p is q, the device address information of the log data D in the first log data set is x, the IP address information corresponding to the device address information x is y, the device address information of the log data E is m, and the IP address information corresponding to the device address information m is n.
And sequentially extracting x device address information, y IP address information corresponding to the x device address information, n IP address information corresponding to the m device address information, p device address information and q IP address information corresponding to the p device address information from the second log data set, and judging that the x device address information, the y IP address information corresponding to the x device address information, m device address information and n IP address information corresponding to the m device address information exist in the first log data set, wherein the y device address information, the m device address information and n IP address information corresponding to the m device address information are all used as the first device address information and the first IP address information.
S202, for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from a first log data set, obtaining first location information corresponding to the first device address information and the first IP address information based on the obtained log data, and updating location information in the second log data by using the first location information.
Here, after acquiring the first device address information and the log data corresponding to the first IP address information, the method further includes: and calculating the number of corresponding log data.
For example, assuming that the device address information of the log data F in the first log data set is x and the IP address information corresponding to the device address information x is y in the above example, the device address information of the log data a in the second log data set is x, the IP address information corresponding to the device address information x is y, the device address information of the log data a and the log data F in the first log data set having the same information is x, and the IP address information corresponding to the device address information x is y.
When the number of the log data is one, the first device address information and the first location information corresponding to the first IP address information are obtained based on the acquired log data.
For example, in the above example, if the device address information of the log data B in the second log data set is m, the IP address information corresponding to the device address information m is n, and the device address information of the log data in the first log data set that has the same information is the log data E is m, the IP address information corresponding to the device address information m is n, then the corresponding location information in the log data E is the location information corresponding to the log data B.
And when the number of the log data is more than or equal to two, calculating to obtain the first device address information and first position information corresponding to the first IP address information based on the acquired log data.
Specifically, all position information of a plurality of log data is obtained and marked in a map respectively; when the number of the marked position information is two, connecting the two position information into a line segment in the map, calculating midpoint position information of the line segment, and marking as the first position information corresponding to the first equipment address information and the first IP address information; and when the number of the marked position information is more than three, sequentially connecting the position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording the gravity center position information as the first position information corresponding to the first equipment address information and the first IP address information.
In step 106, performing resource allocation on the to-be-allocated area corresponding to the resource based on the first log data set and the updated second log data set, including:
acquiring position information of all log data in the first log data set and the updated second log data set and time information corresponding to all equipment addresses; calculating the overlapping area of the position areas corresponding to all the position information and the area to be allocated corresponding to the resource; acquiring user characteristics corresponding to the equipment addresses according to each equipment address of the overlapping area and time information corresponding to the equipment addresses; and allocating resources according to the acquired user characteristics.
For example, it is assumed that log data a, log data B, and log data C exist in a target log data set, corresponding location information exists in the log data a, a corresponding device is a mobile phone of a certain brand and a certain model, corresponding log data generation time information is nine am, corresponding location information does not exist in the log data B and the log data C, device address information and IP address information corresponding to the log data B are the same as those in the log data a, corresponding log data generation time information is three pm, and the corresponding location information exists in the log data B after the log data without the location information is updated.
Before a target log data set is not updated, when a to-be-allocated area corresponding to a resource is allocated, only part of user characteristic information of equipment corresponding to log data A can be obtained according to log data existing in the target log data set, after the target log data set is updated, user characteristic information of equipment corresponding to the log data A and the log data B can be obtained, and user characteristics can be analyzed more comprehensively according to the user characteristic information, so that the resource allocation is performed on the to-be-allocated area corresponding to the resource.
According to the resource allocation method provided by the embodiment, according to the device address and the IP address in the acquired target log data set, the log data without the location information is updated by using the log data with the location information, and when resource allocation is performed according to the updated target log data set, reasonable allocation of resources can be realized according to the location information of the target log data set and the location information of the area to be allocated corresponding to the resources.
Example two
Referring to fig. 3, a schematic structural diagram of an apparatus for resource allocation provided in an embodiment of the present application is shown, including: a first obtaining module 301, a second obtaining module 302, a determining module 303, a third obtaining module 304, an updating module 305, and a distributing module 306, specifically:
a first obtaining module 301, configured to determine location information of a to-be-allocated area corresponding to a resource, and obtain a target IP address information set corresponding to the location information;
a second obtaining module 302, configured to obtain log data corresponding to each piece of IP address information in the target IP address information set, to obtain a target log data set, where the log data includes device address information, IP address information, and location information;
a determining module 303, configured to divide the target log data set into a first log data set whose location information is not empty and a second log data set whose location information is empty according to whether location information in the log data is empty;
a third obtaining module 304, configured to obtain first device address information and first location information corresponding to first IP address information according to the first log data in the first log data set;
an updating module 305, configured to obtain the first device address information and second log data corresponding to the first IP address information from the second log data set, and update location information in the second log data by using the first location information;
an allocating module 306, configured to allocate resources to the area to be allocated corresponding to the resources based on the first log data set and the updated second log data set.
In an embodiment of the application, after the determining module 303 and before the third obtaining module 304, the apparatus is further configured to:
judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not;
deleting the position information of the first log data which does not conform to the preset format, storing the first log data with the position information deleted to the second log data set, and deleting the first log data in the first log data set.
In an embodiment of the application, the updating module 305, when configured to obtain the first device address information and the second log data corresponding to the first IP address information from the second log data set, and update the location information in the second log data by using the first location information, is configured to:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining the first device address information and first position information corresponding to the first IP address information based on the obtained log data, and updating the position information in the second log data by using the first position information.
In an embodiment of the present application, the updating module 305, when configured to perform union processing on the device address information and the IP address information in the first log data set and the second log data set, is configured to:
sequentially extracting equipment address information and IP address information corresponding to the equipment address information from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
In an embodiment of the application, after the updating module 305 is configured to obtain the first device address information and the log data corresponding to the first IP address information, the updating module is further configured to:
calculating the number of the corresponding log data;
the update module, when configured to obtain the first device address information and the first location information corresponding to the first IP address information based on the acquired log data, is configured to:
when the number of the log data is one, obtaining the first equipment address information and first position information corresponding to the first IP address information based on the obtained log data;
and when the number of the log data is more than or equal to two, calculating to obtain the first equipment address information and first position information corresponding to the first IP address information based on the acquired log data.
In an embodiment of the application, when the updating module 305 is configured to calculate, based on the obtained plurality of log data, first location information corresponding to the first device address information and the first IP address information, to:
acquiring all position information of the plurality of log data, and marking in a map respectively;
when the number of the marked position information is two, connecting the two position information into a line segment in the map, calculating midpoint position information of the line segment, and marking as the first position information corresponding to the first equipment address information and the first IP address information;
and when the number of the marked position information is more than three, sequentially connecting the position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording the gravity center position information as the first position information corresponding to the first equipment address information and the first IP address information.
In an embodiment of the application, when the allocating module 306 is configured to allocate a resource to an area to be allocated corresponding to the resource based on the first log data set and the updated second log data set, the allocating module is configured to:
acquiring the first log data set, the position information of all log data in the updated second log data set and the time information corresponding to all equipment addresses;
calculating the overlapping area of the position areas corresponding to all the position information and the area to be distributed corresponding to the resource;
acquiring user characteristics corresponding to the equipment address according to each equipment address of the overlapping area and time information corresponding to the equipment address;
and allocating the resources according to the acquired user characteristics.
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:
determining the position information of a region to be allocated corresponding to resources, and acquiring a target IP address information set corresponding to the position information;
acquiring log data corresponding to each IP address information in the target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information;
dividing the target log data set into a first log data set and a second log data set according to whether the position information in the log data is empty or not;
acquiring first equipment address information and first position information corresponding to first IP address information according to first log data in the first log data set;
acquiring the first equipment address information and second log data corresponding to the first IP address information from the second log data set, and updating position information in the second log data by using the first position information;
and performing resource allocation on the area to be allocated corresponding to the resource based on the first log data set and the updated second log data set.
In one possible design, in a process performed by processor 401, after dividing the target log data set into a first log data set whose location information is not null and a second log data set whose location information is null, before acquiring first device address information and first location information corresponding to first IP address information according to the first log data in the first log data set, the method further includes:
judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not;
deleting the position information of the first log data which does not conform to the preset format, storing the first log data with the position information deleted to the second log data set, and deleting the first log data in the first log data set.
In one possible design, in the processing performed by processor 401, the obtaining, from the second log data set, the first device address information and second log data corresponding to the first IP address information, and updating, by using the first location information, location information in the second log data includes:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining the first device address information and first position information corresponding to the first IP address information based on the obtained log data, and updating the position information in the second log data by using the first position information.
In one possible design, the process performed by processor 401 that merges the device address information and the IP address information in the first log data set and the second log data set includes:
sequentially extracting equipment address information and IP address information corresponding to the equipment address information from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
In a possible design, in the processing executed by the processor 401, after the obtaining the first device address information and the log data corresponding to the first IP address information, the method further includes:
calculating the number of the corresponding log data;
the obtaining of the first device address information and the first location information corresponding to the first IP address information based on the obtained log data includes:
when the number of the log data is one, obtaining the first equipment address information and first position information corresponding to the first IP address information based on the obtained log data;
and when the number of the log data is more than or equal to two, calculating to obtain the first equipment address information and first position information corresponding to the first IP address information based on the obtained plurality of log data.
In a possible design, in the processing executed by the processor 401, the calculating, based on the obtained multiple pieces of log data, first location information corresponding to the first device address information and the first IP address information includes:
acquiring all position information of the plurality of log data, and marking the position information in a map respectively;
when the number of the marked position information is two, connecting the two position information into a line segment in the map, calculating midpoint position information of the line segment, and marking as the first position information corresponding to the first equipment address information and the first IP address information;
and when the number of the marked position information is more than three, sequentially connecting the position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording the gravity center position information as the first position information corresponding to the first equipment address information and the first IP address information.
In a possible design, in a process executed by processor 401, the allocating a resource to an area to be allocated corresponding to the resource based on the first log data set and the updated second log data set includes:
acquiring the first log data set, the position information of all log data in the updated second log data set and the time information corresponding to all equipment addresses;
calculating the overlapping area of the position areas corresponding to all the position information and the area to be allocated corresponding to the resource;
acquiring user characteristics corresponding to the equipment address according to each equipment address of the overlapping area and time information corresponding to the equipment address;
and allocating the resources according to the acquired user characteristics.
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 resource allocation.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, and the like, and when a computer program on the storage medium is executed, the steps of the resource allocation method can be executed, so that the reasonable allocation of resources is realized.
The computer program product of the method for resource allocation provided in the embodiment of the present application includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method in the foregoing method embodiment, and specific implementation may refer to the method embodiment, which 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 embodiments provided in the present application, it should be understood that the disclosed 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 provided in 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 computer readable storage medium. 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: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
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 present disclosure, which should be construed in light of the above teachings. 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 of resource allocation, the method comprising:
determining the position information of a region to be allocated corresponding to resources, and acquiring a target IP address information set corresponding to the position information;
acquiring log data corresponding to each IP address information in the target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information;
dividing the target log data set into a first log data set and a second log data set according to whether the position information in the log data is empty or not;
acquiring first equipment address information and first position information corresponding to first IP address information according to first log data in the first log data set;
acquiring the first equipment address information and second log data corresponding to the first IP address information from the second log data set, and updating the position information in the second log data by using the first position information;
performing resource allocation on the area to be allocated corresponding to the resource based on the first log data set and the updated second log data set;
the obtaining, from the second log data set, the first device address information and second log data corresponding to the first IP address information, and updating, by using the first location information, location information in the second log data includes:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining the first device address information and first position information corresponding to the first IP address information based on the obtained log data, and updating the position information in the second log data by using the first position information.
2. The method according to claim 1, wherein after the dividing the target log data set into the first log data set whose location information is not empty and the second log data set whose location information is empty, before acquiring the first device address information and the first location information corresponding to the first IP address information according to the first log data in the first log data set, the method further comprises:
judging whether a data format corresponding to the position information of each first log data in the first log data set conforms to a preset format or not;
deleting the position information of the first log data which does not conform to the preset format, storing the first log data with the position information deleted to the second log data set, and deleting the first log data in the first log data set.
3. The method of claim 1, wherein the merging the device address information and the IP address information in the first log data set and the second log data set comprises:
sequentially extracting equipment address information and IP address information corresponding to the equipment address information from the second log data set;
judging whether the first log data set has the same device address information and IP address information corresponding to the extracted device address information and IP address information;
and if so, taking the extracted equipment address information and the extracted IP address information as the first equipment address information and the first IP address information.
4. The method of claim 1, wherein after the obtaining the first device address information and the log data corresponding to the first IP address information, the method further comprises:
calculating the number of the corresponding log data;
the obtaining of the first device address information and the first location information corresponding to the first IP address information based on the obtained log data includes:
when the number of the log data is one, obtaining the first equipment address information and first position information corresponding to the first IP address information based on the obtained log data;
and when the number of the log data is more than or equal to two, calculating to obtain the first equipment address information and first position information corresponding to the first IP address information based on the acquired log data.
5. The method of claim 4, wherein the calculating the first location information corresponding to the first device address information and the first IP address information based on the obtained log data comprises:
acquiring all position information of the plurality of log data, and marking in a map respectively;
when the number of the marked position information is two, connecting the two position information into a line segment in the map, calculating midpoint position information of the line segment, and marking as the first position information corresponding to the first equipment address information and the first IP address information;
and when the number of the marked position information is more than three, sequentially connecting the plurality of position information into a closed graph in the map, calculating the gravity center position information of the closed graph, and recording as the first position information corresponding to the first equipment address information and the first IP address information.
6. The method according to any one of claims 1 to 5, wherein the allocating the resource to the area to be allocated corresponding to the resource based on the first log data set and the updated second log data set comprises:
acquiring the first log data set, the position information of all log data in the updated second log data set and the time information corresponding to all equipment addresses;
calculating the overlapping area of the position areas corresponding to all the position information and the area to be allocated corresponding to the resource;
acquiring user characteristics corresponding to the equipment address according to each equipment address of the overlapping area and time information corresponding to the equipment address;
and allocating the resources according to the acquired user characteristics.
7. An apparatus for resource allocation, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for determining the position information of a region to be allocated corresponding to resources and acquiring a target IP address information set corresponding to the position information;
the second acquisition module is used for acquiring log data corresponding to each IP address information in the target IP address information set to obtain a target log data set, wherein the log data comprises equipment address information, IP address information and position information;
the judging module is used for dividing the target log data set into a first log data set and a second log data set according to whether the position information in the log data is empty or not;
a third obtaining module, configured to obtain, according to the first log data in the first log data set, first device address information and first location information corresponding to the first IP address information;
the updating module is used for acquiring the first equipment address information and second log data corresponding to the first IP address information from the second log data set, and updating the position information in the second log data by using the first position information;
the allocation module is used for allocating resources to the area to be allocated corresponding to the resources based on the first log data set and the updated second log data set;
the updating module is configured to obtain, from the second log data set, the first device address information and second log data corresponding to the first IP address information, and update location information in the second log data by using the first location information, where the updating module is configured to:
merging the device address information and the IP address information in the first log data set and the second log data set to obtain a plurality of pieces of first device address information and first IP address information corresponding to the first device address information;
for each piece of first device address information and first IP address information, obtaining log data corresponding to the first device address information and the first IP address information from the first log data set, obtaining first position information corresponding to the first device address information and the first IP address information based on the obtained log data, and updating position information in the second log data by using the first position information.
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 over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the method of resource allocation according to any one of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, is adapted to carry out the steps of the method of resource allocation according to any one of claims 1 to 6.
CN201910640020.8A 2019-07-16 2019-07-16 Resource allocation method and device Active CN110324845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910640020.8A CN110324845B (en) 2019-07-16 2019-07-16 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910640020.8A CN110324845B (en) 2019-07-16 2019-07-16 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN110324845A CN110324845A (en) 2019-10-11
CN110324845B true CN110324845B (en) 2022-08-12

Family

ID=68123731

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910640020.8A Active CN110324845B (en) 2019-07-16 2019-07-16 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN110324845B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990244B (en) * 2019-12-03 2023-09-01 秒针信息技术有限公司 Target equipment identification determining method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102076011A (en) * 2011-01-18 2011-05-25 大唐移动通信设备有限公司 Measurement information acquiring method and device
CN105608153A (en) * 2015-12-18 2016-05-25 晶赞广告(上海)有限公司 Universal POI information association method
CN107508883A (en) * 2017-08-23 2017-12-22 广东欧珀移动通信有限公司 Information-pushing method, device, storage medium and mobile terminal
CN107590244A (en) * 2017-09-14 2018-01-16 深圳市和讯华谷信息技术有限公司 The recognition methods of mobile device Below-the-line scene and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10474381B2 (en) * 2017-03-29 2019-11-12 The Travelers Indemnity Company Multi-server system resource manager

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102076011A (en) * 2011-01-18 2011-05-25 大唐移动通信设备有限公司 Measurement information acquiring method and device
CN105608153A (en) * 2015-12-18 2016-05-25 晶赞广告(上海)有限公司 Universal POI information association method
CN107508883A (en) * 2017-08-23 2017-12-22 广东欧珀移动通信有限公司 Information-pushing method, device, storage medium and mobile terminal
CN107590244A (en) * 2017-09-14 2018-01-16 深圳市和讯华谷信息技术有限公司 The recognition methods of mobile device Below-the-line scene and device

Also Published As

Publication number Publication date
CN110324845A (en) 2019-10-11

Similar Documents

Publication Publication Date Title
CN108737325B (en) Multi-tenant data isolation method, device and system
CN110532059B (en) Quota management method and device for K8s cluster management software
CN111694649A (en) Resource scheduling method and device, computer equipment and storage medium
CN109447820B (en) Data processing method, device, computer equipment and storage medium
CN103544153A (en) Data updating method and system based on database
CN111694756A (en) Application program testing method and device
CN111258680A (en) Resource loading method and device, storage medium and electronic device
CN110324845B (en) Resource allocation method and device
CN113114515B (en) Resource file configuration method and device
CN113961226A (en) Software development kit repairing method, terminal, server and equipment
CN112269665A (en) Memory processing method and device, electronic equipment and storage medium
CN111930363A (en) Block interface code generation method and device
CN111026613A (en) Log processing method and device
CN112073554B (en) Global unique identifier generation method, device and computer readable storage medium
CN111857736B (en) Cloud computing product generation method, device, equipment and storage medium
CN108376314B (en) Material allocation method, device, server and storage medium
CN114817151A (en) Data processing method and device, computer equipment and storage medium
CN109522014B (en) Algorithm processing method based on new product development, electronic device and readable storage medium
CN112948501A (en) Data analysis method, device and system
CN113114571A (en) Data packet processing method and device, electronic equipment and storage medium
CN111638902A (en) Cloud API unified management method and device
CN111459737A (en) Problem positioning method and device, computer equipment and storage medium
CN110162373A (en) The method and device of chart is shown in webpage
CN110460659A (en) Data push method and device, storage medium, computer equipment
CN111953722A (en) Terminal address book synchronization method and device

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