Object recommendation method and device, equipment and storage medium
The object recommendation method addresses the limitations of existing systems by determining user location-based blocks and object identifiers, enhancing recommendation accuracy and reducing latency through data synchronization and caching.
Patent Information
- Application Number
- CN202310805296.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
Existing object recommendation methods fail to meet users' viewing or browsing needs and are computationally intensive, especially in low-latency scenarios.
An object recommendation method that determines a target block corresponding to a user's geographical location, identifies the object position identifier from a pre-established correspondence, and recommends objects based on this identifier, utilizing a distributed cache and relational database to ensure data consistency and reduce computation.
Enriches the recommendation method by satisfying user needs and reduces computational latency by recommending objects based on geographical proximity, ensuring timely delivery and accurate recommendations.
Smart Images

Figure CN119226595A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to an object recommendation method, device, equipment and storage medium. Background Art
[0002] With the continuous development of network technology, when users watch or browse short videos, live broadcast rooms, objects and other objects, related short videos, live broadcast rooms, objects and other objects are usually recommended to users based on their browsing preferences or interest preferences. However, this object recommendation method is relatively simple and cannot better meet users' viewing or browsing needs for recommended objects.
[0003] Therefore, how to enrich the recommendation method for objects to meet the viewing or browsing needs of users is a technical problem that urgently needs to be solved. Summary of the invention
[0004] In order to solve the above technical problems, an embodiment of the present disclosure provides an object recommendation method.
[0005] In a first aspect, the present disclosure provides an object recommendation method, the method comprising:
[0006] In response to an object recommendation request for a target user, determining a target block corresponding to the target user; wherein the target block is used to describe a preset geographical location area;
[0007] Determine the object position identifier corresponding to the target block from the pre-established correspondence between the block and the object position identifier as the first target position identifier; wherein the object position identifier is used to identify the position corresponding to the object to be recommended;
[0008] Based on the to-be-recommended object corresponding to the first target location identifier, recommend an object to the target user.
[0009] In an optional implementation manner, before recommending the object to be recommended corresponding to the first target location identifier to the target user, the method further includes:
[0010] Acquire geographic range information corresponding to the first target location identifier; wherein the geographic range information is used to reflect the geographic range corresponding to the first target location identifier;
[0011] Determining that the target user is within the geographical range corresponding to the first target location identifier, then determining the first target location identifier as the second target location identifier;
[0012] Accordingly, the step of recommending the object to be recommended to the target user based on the object to be recommended corresponding to the first target location identifier includes:
[0013] Based on the to-be-recommended object corresponding to the second target location identifier, recommend an object to the target user.
[0014] In an optional implementation manner, it is characterized in that the acquiring the geographical range information corresponding to the first target location identifier includes:
[0015] The geographic range information corresponding to the first target location identifier is obtained from a local cache; wherein the local cache is used to store the geographic range information of the object location identifier.
[0016] In an optional implementation manner, it is characterized in that the correspondence between the block and the object location identifier is stored in a distributed cache, and the method further includes:
[0017] If it is determined that the data version in the distributed cache is lower than the latest data version in the preset relational database, the preset relational database synchronizes the correspondence between the block corresponding to the latest data version and the object location identifier to the distributed cache; wherein the preset relational database is used to store data including the geographic range information of the object location identifier and the correspondence between the block and the object location identifier.
[0018] In an optional implementation manner, it is characterized in that the method further comprises:
[0019] If it is determined that the data version in the local cache is lower than the latest data version in the distributed cache, obtaining an identifier of the latest data version;
[0020] Based on the identifier of the latest data version, the preset relational database synchronizes the geographic range information of the object location identifier corresponding to the latest data version to the local cache.
[0021] In an optional implementation manner, it is characterized in that the method further comprises:
[0022] Upon receiving a message that the geographic range information corresponding to the first object location identifier is updated, obtaining the updated geographic range information corresponding to the first object location identifier, and storing the updated geographic range information corresponding to the first object location identifier in the preset relational database;
[0023] The updated geographic range information corresponding to the first object location identifier is synchronized to the local cache.
[0024] In an optional implementation manner, it is characterized in that the method further comprises:
[0025] Determine an updated block corresponding to the first object location identifier based on the updated geographic range information corresponding to the first object location identifier;
[0026] The corresponding relationship between the first object location identifier and the updated block is synchronized to the distributed cache.
[0027] An optional implementation is characterized in that the object to be recommended includes an item object and / or a media resource object, and the media resource object includes at least one of a live broadcast room object, a video object, and a graphic object.
[0028] In a second aspect, the present disclosure provides an object recommendation device, the device comprising:
[0029] A first determination module is used to determine a target block corresponding to a target user in response to an object recommendation request for the target user; wherein the target block is used to describe a preset geographical location area;
[0030] A second determination module is used to determine the object position identifier corresponding to the target block from the pre-established correspondence between the block and the object position identifier as the first target position identifier; wherein the object position identifier is used to identify the position corresponding to the object to be recommended;
[0031] A recommendation module is used to recommend an object to the target user based on the object to be recommended corresponding to the first target location identifier.
[0032] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0033] In a fourth aspect, the present disclosure provides an object recommendation device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0034] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0035] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:
[0036] The disclosed embodiment provides an object recommendation method. When receiving an object recommendation request for a target user, the target block corresponding to the target user is first determined. Then, from the pre-established correspondence between the block and the object position identifier, the object position identifier corresponding to the target block is determined as the first target position identifier. Finally, based on the to-be-recommended object corresponding to the first target position identifier, the object is recommended to the target user. It can be seen that the disclosed embodiment can recommend the to-be-recommended object corresponding to the object position identifier to the target user based on the correspondence between the block and the object position identifier, thereby enriching the recommendation method for the object and satisfying the browsing or viewing needs of the user.
[0037] In addition, the disclosed embodiments can also determine the first target location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier, and recommend the object to the target user based on the first target location identifier, thereby reducing the amount of calculation when recommending objects to the target user, thereby meeting the need to recommend objects corresponding to the object location identifier to the target user in a low-latency scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 A flowchart of an object recommendation method provided by an embodiment of the present disclosure;
[0041] Figure 2 A schematic diagram of a correspondence relationship between a block and an object position identifier provided in an embodiment of the present disclosure;
[0042] Figure 3 A flowchart of another object recommendation method provided by an embodiment of the present disclosure;
[0043] Figure 4 A storage construction flow chart provided for an embodiment of the present disclosure;
[0044] Figure 5 A schematic diagram of a storage data consistency reconciliation provided in an embodiment of the present disclosure;
[0045] Figure 6 A schematic diagram of the structure of an object recommendation device provided by an embodiment of the present disclosure;
[0046] Figure 7 A schematic diagram of the structure of an object recommendation device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0049] With the continuous development of network technology, in the process of users browsing objects (such as short videos, live broadcast rooms, and items), related short videos, live broadcast rooms, and items are usually recommended to users based on their browsing preferences or interest preferences. However, this object recommendation method is relatively simple and cannot better meet users' viewing or browsing needs for objects.
[0050] In addition, when recommending objects to target users, objects can also be recommended to target users based on their geographic locations. Specifically, objects corresponding to the object location identifiers are recommended to target users by calculating whether the target user's geographic location is within the geographic range corresponding to the object location identifier. However, this recommendation method has a large amount of computation and cannot meet the needs of recommending objects to target users in low-latency scenarios.
[0051] To this end, the disclosed embodiment provides an object recommendation method. When receiving an object recommendation request for a target user, the target block corresponding to the target user is first determined. Then, from the pre-established correspondence between the block and the object position identifier, the object position identifier corresponding to the target block is determined as the first target position identifier. Finally, based on the object to be recommended corresponding to the first target position identifier, the object is recommended to the target user. It can be seen that the disclosed embodiment can recommend the object corresponding to the object position identifier to the target user based on the correspondence between the block and the object position identifier, thereby enriching the recommendation method for the object and satisfying the browsing or viewing needs of the user.
[0052] In addition, the disclosed embodiments can also determine the first target location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier, and recommend the object to the target user based on the first target location identifier, thereby reducing the amount of calculation when recommending objects to the target user, thereby meeting the need to recommend objects corresponding to the object location identifier to the target user in a low-latency scenario.
[0053] Based on this, the present disclosure provides an object recommendation method, referring to Figure 1 , is a flow chart of an object recommendation method provided by an embodiment of the present disclosure, the method specifically comprising:
[0054] S101: In response to an object recommendation request for a target user, determining a target block corresponding to the target user.
[0055] The target block is used to describe a preset geographical location area.
[0056] The object recommendation method provided by the embodiments of the present disclosure may be applied to a server, wherein the server may include a cloud server, a local server, etc.
[0057] In the disclosed embodiment, the target user may be any user who is browsing media content, such as a user who is watching a short video or a live broadcast, or a user who is reading a picture book or a user who is listening to music, etc.; while the target user is browsing content or listening to music, the client where the target user is located may send an object recommendation request to the server to request the server to recommend the corresponding object to the target user.
[0058] In an optional implementation, when the server receives an object recommendation request for a target user, the server first obtains the target user's geographic location information if the target user authorizes obtaining the current geographic location information, and then determines the target block corresponding to the target user based on the obtained geographic location information, wherein the target user's geographic location information is used to characterize the geographic location area where the target user is located, such as the city where the target user is located.
[0059] In an optional implementation, when the target user authorizes obtaining the current geographical location information, the geographical location information of the target user, such as the city where the target user is located, may be obtained.
[0060] In another optional implementation, when the target user authorizes obtaining the current geographical location information, the geographical location information of the target user may also be determined based on the login information of the client where the target user is located.
[0061] In the embodiment of the present disclosure, the target block may be used to describe a preset geographical location area.
[0062] In an optional implementation, the preset geographic location area can be divided into multiple squares in advance, each square is a block, and the block set formed by the multiple blocks can be used to represent the preset geographic location area. In actual applications, each block corresponds to a block identifier, and based on the block identifier, the geographic scope information of the preset geographic location area covered by the block can be understood.
[0063] In an optional implementation, after determining the geographic location information of the target user, such as the city where the target user is located, the target block corresponding to the target user may be determined based on the relationship between the geographic location information of the target user and each block.
[0064] like Figure 2 As shown, it is a schematic diagram of the correspondence between a block and an object location identifier provided by an embodiment of the present disclosure, wherein the numbers displayed on each block are block identifiers, and triangles and pentagons are used to represent the geographic location of the target user; for example, assuming that the geographic location of the target user is a "pentagon", then the block corresponding to the geographic location information of the target user, that is, block 1, is the target block corresponding to the target user; for another example, assuming that the geographic location of the target user is a "triangle", then the block corresponding to the geographic location information of the target user, that is, block 5, is the target block corresponding to the target user.
[0065] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0066] S102: Determine the object location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier as the first target location identifier.
[0067] In the disclosed embodiment, after the target block corresponding to the target user is determined, the object location identifier corresponding to the target block can be determined from the pre-established correspondence between the block and the object location identifier as the first target location identifier.
[0068] In an optional implementation, a correspondence between a block and an object location identifier may be pre-established, such as Figure 2 As shown, the circular area 201 covered by the object location identifier A can be used to represent the delivery range of the object location identifier A, and the circular area 202 covered by the object location identifier B can be used to represent the delivery range of the object location identifier B.
[0069] Assume that the number displayed on each block is the block identifier, Figure 2 It can be seen that the blocks covered by object location identifier A are 1, 2, 3, 4, 5, 6, 7, 8, and 9, and the blocks covered by object location identifier B are 7, 8, 10, and 11. Therefore, the corresponding relationship between object location identifiers and blocks can be established, and the results are as follows:
[0070] 1->[object location identifier A], 2->[object location identifier A], 3->[object location identifier A], 4->[object location identifier A], 5->[object location identifier A], 6->[object location identifier A], 7->[object location identifier A, object location identifier B], 8->[object location identifier A, object location identifier B], 9->[object location identifier A], 10->[object location identifier B], 11->[object location identifier B].
[0071] In the disclosed embodiment, after the target block corresponding to the target user is determined, the location identifier corresponding to the target block can be determined from the pre-established correspondence between the block and the object location identifier as the first target object location identifier.
[0072] For example, Figure 2 As shown, assuming that the target block corresponding to the target user is block 1, by querying the correspondence between the above blocks and the object location identifiers, it can be determined that the location identifier corresponding to block 1 is A, and the object location identifier A can be used as the first target location identifier.
[0073] For example, Figure 2 As shown, assuming that the target block corresponding to the target user is block 7, by querying the correspondence between the above blocks and the object location identifiers, it can be determined that the object location identifiers corresponding to block 7 are A and B, then object location identifier A and object location identifier B can be used as the first target location identifier.
[0074] S103: Recommending an object to the target user based on the to-be-recommended object corresponding to the first target location identifier.
[0075] In an optional implementation, the object to be recommended may include at least one of an item object and a media resource object. The item object may include books, clothes, cosmetics, etc., and the media resource object may include a live broadcast room object, an audio object, a video object, and a graphic object, etc.
[0076] In the disclosed embodiment, the object location identifier can be used to identify the location corresponding to the object to be recommended. That is, there is a corresponding relationship between the object to be recommended and the object location identifier. After determining the object location identifier, the corresponding object to be recommended can be obtained based on the object location identifier.
[0077] For example, assuming that the object to be recommended is an item object, the object location identifier is used to identify the location information of the physical store where the item object is located. For another example, assuming that the object to be recommended is a live broadcast room object, the object location identifier is used to identify the delivery range of the physical store corresponding to the live broadcast room object, etc.
[0078] In the disclosed embodiment, after determining the first target location identifier, the recommended object corresponding to the first target location identifier can be recommended to the target user. Since the block corresponding to the first target and the block corresponding to the target user belong to the same block (i.e., the distance between the first target location identifier and the target user is relatively close), therefore, in the scenario where the target user watches the live broadcast room corresponding to the first target location identifier, if the target user places an order for items in the live broadcast room, the items can be delivered to the target user more quickly. For another example, in the scenario where the target user visits a historical building, if the user is within the geographical scope covered by the historical building, the explanation video or explanation audio bound to the historical building can be recommended to the target user, so that the target user can understand the stories or deeds related to the historical building where the target user is located based on the explanation video or explanation audio.
[0079] In the object recommendation method provided by the embodiment of the present disclosure, when an object recommendation request for a target user is received, the target block corresponding to the target user is first determined, and then the object location identifier corresponding to the target block is determined from the pre-established correspondence between the block and the object location identifier as the first target location identifier, and finally the object is recommended to the target user based on the object to be recommended corresponding to the first target location identifier. It can be seen that the embodiment of the present disclosure can recommend the object to be recommended corresponding to the location identifier to the target user based on the correspondence between the block and the object location identifier, thereby enriching the object recommendation method and satisfying the browsing or viewing needs of the user.
[0080] In addition, the disclosed embodiments can also determine the first target location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier, and recommend the object to the target user based on the first target location identifier, thereby reducing the amount of calculation when recommending objects to the target user, thereby meeting the need to recommend objects corresponding to the object location identifier to the target user in a low-latency scenario.
[0081] In practical applications, after determining the object location identifier corresponding to the block where the target user is located based on the correspondence between the block and the object location identifier, since the object location identifier may only cover part of the block, the target user may be within the coverage range of the object location identifier or outside the coverage range of the object location identifier. In order to more accurately recommend objects to the target user, the embodiment of the present disclosure further provides an object recommendation method, such as Figure 3 FIG. 1 is a flowchart of another object recommendation method provided by an embodiment of the present disclosure, and the method specifically includes:
[0082] S301: In response to an object recommendation request for a target user, determine a target block corresponding to the target user.
[0083] The target block is used to describe a preset geographical location area.
[0084] S302: Determine the object location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier as the first target location identifier.
[0085] The object position identifier is used to identify the position corresponding to the object to be recommended.
[0086] S303: Recommending an object to the target user based on the to-be-recommended object corresponding to the first target location identifier.
[0087] S304: Obtain geographic range information corresponding to the first target location identifier.
[0088] The geographic range information is used to reflect the geographic range corresponding to the first target location identifier.
[0089] In an optional implementation, a correspondence between an object location identifier and geographic range information may be pre-established. After determining a first target location identifier corresponding to a target user, the geographic range corresponding to the first target location identifier may be determined from the pre-established correspondence between the object location identifier and the geographic range information.
[0090] In the embodiment of the present disclosure, the geographic range information may reflect the geographic range corresponding to the first target location identifier. For example, the geographic range information may reflect the area or delivery range of the first target location identifier.
[0091] In order to further reduce the delay in obtaining the geographic range information corresponding to the first target location identifier, in actual applications, the correspondence between the object location identifier and the geographic range information can be pre-set. After determining the first target location identifier corresponding to the target user, the geographic range information corresponding to the first target location identifier can be obtained from the pre-set correspondence between the object location identifier and the geographic range information.
[0092] S305: Determine whether the target user is within the geographical range corresponding to the first target location identifier.
[0093] In an optional implementation, after determining the geographic range information corresponding to the first target location identifier, it may be determined whether the target user is within the geographic range corresponding to the first target location identifier based on the geographic range information corresponding to the first target location identifier and the geographic location information of the target user.
[0094] In an optional implementation, in order to more accurately determine the relationship between the target user and the first target location identifier, a ray method may be used to determine whether the target user is within the geographical range corresponding to the first target location identifier.
[0095] Specifically, a ray is drawn in any direction with the target user as the starting point. If the number of intersections between the ray and the geographical range corresponding to the first target location identifier is an even number, it indicates that the target user is not within the geographical range corresponding to the first target location identifier. If the number of intersections between the ray and the geographical range corresponding to the first target location identifier is an odd number, it indicates that the target user is within the geographical range corresponding to the first target location identifier.
[0096] S306: If it is determined that the target user is within the geographical range corresponding to the first target location identifier, determine the first target location identifier as the second target location identifier.
[0097] In the disclosed embodiment, the second target location identifier and the first target location identifier may be the same location identifier or may be different location identifiers.
[0098] In the disclosed embodiment, if it is determined that the target user is within the geographical range corresponding to the first target location identifier, the first target location identifier is determined as the second target location identifier, so that an object can be recommended to the target user based on the recommended object corresponding to the second target location identifier.
[0099] S307: Recommending an object to the target user based on the to-be-recommended object corresponding to the second target location identifier.
[0100] In the disclosed embodiment, after the second target location identifier is determined, the recommended object corresponding to the second target location identifier can be recommended to the target user. Since the target user is within the geographical scope corresponding to the second target location identifier (for example, the target user is within the delivery range of the second target location identifier), when the target user is watching the live broadcast room corresponding to the second target location identifier, if the target user places an order for an item in the live broadcast room, the item can be delivered to the target user more quickly.
[0101] In the object recommendation method provided by the embodiment of the present disclosure, when an object recommendation request for a target user is received, a target block corresponding to the target user is obtained; from the correspondence relationship between the pre-established block and the object location identifier, the object location identifier corresponding to the target block is determined as the first target location identifier, and the geographical range information corresponding to the first target location identifier is obtained; it is determined whether the target user is within the geographical range corresponding to the first target location identifier; if it is determined that the target user is within the geographical range corresponding to the first target location identifier, the first target location identifier is determined as the second target location identifier, and based on the object to be recommended corresponding to the second target location identifier, an object is recommended to the target user.
[0102] It can be seen that after determining the first target location identifier, the embodiment of the present disclosure can also more accurately recommend objects to be recommended to the target user based on the geographic range information corresponding to the first target location identifier, thereby further reducing the amount of calculation when recommending objects to the target user based on the first target location identifier, thereby meeting the need to recommend objects to be recommended corresponding to the object location identifier to the target user in a low-latency scenario.
[0103] In an optional implementation, in order to reduce the delay in remote data transmission and enable the server to store or read data more quickly, the correspondence between blocks and object location identifiers can be stored in a distributed cache in advance. After determining the target block corresponding to the target user, the location identifier corresponding to the target block can be directly obtained from the distributed cache as the first target location identifier, thereby recommending objects to the target user based on the object to be recommended corresponding to the first target location identifier.
[0104] In actual applications, since the geographic scope information of the object location identifier may change, when storing the geographic scope information of the object location identifier based on the local cache, and the correspondence between the storage block and the object location identifier based on the distributed cache, it is also necessary to ensure the real-time nature of the cached data.
[0105] Based on this, the embodiment of the present disclosure provides a new storage solution to solve the problem of cache real-time performance, such as Figure 4 As shown, a storage construction flow chart provided by an embodiment of the present disclosure is provided. Specifically, the server obtains the location identifier and geographic range information based on the object location identifier module, and inputs the object location identifier into the inventory module, and synchronizes the object location identifier and geographic range information based on the inventory module, and stores the synchronized data in a preset relational database, wherein the preset relational database is used to store the object location identifier, geographic range information and the corresponding relationship between the block and the object location identifier, and the preset relational database may include MySQL, SQL Server, Oracle database, etc.
[0106] Then, the object location identifier and geographic scope information are input into the address middle platform, and the correspondence between the object location identifier and the geographic scope information, as well as the correspondence between the block and the object location identifier are created based on the address middle platform. The geographic scope information corresponding to the object location identifier is stored in the local cache of the server, and the correspondence between the block and the object location identifier is stored in the distributed cache, thereby realizing a three-storage solution consisting of a local cache, a distributed cache, and a preset relational database.
[0107] In actual applications, in order to ensure the consistency of data in the local cache, distributed cache and the preset relational database, the embodiment of the present disclosure aligns the data in the distributed cache with the data in the preset relational database, and aligns the data in the local cache with the data in the distributed cache based on the data version in the preset relational database.
[0108] Specifically, if it is determined that the data version in the distributed cache is lower than the latest data version in the preset relational database, the preset relational database synchronizes the correspondence between the block and the object location identifier of the latest data version object to the distributed cache.
[0109] In the embodiment of the present disclosure, the preset relational database stores the geographical range information of the object location identifier and the corresponding relationship data between the block and the object location identifier.
[0110] In an embodiment of the present disclosure, if it is determined that the data version in the local cache is lower than the latest data version in the distributed cache, the identifier of the latest data version is obtained, and based on the identifier of the latest data version, the preset relational database synchronizes the geographic scope information of the object location identifier corresponding to the latest data version to the local cache.
[0111] like Figure 5 As shown, it is a schematic diagram of a storage data consistency reconciliation provided by an embodiment of the present disclosure. The Faas server polls periodically. When it detects that the data version in the distributed cache is lower than the latest data version in the preset relational database, the preset relational database synchronizes the correspondence between the block corresponding to the latest data version and the object location identifier to the distributed cache, thereby solving the problem of consistency between offline links and real-time links.
[0112] like Figure 5 As shown, the server polls periodically, and when it detects that the data version in the local cache is lower than the latest data version in the distributed cache, it obtains the identifier of the latest data version, and synchronizes the geographic range information of the object location identifier corresponding to the latest data version to the local cache by the preset relational database, so that the data version in the local cache is consistent with the data version in the distributed cache, thereby solving the problem of consistency between offline links and real-time links.
[0113] In an optional implementation, Figure 4 As shown, when the server receives a message that the geographic scope information corresponding to the first object location identifier is updated, it first obtains the updated geographic scope information corresponding to the first object location identifier, and stores the updated geographic scope information corresponding to the first object location identifier in a preset relational database, and then synchronizes the updated geographic scope information corresponding to the first object location identifier to the local cache, so that the data in the local cache is consistent with the data in the preset relational database.
[0114] In another optional implementation, if Figure 4 As shown, after the updated geographic range information corresponding to the first object location identifier is synchronized to the local cache, the updated block corresponding to the first object location identifier can be determined based on the updated geographic range information corresponding to the first object location identifier, and the correspondence between the first object location identifier and the updated block can be synchronized to the distributed cache, so that the data in the local cache, the distributed cache and the preset relational database remain consistent.
[0115] In the embodiments of the present disclosure, when it is determined that the data version in the distributed cache is lower than the latest data version in the preset relational database, the preset relational database synchronizes the corresponding relationship between the block of the object of the latest data version and the object location identifier to the distributed cache; and when it is determined that the data version in the local cache is lower than the latest data version in the distributed cache, the identifier of the latest data version is obtained, and based on the identifier of the latest data version, the preset relational database synchronizes the geographic range information of the object location identifier corresponding to the latest data version to the local cache. It can be seen that the embodiments of the present disclosure can ensure the data consistency of the local cache, the distributed cache and the preset relational database by aligning the data in the distributed cache with the data in the preset relational database, and aligning the data in the local cache with the data in the distributed cache.
[0116] Based on the above method embodiment, the present disclosure also provides an object recommendation device, referring to Figure 6 , is a schematic diagram of the structure of an object recommendation device provided by an embodiment of the present disclosure, the device comprising:
[0117] The first determination module 601 is used to determine a target block corresponding to a target user in response to an object recommendation request for the target user; wherein the target block is used to describe a preset geographical location area;
[0118] The second determination module 602 is used to determine the object position identifier corresponding to the target block from the pre-established correspondence between the block and the object position identifier as the first target position identifier; wherein the object position identifier is used to identify the position corresponding to the object to be recommended;
[0119] The recommendation module 603 is configured to recommend an object to the target user based on the object to be recommended corresponding to the first target location identifier.
[0120] In an optional implementation, the device further includes:
[0121] A first acquisition module, used to acquire geographical range information corresponding to the first target location identifier; wherein the geographical range information is used to reflect the geographical range corresponding to the first target location identifier;
[0122] A third determination module is used to determine whether the target user is within the geographical range corresponding to the first target location identifier;
[0123] a fourth determination module, configured to determine the first target location identifier as a second target location identifier if it is determined that the target user is within the geographical range corresponding to the first target location identifier;
[0124] Accordingly, the recommendation includes:
[0125] A recommendation submodule is used to recommend an object to the target user based on the object to be recommended corresponding to the second target location identifier.
[0126] In an optional implementation, the acquisition module includes:
[0127] The acquisition submodule is used to acquire the geographic range information corresponding to the first target location identifier from the local cache; wherein the local cache is used to store the geographic range information of the object location identifier.
[0128] In an optional implementation manner, the correspondence between the block and the object location identifier is stored in a distributed cache, and the device further includes:
[0129] The first synchronization module is used to synchronize the correspondence between the block corresponding to the latest data version and the object location identifier to the distributed cache by the preset relational database if it is determined that the data version in the distributed cache is lower than the latest data version in the preset relational database; wherein the preset relational database is used to store data including the geographic scope information of the object location identifier and the correspondence between the block and the object location identifier.
[0130] In an optional implementation, the device further includes:
[0131] A second acquisition module, configured to acquire an identifier of the latest data version if it is determined that the data version in the local cache is lower than the latest data version in the distributed cache;
[0132] The second synchronization module is used to synchronize the geographic range information of the object location identifier corresponding to the latest data version from the preset relational database to the local cache based on the identifier of the latest data version.
[0133] In an optional implementation, the device further includes:
[0134] A third acquisition module is used to acquire the updated geographic range information corresponding to the first object location identifier upon receiving a message that the geographic range information corresponding to the first object location identifier is updated, and store the updated geographic range information corresponding to the first object location identifier in the preset relational database;
[0135] A third synchronization module is used to synchronize the updated geographic range information corresponding to the first object location identifier to the local cache.
[0136] In an optional implementation, the device further includes:
[0137] A fifth determining module, configured to determine an updated block corresponding to the first object location identifier based on the updated geographic range information corresponding to the first object location identifier;
[0138] A fourth synchronization module is used to synchronize the corresponding relationship between the first object location identifier and the updated block into the distributed cache.
[0139] In an optional implementation, the object to be recommended includes an item object and / or a media resource object, and the media resource object includes at least one of a live broadcast room object, an audio object, a video object, and a graphic object.
[0140] In the object recommendation device provided by the embodiment of the present disclosure, when receiving an object recommendation request for a target user, the target block corresponding to the target user is first determined, and then the object location identifier corresponding to the target block is determined from the pre-established correspondence between the block and the object location identifier as the first target location identifier, and finally the object is recommended to the target user based on the object to be recommended corresponding to the first target location identifier. It can be seen that the embodiment of the present disclosure can recommend the object to be recommended corresponding to the object location identifier to the target user based on the correspondence between the block and the object location identifier, thereby enriching the recommendation method for the object and satisfying the browsing or viewing needs of the user.
[0141] In addition, the disclosed embodiments can also determine the first target location identifier corresponding to the target block from the pre-established correspondence between the block and the object location identifier, and recommend the object to the target user based on the first target location identifier, thereby reducing the amount of calculation when recommending objects to the target user, thereby meeting the need to recommend objects corresponding to the object location identifier to the target user in a low-latency scenario.
[0142] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the object recommendation method described in the embodiments of the present disclosure.
[0143] The embodiment of the present disclosure further provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the object recommendation method described in the embodiment of the present disclosure is implemented.
[0144] In addition, the present disclosure also provides an object recommendation device, see Figure 7 As shown, it may include:
[0145] Processor 701, memory 702, input device 703 and output device 704. The number of processors 701 in the object recommendation device can be one or more. Figure 7 In some embodiments of the present disclosure, the processor 701, the memory 702, the input device 703 and the output device 704 may be connected via a bus or other means, wherein: Figure 7 The example of connecting through bus is taken in the following.
[0146] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing of the object recommendation device by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The input device 703 may be used to receive input digital or character information, and to generate signal input related to user settings and function control of the object recommendation device.
[0147] Specifically in this embodiment, the processor 701 will load the executable files corresponding to the processes of one or more applications into the memory 702 according to the following instructions, and the processor 701 will run the applications stored in the memory 702, thereby realizing the various functions of the above-mentioned object recommendation device.
[0148] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0149] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An object recommendation method, characterized in that: The method comprises: In response to an object recommendation request for a target user, determining a target block corresponding to the target user; wherein the target block is used to describe a preset geographical location area; Determine the object position identifier corresponding to the target block from the pre-established correspondence between the block and the object position identifier as the first target position identifier; wherein the object position identifier is used to identify the position corresponding to the object to be recommended; Based on the to-be-recommended object corresponding to the first target location identifier, recommend an object to the target user.
2. The method according to claim 1, characterized in that Before recommending the object to be recommended corresponding to the first target location identifier to the target user, the method further includes: Acquire geographic range information corresponding to the first target location identifier; wherein the geographic range information is used to reflect the geographic range corresponding to the first target location identifier; Determining whether the target user is within the geographical range corresponding to the first target location identifier; If it is determined that the target user is within the geographical range corresponding to the first target location identifier, determining the first target location identifier as the second target location identifier; Accordingly, the step of recommending an object to the target user based on the object to be recommended corresponding to the first target location identifier includes: Based on the to-be-recommended object corresponding to the second target location identifier, recommend an object to the target user.
3. The method according to claim 2, characterized in that The acquiring the geographical range information corresponding to the first target location identifier includes: The geographic range information corresponding to the first target location identifier is obtained from a local cache; wherein the local cache is used to store the geographic range information of the object location identifier.
4. The method according to any one of claims 1 to 3, characterized in that The corresponding relationship between the block and the object location identifier is stored in a distributed cache, and the method further includes: If it is determined that the data version in the distributed cache is lower than the latest data version in the preset relational database, the preset relational database synchronizes the correspondence between the block corresponding to the latest data version and the object location identifier to the distributed cache; wherein the preset relational database is used to store data including the geographic range information of the object location identifier and the correspondence between the block and the object location identifier.
5. The method according to claim 4, characterized in that The method further comprises: If it is determined that the data version in the local cache is lower than the latest data version in the distributed cache, obtaining an identifier of the latest data version; Based on the identifier of the latest data version, the preset relational database synchronizes the geographic range information of the object location identifier corresponding to the latest data version to the local cache.
6. The method according to claim 5, characterized in that The method further comprises: Upon receiving a message that the geographic range information corresponding to the first object location identifier is updated, obtaining the updated geographic range information corresponding to the first object location identifier, and storing the updated geographic range information corresponding to the first object location identifier in the preset relational database; The updated geographic range information corresponding to the first object location identifier is synchronized to the local cache.
7. The method according to claim 6, characterized in that The method further comprises: Determine an updated block corresponding to the first object location identifier based on the updated geographic range information corresponding to the first object location identifier; The corresponding relationship between the first object location identifier and the updated block is synchronized to the distributed cache.
8. The method according to claim 1, characterized in that The objects to be recommended include item objects and / or media resource objects, and the media resource objects include at least one of live broadcast room objects, audio objects, video objects, and graphic objects.
9. An object recommendation device, characterized in that: The method comprises: A first determination module is used to determine a target block corresponding to a target user in response to an object recommendation request for the target user; wherein the target block is used to describe a preset geographical location area; A second determination module is used to determine the object position identifier corresponding to the target block from the pre-established correspondence between the block and the object position identifier as the first target position identifier; wherein the object position identifier is used to identify the position corresponding to the object to be recommended; A recommendation module is used to recommend an object to the target user based on the object to be recommended corresponding to the first target location identifier.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 8.
11. An object recommendation device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
