Equipment positioning cache updating method and device, equipment and storage medium

By obtaining network information of mobile devices and updating cache data through data heat algorithm, the problem of lack of strategy in cache elimination mechanism is solved, and the hit rate and service efficiency of positioning cache are improved.

CN120729937APending Publication Date: 2025-09-30ZHENSHI INFORMATION TECH SHANGHAI CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510881039.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

The existing cache elimination mechanism lacks a reasonable strategy, resulting in reduced cache efficiency, waste of storage resources, and poor cache hit rate, making it unsuitable for location-based cache elimination applications.

Method used

By obtaining the network information of the mobile device, determining whether there is positioning information in the device positioning cache library, calling the external positioning service to obtain the positioning information, and using the data heat algorithm to calculate the heat value, the cached data is updated, low-value data is eliminated, and high-reuse rate data is retained.

Benefits of technology

The hit rate of positioning cache data is improved, the calls to external positioning services are reduced, and more efficient and stable positioning services are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729937A_ABST
    Figure CN120729937A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment positioning cache updating method and device, equipment and a storage medium. The method comprises the following steps: determining whether first positioning information corresponding to first mobile equipment exists in an equipment positioning cache library or not according to first network information of the first mobile equipment under the condition of determining that the first mobile equipment requests equipment positioning; if the first positioning information does not exist, calling an external positioning service, determining the first positioning information, and determining a first popularity value corresponding to the first positioning information according to a pre-constructed data popularity algorithm; and according to a first popularity value corresponding to the first positioning information and a cache popularity value corresponding to each piece of positioning cache data in an equipment positioning cache library, performing updating processing on the positioning cache data in the equipment positioning cache library so as to realize accurate elimination of low-value positioning cache data and reservation of high-reuse-rate positioning cache data. Therefore, the hit rate of the positioning cache data is improved, and external positioning service calling is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cache management technology, and in particular to a device positioning cache update method, device, equipment and storage medium. Background Art

[0002] Location-based services (LBS) have become a core feature of internet and mobile applications, and users are increasingly demanding real-time and responsive location data. To improve the performance of location-based services, existing technologies typically employ caching mechanisms to store frequently accessed location information. This reduces the overhead and resource consumption of remote data queries, thereby improving response efficiency and optimizing the user experience.

[0003] Due to the high cost of caching, a balance must be struck between storage capacity and performance, necessitating a rational eviction mechanism to retain the most valuable data. Existing cache eviction mechanisms, lacking a rational eviction strategy over the long term, lead to reduced cache efficiency and overall system performance. These mechanisms are unsuitable for targeted cache eviction applications, resulting in poor cache hit rates.

[0004] Due to the lack of an effective elimination mechanism, a large amount of low-frequency or invalid positioning data stored in the cache occupies cache space for a long time, resulting in a waste of storage resources and a reduction in cache hit rate. Therefore, a cache management method for positioning cache data is urgently needed to achieve efficient data reuse within limited storage space. Summary of the Invention

[0005] The present invention provides a device positioning cache update method, apparatus, device and storage medium to accurately eliminate low-value positioning cache data and retain high-reuse rate positioning cache data, thereby improving the positioning cache data hit rate and reducing external positioning service calls.

[0006] According to one aspect of the present invention, a method for updating a device location cache is provided. The method comprises:

[0007] When it is determined that the first mobile device requests device positioning, obtaining first network information of the first mobile device, wherein the first network information includes at least Wi-Fi network information and mobile network information;

[0008] Determining, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library, wherein the device positioning cache library at least includes cached positioning information and cached network information corresponding to each piece of positioning cache data;

[0009] In a case where it is determined that the first positioning information does not exist in the device positioning cache, calling an external positioning service according to the first network information to determine the first positioning information corresponding to the first mobile device, and determining a first heat value corresponding to the first positioning information according to a pre-built data heat algorithm, wherein the algorithm parameters of the data heat algorithm include at least a time attenuation factor, and the time attenuation factor includes at least a high-frequency attenuation factor, a default attenuation factor, and a low-frequency attenuation factor;

[0010] The positioning cache data in the device positioning cache library is updated according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library.

[0011] According to another aspect of the present invention, a device location cache update apparatus is provided. The apparatus comprises:

[0012] a network information acquisition module, configured to acquire first network information of the first mobile device when it is determined that the first mobile device requests device positioning, wherein the first network information includes at least Wi-Fi network information and mobile network information;

[0013] a network information comparison module, configured to determine, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library, wherein the device positioning cache library includes at least cached positioning information and cached network information corresponding to each piece of positioning cache data;

[0014] a heat value calculation module, configured to, upon determining that the first positioning information does not exist in the device positioning cache, call an external positioning service based on the first network information to determine the first positioning information corresponding to the first mobile device, and determine a first heat value corresponding to the first positioning information based on a pre-established data heat algorithm, wherein the algorithm parameters of the data heat algorithm include at least a time attenuation factor, and the time attenuation factor includes at least a high-frequency attenuation factor, a default attenuation factor, and a low-frequency attenuation factor;

[0015] A positioning cache update module is configured to update the positioning cache data in the device positioning cache based on the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache. According to another aspect of the present invention, an electronic device is provided, comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the device location cache updating method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the device location cache update method according to any embodiment of the present invention when executed.

[0020] The technical solution of an embodiment of the present invention is to obtain the first network information of the first mobile device when it is determined that the first mobile device requests device positioning. Based on the first network information, it is determined whether the first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library. When it is determined that the first positioning information does not exist in the device positioning cache library, an external positioning service is called according to the first network information to determine the first positioning information corresponding to the first mobile device, and a first heat value corresponding to the first positioning information is determined according to a pre-built data heat algorithm. Based on the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library, the positioning cache data in the device positioning cache library is updated, which solves the problem that the existing cache mechanism lacks a reasonable elimination strategy. The present invention combines the heat value update mechanism to ensure that the cache library always stores more valuable data, avoids memory waste, improves the positioning cache data hit rate, and realizes a more efficient and stable positioning service.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is a flowchart of a device location cache update method provided according to the first embodiment of the present invention;

[0024] Figure 2 Schematic diagram of the effect of the time decay factor on the heat value according to the first embodiment of the present invention;

[0025] Figure 3 This is a flowchart of a device location cache update method provided in accordance with the second embodiment of the present invention;

[0026] Figure 4 This is a structural diagram of a device location cache update apparatus provided according to Embodiment 3 of the present invention;

[0027] Figure 5 It is a structural diagram of an electronic device that implements the device location cache update method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Example 1

[0031] Figure 1 This is a flowchart of a device location cache update method provided in the first embodiment of the present invention. This embodiment is applicable to the case of updating location cache data in a cache library. The method can be executed by a device location cache update device. The device location cache update device can be implemented in the form of hardware and / or software. The device location cache update device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0032] S101: When it is determined that a first mobile device requests device positioning, obtain first network information of the first mobile device.

[0033] In the present invention, the first mobile device may refer to a portable electronic device, such as a mobile phone, an in-vehicle system, or a smartwatch. The first network information may refer to the network information of the first mobile device. Exemplarily, the first network information includes at least Wi-Fi network information and mobile network information. The Wi-Fi network information may include the MAC address of the Wi-Fi hotspot and the signal strength of the Wi-Fi hotspot. Correspondingly, the mobile network information includes the base station representation of the currently connected mobile network base station and the signal strength of other nearby base stations.

[0034] Specifically, when the first mobile device needs to be positioned (such as for navigation and location query), it can be considered that the first mobile device requests device positioning. When it is determined that the first mobile device requests device positioning, the first network information of the first mobile device can be determined by obtaining the Wi-Fi network information or mobile network information to which the first mobile device is connected.

[0035] S102: Determine, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library.

[0036] The device positioning cache library may refer to a pre-built cache library for storing positioning cache data commonly used by the first mobile device, so as to reduce calls to servers of external positioning service providers (such as Amap and Google's location service interface), thereby reducing positioning costs.

[0037] The first positioning information may refer to the current location information of the first mobile device. Exemplarily, the device positioning cache library includes at least cached positioning information and cached network information corresponding to each positioning cache data. It should be explained that the essence of network positioning is to reversely infer the "device location" through "marked network information and hotspot locations". The core is to query a huge mapping database. The device positioning cache library can be regarded as a database containing the precise locations of Wi-Fi hotspots and base stations, and accurately estimates the location based on the MAC address / base station identifier and signal strength.

[0038] Specifically, the first mobile device sends the collected first network information to the server via the mobile network or Wi-Fi, so that the server queries the device positioning cache library and determines whether the first positioning information corresponding to the first mobile device exists in the device positioning cache library.

[0039] Exemplarily, determining, based on the first network information, whether the first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library includes:

[0040] The first network information is compared with the cached network information corresponding to each positioning cache data in the device positioning cache library; if the cached network information of the positioning cache data matches the first network information, the cached positioning information corresponding to the positioning cache data is determined to be the first positioning information corresponding to the first mobile device, and it is determined that the first positioning information exists; otherwise, it is determined that the first positioning information does not exist.

[0041] That is, after receiving the first network information sent by the first mobile device, the server parses the first network information to obtain the MAC address / base station identifier and signal strength. These parameters are compared one by one with the cached network information corresponding to each location cache data in the device location cache library. If there is a cached network information that matches the first network information, the cached location information in the location cache data corresponding to the cached network information can be used as the first location information of the first mobile device, and the existence of the first location information is determined. If no cached network information that matches the first network information can be found, it can be determined that the first location information does not exist in the device location cache library.

[0042] S103. When it is determined that the first positioning information does not exist in the device positioning cache, call an external positioning service based on the first network information to determine the first positioning information corresponding to the first mobile device, and determine a first heat value corresponding to the first positioning information based on a pre-built data heat algorithm.

[0043] Among them, external positioning services can refer to the paid service of calling the positioning service database provided by the positioning service provider. The positioning service database provided by the positioning service provider is similar in principle to the device positioning cache library. It contains a database of the precise locations of hundreds of millions or even billions of Wi-Fi hotspots and base stations. It is an extremely large and expensive project. It requires a lot of manpower and material resources for surveying and mapping, data collection, continuous updating and verification. It is difficult for other small-scale device manufacturers (especially watch manufacturers) to independently complete and maintain such a global database. In addition, having a database alone is not enough. How to accurately estimate the location based on the strength of multiple received signals, especially in complex signal environments (high-rise buildings, indoors), requires powerful algorithm capabilities. Service providers can continue to invest in research and development to optimize their positioning algorithms, but device manufacturers cannot achieve it.

[0044] The data heat algorithm calculates the heat value of positioning data. The heat value can be used to indicate the popularity of a location being hit again. Therefore, the positioning cache data in the device positioning cache can be updated based on the heat value of the positioning data, so that the device positioning cache always stores the most valuable cached positioning data.

[0045] For example, the algorithm parameters of the data heat algorithm include at least a time decay factor, which can affect the heat value of the cached data according to the time parameter. In order to better adapt to different usage scenarios, the time decay factor is divided into at least a high-frequency decay factor, a default decay factor, and a low-frequency decay factor.

[0046] Specifically, if it is determined that the first positioning information does not exist in the device positioning cache, an external positioning service is called to determine the first positioning information of the first mobile device. Simultaneously, a first popularity value of the first positioning information is calculated, and based on the first popularity value, a determination is made as to whether to store the first positioning information in the device positioning cache, thereby updating the device positioning cache.

[0047] Exemplarily, before determining the first popularity value corresponding to the first positioning information, the method further includes:

[0048] Determine whether the device positioning cache library is in a saturated state; when it is determined that the device positioning cache library is in a saturated state, determine a first heat value corresponding to the first positioning information; when it is determined that the device positioning cache library is in an unsaturated state, determine the first positioning information as positioning cache data, and store the positioning cache data in the device positioning cache library.

[0049] Before calculating the first heat value, it is possible to further determine whether the device positioning cache is in a saturated state, such as determining whether the number of positioning cache data in the device positioning cache has reached a set number. In an unsaturated state, there is no need to calculate the first heat value, and the relevant data of the first positioning information is directly determined as positioning cache data and stored in the device positioning cache. In a saturated state, it is necessary to calculate the first heat value corresponding to the first positioning information to determine whether to store the first positioning information in the device positioning cache.

[0050] S104: Update the positioning cache data in the device positioning cache library according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library.

[0051] Specifically, the first heat value corresponding to the first positioning information is compared with the cache heat value corresponding to each positioning cache data to determine whether to replace the positioning cache data with a lower cache heat value in the device positioning cache library according to the first positioning information, thereby updating the device positioning cache library.

[0052] Based on the above embodiments, the process of determining the heat value includes:

[0053] Determine the number of hits and the last hit time corresponding to the object to be calculated;

[0054] Determining a hit frequency of the object to be calculated based on the number of hits and a preset time period, and determining a target attenuation factor from the time attenuation factor based on the hit frequency, wherein the target attenuation factor is the high-frequency attenuation factor, the default attenuation factor, or the low-frequency attenuation factor, the high-frequency attenuation factor being greater than the default attenuation factor, and the default attenuation factor being greater than the low-frequency attenuation factor;

[0055] Based on the data heat algorithm, according to the number of hits, the last hit time and the target attenuation factor, the heat value corresponding to the object to be calculated is determined.

[0056] It should be noted that calculating the heat value is the core of the technical solution of the embodiments of the present invention. The object to be calculated can refer to the first positioning information or the cached positioning information. In other words, the heat value determination process for the first positioning information is the same as that for the cached positioning information. For example, the high-frequency attenuation factor can be 0.5, the default attenuation factor can be 0.3466, and the low-frequency attenuation factor can be 0.2.

[0057] Specifically, the number of hits and the last hit time of the object to be calculated are determined. If the object to be calculated is the first positioning information, the number of hits is 1, and the last hit time is the time when the first positioning information was determined. Based on the number of hits and a preset time period (e.g., 30 days), the hit frequency of the object to be calculated is determined.

[0058] Based on the hit frequency, a target attenuation factor is determined from the time attenuation factor. Specifically, the hit frequency is compared with a threshold rate. If the object to be calculated is cached positioning information and the hit frequency is greater than the threshold rate, the target attenuation factor uses a high-frequency attenuation factor. If the hit frequency is less than or equal to the threshold rate, the target attenuation factor uses a low-frequency attenuation factor. If the object to be calculated is the first positioning information, the target attenuation factor uses a default attenuation factor.

[0059] The number of hits, the last hit time and the target attenuation factor are substituted into the data heat algorithm to calculate the heat value corresponding to the object to be calculated.

[0060] Exemplarily, the data heat algorithm includes:

[0061] hot=round(hit_count*math.exp(-decay_factor*((current_time-last_hit_time) / 86400))*100,2);

[0062] Among them, hot represents the heat value, hit_count represents the number of hits, -decay_factor represents the time decay factor, current_time represents the current time (in seconds), and last_hit_time represents the last hit time (in seconds).

[0063] The formula achieves an exponential decay of popularity over time. The decay rate is controlled by the decay_factor, with newer hits contributing more to popularity. The decay_factor directly controls the decay rate: a larger decay_factor value results in a steeper exponential curve and faster popularity decay; conversely, a smaller decay_factor value results in a flatter exponential curve and slower popularity decay. The number of hits (hit_count) is multiplied by the exponential decay factor (e - decay_factor x time difference to the power of the time difference), where the time difference is converted to days. The result is then multiplied 100 times and rounded to two decimal places.

[0064] In the data heat algorithm, the time decay factor uses math.exp, which is the natural exponential function. The exponential part is the negative decay coefficient multiplied by the time difference divided by 86400 (the number of seconds in a day). Therefore, the time difference is the current time minus the time of the last click, and then converted into days. In addition, when the time difference is very large, the exponential part will approach 0, and the heat value will be very low, possibly close to 0. In this case, even if the hit_count is high, if there are no new clicks for too long, the heat will be very low, which is consistent with the characteristics of exponential decay.

[0065] The exponential part is simply the decay factor multiplied by the number of days. The hit_count is then multiplied by the result of this exponential function, multiplied by 100, and rounded to two decimal places. The multiplication by 100 amplifies the result so that the heat value is not too small, making it easier to display or compare.

[0066] The popularity value decays exponentially over time, with the decay rate controlled by decay_factor. This means that as time passes, the popularity contributed by each hit gradually decreases, with newer hits contributing more to the popularity. This means that newer hits have a greater impact on the current popularity value than older hits.

[0067] Figure 2 This is a schematic diagram of the effect of the time decay factor on the heat value provided by the first embodiment of the present invention. Figure 2 As shown, the 0-7 day period belongs to the rapid decay zone, and high-frequency access data maintains high popularity; the 7-15 day period belongs to the transitional decay zone, balancing the retention needs of new and old data; the 15-30 day period belongs to the slow decay zone, and long-tail data is slowly eliminated.

[0068] The technical solution of an embodiment of the present invention is to obtain the first network information of the first mobile device when it is determined that the first mobile device requests device positioning. Based on the first network information, it is determined whether the first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library. When it is determined that the first positioning information does not exist in the device positioning cache library, an external positioning service is called according to the first network information to determine the first positioning information corresponding to the first mobile device, and a first heat value corresponding to the first positioning information is determined according to a pre-built data heat algorithm. Based on the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library, the positioning cache data in the device positioning cache library is updated, which solves the problem that the existing cache mechanism lacks a reasonable elimination strategy. The present invention combines the heat value update mechanism to ensure that the cache library always stores more valuable data, avoids memory waste, improves the positioning cache data hit rate, and realizes a more efficient and stable positioning service.

[0069] Example 2

[0070] Figure 3 This is a flowchart of a device location cache update method provided by the second embodiment of the present invention. Based on the above embodiments, this embodiment further refines the update process of the location cache data in the device location cache library. Figure 3 As shown, the method includes:

[0071] S201: When it is determined that a first mobile device requests device positioning, obtain first network information of the first mobile device.

[0072] S202: Determine, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library.

[0073] S203. When it is determined that the first positioning information does not exist in the device positioning cache, call an external positioning service based on the first network information to determine the first positioning information corresponding to the first mobile device, and determine a first heat value corresponding to the first positioning information based on a pre-built data heat algorithm.

[0074] S204: Compare the cache heat value with the first heat value to determine a first located cache in the located cache data whose cache heat value is smaller than the first heat value.

[0075] The first positioning cache may refer to positioning cache data having a cache heat value less than a first heat value.

[0076] Specifically, each cache heat value is compared with the first heat value one by one, and a first positioning cache having a cache heat value smaller than the first heat value is screened out from the positioning cache data.

[0077] S105: Eliminate the first positioning cache, build a new target positioning cache according to the first positioning information and the first network information, and store the target positioning cache in the device positioning cache library.

[0078] Specifically, the first positioning cache is deleted, and the first positioning information and the first network information are constructed into a new target positioning cache, and the target positioning cache is stored in the device positioning cache library to update the positioning cache data in the device positioning cache library.

[0079] Exemplarily, the method further includes: when there are multiple first positioning caches, determining a second positioning cache having a minimum cache heat value in the first positioning cache, and removing the second positioning cache.

[0080] In fact, there may be multiple first positioning caches. If there are multiple first positioning caches, the second positioning cache with the smallest cache heat value in the first positioning cache is determined and the second positioning cache is eliminated to ensure the maximum utilization of the device positioning cache library.

[0081] The technical solution of the embodiment of the present invention compares the cache heat value with the first heat value to determine the first positioning cache in the positioning cache data whose cache heat value is less than the first heat value; then eliminates the first positioning cache, constructs a new target positioning cache based on the first positioning information and the first network information, and stores the target positioning cache in the device positioning cache library. Through real-time heat comparison and targeted elimination, "intelligent self-purification" of cached data is achieved, ensuring that the stored content always meets current business needs, thereby achieving an optimal balance between resource consumption, response speed, and scenario adaptability.

[0082] Example 3

[0083] Figure 4 This is a schematic diagram of the structure of a device location cache update device provided by the third embodiment of the present invention. Figure 4 As shown, the device includes:

[0084] A network information acquisition module 301 is configured to acquire first network information of the first mobile device when it is determined that the first mobile device requests device positioning, wherein the first network information includes at least Wi-Fi network information and mobile network information;

[0085] a network information comparison module 302 configured to determine, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library, wherein the device positioning cache library includes at least cached positioning information and cached network information corresponding to each piece of positioning cache data;

[0086] The heat value calculation module 303 is configured to, when it is determined that the first positioning information does not exist in the device positioning cache, call an external positioning service based on the first network information to determine the first positioning information corresponding to the first mobile device, and determine the first heat value corresponding to the first positioning information based on a pre-built data heat algorithm, wherein the algorithm parameters of the data heat algorithm include at least a time attenuation factor, and the time attenuation factor includes at least a high-frequency attenuation factor, a default attenuation factor, and a low-frequency attenuation factor;

[0087] The positioning cache update module 304 is configured to update the positioning cache data in the device positioning cache according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache.

[0088] The technical solution of an embodiment of the present invention is to obtain the first network information of the first mobile device when it is determined that the first mobile device requests device positioning. Based on the first network information, it is determined whether the first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library. When it is determined that the first positioning information does not exist in the device positioning cache library, an external positioning service is called according to the first network information to determine the first positioning information corresponding to the first mobile device, and a first heat value corresponding to the first positioning information is determined according to a pre-built data heat algorithm. Based on the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library, the positioning cache data in the device positioning cache library is updated, which solves the problem that the existing cache mechanism lacks a reasonable elimination strategy. The present invention combines the heat value update mechanism to ensure that the cache library always stores more valuable data, avoids memory waste, improves the positioning cache data hit rate, and realizes a more efficient and stable positioning service.

[0089] Optionally, the heat value calculation module 303 may also be used to:

[0090] Determining the number of hits and the last hit time corresponding to the object to be calculated, wherein the object to be calculated includes the first positioning information and the cache positioning information;

[0091] Determining a hit frequency of the object to be calculated based on the number of hits and a preset time period, and determining a target attenuation factor from the time attenuation factor based on the hit frequency, wherein the target attenuation factor is the high-frequency attenuation factor, the default attenuation factor, or the low-frequency attenuation factor, the high-frequency attenuation factor being greater than the default attenuation factor, and the default attenuation factor being greater than the low-frequency attenuation factor;

[0092] Based on the data heat algorithm, according to the number of hits, the last hit time and the target attenuation factor, the heat value corresponding to the object to be calculated is determined.

[0093] Optionally, the data heat algorithm includes:

[0094] hot=round(hit_count*math.exp(-decay_factor*((current_time-last_hit_time) / 86400))*100,2);

[0095] Among them, hot represents the heat value, hit_count represents the number of hits, -decay_factor represents the time decay factor, current_time represents the current time, and last_hit_time represents the last hit time.

[0096] Optionally, the location cache update module 304 is specifically configured to:

[0097] Comparing the cache heat value with the first heat value, and determining a first locating cache in the locating cache data whose cache heat value is less than the first heat value;

[0098] The first positioning cache is deleted, and a new target positioning cache is constructed according to the first positioning information and the first network information, and the target positioning cache is stored in the device positioning cache library.

[0099] Optionally, the location cache update module 304 may also be specifically configured to:

[0100] In the case that there are multiple first positioning caches, a second positioning cache having the smallest cache heat value in the first positioning caches is determined, and the second positioning cache is eliminated.

[0101] Optionally, the network information comparison module 302 is specifically configured to:

[0102] Comparing the first network information with the cached network information corresponding to each positioning cache data in the device positioning cache library;

[0103] If the cached network information of the existing location cache data matches the first network information, determining the cached location information corresponding to the location cache data as the first location information corresponding to the first mobile device, and determining that the first location information exists;

[0104] Otherwise, it is determined that the first positioning information does not exist.

[0105] Optionally, the heat value calculation module 303 is specifically used to:

[0106] Before determining the first heat value corresponding to the first positioning information, determining whether the device positioning cache is in a saturated state;

[0107] When it is determined that the device positioning cache is in a saturated state, determining a first heat value corresponding to the first positioning information;

[0108] When it is determined that the device positioning cache is in an unsaturated state, the first positioning information is determined as positioning cache data, and the positioning cache data is stored in the device positioning cache.

[0109] The device location cache updating apparatus provided in the embodiment of the present invention can execute the device location cache updating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0110] Example 4

[0111] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0112] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0113] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0114] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the device location cache update method.

[0115] In some embodiments, the device location cache update method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the device location cache update method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the device location cache update method in any other appropriate manner (e.g., by means of firmware).

[0116] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0117] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0118] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0119] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0120] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0121] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0122] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0123] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A device location cache update method, characterized in that: include: When it is determined that the first mobile device requests device positioning, obtaining first network information of the first mobile device, wherein the first network information includes at least Wi-Fi network information and mobile network information; Determining, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library, wherein the device positioning cache library at least includes cached positioning information and cached network information corresponding to each piece of positioning cache data; In a case where it is determined that the first positioning information does not exist in the device positioning cache, calling an external positioning service according to the first network information to determine the first positioning information corresponding to the first mobile device, and determining a first heat value corresponding to the first positioning information according to a pre-built data heat algorithm, wherein the algorithm parameters of the data heat algorithm include at least a time attenuation factor, and the time attenuation factor includes at least a high-frequency attenuation factor, a default attenuation factor, and a low-frequency attenuation factor; The positioning cache data in the device positioning cache library is updated according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library.

2. The device location cache update method according to claim 1, characterized in that: The process of determining the heat value includes: Determining the number of hits and the last hit time corresponding to the object to be calculated, wherein the object to be calculated includes the first positioning information and the cache positioning information; Determining a hit frequency of the object to be calculated based on the number of hits and a preset time period, and determining a target attenuation factor from the time attenuation factor based on the hit frequency, wherein the target attenuation factor is the high-frequency attenuation factor, the default attenuation factor, or the low-frequency attenuation factor, the high-frequency attenuation factor being greater than the default attenuation factor, and the default attenuation factor being greater than the low-frequency attenuation factor; Based on the data heat algorithm, according to the number of hits, the last hit time and the target attenuation factor, the heat value corresponding to the object to be calculated is determined.

3. The device location cache update method according to claim 1 or 2, characterized in that: The data heat algorithm includes: hot=round(hit_count*math.exp(-decay_factor*((current_time-last_hit_time) / 86400))*100,2); Among them, hot represents the heat value, hit_count represents the number of hits, -decay_factor represents the time decay factor, current_time represents the current time, and last_hit_time represents the last hit time.

4. The device location cache update method according to claim 1, characterized in that: The updating process of the positioning cache data in the device positioning cache library according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library includes: Comparing the cache heat value with the first heat value, and determining a first locating cache in the locating cache data whose cache heat value is less than the first heat value; The first positioning cache is deleted, and a new target positioning cache is constructed according to the first positioning information and the first network information, and the target positioning cache is stored in the device positioning cache library.

5. The device location cache update method according to claim 4, characterized in that: The method further comprises: In the case that there are multiple first positioning caches, a second positioning cache having the smallest cache heat value in the first positioning caches is determined, and the second positioning cache is eliminated.

6. The device location cache update method according to claim 1, characterized in that: The determining, based on the first network information, whether the first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library includes: Comparing the first network information with the cached network information corresponding to each positioning cache data in the device positioning cache library; If the cached network information of the existing location cache data matches the first network information, determining the cached location information corresponding to the location cache data as the first location information corresponding to the first mobile device, and determining that the first location information exists; Otherwise, it is determined that the first positioning information does not exist.

7. The device location cache update method according to claim 1, characterized in that: Before determining the first popularity value corresponding to the first positioning information, the method further includes: Determining whether the device positioning cache is in a saturated state; When it is determined that the device positioning cache is in a saturated state, determining a first heat value corresponding to the first positioning information; When it is determined that the device positioning cache is in an unsaturated state, the first positioning information is determined as positioning cache data, and the positioning cache data is stored in the device positioning cache.

8. A device location cache update device, characterized in that: include: a network information acquisition module, configured to acquire first network information of the first mobile device when it is determined that the first mobile device requests device positioning, wherein the first network information includes at least Wi-Fi network information and mobile network information; a network information comparison module, configured to determine, based on the first network information, whether first positioning information corresponding to the first mobile device exists in a pre-built device positioning cache library, wherein the device positioning cache library includes at least cached positioning information and cached network information corresponding to each piece of positioning cache data; a heat value calculation module, configured to, upon determining that the first positioning information does not exist in the device positioning cache, call an external positioning service based on the first network information to determine the first positioning information corresponding to the first mobile device, and determine a first heat value corresponding to the first positioning information based on a pre-established data heat algorithm, wherein the algorithm parameters of the data heat algorithm include at least a time attenuation factor, and the time attenuation factor includes at least a high-frequency attenuation factor, a default attenuation factor, and a low-frequency attenuation factor; The positioning cache update module is used to update the positioning cache data in the device positioning cache library according to the first heat value corresponding to the first positioning information and the cache heat value corresponding to each positioning cache data in the device positioning cache library.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the device location cache updating method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the device location cache updating method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Positioning database management applied to server-based positioning system

    CN104349275A

  • Data caching method and device

    CN109582233A

  • Cache data processing method and device, computer storage medium and electronic equipment

    CN110837480A

  • Method and equipment for positioning wearable mobile terminal

    CN113079458A