Query Method, Device, Electronic Device and Storage Medium for User's IP Location
By compressing and aggregating the user's regional information, the regional database and aggregate data are generated, and the problem of low efficiency of IP territorial query under large traffic requests in the prior art is solved, and fast and accurate IP territorial query is achieved.
Patent Information
- Application Number
- CN202211257322.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-10-13
AI Technical Summary
The prior art is inefficient and prone to lag when acquiring user IP territories under large traffic requests, and cannot quickly and accurately query IP territories.
By obtaining the user's area information, performing compression processing and aggregation processing, generating the area database and aggregation data, which are used to query the user's IP address.
It realizes the rapid and accurate acquisition of the user's IP territorial home, improves query efficiency, avoids lag, and shortens query time.
Smart Images

Figure CN115941645B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of front-end technologies. Specifically, it relates to a method, device, electronic device, and computer-readable storage medium for querying the IP location of a user. Background Art
[0002] With the gradual upgrade of Internet security, the management of IP locations has become increasingly strict. Especially for some social platforms, such as major platforms like Sina Weibo, Toutiao, Tencent, Douyin, Zhihu, Kuaishou, and Xiaohongshu, they have all launched the "IP location display function for network users", which forcibly displays the location of users. Overseas users are shown the country, and domestic users are shown the province.
[0003] However, in the prior art, the IP location is usually requested in real time, and the IP location is requested through a third-party library such as Taobao IP library. However, due to the limitation of the interface QPS, a large number of error exceptions will occur for large-traffic requests, with low efficiency and serious lag. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a method, device, electronic device, and computer-readable storage medium for querying the IP location of a user, which can quickly and accurately obtain the IP location of the user, accept large-traffic query requests, improve the query efficiency of the IP location, avoid the occurrence of lag, and shorten the query time.
[0005] In a first aspect, the embodiments of this application provide a method for querying the IP location of a user, and the method includes:
[0006] Obtain the regional information of the user;
[0007] Perform compression processing on the regional information to obtain a regional database;
[0008] Perform aggregation processing on the regional data in the regional database to obtain aggregated data;
[0009] Query the IP location of the user according to the aggregated data.
[0010] In the above implementation process, by performing compression processing and aggregation processing on the regional information of the user to obtain aggregated data, and querying the IP location of the user according to the aggregated data, the IP location of the user can be quickly and accurately obtained, large-traffic query requests can be accepted, the query efficiency of the IP location can be improved, the occurrence of lag can be avoided, and the query time can be shortened.
[0011] Further, the step of obtaining the regional information of the user includes:
[0012] Obtain the IP location of the user;
[0013] Extract the IP data segment from the IP location;
[0014] Obtain the area information according to the IP data segment.
[0015] In the above implementation process, extracting the IP data segment from the IP location and obtaining the area information according to the IP data segment can ensure the accuracy of the obtained area information.
[0016] Further, the step of performing compression processing on the area information to obtain an area database includes:
[0017] Remove duplicates from the area information to obtain the area information after duplicate removal;
[0018] Perform compression processing on the area information after duplicate removal to obtain the area database.
[0019] In the above implementation process, removing duplicates from the area information and then performing compression processing can improve the efficiency of subsequent queries and reduce the phenomenon of data redundancy.
[0020] Further, the step of performing aggregation processing on the area data in the area database to obtain aggregated data includes:
[0021] Obtain the aggregation type corresponding to the area data in the area database;
[0022] Perform aggregation processing on the area data in the area database according to the aggregation type to obtain aggregated data.
[0023] In the above implementation process, performing aggregation processing on the area data in the area database according to the aggregation type can shorten the query time, improve the efficiency, and ensure the accuracy.
[0024] In a second aspect, an embodiment of the present application further provides a query device for the IP location of a user, and the device includes:
[0025] An acquisition module, configured to acquire the area information of the user;
[0026] A compression module, configured to perform compression processing on the area information to obtain an area database;
[0027] An aggregation module, configured to perform aggregation processing on the area data in the area database to obtain aggregated data;
[0028] A query module, configured to query the IP location of the user according to the aggregated data.
[0029] In the above implementation process, the regional information of the user is compressed and aggregated to obtain aggregated data. By querying the user's IP location based on the aggregated data, the IP location of the user can be quickly and accurately obtained, large traffic query requests can be accepted, the query efficiency of the IP location can be improved, the occurrence of lag phenomena can be avoided, and the query time can be shortened.
[0030] Further, the obtaining module further includes:
[0031] Obtain the IP location of the user;
[0032] Extract the IP data segment in the IP location;
[0033] Obtain the regional information according to the IP data segment.
[0034] In the above implementation process, by extracting the IP data segment in the IP location and obtaining the regional information according to the IP data segment, the accuracy of the obtained regional information can be ensured.
[0035] Further, the compression module is further configured to:
[0036] Deduplicate the regional information to obtain the deduplicated regional information;
[0037] Perform compression processing on the deduplicated regional information to obtain the regional database.
[0038] In the above implementation process, by deduplicating the regional information and then performing compression processing, the subsequent query efficiency can be improved, and the phenomenon of data redundancy can be reduced.
[0039] Further, the aggregation module is further configured to:
[0040] Obtain the aggregation type corresponding to the regional data in the regional database;
[0041] Perform aggregation processing on the regional data in the regional database according to the aggregation type to obtain aggregated data.
[0042] In the above implementation process, by performing aggregation processing on the regional data in the regional database according to the aggregation type, the query time can be shortened, the efficiency can be improved, and the accuracy can be ensured.
[0043] In a third aspect, an electronic device provided by an embodiment of the present application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method described in any item of the first aspect are implemented.
[0044] Fourthly, a computer-readable storage medium provided by an embodiment of the present application, where instructions are stored on the storage medium, and when the instructions run on a computer, the computer is caused to execute the method according to any one of the first aspect.
[0045] Fifthly, a computer program product provided by an embodiment of the present application, when the computer program product runs on a computer, the computer is caused to execute the method according to any one of the first aspect.
[0046] Other features and advantages of the present disclosure will be described in the following specification, or some features and advantages can be inferred from the specification or determined without doubt, or can be known by implementing the above technologies of the present disclosure.
[0047] And it can be implemented according to the content of the specification. The following will be described in detail with reference to the preferred embodiments of the present application and the accompanying drawings. Description of the Drawings
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0049] Figure 1 It is a schematic flowchart of the method for querying the IP address of a user provided by an embodiment of the present application;
[0050] Figure 2 It is a schematic structural composition diagram of the device for querying the IP address of a user provided by an embodiment of the present application;
[0051] Figure 3 It is a schematic structural composition diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0052] Next, the technical solutions in the embodiments of the present application will be described with reference to the drawings in the embodiments of the present application.
[0053] It should be noted that: similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0054] The following will further describe in detail the specific implementation manners of the present application in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0055] Embodiment 1
[0056] Figure 1 is a schematic flowchart of a method for querying the IP location of a user provided by an embodiment of the present application. As Figure 1 shown, the method includes:
[0057] S1. Obtain the regional information of the user;
[0058] S2. Perform compression processing on the regional information to obtain a regional database;
[0059] S3. Perform aggregation processing on the regional data in the regional database to obtain aggregated data;
[0060] S4. Query the IP location of the user according to the aggregated data.
[0061] In the above implementation process, by performing compression processing and aggregation processing on the regional information of the user to obtain aggregated data, and querying the IP location of the user according to the aggregated data, the IP location attribution of the user can be obtained quickly and accurately, large traffic query requests can be accepted, the query efficiency of the IP location can be improved, the occurrence of jamming phenomena can be avoided, and the query time can be shortened.
[0062] The IP location is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet to shield the differences in physical addresses.
[0063] The IP location is used to assign a number to a computer on the Internet. The common situation seen daily is that each networked PC needs to have an IP location to communicate normally. If a "personal computer" is compared to "a telephone", then the "IP location" is equivalent to the "phone number", and the router in the Internet is equivalent to the "program-controlled switch" of the telecommunications bureau.
[0064] Devices accessing the network must have a unique IP location so as to be able to identify a target. Therefore, only one IP location can be assigned to a network card of a device, that is, only one device can be assigned to one IP location.
[0065] By de-duplicating, compressing and aggregating the regional information and then querying the IP location in the embodiments of the present application, the IP location attribution of the user can be obtained quickly and accurately, large traffic query requests can be accepted, the query efficiency of the IP location can be improved, the occurrence of jamming phenomena can be avoided, and the query time can be shortened.
[0066] Further, S1 includes:
[0067] Obtain the IP location of the user;
[0068] Extract the IP data segment from the IP location;
[0069] Obtain the regional information based on the IP data segment.
[0070] In the above implementation process, extracting the IP data segment from the IP location and obtaining the regional information based on the IP data segment can ensure the accuracy of the obtained regional information.
[0071] The regional information of the user adopts a standardized data format. For example, the regional information of each IP data segment has a fixed format: country|region|province|city|Internet Service Provider (ISP), which can be accurate to the city. If it is the IP location of other countries, it can only be accurately located to the country.
[0072] The header length and data length of the IP data segment are both variable-length, but are always integer multiples of 4 bytes. For IPv4, the 4-bit version field is 4. The value of the 4-bit header length is in units of 4 bytes, with a minimum value of 5, that is, the minimum header length is 4x5 = 20 bytes, which is the IP header without any options. The maximum value that can be represented by 4 bits is 15, that is, the maximum header length is 60 bytes. The 8-bit TOS field has 3 bits used to specify the priority of the IP data segment (currently deprecated), and 4 bits represent the optional service type (minimum delay, maximum throughput, maximum reliability, minimum cost), and there is also 1 bit that is always 0.
[0073] The total length is the number of bytes of the entire data segment (including the IP header and the IP layer payload). Each time an IP data segment is transmitted, the 16-bit identifier is incremented by 1, which can be used for fragmenting and reassembling the data segment. The 3-bit flag and 13-bit fragment offset are used for fragmentation.
[0074] Specifically, the usage of TTL (Time to live) includes: the source host sets a survival time for the data packet, such as 64. Each time it passes through a router, the value is decremented by 1. If it is decremented to 0, it means that the route is too long and the destination host network still cannot be found, and the packet is discarded. Therefore, the unit of this survival time is not seconds, but hops. The protocol field indicates whether the upper-layer protocol is TCP, UDP, ICMP, or IGMP. Then there is the checksum, which only checks the IP data segment header, and the checksum of the data is the responsibility of the higher-layer protocol. The IP location length of IPv4 is 32 bits.
[0075] TTL is the maximum number of network segments that an IP packet is allowed to pass through before being discarded by a router. TTL is a bit field in the IPv4 header.
[0076] An ISP is a telecommunications operator that comprehensively provides Internet access services, information services, and value-added services to a large number of users.
[0077] Just as a user needs to find the telecommunications bureau when installing a telephone, if a user wants to access the Internet, they need to find an ISP. An ISP is the entrance for users to access the Internet. Usually, the computer of an individual user or the computer network of a corporate user is first connected to the host of the ISP through a certain communication line, and then accesses the Internet through the connection channel of the ISP. The functions of an ISP mainly include two aspects. One is to provide users with Internet access services, and the other is to provide users with various information services, such as email services, information publishing agency services, etc. Users can choose an ISP that suits them according to the network bandwidth, access method, service items, charging standards, and management measures provided by the ISP.
[0078] The selection of an ISP can be based on the following references: whether it has the ability to connect to various communication lines, whether the speed of the used modem is high enough, whether the line is excellent and the line maintenance ability; try to choose a local ISP, at least the telephone bill cost is relatively small; the export bandwidth and access line; the larger the bandwidth value and the more access lines; the speed of the access modem used by the ISP directly affects the user's access speed, and the user cannot exceed its speed; the larger the email capacity, the better.
[0079] In the Internet application service industry chain "equipment supplier - basic network operator - content collector and producer - service provider - user", the ISP is in the position of content collector, producer, and service provider.
[0080] Further, S2 includes:
[0081] Deduplicate the regional information to obtain the deduplicated regional information;
[0082] Perform compression processing on the deduplicated regional information to obtain a regional database.
[0083] In the above implementation process, performing deduplication on the regional information and then compression processing can improve the efficiency of subsequent queries and reduce the phenomenon of data redundancy.
[0084] The regional information can be in the xdb format. After deduplicating and compressing the regional information, the default all regional information, the generated xdb format regional database increases in size as the data detail increases.
[0085] In the embodiments of this application, even for a query completely based on the xdb format, the single query response time is at the 10 microsecond level.
[0086] Optionally, memory-accelerated query can be enabled in the following two ways:
[0087] vIndex index cache: Use a fixed 512 KiB of memory space to cache vector index data, reducing one Input / Output (IO) disk operation and keeping the average query efficiency stable between 10 - 20 microseconds.
[0088] Whole xdb file cache: Load the entire xdb file into memory. The memory occupancy is equal to the size of the xdb file, without disk IO operations, and maintaining query efficiency at the microsecond level.
[0089] The xdb format supports hundreds of millions of IP data segment rows, and the area information can also be fully customized. Exemplarily, data for specific business requirements can be appended to the area information, such as: Global Positioning System (GPS) information / International Standard Industrial Classification of All Economic Activities / Postal codes, etc.
[0090] GPS, also known as the Global Positioning System, is a medium-range circular orbit satellite navigation system. It can provide accurate positioning, speed measurement, and high-precision time standards for most areas (98%) of the Earth's surface.
[0091] GPS is one of the most groundbreaking high-tech technologies. Its global, all-round, and all-weather navigation, positioning, timing, and speed measurement advantages will surely be more widely applied in many fields. In developed countries, GPS technology has already been applied to transportation and traffic engineering. The application of GPS technology in China's road engineering and traffic management has just started. With the development of China's economy, the rapid construction of high-grade highways and the gradual in-depth application research of GPS technology, its application in road engineering will also be more extensive and in-depth, and play a greater role.
[0092] Among them, GPS has the following multiple advantages: Using low-frequency signals, it can still maintain considerable signal penetration even in poor weather; global coverage (up to 98%); three-dimensional speed and time measurement with high precision; fast, time-saving, and high-efficiency; wide application and multi-functional; mobile positioning; different from the double-star positioning system, the receiver does not need to emit any signals during use, increasing its concealment and improving its application efficiency.
[0093] Furthermore, S3 includes:
[0094] Obtain the aggregation type corresponding to the area data in the area database;
[0095] Aggregate the area data in the area database according to the aggregation type to obtain aggregated data.
[0096] In the above implementation process, aggregating the regional data in the regional database according to the aggregation type can shorten the query time, improve efficiency, and ensure accuracy.
[0097] Aggregation can facilitate the implementation of statistical operation analysis on data. The three common types of aggregation include: Bucket Aggregation: used to group documents; Metric Aggregation: used to calculate some numerical values, and Pipeline Aggregation: aggregating based on the results of other aggregations.
[0098] The three elements of aggregation: aggregation name, aggregation type, and aggregation field.
[0099] Configurable attributes of aggregation: size: specify the number of aggregation results; order: specify the sorting method of aggregation results; field: specify the aggregation field.
[0100] Bucket Aggregation is achieved by creating multiple "buckets" to store documents. Each bucket is associated with a criterion (depending on the aggregation type), and this criterion determines whether a document in the current context "falls into" it. In other words, Bucket Aggregation effectively defines a set of documents. In addition to the Bucket Aggregation itself, Bucket Aggregation also calculates and returns the number of documents that "fall into" each bucket.
[0101] Bucket Aggregation can contain sub-aggregations. These sub-aggregations will aggregate the buckets created by their "parent" bucket aggregation.
[0102] Different bucket aggregators have different "bucket splitting" strategies. Some define a single bucket, some define a fixed number of multiple buckets, and some dynamically create buckets during the aggregation process.
[0103] Bucket Aggregation queries are mainly used for grouped statistics. Each bucket represents a group.
[0104] Exemplarily, single-value aggregation statistics can be performed using Bucket Aggregation, an aggregation based on a multi-bucket value source where buckets are dynamically constructed - one bucket for each unique value. It is mainly used for counting the number of groups.
[0105] Exemplarily, to count the number of records for each type, create multiple buckets based on the number of unique values of genre, and count the number of records in each bucket.
[0106] Metric Aggregation calculates metrics from the documents being aggregated according to a certain method. Metric values are usually extracted from the fields of the documents, but can also be generated using scripts.
[0107] Numeric Metric Aggregation is a specific metric type that outputs numeric values. Some aggregations output a single numeric metric, which is called a single-value numeric metric aggregation. The difference between single-value numeric metric aggregation and multi-value numeric metric aggregation becomes apparent when the aggregation serves as a sub-aggregation of a bucket aggregation.
[0108] The pipeline aggregates the output from other aggregations rather than the document set, adding information to the output tree. The pipeline aggregations include various methods, such as: parent pipeline aggregation, cumulative pipeline aggregation, sibling pipeline aggregation, and percentile pipeline aggregation.
[0109] Among them, the sibling pipeline aggregation calculates the average value of the specified metric in the sibling aggregations. The sibling aggregations must be multi-bucket aggregations and target metric aggregations.
[0110] In the embodiments of the present application, aggregating the regional data in the regional database according to the aggregation type can improve the accuracy of the regional data, facilitate querying the IP location, and reduce the redundancy generated during the calculation process.
[0111] Embodiment Two
[0112] To execute the method corresponding to the above Embodiment One to achieve the corresponding functions and technical effects, the following provides a query device for the IP location of a user, as Figure 2 shown. The device includes:
[0113] An acquisition module 1, configured to acquire the regional information of the user;
[0114] A compression module 2, configured to perform compression processing on the regional information to obtain a regional database;
[0115] An aggregation module 3, configured to perform aggregation processing on the regional data in the regional database to obtain aggregated data;
[0116] A query module 4, configured to query the IP location of the user according to the aggregated data.
[0117] In the above implementation process, performing compression processing and aggregation processing on the regional information of the user to obtain aggregated data, and querying the IP location of the user according to the aggregated data can quickly and accurately obtain the IP location attribution of the user, accept large-traffic query requests, improve the query efficiency of the IP location, avoid the occurrence of lag phenomena, and shorten the query time.
[0118] Further, the acquisition module 1 further includes:
[0119] Acquire the IP location of the user;
[0120] Extract the IP data segment in the IP location;
[0121] Obtain the regional information according to the IP data segment.
[0122] In the above implementation process, extracting the IP data segment in the IP location and obtaining the regional information according to the IP data segment can ensure the accuracy of the obtained regional information.
[0123] Further, the compression module 2 is further configured to:
[0124] Deduplicate the area information to obtain the deduplicated area information;
[0125] Perform compression processing on the deduplicated area information to obtain an area database.
[0126] In the above implementation process, performing deduplication on the area information and then performing compression processing can improve the efficiency of subsequent queries and reduce the phenomenon of data redundancy.
[0127] Further, the aggregation module 3 is further configured to:
[0128] Obtain the aggregation type corresponding to the area data in the area database;
[0129] Perform aggregation processing on the area data in the area database according to the aggregation type to obtain aggregated data.
[0130] In the above implementation process, performing aggregation processing on the area data in the area database according to the aggregation type can shorten the query time, improve the efficiency, and ensure the accuracy.
[0131] The above IP address query device of the user can implement the method of the first embodiment. The optional items in the first embodiment also apply to this embodiment and will not be elaborated here.
[0132] The remaining content of the embodiments of the present application can refer to the content of the first embodiment, and will not be repeated in this embodiment.
[0133] Embodiment 3
[0134] The embodiment of the present application provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the IP address query method of the user in the first embodiment.
[0135] Optionally, the above electronic device may be a server.
[0136] Please refer to Figure 3 , Figure 3 , which is a schematic structural composition diagram of the electronic device provided by the embodiment of the present application. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. Among them, the communication bus 34 is used to realize the direct connection communication between these components. Among them, the communication interface 32 of the device in the embodiment of the present application is used to communicate with other node devices for signaling or data. The processor 31 may be an integrated circuit chip with signal processing capabilities.
[0137] The above-mentioned processor 31 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor, or the processor 31 may also be any conventional processor, etc.
[0138] The memory 33 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM), etc. Computer-readable instructions are stored in the memory 33. When the computer-readable instructions are executed by the processor 31, the device can execute the Figure 1 various steps involved in the method embodiments.
[0139] Optionally, the electronic device may further include a storage controller and an input / output unit. The memory 33, the storage controller, the processor 31, the peripheral interface, and the input / output unit are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses 34. The processor 31 is used to execute the executable modules stored in the memory 33, such as software function modules or computer programs included in the device.
[0140] The input / output unit is used to provide the user with the ability to create tasks and create a start optional period or a preset execution time for the task to achieve interaction between the user and the server. The input / output unit may be, but is not limited to, a mouse, a keyboard, etc.
[0141] It can be understood that Figure 3 the structure shown is only schematic, and the electronic device may further include more or fewer components than those Figure 3 shown, or have a different configuration from that Figure 3 shown. Figure 3Each component shown in the figure can be implemented by hardware, software, or a combination thereof.
[0142] In addition, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the method for querying the IP address of the user in the first embodiment.
[0143] The embodiment of the present application also provides a computer program product, and when the computer program product runs on a computer, it causes the computer to execute the method described in the method embodiment.
[0144] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program product according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based device for performing the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0145] In addition, in each embodiment of the present application, the various functional modules may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0146] If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, external hard drives, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0147] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application. It should be noted that similar reference numerals and letters indicate similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0148] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, and all of them should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
[0149] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.
Claims
1. A method for querying the IP address location of a user, characterized in that, The method includes: Obtaining the regional information of the user; Performing compression processing on the regional information to obtain a regional database; Performing aggregation processing on the regional data in the regional database to obtain aggregated data; Querying the IP location of the user according to the aggregated data; The step of performing aggregation processing on the regional data in the regional database to obtain aggregated data includes: Obtaining the aggregation type corresponding to the regional data in the regional database; Performing aggregation processing on the regional data in the regional database according to the aggregation type to obtain aggregated data; The step of performing compression processing on the regional information to obtain a regional database includes: Removing duplicates from the regional information to obtain the regional information after duplicate removal; Performing compression processing on the regional information after duplicate removal to obtain the regional database; The regional information is in xdb format. When performing duplicate removal and compression on the regional information, the size of the generated xdb-format regional database increases as the data detail increases.
2. The method for querying the IP location of a user according to claim 1, wherein, The step of obtaining the regional information of the user includes: Obtaining the IP location of the user; Extracting the IP data segment in the IP location; Obtaining the regional information according to the IP data segment.
3. A query device for a user's IP address location, characterized in that, The device includes: An obtaining module for obtaining the regional information of the user; A compression module for performing compression processing on the regional information to obtain a regional database; An aggregation module for performing aggregation processing on the regional data in the regional database to obtain aggregated data; A query module for querying the IP location of the user according to the aggregated data; The aggregation module is further configured to: Obtain the aggregation type corresponding to the regional data in the regional database; Perform aggregation processing on the regional data in the regional database according to the aggregation type to obtain aggregated data; The compression module is further configured to: Remove duplicates from the regional information to obtain the regional information after duplicate removal; Perform compression processing on the regional information after duplicate removal to obtain the regional database; The regional information is in xdb format. When performing duplicate removal and compression on the regional information, the size of the generated xdb-format regional database increases as the data detail increases.
4. The query device for the user's IP address location according to claim 3, wherein The obtaining module further includes: Obtaining the IP location of the user; Extracting the IP data segment in the IP location; Obtaining the regional information according to the IP data segment.
5. An electronic device, characterized in that, It includes a memory and a processor. The memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for querying the IP location of the user according to any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that, It stores a computer program, and when the computer program is executed by the processor, it implements the method for querying the IP location of the user according to any one of claims 1 to 2.
Citation Information
Patent Citations
IP address ownership information indexing and fast querying method
CN103561133A
IP address data processing method and device and electronic equipment
CN111629081A