Recommendation information processing method, recommendation method, computing device, and readable storage medium
By constructing a city information table and a service node table, a table of missing city brands is generated. The target service node is then queried using a cached database, solving the real-time computing performance problem of traditional recommendation systems and achieving efficient and accurate recommendation information processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CHESHANGHUI SOFTWARE
- Filing Date
- 2023-09-26
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional location-based recommendation systems require real-time calculation of user location, leading to performance issues and excessive data processing, especially impacting performance during large-scale searches.
Construct a city information table and a service node information table, generate a table of missing city brands, determine the target service node by the distance between the city center and the service node, and use a cached database to store and query the target service node to avoid real-time calculation.
It reduces reliance on server computing resources, improves recommendation speed and accuracy, simplifies cache update steps, and reduces performance requirements.
Smart Images

Figure CN117216422B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the Internet field, and more particularly to a method, computing device, and readable storage medium for processing recommendation information. Background Technology
[0002] Location-based recommendation services are emerging in large numbers, such as recommendation systems for nearby restaurants, nearby businesses, and nearby people. These systems all obtain the user's current location information, set a search radius centered on the user's current location, and generate a circular query range. Based on the distance between the user's current location and the location of the business, they recommend businesses in the user's city. If there are no businesses in the user's city that the user needs, the search radius is expanded, still based on the user's real-time location, to search in other cities outside the user's city.
[0003] Traditional recommendation systems require real-time recommendations based on user location. Real-time recommendation methods typically extend data processing time, degrade interface performance, and necessitate setting a search radius during the recommendation process. When the search radius is set to a large value, while it may match potential target merchants, it may also hit all merchant data within a large geographical area, leading to significant performance issues. Summary of the Invention
[0004] Therefore, the present invention provides a recommendation information processing method, a computing device, and a readable storage medium in an attempt to solve or at least alleviate the problems mentioned above.
[0005] According to one aspect of the present invention, a recommendation information processing method is provided, suitable for execution in a computing device, comprising: constructing a city information table and a service node information table, wherein the city information table is suitable for storing the association between city identifiers and the geographical locations of city centers, and the service node information table is suitable for storing the association between service node identifiers, the city identifiers where the service nodes are located, the brand identifiers served by the service nodes, and the geographical locations of the service nodes; generating a city missing brand table based on the city information table and the service node information table, wherein the city missing brand table is suitable for storing the association between city identifiers and missing brands, wherein if there is no service node serving a certain brand in a certain city, then that brand is a missing brand in that city; for any city identifier and associated missing brand in the city missing brand table, based on the distance between the city center and the service node, determining service nodes in other cities serving the missing brand from the service node information table as target service nodes; and storing the city identifier, the missing brand, and the target service node in association in a cache database, so that when a service node for the target brand cannot be obtained from the user's city based on the distance between the user and the service node, the target service node is retrieved from the cache database and recommended to the user.
[0006] Optionally, according to the recommended information processing method of the present invention, generating a city missing brand table based on a city information table and a service node information table includes: summarizing the brand identifiers appearing in the service node information table to generate a brand set; for any brand in the brand set, performing statistics based on the service node information table to generate a first city set corresponding to the brand, where each city in the first city set has a service node serving the brand; comparing the city information table with the first city set corresponding to the brand to obtain a second city set corresponding to the brand, where each city in the second city set does not have a service node serving the brand; and adding the city identifiers in the second city set associated with the corresponding brand identifiers to the city missing brand table.
[0007] Optionally, according to the recommended information processing method of the present invention, the geographical location includes geographical coordinates and corresponding block codes.
[0008] Optionally, according to the recommended information processing method of the present invention, the block code is calculated as follows: the geographic coordinates are converted into binary code; the binary code is Base32 encoded to generate the corresponding block code.
[0009] Optionally, according to the recommended information processing method of the present invention, the block encoding is a GeoHash code.
[0010] Optionally, according to the recommended information processing method of the present invention, the step of determining service nodes in other cities serving the missing brand from the service node information table based on the distance between the city center and the service node, as target service nodes, includes: taking the block where the city center is located as the central block, determining a plurality of adjacent blocks adjacent to the central block as a first-level search area; searching for target service nodes serving the missing brand from the first-level search area according to the service node information table; when the number of target service nodes found in the first-level search area does not reach a predetermined number, expanding the search range layer by layer until the number of target service nodes found reaches the predetermined number.
[0011] Optionally, the recommended information processing method according to the present invention further includes: calculating the distance between the city center and the target service node based on geographical coordinates, and selecting a predetermined number of target service nodes as the final target service nodes in ascending order of distance.
[0012] Optionally, the recommendation information processing method according to the present invention further includes: when a new service node is added, adding an entry corresponding to the new service node to the service node information table; when the new service node is located in a city where the brand corresponding to the new service node is missing, deleting the cache data of the city in the cache database corresponding to the brand served by the new service node, and updating the entry corresponding to the city in the city missing brand table.
[0013] Optionally, the recommendation information processing method according to the present invention further includes: when the newly added service node is not located in a city where the brand corresponding to the newly added service node is missing, determining whether it is necessary to use the newly added service node to replace the target node in the city where the brand corresponding to the newly added service node is missing; if the distance between the newly added service node and the city where the brand corresponding to the newly added service node is missing is less than the target node with the largest distance from the city, then the newly added service node is used to replace the target node with the largest distance from the city; and storing the missing brand corresponding to the newly added service node, the newly added service node, and the city identifier of the city where the brand corresponding to the newly added service node is missing in association in a cache database to update the cache database cache.
[0014] Optionally, the recommended information processing method according to the present invention further includes: when a service node is deleted, deleting the entry corresponding to the service node from the service node information table; determining, based on the service node information table, whether there are other service nodes in the city where the deleted service node is located that serve the same brand as the deleted service node; if not, adding the city identifier of the city where the deleted service node is located and the brand identifier corresponding to the service node to the city missing brand table; based on the distance between the city where the deleted service node is located and other service nodes in other cities that serve the same brand as the deleted service node, obtaining a predetermined number of other service nodes in other cities serving the deleted brand from the service node information table; and storing the city identifier of the city where the deleted service node is located, the deleted brand, and the obtained other service nodes in other cities serving the deleted brand in association in a cache database.
[0015] Optionally, the recommendation information processing method according to the present invention further includes: determining whether the deleted service node is the target service node; if it is the target service node, then based on the distance between the city where the deleted service node is located and other service nodes serving the same brand as the deleted service node, determining service nodes in other cities serving the deleted brand with the same number of deleted service nodes from the service node information table as supplementary nodes; and storing the city identifier of the city where the deleted service node is located, the deleted brand, and the supplementary nodes in association in a cache database.
[0016] Optionally, according to the recommended information processing method of the present invention, the cache database is a Redis cache database, and the data in the cache database is stored in an hset structure.
[0017] Optionally, according to the recommendation information processing method of the present invention, the data in the cache database is stored in an hset structure, including: storing the city identifier as the key, the missing brand as the field field, and the target service node as the field value in association.
[0018] According to one aspect of the present invention, a target recommendation method is provided, further comprising: when a service node is deleted, deleting the entry corresponding to the service node from the service node information table; determining, based on the service node information table, whether there are other service nodes in the city where the deleted service node is located that serve the same brand as the deleted service node; if not, adding the city identifier of the city where the deleted service node is located and the brand identifier corresponding to the service node to the city missing brand table; based on the distance between the city where the deleted service node is located and other service nodes in other cities that serve the same brand as the deleted service node, obtaining a predetermined number of other service nodes in other cities serving the deleted brand from the service node information table; and storing the city identifier of the city where the deleted service node is located, the deleted brand, and the obtained other service nodes in other cities serving the deleted brand in association in a cache database.
[0019] Optionally, the target recommendation method according to the present invention further includes: determining whether the deleted service node is the target service node; if it is the target service node, then based on the distance between the city where the deleted service node is located and other service nodes serving the same brand as the deleted service node, determining service nodes in other cities serving the deleted brand with the same number of deleted service nodes from the service node information table as supplementary nodes; and storing the city identifier of the city where the deleted service node is located, the deleted brand, and the supplementary node in association in a cache database.
[0020] Optionally, according to the target recommendation method of the present invention, the cache database is a Redis cache database, and the data in the cache database is stored in an hset structure.
[0021] Optionally, according to the target recommendation method of the present invention, the data in the cache database is stored in an hset structure, including: storing the city identifier as the key, the missing brand as the field field, and the target service node as the field value, and storing the three in association.
[0022] According to another aspect of the present invention, a recommendation method is provided, executed in a computing device, the method comprising: searching for service nodes corresponding to the target brand in the user's city based on the distance between the user's location and the service node corresponding to the target brand, and selecting these as target service nodes; when no target service node can be found in the user's city, searching for and obtaining a predetermined number of target service nodes from a cache database generated in any of the above-described recommendation information processing methods, based on the city identifier of the user's city and the brand identifier of the target brand; and recommending the found target service nodes to the user.
[0023] According to another aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the methods described above.
[0024] According to another aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the method described above.
[0025] According to the recommendation information processing method provided by this invention, a city information table and a service node information table are constructed. Based on the city information table and the service node information table, a city missing brand table is generated. For any city identifier and associated missing brand in the city missing brand table, based on the distance between the city center and the service node, service nodes in other cities serving that missing brand are determined from the service node information table as target service nodes, so as to recommend target service nodes to users. Obtaining the corresponding target service node based on the distance between the city and the service node does not require real-time calculation; it only requires requesting resources from the database during recommendation, reducing the dependence on server computing resources. The recommendation speed for recommending target service nodes to users is relatively high. Furthermore, since the location of the city does not change, using the city location instead of the user's real-time location for target service node recommendation does not require real-time calculation, thus enabling offline execution.
[0026] Furthermore, taking the city center as the central block, several adjacent blocks are identified as the first-level search area. Based on the service node information table, the target service nodes serving the missing brand are searched within this first-level search area. If the number of target service nodes found in the first-level search area does not reach a predetermined number, the search range is expanded layer by layer until the predetermined number of target service nodes is found. Expanding the search range layer by layer does not require pre-setting the query radius. The search range expansion stops when the preset number of target service nodes are found, preventing the search from hitting too many non-target service node data, reducing performance requirements during execution, and improving query speed.
[0027] In addition, when service nodes are added or deleted, only the data related to the changed service nodes is recalculated, and the recalculated data is updated differentially, so that the recommendation results obtained by users can change in real time, improving the accuracy of recommendations. Moreover, there is no need to recalculate the entire cached data, simplifying the cache update steps and improving performance.
[0028] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0029] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0030] Figure 1 A schematic diagram of a recommendation information processing system 100 according to an embodiment of the present invention is shown;
[0031] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown;
[0032] Figure 3 A flowchart of a recommendation information processing method 300 according to an embodiment of the present invention is shown;
[0033] Figure 4 A city-service node relationship diagram according to an embodiment of the present invention is shown;
[0034] Figure 5 A flowchart of a target service node query according to an embodiment of the present invention is shown;
[0035] Figure 6 A flowchart of a target recommendation method 400 according to an embodiment of the present invention is shown. Detailed Implementation
[0036] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0037] Figure 1 A schematic diagram of a recommendation information processing system 100 according to an embodiment of the present invention is shown. For example... Figure 1 As shown, system 100 includes one or more clients 110 (three are shown in the figure), a data storage device 120, and a server 200. The clients communicate with the server 200 via the Internet.
[0038] Client 110 refers to the terminal device used by the user, which can be a personal computer such as a desktop computer or laptop, or a mobile phone, tablet computer, multimedia device, smart wearable device, etc., but is not limited to these. Server 200 is used to provide services to client 110, and can be implemented as an application server, web server, etc.; it can also be implemented as a computing device such as a desktop computer, laptop computer, processor chip, mobile phone, tablet computer, etc., but is not limited to these.
[0039] Client 110 can access the network address of the recommendation information page of server 200. Server 200 returns the recommendation information page, which includes a search bar and nearby service nodes randomly recommended based on the client's current location. Client 110 receives the recommendation information page, and the user can view nearby service nodes on the recommendation information page, or use the search bar to search for service nodes corresponding to the target brand, so as to recommend service nodes corresponding to the target brand to the user.
[0040] The server 200 is also communicatively connected to the data storage device 120. The data storage device 120 can be integrated within the server or deployed independently within the system and communicatively connected to the server 200. The data storage device is suitable for storing the association between city identifiers, missing brands, and target service nodes. The data storage device 120 can be configured as a non-relational database such as Redis, where the dataset is stored in an hset structure. Based on the target brand and current location input by the user, the server 200 can determine the target service nodes to recommend to the user and then recommend the target service nodes to the user.
[0041] Client 110 can display the recommendation information page shown to the user by service point 200, and then select a recommended service node on the recommendation page, or enter a target brand in the search box, and send the entered target brand and the user's location to server 200. Server 200 receives the target brand and user's location entered by the user, determines the user's city based on the user's location, and if there is no service node corresponding to the target brand in the user's city, it will query the database based on the target brand and the user's city to obtain a predetermined number of target service nodes, and finally recommend the target service nodes to the user.
[0042] This invention also provides a method for processing recommendation information, which is executed on a server 200 provided in this invention. The server 200 can be implemented as a computing device 200 as described below.
[0043] Figure 2 A structural diagram of a computing device 200 according to an embodiment of the present invention is shown. Figure 2 As shown, in the basic configuration 202, the computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 can be used for communication between the processors 204 and the system memory 206.
[0044] Depending on the desired configuration, processor 204 can be any type of processor, including but not limited to: microprocessor (μP), microcontroller (μC), digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache such as L1 cache 210 and L2 cache 212, processor core 214, and registers 216. Example processor core 214 may include an arithmetic logic unit (ALU), floating-point unit (FPU), digital signal processing core (DSP core), or any combination thereof. Example memory controller 218 may be used with processor 204, or in some implementations, memory controller 218 may be an internal part of processor 204.
[0045] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 may include operating system 220, one or more applications 222, and program data 224. Application 222 is actually a set of program instructions that instruct processor 204 to perform corresponding operations. In some embodiments, application 222 may be arranged to cause processor 204 to operate using program data 224 on the operating system.
[0046] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via a bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via a network communication link through one or more communication ports 264.
[0047] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or whose modifications, can be encoded with information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.
[0048] The computing device 200 can be implemented as a personal computer, including desktop and laptop computers, or as a server, such as a file server, database server, application server, and web server. Of course, the computing device 200 can also be part of a small portable (or mobile) electronic device. In an embodiment of the invention, the server-side computing device 200 is configured to execute the recommended information processing method 300 according to the invention. The application 222 of the computing device 200 includes multiple program instructions for executing the method 300 according to the invention.
[0049] Figure 3 A flowchart of a recommendation information processing method 300 according to an embodiment of the present invention is shown. Method 300 is adapted to be executed in a computing device, for example, in... Figure 1 The server 200 shown is executed. The data storage device 120 can be integrated into the server 200 or configured independently in the system and communicate with the server 200.
[0050] like Figure 3 As shown, method 300 begins with step S310, which constructs a city information table and a service node information table.
[0051] The city information table is suitable for storing the relationship between city identifiers and the geographical location of city centers. That is, the city information table includes multiple entries, each of which can include two fields: city identifier and the geographical location of the city center. The service node information table is suitable for storing the relationship between service node identifiers, the city identifier where the service node is located, the brand identifier served by the service node, and the geographical location of the service node. That is, the service node information table includes multiple entries, each of which can include five fields: service brand name, service node identifier, service brand identifier, city identifier of the city where the service node is located, and the geographical location of the service node. The geographical location can be geographic coordinates, the block code corresponding to the geographic coordinates, or both geographic coordinates and their corresponding block codes.
[0052] Here, the geographic coordinates of the city center and the geographic coordinates of the service nodes represent the latitude and longitude of the city center and the service nodes, respectively. The city center can be the administrative center of the city, or it can be the geometric center of a polygon after the city is fitted into a polygonal shape.
[0053] According to one embodiment of the present invention, the service node information table includes a service node identifier, a city identifier where the service node is located, a brand identifier served by the service node, a brand name served by the service node, the geographical coordinates of the service node, and the block code of the service node. The service node information table is shown below:
[0054]
[0055] Table 1
[0056] The city information table includes the city name, city identifier, city center geographic coordinates, and city block code, as shown below:
[0057] cityName cityId latlng geoHash City A 130500 114.746,40.293 wx1t City B 210800 118.030,40.728 wx5z City C 110100 116.411,39.925 wx4g
[0058] Table 2
[0059] In step S310, it is necessary to calculate the block code of the city and the block code of the service node, i.e., the GeoHash code. One way to calculate the block code is to convert the geographic coordinates into binary code, then encode the binary code into Base32, and use the Base32 encoded data as the block code corresponding to the geographic coordinates. Here, the block code of the city corresponds to the geographic coordinates of the city center, and the block code of the service node corresponds to the geographic coordinates of the service node.
[0060] According to one embodiment of the present invention, the GeoHash algorithm is used to calculate the block code of a city and the block code of a service node. GeoHash is an algorithm that converts two-dimensional latitude and longitude into strings, where each string represents the location area at that latitude and longitude. The Earth's plane is divided into regions proportionally and evenly, with latitude and longitude within the same region corresponding to the same string. The smaller the divided region, the greater the precision and the longer the GeoHash string.
[0061] Obtain the latitude and longitude of the city center and service nodes, and then convert these coordinates into binary code. One implementation method for converting latitude and longitude to binary code is as follows, and a latitude-longitude binary conversion table is constructed, as shown in Table 3:
[0062]
[0063] Table 3
[0064] As shown in Table 3, taking the conversion of latitude to binary encoding as an example, the multiple latitude ranges can be subdivided into (-90, 90), (0.0, 90), and (0.0, 45.0) in sequence. Each latitude range is divided into two interval sets, a first and a second. The location of the latitude in the first interval set is recorded as 0, and the location in the second interval set is recorded as 1. The first interval set can be subdivided into (-90, 0.0) and (0.0, 45.0) in sequence, and the second interval set can be subdivided into (0.0, 90) and (45.0, 90) in sequence.
[0065] Taking a location with latitude and longitude of [104.059684, 30.559545] as an example, the latitude of this location is 30.559545, which falls within the interval (0.0, 90). Therefore, the first bit is encoded as 1, which falls within the interval (0.0, 45.0). The second bit is encoded as 0, and so on, to obtain the binary code of the latitude of this location. The binary code of the longitude of the same location can be obtained in the same way, which will not be elaborated further.
[0066] After obtaining the binary codes for the longitude and latitude of a location with coordinates [104.059684, 30.559545], the binary codes for longitude and latitude are merged, starting from 0. Longitude occupies even-numbered positions, and latitude occupies odd-numbered positions. Here, 0 is recorded as an even number. This process yields the binary codes for the geographic coordinates of the city center or service node. See the table below:
[0067] Serial Number 0 1 2 3 4 5 6 7 8 9 10 11 … coding 1 1 1 0 0 1 0 0 1 1 0 0 …
[0068] Table 4
[0069] Next, according to the second preset rule, the binary encoding is converted into Base32 encoding, and this encoding is used as the block encoding. The second preset rule is: divide the code into 6 groups of 5 bits each, and calculate the corresponding decimal value for each group. That is, every 5 bits yields a number from 0 to 31, resulting in 6 numbers in the range 0 to 31. The resulting numbers are then converted to be represented using the 32 letters 0-9 and bz (excluding a, i, l, o). See the table below:
[0070] 11100 10011 00011 11011 28(w) 19(m) 3(3) 27(v)
[0071] Table 5
[0072] The final latitude and longitude coordinates of the location [104.059684, 30.559545] are encoded as wm3v.
[0073] Proceed to step S320. In step S320, a table of missing city brands is generated based on the city information table and the service node information table.
[0074] This missing brand table is suitable for storing the association between city identifiers and missing brands. That is, the missing brand table can include two fields: city identifier and brand identifier of the missing brand in the city. If there is no service node in a city that serves a certain brand, then the brand served by that service node is the missing brand of that city.
[0075] Specifically, the brand identifiers appearing in the service node information table are aggregated to generate a brand set. For any brand in the brand set, statistics are performed based on the service node information table to generate a first set of cities corresponding to that brand. Each city in the first set of cities has service nodes serving that brand. By comparing the city information table with the first set of cities corresponding to the brand, a second set of cities corresponding to that brand is obtained. Each city in the second set of cities does not have service nodes serving that brand. The city identifiers in the second set that are associated with the corresponding brand identifiers are added to the city missing brand table. The city missing brand table is shown below:
[0076] cityName cityId brandId exist City A 130500 1 (Audi) 1 City A 130500 2 (Mercedes-Benz) 1 City A 130500 3 (BMW) 0 City B 210800 1 (Audi) 1 City B 210800 2 (Mercedes-Benz) 1 City B 210800 3 (BMW) 0 City C 110100 1 (Audi) 0 City C 110100 2 (Mercedes-Benz) 0 City C 110100 3 (BMW) 1
[0077] Table 6
[0078] To facilitate understanding, a distribution map of service nodes corresponding to the three brands Audi, BMW, and Mercedes-Benz in cities A, B, and C was constructed. Figure 4 A city-service node relationship diagram according to an embodiment of the present invention is shown. As shown in the diagram, city A has two brand service nodes: Audi and Mercedes-Benz, with two Audi service nodes and one Mercedes-Benz service node. City B has two Mercedes-Benz service nodes and one Audi service node, while city C has three BMW service nodes. Therefore, city A lacks a BMW service node, city B also lacks a BMW service node, and city C lacks both Audi and Mercedes-Benz service nodes.
[0079] Proceed to step S330. For any city identifier and associated missing brand in the city missing brand table, based on the distance between the city center and the service node, determine the service nodes in other cities that serve the missing brand from the service node information table, and use them as the target service nodes.
[0080] Based on the distance between the city center and the service node, the process of determining the service nodes in other cities that serve the missing brand from the service node information table can be as follows: taking the block where the city center is located as the central block, determining multiple adjacent blocks adjacent to the central block as the first-level search area, searching for the target service node serving the missing brand from the first-level search area according to the service node information table, and expanding the search range layer by layer until the number of target service nodes found reaches the predetermined number.
[0081] Next, the distance between the city center and the target service nodes is calculated based on geographic coordinates. Then, a predetermined number of target service nodes are selected as the final target service nodes, ordered from smallest to largest distance. For example, if 6 target service nodes are found, but only 5 are needed, then the 5 target service nodes with the smallest distance from the city center are selected as the final target service nodes. The final target service node data is as follows:
[0082] City brand Recommended additional dealerName and dealerId 130500 (City A) 3 (BMW) BMW BM1(7)\BMW BM2(8) 210800 (City B) 3 (BMW) BMW BM1(7)\BMW BM3(9) 110100 (City C) 1 (Audi) Audi AD1(1)\Audi AD2(2) 110100 (City C) 2 (Mercedes-Benz) Mercedes-Benz BZ1(4)\Mercedes-Benz BZ3(6)
[0083] Table 7
[0084] According to one embodiment of the present invention, taking a location with latitude and longitude of [104.059684, 30.559545] as an example, eight adjacent blocks can be deduced from this location, and the deduction method is as follows.
[0085] lat+1,lon-1 lat+1,lon lat+1,lon+1 lat,lon-1 lat,lon lat,lon+1 lat-1,lon-1 lat-1,lon lat-1,lon+1
[0086] Table 8
[0087] In Table 8, lat represents latitude, lon represents longitude, and the middle cell (lat, lon) represents the location corresponding to the latitude and longitude code wm3v. The other eight cells represent adjacent areas. In the table, lat+1 means latitude plus one, and lon+1 means longitude plus one, thus obtaining the block codes of eight adjacent blocks, as shown in the table below:
[0088] wm3w wm3y wm6n wm3t wm3v wm6j wm3s wm3u wm6h
[0089] Table 9
[0090] This allows us to deduce the area surrounding each block, and then gradually expand the range of adjacent blocks outwards using this method. Taking the block with block code wm3w in the search area of this layer as an example, it can be seen that the block where this location is located is contained within wm3, and further contained within wm and w. Therefore, the block code of the service node in this block can be wm3wo or wm3w9, etc.
[0091] This method of gradually expanding the search area to find target nodes differs from conventional search methods, which require setting a search radius. This avoids the problem of affecting the performance of computing devices due to an excessively large search radius, and enables more efficient search for target nodes.
[0092] In another embodiment of the present invention, a flowchart for finding the target service node is constructed, such as... Figure 5As shown. First, determine the brand of the service node to be recommended and the city where the brand is missing. Starting from x=1, calculate the block code of each block in the adjacent area of the xth layer. In the search area of the xth layer, find the service node whose block code is the same as the block code of the block in the query area, or whose block code is contained in the block code of the block in the query area (if the block code of the block is wm3w, then wm3w9 is contained in the wm3w block). Find n target service nodes, then determine whether n has reached the preset number m. If not, then x+1 expands the search area by one layer. If it has reached the preset number m, calculate the distance between the city center and the target service node and sort them according to the distance. Next, determine whether the number of service nodes n found is greater than the preset number m. If so, only the m target service nodes with the smallest distance between the target service node and the city center are selected as the final target service nodes.
[0093] In S340, city identifiers, missing brands, and target service nodes are associated and stored in a cache database. This allows the target service node to be retrieved from the cache database and recommended to the user when a service node for the target brand cannot be obtained from the user's city based on the distance between the user and the service node.
[0094] The database used for storage in this invention is a Redis cache database, with city identifier as the data key, missing brand as the field field, and target service node as the field value, and is used for associated storage. This data structure is an hset structure.
[0095] Based on the distance between the city and the service node, the corresponding target service node is obtained. There is no need to perform real-time calculation based on the user's current location. Resources only need to be requested from the database during recommendation, which reduces the dependence on server computing resources. The recommendation speed of recommending target service nodes to users is relatively high. Furthermore, since the location of the city does not change, using the city location instead of the user's real-time location for recommending target service nodes does not require real-time calculation, thus enabling offline execution.
[0096] In practical applications, service nodes are typically added or deleted. When a new service node is added, an entry corresponding to the new service node is added to the service node information table. It is then determined whether the new service node is located in a city where the brand corresponding to the new service node is missing. If so, the cached data for that city corresponding to the brand served by the new service node in the cache database is deleted, and the corresponding entry for that city in the city brand missing table is updated.
[0097] When a newly added service node is not located in a city where the brand corresponding to the newly added service node is missing, determine whether the target node corresponding to that city needs to be replaced by the newly added service node. If the distance between the newly added service node and the city where the brand corresponding to the newly added service node is missing is less than the target node that is furthest from that city, then the newly added service node is used to replace the target node that is furthest from that city. The missing brand corresponding to the newly added service node, the newly added service node, and the city identifier of the city where the brand corresponding to the newly added service node is missing are associated and stored in the cache database to update the cache database cache.
[0098] When a service node is deleted, the corresponding entry for that service node is removed from the service node information table. Based on the service node information table, it is determined whether there are other service nodes in the city where the deleted service node is located that serve the same brand as the deleted service node. If not, the city identifier of the city where the deleted service node is located and the brand identifier corresponding to the service node are added to the city missing brand table. Based on the distance between the city where the deleted service node is located and other service nodes in other cities that serve the same brand as the deleted service node, a predetermined number of other service nodes serving the deleted brand are retrieved from the service node information table. The city identifier of the city where the deleted service node is located, the deleted brand, and the retrieved other service nodes serving the deleted brand are associated and stored in the cache database.
[0099] Next, it is determined whether the deleted service node is the target service node. If it is the target service node, based on the distance between the city where the deleted service node is located and other service nodes serving the same brand as the deleted service node, service nodes in other cities serving the deleted brand with the same number of deleted service nodes are determined from the service node information table as supplementary nodes. The city identifier of the city where the deleted service node is located, the deleted brand, and the supplementary node are associated and stored in the cache database.
[0100] According to one embodiment of the present invention, taking the deletion of a service node as an example, when a service node is deregistered and no longer in operation, it is necessary to delete the service node and update the existing cache. For example, if a node with dealrid=7 needs to be deleted, the information of this node is obtained as follows:
[0101]
[0102] Table 10
[0103] First, determine the number of service nodes selling BMWs (3) in city C (110100) after removing this service node. If the number is 0, then...
[0104] Calculate and recommend service nodes selling BMWs in other cities separately and include them in this cache. If there are still service nodes selling BMWs in city C after removing the above nodes, that is, the number is not 0 and no action is required.
[0105] Then, it is determined whether the service node to be removed is the target service node. If so, the target service node corresponding to that city is recalculated and the cache is updated. If it is not included, no operation is performed. After removing the above example service node, it is found that this node is the target service node for 130500 (City A), so the target service node for 130500 (City A) needs to be recalculated and the cache updated.
[0106] Figure 6 A flowchart of a target recommendation method 400 according to an embodiment of the present invention is shown, the method 400 being adapted to be executed in a computing device.
[0107] like Figure 5 As shown, method 400 begins with step S410, which searches for the service node corresponding to the target brand in the user's city based on the distance between the user's location and the service node corresponding to the target brand, and uses it as the target service node.
[0108] Subsequently, in step S420, when no target service node can be found in the user's city, a predetermined number of target service nodes are retrieved from the cache database generated in the recommendation information processing method described above, based on the city identifier of the user's city and the brand identifier of the target brand.
[0109] Specifically, when there is no target service node in the city where the user is located, a predetermined number of service nodes corresponding to the city identifier and brand identifier will be retrieved from the database based on the city identifier of the user's city and the brand identifier of the target brand. The retrieved service nodes are one or more service nodes that are closest to the user's city.
[0110] Finally, in step S430, the found target service node is recommended to the user.
[0111] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.
[0112] A8 The method as described in any one of A1-A7 further includes:
[0113] When a new service node is added, an entry corresponding to the new service node is added to the service node information table.
[0114] When the newly added service node is located in a city where the brand corresponding to the newly added service node is missing, delete the cache data of that city in the cache database corresponding to the brand served by the newly added service node, and update the table entry corresponding to that city in the city missing brand table.
[0115] A9, as described in A8, further includes:
[0116] When the newly added service node is not located in a city where the brand corresponding to the newly added service node is missing, determine whether it is necessary to use the newly added service node to replace the target node in the city where the brand corresponding to the newly added service node is missing.
[0117] If the distance between the newly added service node and the city where the brand corresponding to the missing newly added service node is less than the target node that is furthest from that city, then the newly added service node will replace the target node that is furthest from that city.
[0118] The missing brand corresponding to the newly added service node, the newly added service node, and the city identifier of the city where the brand corresponding to the newly added service node is missing are associated and stored in the cache database to update the cache database cache.
[0119] A10 The method described in any of A1-A7 further includes:
[0120] When a service node is deleted, the entry corresponding to that service node is deleted from the service node information table.
[0121] Based on the service node information table, determine whether there are other service nodes in the city where the deleted service node is located that serve the same brand as the deleted service node.
[0122] If not, the city identifier of the city where the deleted service node is located and the brand identifier corresponding to the service node will be added to the missing brand table of the city.
[0123] Based on the distance between the city where the deleted service node is located and other service nodes in other cities that serve the same brand as the deleted service node, a predetermined number of service nodes in other cities that serve the deleted brand are retrieved from the service node information table.
[0124] The city identifier of the city where the service node to be deleted is located, the brand to be deleted, and the associated service nodes of the brand to be deleted in other cities are stored in the cache database.
[0125] As described in A10, A11 further includes:
[0126] Determine whether the service node to be deleted is the target service node;
[0127] If it is a target service node, then based on the distance between the city where the deleted service node is located and other service nodes serving the same brand as the deleted service node, service nodes in other cities serving the deleted brand with the same number of deleted service nodes are determined from the service node information table as supplementary nodes;
[0128] The city identifier of the city where the deleted service node is located, the deleted brand, and the associated supplementary node are stored in the cache database.
[0129] A12 is the method described in any one of A1-A7, wherein the cache database is a Redis cache database, and the data in the cache database is stored in an hset structure.
[0130] A13 is the method described in A12, wherein the data in the cache database is stored in an hset structure, including:
[0131] The city identifier is used as the key, the missing brand is used as the field field, and the target service node is used as the field value for associated storage.
[0132] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the multilingual spam text recognition method of the present invention according to instructions in the program code stored in the memory.
[0133] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.
[0134] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0135] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0136] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into this detailed description, wherein each claim itself is a separate embodiment of the invention.
[0137] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0138] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0139] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0140] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A method for processing recommendation information, suitable for execution in a computing device, the method comprising: Construct a city information table and a service node information table. The city information table is suitable for storing the relationship between the city identifier and the geographical location of the city center. The service node information table is suitable for storing the relationship between the service node identifier, the city identifier where the service node is located, the brand identifier served by the service node, and the geographical location of the service node. Based on the city information table and the service node information table, a city missing brand table is generated. The city missing brand table is suitable for storing the association between city identifiers and missing brands. If there is no service node serving a certain brand in a city, then that brand is a missing brand in that city. For any city identifier and associated missing brand in the city missing brand table, based on the distance between the city center and the service node, determine the service nodes in other cities that serve the missing brand from the service node information table, and use them as the target service nodes. The city identifier, missing brand, and target service node are associated and stored in the cache database so that when the target brand service node cannot be obtained from the user's city based on the distance between the user and the service node, the target service node is retrieved from the cache database and recommended to the user.
2. The method as described in claim 1, wherein, The step of generating a table of missing city brands based on the city information table and the service node information table includes: The brand identifiers appearing in the service node information table are summarized to generate a brand set; For any brand in the brand set, statistics are performed according to the service node information table to generate a first city set corresponding to the brand. Each city in the first city set has a service node that serves the brand. By comparing the city information table with the first city set corresponding to the brand, a second city set corresponding to the brand is obtained. Each city in the second city set does not have a service node serving the brand. Add the city identifiers associated with the corresponding brand identifiers in the second city set to the city missing brand table.
3. The method as described in claim 2, wherein, The geographical location includes geographical coordinates and the corresponding block code.
4. The method of claim 3, wherein, The block code is calculated as follows: Convert the geographic coordinates into binary code; The binary code is Base32 encoded to generate the corresponding block code.
5. The method of claim 3, wherein, The block is encoded using GeoHash codes.
6. The method of claim 4, wherein, The process of determining service nodes in other cities serving the missing brand from the service node information table based on the distance between the city center and the service node, and using these as target service nodes, includes: Using the area where the city center is located as the central area, determine multiple adjacent areas that are adjacent to the central area, and use them as the first-level search area; Based on the service node information table, search for the target service node serving the missing brand in the first-level search area; If the number of target service nodes found in the first-level search area does not reach the predetermined number, the search range is expanded layer by layer until the number of target service nodes found reaches the predetermined number.
7. The method of claim 6, further comprising: The distance between the city center and the target service node is calculated based on the geographic coordinates, and a predetermined number of target service nodes are selected as the final target service nodes in ascending order of distance.
8. The method according to any one of claims 1-7, further comprising: When a new service node is added, an entry corresponding to the new service node is added to the service node information table. When the newly added service node is located in a city where the brand corresponding to the newly added service node is missing, delete the cache data of that city in the cache database corresponding to the brand served by the newly added service node, and update the table entry corresponding to that city in the city missing brand table.
9. The method of claim 8, wherein, Also includes: When the newly added service node is not located in a city where the brand corresponding to the newly added service node is missing, determine whether it is necessary to use the newly added service node to replace the target node in the city where the brand corresponding to the newly added service node is missing. If the distance between the newly added service node and the city where the brand corresponding to the missing newly added service node is less than the target node that is furthest from that city, then the newly added service node will replace the target node that is furthest from that city. The missing brand corresponding to the newly added service node, the newly added service node, and the city identifier of the city where the brand corresponding to the newly added service node is missing are associated and stored in the cache database to update the cache database cache.
10. The method according to any one of claims 1-7, further comprising: When a service node is deleted, the entry corresponding to that service node is deleted from the service node information table. Based on the service node information table, determine whether there are other service nodes in the city where the deleted service node is located that serve the same brand as the deleted service node. If not, the city identifier of the city where the deleted service node is located and the brand identifier corresponding to the service node will be added to the missing brand table of the city. Based on the distance between the city where the deleted service node is located and other service nodes in other cities that serve the same brand as the deleted service node, a predetermined number of service nodes in other cities that serve the deleted brand are retrieved from the service node information table. The city identifier of the city where the service node to be deleted is located, the brand to be deleted, and the associated service nodes of the brand to be deleted in other cities are stored in the cache database.
11. The method of claim 10, further comprising: Determine whether the service node to be deleted is the target service node; If it is a target service node, then based on the distance between the city where the deleted service node is located and other service nodes serving the same brand as the deleted service node, service nodes in other cities serving the deleted brand with the same number of deleted service nodes are determined from the service node information table as supplementary nodes; The city identifier of the city where the deleted service node is located, the deleted brand, and the associated supplementary node are stored in the cache database.
12. The method according to any one of claims 1-7, wherein, The cache database is a Redis cache database, and the data in the cache database is stored in the hset structure.
13. The method of claim 12, wherein, The data in the cache database is stored in an hset structure, including: The city identifier is used as the key, the missing brand is used as the field field, and the target service node is used as the field value for associated storage.
14. A recommended method, performed in a computing device, the method comprising: Based on the distance between the user's location and the service node corresponding to the target brand, the service node corresponding to the target brand is found in the user's city and used as the target service node. When no target service node can be found in the user's city, a predetermined number of target service nodes are retrieved from the cache database generated by the recommendation information processing method as described in any one of claims 1-13, based on the city identifier of the user's city and the brand identifier of the target brand. The found target service nodes will be recommended to the user.
15. A computing device, comprising: At least one processor; and A memory storing program instructions configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-14.
16. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-14.
Citation Information
Patent Citations
Calculation method for obtaining activities near store based on LBS positioning
CN110648198A