User relationship chain data processing method and device, electronic equipment and storage medium
By using MongoDB and MapReduce technologies in user relationship chain data processing, the energy efficiency problem under massive data conditions was solved, and efficient user relationship chain data querying and processing were achieved.
Patent Information
- Application Number
- CN202311266597.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Existing user relationship chain data processing methods suffer from energy efficiency issues under massive data conditions, resulting in slow response and low processing efficiency.
The system uses MongoDB, a non-relational database, to store user relationship chain data. It also utilizes the Bson data structure and MapReduce technology to directly retrieve target related users by pre-configuring array index conditions, thereby reducing computation and improving query efficiency.
By directly retrieving target related users from the stored array, the pressure on database and CPU access and computational bottlenecks is reduced, thereby improving the processing efficiency and query speed of personal relationship data.
Smart Images

Figure CN117290615B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of relationship chain data processing technology, and in particular to a user relationship chain data processing method, a user relationship chain data processing device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] With the development of the internet, in order to meet users' social needs, related systems usually provide friend recommendation functions such as "people you may be interested in", "recommendations from friends", and "people you may know". The core algorithm required for these functions is the algorithm of second-degree relationships. The underlying layer of these relationship algorithms actually requires the integration of one-way links of big data, involving superposition and deduplication.
[0003] For personal network data, in addition to reading massive amounts of user information from the database, it's also necessary to sort and merge related network levels, such as complex relationships like direct friends and indirect friends. Currently, the conventional method for data storage and processing involves using Hive as the front-end for collection, and then using Hadoop with MapReduce and other methods for multiple processing steps. When the data volume is small, programmatic computation can be used to record and judge query results during reading. However, when the data volume increases massively, reaching tens of millions or even more, existing data storage and query methods will have significant energy efficiency issues. Summary of the Invention
[0004] This application provides a user relationship chain data processing method, apparatus, electronic device, and readable storage medium to solve the problem that existing data storage and retrieval methods have significant energy efficiency issues.
[0005] A first aspect of this application provides a method for processing user relationship chain data, comprising:
[0006] In response to a query command from a user, query information corresponding to the query command is obtained, wherein the query information includes at least first information of the object to be queried and second information of the target associated object of the object to be queried;
[0007] Using the first information and the second information as index conditions, query whether there is a target array that matches the index conditions from the pre-stored first dataset. If there is, retrieve the target associated object of the object to be queried from the target array and return the retrieved target associated object to the user terminal.
[0008] If it does not exist, retrieve the target associated object that matches the index condition from the pre-stored second dataset, return the retrieved target associated object to the user terminal, construct a corresponding array based on the retrieved target associated object, and store the constructed array in the first dataset.
[0009] Optionally, the first information includes the user ID of the object to be queried, and the second information includes the relationship hierarchy between the target associated object and the object to be queried;
[0010] The relationship hierarchy includes the N-degree connections of the target associated object to the object to be queried.
[0011] Optionally, querying whether a target array matching the index conditions exists in the pre-stored first dataset, using the first information and the second information as index conditions, further includes:
[0012] If there is no target array in the first dataset that matches the index condition, query whether there is a first array in the first dataset that matches the first information and includes N-1 degree connections belonging to the object to be queried;
[0013] If it exists, based on the obtained first array, retrieve the target associated object that matches the index condition from the second dataset, return the retrieved target associated object to the user terminal, construct a corresponding array based on the retrieved target associated object, and store the constructed array in the first dataset.
[0014] Optionally, querying whether a target array matching the index conditions exists in the pre-stored first dataset, using the first information and the second information as index conditions, further includes:
[0015] If there is no first array in the first dataset that matches the first information and includes N-1 degree connections belonging to the object to be queried, then query whether there is a second array in the first dataset that matches the first information and includes N-2 degree connections belonging to the object to be queried, until a second array of related objects that matches the first information and includes n degree connections belonging to the object to be queried is obtained, wherein n degree connections belong to any one of the first degree connections to N-2 degree connections;
[0016] Based on the obtained second array, retrieve the associated objects of the nth degree of connections that match the first information and belong to the target object from the second dataset. Based on the obtained associated objects of the nth degree of connections of the target object, retrieve the associated objects of the (n+1)th degree of connections that match the first information and belong to the target object from the second dataset, until the target associated object of the Nth degree of connections of the target object is obtained. Return the obtained target associated objects to the user terminal. Construct a corresponding array based on the obtained target associated objects and store the constructed array in the first dataset.
[0017] Optionally, the second dataset includes at least one data element, which includes at least the user ID of the corresponding object, third information representing the user ID of the associated object of the object, and fourth information representing the relationship hierarchy between the object and its associated object.
[0018] Optionally, retrieving the target associated object matching the index criteria from a pre-stored second dataset includes:
[0019] In the second dataset, the data elements that include the third information that matches the first information and the fourth information that matches the second information are identified as target data elements.
[0020] Obtain the corresponding object of the target data element, and use the corresponding object of the target data element as the target associated object.
[0021] A second aspect of this application provides a user relationship chain data processing apparatus, comprising:
[0022] The data receiving module is configured to respond to a query command from a user terminal and obtain query information corresponding to the query command. The query information includes at least first information about the object to be queried and second information about the target associated object of the object to be queried.
[0023] The query module is configured to use the first information and the second information as index conditions to query whether there is a target array that matches the index conditions from the pre-stored first dataset. If there is, the target associated object of the object to be queried is obtained from the target array, and the obtained target associated object is returned to the user terminal.
[0024] If it does not exist, retrieve the target associated object that matches the index condition from the pre-stored second dataset, return the retrieved target associated object to the user terminal, construct a corresponding array based on the retrieved target associated object, and store the constructed array in the first dataset.
[0025] A third aspect of this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0026] The memory stores computer-executed instructions;
[0027] The processor executes computer execution instructions stored in the memory to implement the method described above.
[0028] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described above.
[0029] A fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0030] This application pre-stores the associated user data of different levels of social connections of different users in an array, and pre-configures the different fields of the array. When querying, by using a single field or a combination of different fields as an index, the target associated user can be directly obtained from the stored array without having to calculate the first-degree and second-degree connections of the target user separately during the query, thereby effectively improving the processing efficiency of social connection data. Attached Figure Description
[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0032] Figure 1 A flowchart illustrating the user relationship chain data processing method provided in this application embodiment;
[0033] Figure 2 A schematic block diagram of a user relationship chain data processing device provided in an embodiment of this application;
[0034] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0035] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0037] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0038] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application. It is understood that in the technical solutions of this application, the acquisition, collection, storage, use, processing, transmission, provision, disclosure, and application of data all comply with the provisions of relevant laws and regulations.
[0039] Currently, existing technologies for processing user relationship chain data, i.e., users' social network data, typically use Hive and relational databases for storage and collection. This usually requires a large amount of data storage space and generates a large number of index files. The storage process and relationship data redundancy are significant, resulting in massive data volumes and low indexing efficiency. At the same time, applications need to perform a certain amount of calculations, judgments, filtering, and other logical operations when querying, leading to slow response times, non-reusable datasets, and low compatibility between different programs. Various boundary issues and data set compatibility problems need to be addressed. Depending on different business scenarios, Hadoop's MapReduce is used to repeatedly process the data, resulting in massive data redundancy between old and new datasets, low processing efficiency, and long update times when query conditions change.
[0040] To solve the above problems, such as Figure 1 As shown, the first aspect of this application provides a user relationship chain data processing method, comprising:
[0041] S100. In response to the query command from the user, obtain the query information corresponding to the query command. The query information includes at least the first information of the object to be queried and the second information of the target associated object of the object to be queried.
[0042] S200. Using the first information and the second information as index conditions, query whether there is a target array that matches the index conditions from the pre-stored first dataset. If it exists, retrieve the target associated object of the object to be queried from the target array and return the retrieved target associated object to the user. If it does not exist, retrieve the target associated object that matches the index conditions from the pre-stored second dataset and return the retrieved target associated object to the user. Construct a corresponding array based on the retrieved target associated object and store the constructed array in the first dataset.
[0043] This application pre-stores the associated user data of different levels of social connections of different users in an array, and pre-configures the different fields of the array. When querying, by using a single field or a combination of different fields as an index, the target associated user can be directly obtained from the stored array without having to calculate the first-degree and second-degree connections of the target user separately during the query, thereby effectively improving the processing efficiency of social connection data.
[0044] In step S100, the first information includes the user ID of the object to be queried, and the second information includes the relationship hierarchy between the target associated object and the object to be queried. The relationship hierarchy includes the Nth degree of connections of the target associated object to the object to be queried. For example, if the query instruction is to query the second degree of connections of user A, then the first information is user A, and the second information is the second degree of connections. It can be understood that if A and B are friends, B and C are friends, but C and A are not friends, then A and C can meet through B, i.e., B is the intermediary, and A and C are second-degree friends. For example, if A has first-degree friends B and D; B has first-degree friends C and D; C has first-degree friends B and E, then C is A's second-degree friend, E is C's third-degree friend, and so on.
[0045] In step S200, after parsing the user command to obtain the first and second information, the first and second information are used as index conditions to query whether there is a matching target array in the first dataset. For example, the index condition is {User A: 2}, which represents User A's second-degree connections. If the array to be queried contains the corresponding field, it can be determined as the target array. For example, if the array ID to be queried is User C, and it includes the field {User A: 2}, then User C is User A's second-degree connection. It is understood that the meaning of each field in the array can be defined as needed; this is only an example and not a limitation.
[0046] To improve query efficiency, this application pre-establishes a dataset of social connections for different users. For example, if user A adds user B as a friend within the application, then user B can be identified as a first-degree friend of user A; or, if user A shares a link with user B, and users C and D click on that link, then users C and D are second-degree friends of user A. In this application, the collected source data is stored in MongoDB using a Bson data structure.
[0047] MongoDB is a database based on distributed file storage. A MongoDB instance can contain a set of databases, a database can contain a set of collections, a collection can contain a set of documents, and a collection can contain a set of fields, each field being a key-value pair. For example, in this application, an array is a single document in MongoDB, and a dataset is a collection of multiple arrays.
[0048] MongoDB lies between relational and non-relational databases, supporting a JSON-like BSON data structure, which allows for the storage of complex data types. Leveraging MongoDB's BSON data structure, specific parameters can be used to filter second-degree connections during processing, significantly improving data processing efficiency, yielding corresponding result sets, reducing database and CPU access and computational bottlenecks, efficiently providing data, and offering a superior user experience for connection queries.
[0049] In this application, data processing is performed using MapReduce. MapReduce is a programming model typically used for parallel computation of large-scale datasets (greater than 1TB). MapReduce can extract key-value pairs from disorganized and unrelated data by parsing each data point, i.e., extracting the features of the data, and then summarizing the data according to these features.
[0050] In this application, the collected source data is stored in a second dataset, and the source data is processed periodically before being transferred to the first dataset. For example, if the source data is that user A's friends in a certain application are B and C, then the source data is processed using MapReduc, and the corresponding arrays are constructed based on the Bson data structure and stored in MongoDB. For example, the arrays [{ID: User B}, {User A: 1}] and [{ID: User C}, {User A: 1}] represent that users B and C are first-degree friends of user A.
[0051] In this way, during a query, by using the defined index conditions, for example, using ID as the key for user A and 1 as the value, you can retrieve an array of all fields that include user A: 1 to get user A's first-degree friends.
[0052] In step S200, using the first information and the second information as index conditions, querying the pre-stored first dataset to see if a target array matching the index conditions exists also includes:
[0053] If there is no target array in the first dataset that matches the index condition, query whether there is a first array in the first dataset that matches the first information and includes N-1 related objects belonging to the object to be queried; for example, if the index condition is to query user A's four-degree connections, if no array with user A's four-degree connections is found from the pre-stored array, then further query the array corresponding to user A's three-degree connections.
[0054] If they exist, based on the obtained first array, the target related objects matching the index conditions are retrieved from the second dataset, and the retrieved target related objects are returned to the user. A corresponding array is constructed based on the retrieved target related objects, and the constructed array is stored in the first dataset. For example, if an array corresponding to A's third-degree connections is found, such as [{ID: User E}, {User A: 3}], [{ID: User F}, {User A: 3}], the query results are directly read, and the source data in the second dataset is checked to see if there is source data related to users E and F. For example, if user G, a first-degree friend of user E, is found in the source data, then user G is user A's fourth-degree connection. The query results are returned to the user, and an array [{ID: User G}, {User A: 4}] is constructed and stored in the first dataset.
[0055] If no first array of related objects matching the first information and including N-1 related objects belonging to the queried object exists in the first dataset, then query the first dataset for a second array of related objects matching the first information and including N-2 related objects belonging to the queried object, until a second array of related objects matching the first information and including n-degree connections belonging to the queried object is obtained. Here, n-degree connections belong to any of the first to N-2 degrees of connection. If no third-degree connection related array for user A is found in the first dataset, then query the second-degree connection related array for user A, repeating the above steps until a related array for user A's n-degree connections is found. For example, if no second-degree connection related array for user A is found, then query the first-degree connection related array for user A, and so on, until a related array for user A's first degree of connection is found.
[0056] Based on the obtained second array, the system retrieves the nth degree connection objects from the second dataset that match the first information and belong to the queried object. Then, based on these nth degree connection objects, it retrieves the (n+1)th degree connection objects from the second dataset that match the first information and belong to the queried object, continuing until the target connection object belonging to the Nth degree of the queried object is obtained. The retrieved target connection objects are then returned to the user. A corresponding array is constructed based on these target connection objects and stored in the first dataset. For example, if the system retrieves the arrays [{ID: User B}, {User A: 2}] and [{ID: User C}, {User A: 2}] corresponding to User A's second degree connection, it then retrieves the first degree connection objects of User B and User C from the second dataset. For instance, if it retrieves User B's first degree connection User H, it further retrieves User H's first degree connection object, for example, User J. Thus, User J is User A's fourth degree connection object, and so on. Understandably, each time a new contact relationship is found, a new array is constructed and stored in the first dataset. For example, [{ID: User H}, {User B: 1}], [{ID: User J}, {User H: 1}], and [{ID: User H}, {User A: 3}], [{ID: User J}, {User A: 4}]. Understandably, if the corresponding data cannot be found in either the first or second dataset, an error message is returned to the user. Understandably, after obtaining the new array, the user's original array can be directly updated. For example, the original array is [{ID: User J}, {User H: 1}], and after updating, the array is [{ID: User J}, {User H: 1}, {User A: 4}]. Understandably, the method of defining the array can be determined according to actual use, and is not limited here.
[0057] During the query process, duplicate data may occur. For example, when querying user A's second-degree friends, if the query returns user A's first-degree friends B, C, and D, user B's first-degree friend D, user C's first-degree friend E, and user D's first-degree friend A, then user A's second-degree friends would be {A, D, E, F}. However, since user D is user A's first-degree friend, users A and D are duplicate data. Therefore, data deduplication is necessary. In this application, each array is built based on the Bson data structure, so data deduplication can be directly performed through MapReduce parameter filtering operations to build user A's second-degree network result set.
[0058] In this application, the second dataset includes at least one data element. Each data element includes at least the user ID of the corresponding object, third information representing the user ID of the associated object, and fourth information representing the hierarchical relationship between the object and its associated objects. Therefore, retrieving the target associated object matching the index conditions from the pre-stored second dataset includes: determining that the data element in the second dataset that includes the third information matching the first information and the fourth information matching the second information is the target data element; and retrieving the corresponding object of the target data element, using the corresponding object of the target data element as the target associated object. Here, a data element is a piece of source data. For example, if the source data includes a link ID shared by user A, and users B and C clicked on that link ID, then the third information is users B and C, and the fourth information is that users B and C are first-degree contacts of user A. Understandably, in order to further improve the efficiency of data query, the data in the second dataset can also be preprocessed. For example, each source data can be preprocessed into data elements with a key:value structure. For example, based on the above source data, after processing, the data elements {user A, user B, 1} and {user A, user C, 1} are obtained, representing user A's first-degree friends user B and user C. The obtained data elements are then periodically transferred to the array of the first dataset.
[0059] like Figure 2 As shown, a second aspect of this application provides a user relationship chain data processing apparatus, comprising:
[0060] The data receiving module is configured to respond to a query command from the user terminal and obtain query information corresponding to the query command. The query information includes at least the first information of the object to be queried and the second information of the target associated object of the object to be queried.
[0061] The query module is configured to use the first information and the second information as index conditions to query whether there is a target array that matches the index conditions from the pre-stored first dataset. If it does, the target associated object of the object to be queried is obtained from the target array and the obtained target associated object is returned to the user.
[0062] If it does not exist, retrieve the target associated object that matches the index condition from the pre-stored second dataset, return the retrieved target associated object to the user, construct the corresponding array based on the retrieved target associated object, and store the constructed array in the first dataset.
[0063] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing elements; they can be fully implemented in hardware; or some modules can be implemented by processing elements calling software, while others are implemented in hardware. For example, the data acquisition module can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0064] A third aspect of this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0065] The memory stores the instructions that the computer executes;
[0066] The processor executes computer-executable instructions stored in memory to implement the method described above.
[0067] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the electronic device may include: transceiver 121, processor 122, and memory 123.
[0068] Processor 122 executes computer execution instructions stored in memory, causing processor 122 to perform the scheme in the above embodiments. Processor 122 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0069] The memory 123 is connected to the processor 122 via the system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0070] Transceiver 121 can be used to obtain the task to be run and its configuration information.
[0071] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0072] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.
[0073] A fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described above.
[0074] A fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0075] In summary, this application overcomes the problems of space redundancy, large indexes, complex processing methods, and low query efficiency in storing massive relational data. By using MongoDB, a non-relational database, and leveraging its Bson data structure characteristics and MapReduce support, it cleverly utilizes specific parameters to directly filter second-degree connections during processing, significantly improving data processing efficiency, obtaining corresponding result sets, reducing the access and computational bottlenecks of the database and CPU, and improving data query efficiency.
[0076] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0077] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A user relationship chain data processing method, characterized by, The method comprises the following steps: in response to a query instruction of a user terminal, obtaining query information corresponding to the query instruction, the query information comprising at least first information of an object to be queried and second information of a target associated object of the object to be queried, the second information comprising a relationship level between the target associated object and the object to be queried, and the relationship level comprising N-degree connections of the target associated object to the object to be queried; using the first information and the second information as index conditions, querying a first data set pre-stored to determine whether there is a target array matching the index conditions, if there is, obtaining the target associated object of the object to be queried from the target array, and returning the obtained target associated object to the user terminal; if there is not, obtaining the target associated object matching the index conditions from a second data set pre-stored, returning the obtained target associated object to the user terminal, constructing a corresponding array according to the obtained target associated object, and storing the constructed array in the first data set.
2. The user relationship chain data processing method of claim 1, wherein, The first information comprises a user ID of the object to be queried.
3. The user relationship chain data processing method of claim 2, wherein, Using the first information and the second information as index conditions, querying the first data set pre-stored to determine whether there is a target array matching the index conditions, further comprising: if there is not a target array matching the index conditions in the first data set, querying whether there is a first array matching the first information and comprising associated objects belonging to N-1-degree connections of the object to be queried in the first data set; if there is, obtaining the target associated object matching the index conditions from the second data set based on the obtained first array, returning the obtained target associated object to the user terminal, constructing a corresponding array according to the obtained target associated object, and storing the constructed array in the first data set.
4. The user relationship chain data processing method of claim 3, wherein, Using the first information and the second information as index conditions, querying the first data set pre-stored to determine whether there is a target array matching the index conditions, further comprising: if there is not a first array matching the first information and comprising associated objects belonging to N-1-degree connections of the object to be queried in the first data set, querying whether there is a second array matching the first information and comprising associated objects belonging to N-2-degree connections of the object to be queried in the first data set, and so on, until a second array matching the first information and comprising associated objects belonging to n-degree connections of the object to be queried is obtained, wherein n-degree connections belong to any one of 1-degree connections to N-2-degree connections. Based on the obtained second array, the associated object of the nth degree of the person in the circle of the first information matching and belonging to the to-be-queried object is obtained from the second data set, the associated object of the n+1th degree of the person in the circle of the to-be-queried object is obtained from the second data set according to the obtained associated object of the nth degree of the person in the circle of the to-be-queried object, and the target associated object of the Nth degree of the person in the circle of the to-be-queried object is obtained until the target associated object of the Nth degree of the person in the circle of the to-be-queried object is obtained. The target associated object obtained is returned to the user end, the corresponding array is constructed according to the obtained target associated object, and the constructed array is stored in the first data set.
5. The user relationship chain data processing method of claim 2, wherein, The second data set includes at least one data element, and the data element includes at least a user ID of a corresponding object, third information representing a user ID of an associated object of the object, and fourth information representing a relationship level of the object and the associated object.
6. The user relationship chain data processing method of claim 5, wherein, The target associated object matching the index condition is obtained from the pre-stored second data set, including: Determining that the data element including the third information matching the first information and the fourth information matching the second information in the second data set is a target data element; Obtaining the corresponding object of the target data element, and taking the corresponding object of the target data element as a target associated object.
7. A user relationship chain data processing apparatus characterized by comprising: Including: The data receiving module is configured to obtain query information corresponding to the query instruction of the user end in response to the query instruction of the user end, the query information at least including first information of a to-be-queried object and second information of a target associated object of the to-be-queried object, the second information including a relationship level of the target associated object and the to-be-queried object, and the relationship level including that the target associated object is an Nth degree of the person in the circle of the to-be-queried object; The query module is configured to take the first information and the second information as index conditions, query whether there is a target array matching the index conditions in the pre-stored first data set, if there is, obtain the target associated object of the to-be-queried object from the target array, and return the obtained target associated object to the user end; If not, a target associated object matching the index condition is obtained from the pre-stored second data set, the obtained target associated object is returned to the user end, and a corresponding array is constructed according to the obtained target associated object, and the constructed array is stored in the first data set.
8. An electronic device, comprising: Including: A processor and a memory in communication connection with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to realize the method in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to realize the method in any one of claims 1-6.
10. A computer program product, characterised in that, The computer program is executed by the processor to realize the method in any one of claims 1-6.
Citation Information
Patent Citations
Data analysis method and device, electronic equipment and storage medium
CN116306571A
Data Processing Method and Apparatus
US20220292122A1