Data retrieval method, apparatus, device, and storage medium

By constructing a decoupled data model and a multi-level caching mechanism, the database pressure problem caused by the tight coupling of product attributes and relationships in live-streaming e-commerce was solved, achieving efficient and real-time product retrieval and sorting, and improving system performance and user experience.

CN122412697APending Publication Date: 2026-07-17BEIJING DAJIA INTERNET INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2026-05-12
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

In the context of live-streaming e-commerce, existing technologies store product attribute information tightly coupled with the influencer-product relationship, resulting in high database pressure and high response latency during high-concurrency queries, making it difficult to achieve efficient and real-time retrieval of associated entity attributes.

Method used

A data model containing account nodes, object nodes, and associated edges is constructed. Object attribute information is uniformly stored in object nodes, and the relationship between accounts and objects is represented by associated edges. Object nodes are located and attribute information is read by directly traversing the associated edges. Multi-level caching and data synchronization mechanisms are used to optimize the retrieval process.

Benefits of technology

It effectively avoids cascading reads and redundant calculations, improves data retrieval efficiency, reduces system load, shortens response time, and enhances system stability and response speed in high-concurrency scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122412697A_ABST
    Figure CN122412697A_ABST
Patent Text Reader

Abstract

This application discloses a data retrieval method, apparatus, device, and storage medium. It includes: receiving a retrieval request carrying a target account identifier; based on a pre-constructed data model, starting from the target account node corresponding to the target account identifier, traversing the association edges connected to the target account node, and determining the target object node connected to the target account node through the association edges; wherein the data model includes: account nodes representing accounts, object nodes representing objects, and association edges representing the relationship between the account and the object, and the object nodes store the attribute information of the object; reading the attribute information of the target object from the target object node, forming a retrieval result, and returning it. This solution introduces a data model, decoupling data and relationships, reducing cascading operations in the data retrieval process, and improving retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data retrieval method, apparatus, device, and storage medium. Background Technology

[0002] In the e-commerce field, especially in the product retrieval and display scenarios of live-streaming e-commerce, in order to improve the consumer shopping experience and platform transaction efficiency, the system usually needs to support users in real-time sorting and filtering of massive amounts of products under a store or streamer based on multiple dimensions such as sales volume and price. This requirement is particularly prominent in scenarios where influencers (streamers) and products have a many-to-many relationship, that is, one influencer can distribute numerous products, while a popular product can also be distributed by a large number of influencers. Therefore, how to efficiently and in real-time complete attribute retrieval based on related entities has become a common technical goal in this field.

[0003] To achieve the above goals, a common approach in related technologies is to limit the number of products an influencer can associate with at the business level, and then retrieve the attribute information of this limited number of products in real time for in-memory sorting during queries. Another common approach does not limit the number of associations, but truncates the set of products participating in the sorting during queries. These approaches share a common feature: their underlying data models typically store product attribute information tightly coupled with the influencer-product association. This model design leads to an inherent bottleneck: during retrieval, it is necessary to look up all associated product identifiers based on the influencer's identifier, and then further query the real-time attribute information of these products. This triggers cascading read propagation, placing enormous pressure on the database in high-concurrency query scenarios and resulting in high response latency. Summary of the Invention

[0004] In view of this, this application provides a data retrieval method, apparatus, device, and storage medium.

[0005] This application provides the following solution: Firstly, a data retrieval method is provided, the method comprising: Receive a search request carrying the target account identifier; Based on a pre-built data model, starting from the target account node corresponding to the target account identifier, the associated edges connected to the target account node are traversed to determine the target object node connected to the target account node through the associated edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and associated edges for representing the relationship between the account and the object, and the object node stores the attribute information of the object; The attribute information of the target object is read from the target object node, the search results are generated and returned.

[0006] Optionally, the search request may also carry a preset sorting rule; The step of reading the attribute information of the target object from the target object node, forming search results, and returning them includes: Read the attribute information of the target object from the target object node; Based on the attribute information, the target objects are sorted according to the preset sorting rules, and the sorted results are returned as search results.

[0007] Optionally, the preset sorting rule includes sorting by at least one of the following fields: transaction volume information, price information, and listing time information.

[0008] Optionally, after receiving the retrieval request, the method further includes: Check if there is a cached result in the cache that matches the retrieval request; then The method based on the pre-built data model, starting from the target account node corresponding to the target account identifier, traverses the associated edges connected to the target account node to determine the target object node connected to the target account node through the associated edges, including: When there is no cached result matching the retrieval request in the cache, based on the pre-built data model, starting from the target account node corresponding to the target account identifier, the associated edges connected to the target account node are traversed to determine the target object node connected to the target account node through the associated edges.

[0009] Optionally, the method further includes: When a cached result matching the retrieval request exists in the cache, the cached result is returned as the retrieval result.

[0010] Optionally, the cache includes a local cache and / or a remote cache.

[0011] Optionally, when the cache includes a local cache and a remote cache, the retrieval priority of the local cache is greater than the retrieval priority of the remote cache.

[0012] Optionally, the method further includes: For a search request that meets preset high-frequency characteristics, a search is performed in advance to generate corresponding search results before the search request is received, and the search results are stored in the cache.

[0013] Optionally, the method further includes: When the search request is identified as meeting the preset low-frequency characteristics, the search result is stored in the cache and maintained for a preset duration.

[0014] Optionally, the method further includes: Listen for the first change event of the attribute information of the object, and update the corresponding object node in the data model according to the first change event; And / or, listen for a second change event for the attribute information of an account, and update the corresponding account node in the data model according to the second change event, wherein the account node stores the attribute information of the account; And / or, listen for a third change event related to the association between an object and an account, and update the corresponding association edge in the data model according to the third change event, wherein the association edge stores the association status information between the account and the object.

[0015] Optionally, the monitoring targets a third change event in the association relationship between the object and the account, and updates the corresponding association edge in the data model according to the third change event, including: When the third change event detected is a new association event, a new association edge connecting the corresponding account node and object node is added to the data model; When the detected third change event is a deassociation event, the corresponding associated edge is deleted from the data model.

[0016] Secondly, a data retrieval device is provided, the device comprising: The request receiving unit is configured to receive a search request carrying the target account identifier; The node determination unit is configured to, based on a pre-built data model, start from the target account node corresponding to the target account identifier, traverse the association edges connected to the target account node, and determine the target object node connected to the target account node through the association edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and association edges for representing the association relationship between the account and the object, and the object node stores the attribute information of the object; The result generation unit is configured to read the attribute information of the target object from the target object node to form the retrieval result and return it.

[0017] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0018] Fourthly, an electronic device is provided, comprising: One or more processors; and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of the first aspects above.

[0019] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0020] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application embodiment pre-constructs a data model containing account nodes, object nodes, and association edges. Object attribute information is uniformly stored in object nodes, and association edges represent the relationships between accounts and objects, achieving decoupling of object attributes and relationships at the data model level. During retrieval, the corresponding association edges can be traversed directly based on the target account node to quickly locate the associated object node and directly read the stored attribute information from the object node, eliminating the need for multi-table joins, aggregation calculations, or multiple data queries. This effectively avoids the cascading reads and redundant calculations caused by data coupling in traditional solutions, reducing system overhead and computational redundancy, significantly improving data retrieval efficiency, reducing system load, and accelerating the response speed of retrieval results.

[0021] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of the system architecture applicable to the embodiments of this application.

[0024] Figure 2 A flowchart of a data retrieval method provided in an embodiment of this application.

[0025] Figure 3 A schematic diagram of the data model provided in the embodiments of this application.

[0026] Figure 4 This is a schematic diagram of a multi-level caching architecture provided in an embodiment of this application.

[0027] Figure 5 This is a schematic diagram of the data synchronization mechanism provided in the embodiments of this application.

[0028] Figure 6 A schematic block diagram of a data retrieval device provided in an embodiment of this application.

[0029] Figure 7 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0031] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0032] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0033] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0034] In e-commerce platforms, especially live-streaming e-commerce scenarios, to achieve efficient retrieval and sorting of objects (such as products) associated with specific accounts (such as influencers or merchants), a common approach is to build a data model based on a relational database. Specifically, this solution involves creating separate data tables for accounts and objects, and establishing a relationship table between them. The basic working principle is that when it's necessary to retrieve all objects associated with a particular account, the system first queries the relationship table to retrieve all object identifiers associated with that account. Then, based on these object identifiers, it batch queries the detailed information in the object table. Finally, it performs sorting calculations on this detailed information in the application server's memory. Its widespread adoption stems from its ability to leverage the mature transaction features of relational databases to ensure data consistency and, through index optimization, achieve acceptable query performance within a certain data volume.

[0035] However, this solution performs poorly when applied to e-commerce scenarios with high concurrency, massive data associations, and frequent changes in object attributes. A fundamental contradiction lies in the fact that the inherent design of this solution, which tightly couples object attributes with their relationships to optimize data consistency management, inevitably compromises the efficiency and scalability of data operations, and may even trigger cascading read / write diffusion problems. Specifically, in a specific application example of influencer-driven product ranking, when a popular product (e.g., Liuzhou snail rice noodles) is simultaneously distributed by millions of influencers, any change in the product's price or sales volume requires updating the product record in the relational database, triggering cascading updates or cache invalidations of millions of related records, resulting in millions of write diffusions and data synchronization delays of up to tens of minutes. Meanwhile, when a consumer visits a KOL's store page and initiates a sorting request, the system needs to first look up the tens of thousands of product identifiers associated with that KOL in the relationship table, and then use these identifiers to look up the product table to obtain real-time prices, sales, and other attributes, resulting in tens of millions of reads. Under high-concurrency queries, this can easily lead to database overload and response timeouts.

[0036] In-depth analysis reveals that the root causes of the aforementioned contradictions are multifaceted: From a data model perspective, object attribute information and the relationship information between objects are stored in a coupled manner, meaning that changes to one will directly affect the other. From a data operation perspective, primary-foreign key-based relational queries are essentially two or more independent index lookups and data merging processes, generating significant network I / O and computational overhead when dealing with massive amounts of relational data. Furthermore, from a system architecture perspective, the caching layer introduced to cope with query pressure incurs extremely high data consistency maintenance costs when facing frequent attribute updates. These factors collectively limit the performance ceiling of existing solutions when handling high-concurrency, real-time-critical scenarios involving massive relational retrieval and sorting.

[0037] In view of this, this application provides a new approach. To facilitate understanding of this application, the system architecture on which this application is based will first be described. Figure 1 This is a schematic diagram of the system architecture applicable to the embodiments of this application, such as... Figure 1 As shown, the system architecture may include: user terminal, terminal device and server terminal.

[0038] In this embodiment, the user terminal is set on the terminal device. The user terminal involved can be a client running on the terminal device, a mini-program, or a web application running through a browser, etc., and is used to initiate a search request carrying the target account identifier.

[0039] Terminal devices can include, but are not limited to, smart mobile terminals, wearable devices, PCs (Personal Computers), and smart home devices. Smart mobile devices can include devices such as mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and connected car terminals. Wearable devices can include devices such as smartwatches, smart glasses, smart bracelets, VR (Virtual Reality) devices, AR (Augmented Reality) devices, and mixed reality devices (devices that support both virtual and augmented reality). Smart home devices can include devices such as smart TVs and smart refrigerators with displays.

[0040] The user can interact with the server via the network. The server can be a platform that provides content tagging services, a single server, a server cluster consisting of multiple servers, or a cloud server. A cloud server, also known as a cloud computing server or cloud host, is a hosting product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Servers (VPS) services, such as high management difficulty and weak service scalability.

[0041] As one possible approach, after receiving a search request from the user, the server traverses the associated edges based on the target account identifier to determine the corresponding target object node, reads the attribute information from the target object node to form the search results, and returns the search results to the user for display.

[0042] It should be understood that Figure 1 The number of client terminals, terminal devices, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of client terminals, terminal devices, and servers.

[0043] Figure 2This is a flowchart of a data retrieval method provided in an embodiment of this application. The method can be... Figure 1 The server-side execution in the system shown. For example... Figure 2 As shown, the method may include the following steps: Step 201: Receive a search request carrying the target account identifier.

[0044] Step 202: Based on the pre-built data model, starting from the target account node corresponding to the target account identifier, traverse the associated edges connected to the target account node to determine the target object node connected to the target account node through the associated edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and associated edges for representing the relationship between accounts and objects, and the object nodes store the attribute information of the objects.

[0045] Step 203: Read the attribute information of the target object from the target object node, form the search results and return them.

[0046] As can be seen, this application pre-constructs a data model containing account nodes, object nodes, and association edges. It stores object attribute information uniformly in the object nodes and uses association edges to represent the relationships between accounts and objects, thus achieving decoupling of object attributes and relationships at the data model level. During retrieval, the corresponding association edges can be traversed directly based on the target account node to quickly locate the associated object node and directly read the attribute information stored in the object node, eliminating the need for multi-table joins, aggregation calculations, or multiple data queries. This effectively avoids the cascading reads and redundant calculations caused by data coupling in traditional solutions, reducing system overhead and computational redundancy, significantly improving data retrieval efficiency, reducing system load, and accelerating the response speed of retrieval results.

[0047] The following describes in detail each step of the above process and the effects that can be further produced, with reference to the embodiments. It should be noted that the terms "first," "second," etc., used in this disclosure do not have limitations in terms of size, order, or quantity, but are only used to distinguish them by name. For example, "first change event," "second change event," and "third change event" are used to distinguish three types of change events by name.

[0048] First, the above step 201, namely "receiving a search request carrying the target account identifier", will be described in detail with reference to the embodiments.

[0049] In this embodiment, the retrieval request received by the server includes at least one target account identifier, which is used to uniquely identify the core entity around which this retrieval service revolves. The retrieval request can be received through a standardized network interface, such as a Hypertext Transfer Protocol (HTTP) request from a user client, or a Remote Procedure Call (RPC) from other microservice components within the system.

[0050] The target account identifier can take many forms, including but not limited to the account's numeric ID, the username in string form, or a unique encoded hash generated based on a digest algorithm (such as the Secure Hash Algorithm, SHA).

[0051] To further optimize search strategies or refine the search scope, the search request can also include other extended parameters. For example, the request may include pagination parameters to specify the display logic of the returned results. These parameters may include page number and page size, which control the number of object data returned in a single search. In addition, the search request may also include filtering conditions, such as limiting the search to only objects with a status of "listed," thereby further narrowing the search scope and improving search efficiency and result accuracy.

[0052] The following describes in detail step 202, namely, "Based on a pre-built data model, starting from the target account node corresponding to the target account identifier, traverse the associated edges connected to the target account node to determine the target object node connected to the target account node through the associated edges."

[0053] The pre-built data model includes: account nodes for representing accounts, object nodes for representing objects, and association edges for representing the relationship between accounts and objects. The object nodes store the attribute information of the objects.

[0054] In practical applications, this data model can be a graph structure model. The following example, using a KOL-product live-streaming scenario, illustrates this data model. Figure 3 As shown, the data model includes: Account Node: The account node here specifically refers to the influencer node, which uniquely identifies a single influencer. This node stores the influencer's basic information, including but not limited to influencer name, influencer ID, influencer level, account registration time, account status, and other attribute information. Object Node: Here, the object node specifically refers to the product node, which uniquely represents a product being promoted. This node pre-stores the product's attribute information, including basic attributes (product name, product ID, product category, inventory status, etc.) and business attributes (sales volume, price, listing time, etc.). The product's attribute information is stored only on the product node, avoiding information redundancy in traditional "one product, multiple associations" scenarios. Association Edge: Serving as the link between influencer nodes (account nodes) and product nodes (object nodes), this edge specifically represents the sales relationship between influencers and products. It stores association status information, including but not limited to the associated listing time, display channel (such as store, live stream, etc.), and listing / delisting status (valid / invalid).

[0055] After constructing the data model, the first step is to locate the corresponding target account node within the data model based on the received target account identifier. Next, using this target account node as the starting point, the system traverses along the edges originating from that node. The traversal direction is from the account node to the object node. During the traversal, the system explores all edges directly connected to the target account node. Each edge connects to an object node. By traversing these edges, all target object nodes directly associated with the target account node can be identified.

[0056] The following describes step 203, namely "reading the attribute information of the target object from the target object node, forming the retrieval result and returning it", in detail with reference to the embodiments.

[0057] In this embodiment, after reading the attribute information of all target objects, it can be encapsulated into a certain data structure, such as a list or a JSON object, to form the search results. Finally, the search results are returned to the party that initiated the search request via the network.

[0058] To further optimize the usability and response efficiency of search results, this application also provides a scheme for flexibly sorting search results. As mentioned above, the search request can carry other parameters. In a preferred embodiment, the received search request also carries a preset sorting rule.

[0059] Based on this, step 203 can specifically include the following sub-steps: First, read the attribute information of the target object from the target object node; then, based on the read attribute information, sort the target object according to the preset sorting rules carried in the retrieval request, and return the sorted result as the retrieval result.

[0060] This approach allows the sorting logic to be pushed down from the application server to the computation layer of the graph database. Its advantage lies in the fact that the graph database can perform the sorting operation directly within its storage engine after traversing and obtaining the attribute information of all related objects, avoiding the memory consumption and network transmission overhead caused by sending massive amounts of raw data back to the application server for sorting.

[0061] Those skilled in the art will understand that the specific location for implementing the sorting function is not limited to within the graph database. For example, after obtaining the unsorted list of attribute information from the graph database, the sorting can be performed on an application server or a dedicated sorting service.

[0062] Specifically, the preset sorting rules can specify ascending or descending order based on one or more attribute fields of the object. For example, preset sorting rules include sorting by at least one of the following fields: transaction volume, price, and listing time.

[0063] By explicitly defining the sorting rules in the search request and performing push-down calculations, multi-dimensional and customizable real-time sorting of search results can be achieved. This directly solves the problem of high time consumption in memory sorting of massive amounts of data in traditional solutions.

[0064] Furthermore, the sorting fields described above are merely examples; those skilled in the art can define any attribute field stored on the object node as the sorting basis according to business needs. The sorting rule can also be a complex combination of rules or algorithms, such as a weighted score sort based on sales volume, price, and rating. This is as long as the rule can be executed based on the attribute information read from the object node.

[0065] Furthermore, to reduce the pressure on the data model from direct access by high-concurrency retrieval requests and to further reduce retrieval latency, this application embodiment also introduces a cache query mechanism in the retrieval process. Specifically, after receiving a retrieval request, the system can first query the cache to see if there are any cached results matching the retrieval request.

[0066] In this scenario, step 202 is executed only if no cached result matching the retrieval request exists in the cache. Accordingly, the process may further include returning the cached result as the retrieval result when a cached result matching the retrieval request exists in the cache.

[0067] The cache is a high-speed data storage layer situated between the application server and the graph database, used to store recently or frequently used search results. Querying the cache occurs before traversing the graph database. The system generates a unique cache key based on the search request; this key is typically determined by the target account identifier, sorting rules, pagination parameters, etc. This key is then used to query the cache system.

[0068] Caching can include local caching and remote caching. Local caching refers to caching stored in the application server process's memory, such as caching built using the Guava Cache or Caffeine libraries. It offers extremely fast access speeds, typically in the microsecond range, but has limited capacity and cannot be shared across multiple application server instances. Remote caching refers to independently deployed caching services, such as Redis or Memcached clusters. It has a larger capacity and can be shared by all application server instances, but network access introduces millisecond-level latency.

[0069] When caching includes both local and remote caches, a multi-level caching architecture can be built. For example... Figure 4 As shown, a retrieval request first queries the first-level local cache. If a match is found, the result is returned directly. If no match is found, the request continues to the second-level remote cache. If the remote cache also fails to find the match, the request finally returns to the third-level graph database for real-time retrieval. The retrieval priority of the local cache is higher than that of the remote cache. This multi-level cascading design allows the fastest local cache to handle the vast majority of high-frequency, repetitive requests, while the remote cache, as a second line of defense, further intercepts missed requests. Only a very small number of requests penetrate to the graph database, thus effectively distributing the query pressure.

[0070] The strategy for building cached results can be differentiated based on the access characteristics of the query. For retrieval requests that meet preset high-frequency characteristics, the system can adopt an asynchronous pre-built caching strategy. That is, before receiving the retrieval request, a background task pre-executes the retrieval to generate the corresponding retrieval results, and stores the retrieval results in the cache. For example, for queries about the homepages of top influencers on the platform, which have high access volume and extremely high requirements for response speed, the ranking results can be pre-calculated and written to the cache on a timed basis or based on data change events.

[0071] On the other hand, when a retrieval request is identified as meeting preset low-frequency characteristics, such as a long-tail query with diverse query conditions and a large result set, an on-demand origin caching strategy is adopted. That is, after retrieving the retrieval result from the origin graph database when the cache is not hit, the result is stored in the cache and maintained for a preset duration, such as 5 minutes or 30 minutes, so that it can be reused for the same query in a short period of time.

[0072] By adopting the aforementioned multi-level caching architecture and differentiated construction strategy, the response latency of most high-concurrency queries can be reduced to milliseconds or even microseconds, while keeping the proportion of query requests returning to the graph database at a very low level. This greatly alleviates the concurrency pressure on the graph database, ensures the overall stability of the system, and effectively solves the sub-problems of high data retrieval latency and easy overload of backend services in high-concurrency scenarios.

[0073] In addition, to ensure that the information stored in nodes and edges in the data model remains consistent with the business source data in real time or near real time, embodiments of this application also provide a data synchronization mechanism. The method further includes the steps of monitoring various change events and updating the data model accordingly.

[0074] Specifically, such as Figure 5 As shown, the system listens for the first change event of an object's attribute information and updates the corresponding object node in the data model based on the first change event. For example, it listens for price changes and sales update events for a product. When the event occurs, it updates the `item_price` or `item_sales` field of the corresponding product node in the graph database based on the product ID and the new attribute value carried in the event. Since product information is only stored in the product node, a single update takes effect for all accounts associated with that product, completely eliminating write diffusion.

[0075] And / or, the system listens for a second change event related to the account's attribute information and updates the corresponding account node in the data model based on the second change event. The account node stores the account's attribute information. For example, when an influencer's nickname changes, the name attribute of the corresponding influencer node is updated.

[0076] And / or, the system listens for a third change event related to the relationship between an object and an account, and updates the corresponding relationship edge in the data model according to the third change event. The relationship edge stores the relationship status information between the account and the object.

[0077] This monitoring and update operation can specifically include: When the third change event detected is a new association event, add an association edge connecting the corresponding account node and object node in the data model; when the third change event detected is a de-association event, delete the corresponding association edge in the data model.

[0078] For example, when an influencer lists a new product, an edge is added to the graph database from the influencer's node to the product's node; when the product is delisted, this edge is deleted.

[0079] These listening and update operations can be implemented through a separate data synchronization service. Once an event is detected, the event type and content are parsed and translated into update operation instructions for the graph database. Since update operations are performed on individual nodes or edges, synchronization can be completed within seconds or even milliseconds, achieving strong real-time data performance. Furthermore, after updating the graph database, asynchronous updates or invalidations of related data in the cache can be triggered, ensuring the consistency of the cached data.

[0080] Those skilled in the art will understand that the sources and methods of event listening can be diverse. For example, one can directly listen to the binary logs of the business database, or listen to events published by the business service to the message middleware. Updating the graph database can be a synchronous call or an asynchronous task. The key point is that by listening to change events to drive atomic updates to the graph data model, an efficient and accurate synchronization channel is established between the source data and the data model used for retrieval.

[0081] The implementation process of this application embodiment is further illustrated below with a specific application scenario example.

[0082] Suppose that on a certain e-commerce platform, a popular influencer known as "Old Li, the King of Sales," has distributed over 50,000 items. Consumer Xiao Wang opens the e-commerce app on his phone, enters "Old Li's" store page, and clicks the "Sort by Sales Volume from High to Low" button.

[0083] At this point, the app sends a retrieval request to the backend server, carrying the target account identifier "Expert Lao Li ID" and the preset sorting rule "sorted in descending order by sales". After the retrieval request reaches the application server, the server first generates a cache key based on "Expert Lao Li ID + sales sorting" and queries the local cache in memory, but it misses. Next, it queries the remote Redis cache, but still misses. Therefore, the request enters the origin server retrieval process.

[0084] The application server initiates a query to the graph database. The graph database first locates the expert node identified as "Expert Lao Li ID," then traverses along the associated edges, quickly finding over 50,000 directly connected product nodes. During this traversal, the graph database engine directly reads attribute information from these product nodes. Because all operations are performed internally within the graph database using pointer jumps and indexes, significant random I / O is avoided. After obtaining the sales attributes of all products, the graph database engine immediately performs a sorting operation at its computation layer, arranging them in descending order by the sales field. Finally, it returns the sorted first page of product information to the application server. The entire back-to-source query takes only a few hundred milliseconds.

[0085] After receiving the results, the application server returns them to Xiao Wang's client for rendering and display. Simultaneously, it populates the results into both a remote Redis cache and a local memory cache, setting appropriate expiration times. Subsequently, within a short period, if other users visit the "King of Sales, Lao Li's" store and sort by sales volume, their requests are highly likely to hit the local or remote cache layer, resulting in millisecond-level responses.

[0086] Meanwhile, a snail rice noodle product distributed by "Influencer Lao Li" on the platform experienced a surge in sales due to a promotional event. The product center's database updated the sales field for this product. This change event was detected by the data synchronization service, which immediately sent a command to the graph database to update the sales attribute value of the corresponding product node. The update was completed within seconds. At this point, the cached result of "Influencer Lao Li ID + Sales Sorting" might not have expired yet, but it already contained outdated sales data. To solve this problem, after updating the graph database, the data synchronization service can asynchronously send a cache invalidation event to the message queue. After consuming this event, the application server actively clears or updates the relevant cached items in both local and remote caches. In this way, when Xiao Wang refreshes the page next time, he will see a sorting result containing the latest sales information.

[0087] In this scenario, the embodiments of this application enable users to browse and sort all products associated with influencers in real time and accurately, significantly improving the user experience. For the platform, the system's maximum influencer sales volume has increased from several thousand to hundreds of thousands, while maintaining stable low latency under high concurrency access. Simultaneously, the data change synchronization efficiency has improved from minutes to seconds, providing a solid technical guarantee for business growth.

[0088] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0089] According to another embodiment, a data retrieval device is provided. Figure 6 A schematic block diagram of a data retrieval apparatus according to one embodiment is shown, the apparatus being disposed in Figure 1 The server side in the illustrated architecture. For example... Figure 6 As shown, the device 600 includes: a request receiving unit 601, a node determining unit 602, and a result generating unit 603. The main functions of each component are as follows: The request receiving unit 601 is configured to receive a search request carrying a target account identifier; The node determination unit 602 is configured to, based on a pre-built data model, traverse the associated edges connected to the target account node, starting from the target account node corresponding to the target account identifier, to determine the target object node connected to the target account node through the associated edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and associated edges for representing the relationship between the account and the object, and the object node stores the attribute information of the object; The result generation unit 603 is configured to read the attribute information of the target object from the target object node to form a retrieval result and return it.

[0090] Optionally, the search request may also carry a preset sorting rule; The result generation unit 603 is specifically configured as follows: Read the attribute information of the target object from the target object node; Based on the attribute information, the target objects are sorted according to the preset sorting rules, and the sorted results are returned as search results.

[0091] Optionally, the preset sorting rule includes sorting by at least one of the following fields: transaction volume information, price information, and listing time information.

[0092] Optionally, the device further includes: The cache query unit 604 is configured to query whether there is a cached result in the cache that matches the retrieval request; then The node determination unit 602 is specifically configured as follows: When there is no cached result matching the retrieval request in the cache, based on the pre-built data model, starting from the target account node corresponding to the target account identifier, the associated edges connected to the target account node are traversed to determine the target object node connected to the target account node through the associated edges.

[0093] Optionally, cache query unit 604 is also configured as follows: When a cached result matching the retrieval request exists in the cache, the cached result is returned as the retrieval result.

[0094] Optionally, the cache includes a local cache and / or a remote cache.

[0095] Optionally, when the cache includes a local cache and a remote cache, the retrieval priority of the local cache is greater than the retrieval priority of the remote cache.

[0096] Optionally, the device further includes: The cache building unit 605 is configured to: for a retrieval request that meets preset high-frequency characteristics, perform a retrieval in advance to generate corresponding retrieval results before receiving the retrieval request, and store the retrieval results in the cache.

[0097] Optionally, the cache building unit 605 is further configured to: When the search request is identified as meeting the preset low-frequency characteristics, the search result is stored in the cache and maintained for a preset duration.

[0098] Optionally, the device also includes a listening unit 606, configured to: Listen for the first change event of the attribute information of the object, and update the corresponding object node in the data model according to the first change event; And / or, listen for a second change event for the attribute information of an account, and update the corresponding account node in the data model according to the second change event, wherein the account node stores the attribute information of the account; And / or, listen for a third change event related to the association between an object and an account, and update the corresponding association edge in the data model according to the third change event, wherein the association edge stores the association status information between the account and the object.

[0099] Optionally, the monitoring unit 606 is specifically configured as follows: When the third change event detected is a new association event, a new association edge connecting the corresponding account node and object node is added to the data model; When the third change event detected is a deassociation event, the corresponding associated edge is deleted from the data model.

[0100] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments. The system and device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0101] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0102] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0103] And an electronic device, comprising: One or more processors; and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.

[0104] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0105] in, Figure 7 An exemplary architecture of an electronic device is shown, which may include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, video display adapter 711, disk drive 712, input / output interface 713, network interface 714, and memory 720 can communicate with each other via a communication bus 730.

[0106] The processor 710 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs and implement the technical solution provided in this application.

[0107] The memory 720 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 720 can store the operating system 721 for controlling the operation of the electronic device 700, and the basic input / output system (BIOS) 722 for controlling the low-level operations of the electronic device 700. Additionally, it can store a web browser 723, a data storage management system 724, and a data retrieval device 600, etc. The aforementioned data retrieval device 600 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when the technical solution provided in this application is implemented through software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.

[0108] Input / output interface 713 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0109] Network interface 714 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0110] Bus 730 includes a pathway for transmitting information between various components of the device, such as processor 710, video display adapter 711, disk drive 712, input / output interface 713, network interface 714, and memory 720.

[0111] It should be noted that although the above-described device only shows the processor 710, video display adapter 711, disk drive 712, input / output interface 713, network interface 714, memory 720, bus 730, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0112] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer program product. This computer program product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0113] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data retrieval method, characterized in that, include: Receive a search request carrying the target account identifier; Based on a pre-built data model, starting from the target account node corresponding to the target account identifier, the associated edges connected to the target account node are traversed to determine the target object node connected to the target account node through the associated edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and associated edges for representing the relationship between the account and the object, and the object node stores the attribute information of the object; The attribute information of the target object is read from the target object node, the search results are generated and returned.

2. The data retrieval method according to claim 1, characterized in that, The search request also carries a preset sorting rule; The step of reading the attribute information of the target object from the target object node, forming search results, and returning them includes: Read the attribute information of the target object from the target object node; Based on the attribute information, the target objects are sorted according to the preset sorting rules, and the sorted results are returned as search results.

3. The data retrieval method according to claim 2, characterized in that, The preset sorting rules include sorting by at least one of the following fields: transaction volume information, price information, and listing time information.

4. The data retrieval method according to claim 1, characterized in that, After receiving the retrieval request, the method further includes: Check if there is a cached result in the cache that matches the retrieval request; then The method based on the pre-built data model, starting from the target account node corresponding to the target account identifier, traverses the associated edges connected to the target account node to determine the target object node connected to the target account node through the associated edges, including: When there is no cached result matching the retrieval request in the cache, based on the pre-built data model, starting from the target account node corresponding to the target account identifier, the associated edges connected to the target account node are traversed to determine the target object node connected to the target account node through the associated edges.

5. The data retrieval method according to claim 4, characterized in that, The method further includes: When a cached result matching the retrieval request exists in the cache, the cached result is returned as the retrieval result.

6. The data retrieval method according to claim 4 or 5, characterized in that, The cache includes local cache and / or remote cache.

7. The data retrieval method according to claim 6, characterized in that, When the cache includes both local and remote caches, the retrieval priority of the local cache is greater than that of the remote cache.

8. The data retrieval method according to claim 4, characterized in that, The method further includes: For a search request that meets preset high-frequency characteristics, a search is performed in advance to generate corresponding search results before the search request is received, and the search results are stored in the cache.

9. The data retrieval method according to claim 4, characterized in that, The method further includes: When the search request is identified as meeting the preset low-frequency characteristics, the search result is stored in the cache and maintained for a preset duration.

10. The data retrieval method according to claim 1, characterized in that, The method further includes: Listen for the first change event of the attribute information of the object, and update the corresponding object node in the data model according to the first change event; And / or, listen for a second change event for the attribute information of an account, and update the corresponding account node in the data model according to the second change event, wherein the account node stores the attribute information of the account; And / or, listen for a third change event related to the association between an object and an account, and update the corresponding association edge in the data model according to the third change event, wherein the association edge stores the association status information between the account and the object.

11. The data retrieval method according to claim 10, characterized in that, The monitoring targets a third change event in the association between the object and the account, and updates the corresponding association edge in the data model based on the third change event, including: When the third change event detected is a new association event, a new association edge connecting the corresponding account node and object node is added to the data model; When the third change event detected is a deassociation event, the corresponding associated edge is deleted from the data model.

12. A data retrieval device, characterized in that, The device includes: The request receiving unit is configured to receive a search request carrying the target account identifier; The node determination unit is configured to, based on a pre-built data model, start from the target account node corresponding to the target account identifier, traverse the association edges connected to the target account node, and determine the target object node connected to the target account node through the association edges; wherein, the data model includes: account nodes for representing accounts, object nodes for representing objects, and association edges for representing the association relationship between the account and the object, and the object node stores the attribute information of the object; The result generation unit is configured to read the attribute information of the target object from the target object node to form the retrieval result and return it.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 11.

14. An electronic device, characterized in that, include: One or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program performs the steps of the method described in any one of claims 1 to 11.