An information intelligent sorting method and device based on user habit learning

CN121579754BActive Publication Date: 2026-08-18XUNKANG INFORMATION TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511734687.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-08-18
Estimated Expiration
2045-11-25

AI Technical Summary

Technical Problem

[0007]本发明的目的在于解决现有信息排序技术缺乏个性化、无法适应用户习惯、重复性工作量大的技术问题,提供一种基于用户习惯学习的信息智能排序方法及装置,通过构建加权优先级图、消解习惯冲突、连通性分析和拓扑排序生成,实现智能化的个性化信息排序

Benefits of technology

[0020]通过构建加权优先级图自动提取用户排序偏好模式,实现了个性化排序逻辑,解决了现有技术无法适应不同用户习惯的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579754B_ABST
    Figure CN121579754B_ABST
Patent Text Reader

Abstract

The application discloses an information intelligent sorting method and device based on user habit learning, obtains user historical information sorting records, carries out data cleaning and standardization processing, calculates priority weights based on the position relationship of the standardization historical sorting data statistical information items, constructs a weighted priority graph, detects conflicts of the weighted priority graph, identifies bidirectional priority relationships and resolves conflict directions according to weights, generates a consistency habit graph, detects connectivity of the consistency habit graph, identifies weak connectivity components and isolated nodes, processes each connectivity component by using a topological sorting algorithm, generates a linear sorting sequence conforming to user habits, calculates a consistency index of the sorting sequence and historical data, and obtains a model quality evaluation result. The application solves the problems that existing information sorting technologies lack personalization, cannot adapt to user habits and have large repetitive workloads, and realizes intelligent personalized information sorting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information processing technology, specifically to an intelligent information sorting method and apparatus based on user habit learning, and particularly to a technical solution that extracts sorting preference patterns from users' historical operations and automatically generates personalized sorting through machine learning technology. Background Technology

[0002] Information sorting technology is an important field in modern information technology. Its core objective is to arrange data items in an ordered manner according to specific logic to improve the efficiency of users' understanding and processing of information. In information systems across various industries, it is often necessary to sort and organize multiple data items according to certain rules so that users can quickly obtain key information.

[0003] Currently, common methods for sorting information include sorting based on fixed rules and sorting based on statistical rules. Sorting based on fixed rules usually employs a preset sorting logic, such as arranging by project category, data entry time, or system default order; while sorting based on statistical rules extracts common sorting patterns by analyzing a large amount of user behavior data.

[0004] Existing information sorting technologies typically employ a single standard or fixed algorithm to organize and present information. The system automatically generates the information sorting based on preset rules, but this approach cannot adapt to the individual habits and professional experience of different users. When the relationships between information items are complex and users have specific sorting preferences, the sorting logic generated by the system often differs significantly from the user's expectations, causing users to spend a considerable amount of time manually adjusting the information order.

[0005] The existing technology has the following main problems: First, it lacks personalized sorting logic and cannot adapt to the personal habits and professional experience of different users; second, users face a large amount of repetitive work and need to manually adjust the order of information each time; third, the system lacks intelligent learning ability and cannot learn from and accumulate experience from users' historical operations; fourth, the consistency and standardization of information sorting are insufficient, and the sorting results of similar information items by the same user at different times may be inconsistent.

[0006] Therefore, there is a need for an intelligent information sorting technology that can automatically learn sorting preferences from users' historical operations, generate personalized sorting schemes, and reduce repetitive manual adjustments. Summary of the Invention

[0007] The purpose of this invention is to solve the technical problems of existing information sorting technologies, such as lack of personalization, inability to adapt to user habits, and large amount of repetitive work. It provides an intelligent information sorting method and device based on user habit learning, which realizes intelligent personalized information sorting by constructing a weighted priority graph, resolving habit conflicts, connectivity analysis, and topological sorting generation.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] A user habit-based intelligent information sorting method includes the following steps: acquiring multiple historical information sorting records of a user; cleaning and standardizing the historical information sorting records to obtain standardized historical sorting data; based on the standardized historical sorting data, statistically analyzing the positional relationship of each pair of information items in the historical sorting data, calculating the priority weights between each pair of information items, and constructing a weighted priority graph; performing conflict detection on the weighted priority graph, identifying information item pairs with bidirectional priority relationships, resolving conflict directions according to weight magnitude, and generating a consistent habit graph; performing connectivity detection on the consistent habit graph, identifying weakly connected components and isolated nodes, and obtaining a complete graph structure representation; using a topological sorting algorithm to process each connected component in the complete graph structure representation, generating a linear sorting sequence that conforms to user habits; calculating the consistency index between the linear sorting sequence and the historical sorting data, and obtaining a model quality evaluation result.

[0010] Furthermore, the historical information sorting records are cleaned and standardized to obtain standardized historical sorting data, including: deduplicating the historical information sorting records by deleting identical sorting records to obtain deduplicated sorting records; performing missing value detection on the deduplicated sorting records to identify records with missing information items or incomplete position information, generating a set of valid records; and standardizing the format of the identifiers and position indices of each information item in the set of valid records to obtain the standardized historical sorting data.

[0011] Furthermore, the positional relationship of each pair of information items in the historical sorting data is statistically analyzed, the priority weights between each pair of information items are calculated, and a weighted priority graph is constructed. This includes: extracting all simultaneously occurring pairs of information items from the standardized historical sorting data to generate a candidate pair of information items set; statistically analyzing the positional differences and order of each pair of information items in the candidate pair of information items set in each historical record to obtain positional statistics; and using the positional statistics to calculate the priority weights of each pair of information items using an inverse distance function to construct the weighted priority graph.

[0012] Furthermore, the positional relationship of each pair of information items in the historical sorting data is statistically analyzed, the priority weights between each pair of information items are calculated, and a weighted priority graph is constructed. This includes: identifying information item pairs that appear repeatedly in multiple historical records from the standardized historical sorting data, generating a set of repeated item pairs; extracting the single weight value corresponding to each information item pair in each historical record for each information item pair in the set of repeated item pairs, obtaining a weight sequence; and performing cumulative aggregation processing on the weight sequence to construct the weighted priority graph.

[0013] Further, the weight sequence is accumulated and aggregated to construct the weighted priority graph, including: for each information item pair in the set of repeated items, calculating the time decay weight based on the time of each occurrence to obtain the time weighting coefficient; based on the time weighting coefficient and the weight sequence, fusing each single weight using the weighted power average formula to obtain the fused weight value; calculating the ratio of the standard deviation to the mean of the weight sequence to obtain the weight reset confidence; adding the fused weight value and the weight reset confidence as edge attributes to the graph structure to generate enhanced edge data; and constructing the adjacency list representation of the graph based on the enhanced edge data and the candidate information item pair set to construct the weighted priority graph.

[0014] Further, conflict detection is performed on the weighted priority graph to identify information item pairs with bidirectional priority relationships. Conflict directions are resolved based on weight magnitude to generate a consistent habit graph. This includes: performing bidirectional edge detection on the weighted priority graph to identify information item pairs with both forward and reverse edges, generating a conflict pair list; comparing the weights of the forward and reverse edges for each conflict pair in the conflict pair list to determine the retention direction; and deleting edges with weights below a preset threshold based on the retention direction to generate the consistent habit graph.

[0015] Further, connectivity detection is performed on the consistent habit graph to identify weakly connected components and isolated nodes, resulting in a complete graph structure representation. This includes: initializing an access marker array for the consistent habit graph and generating a node access state table; based on the node access state table, traversing each node using a depth-first search algorithm to identify each weakly connected component; performing node statistics on each weakly connected component to identify components containing only a single node, generating an isolated node set; for each isolated node in the isolated node set, establishing connection edges with adjacent nodes based on the average position in historical sorting data, generating a supplementary edge set; and adding the supplementary edge set to the consistent habit graph to obtain the complete graph structure representation.

[0016] Further, the priority weights of each information item pair are calculated using an inverse distance function to construct the weighted priority graph, including: defining a loss function containing a frequency term, a location consistency term, and a regularization term for the location statistics, and establishing a weight optimization objective; based on the weight optimization objective, randomly selecting sample batches from the standardized historical sorted data using a time-weighted strategy to obtain the current batch data; calculating the subgradient of the loss function with respect to the weight variables for the current batch data to obtain a subgradient estimate; updating the weight variables using the subgradient descent method based on the subgradient estimate, and constraining the weights to be non-negative through a projection operator to obtain updated weight values; and performing iterative averaging on the updated weight values ​​to construct the weighted priority graph.

[0017] Further, the weight variables are updated using the subgradient descent method, and the weights are constrained to be non-negative by the projection operator to obtain the updated weight values. This includes: initializing the first-order moment estimate and the second-order moment estimate variables of the subgradient estimate to establish an initial state for moment estimation; updating the first-order moment estimate using the exponential moving average method based on the initial state of moment estimation and the subgradient estimate to obtain the updated first-order moment; updating the second-order moment estimate using the exponential moving average method based on the initial state of moment estimation and the square of the subgradient estimate to obtain the updated second-order moment; correcting the deviation between the updated first-order moment and the updated second-order moment to obtain the corrected moment estimate; and calculating the weight update step size using the adaptive learning rate formula based on the corrected moment estimate, and projecting the updated weights onto the feasible region using the projection operator to obtain the updated weight values.

[0018] This invention also provides an intelligent information sorting device based on user habit learning, comprising: a data acquisition module for acquiring multiple historical information sorting records of a specific user, performing data cleaning and standardization on the historical information sorting records to obtain standardized historical sorting data; a graph construction module for, based on the standardized historical sorting data, statistically analyzing the positional relationship of each pair of information items in the historical sorting data, calculating the priority weights between each pair of information items, and constructing a weighted priority graph; a conflict resolution module for performing conflict detection on the weighted priority graph, identifying information item pairs with bidirectional priority relationships, resolving conflict directions according to weight magnitude, and generating a consistent habit graph; a connectivity analysis module for performing connectivity detection on the consistent habit graph, identifying weakly connected components and isolated nodes, and obtaining a complete graph structure representation; a sorting generation module for, based on the complete graph structure representation, using a topological sorting algorithm to process each connected component, generating a linear sorting sequence that conforms to user habits; and an evaluation module for calculating a consistency index between the linear sorting sequence and the historical sorting data, and obtaining a model quality evaluation result.

[0019] The beneficial effects of this invention are as follows:

[0020] By constructing a weighted priority graph to automatically extract user sorting preference patterns, personalized sorting logic is realized, solving the problem that existing technologies cannot adapt to different user habits.

[0021] By employing conflict detection and resolution mechanisms, stable core habit patterns are extracted from the ranking differences of users at different times, thereby improving the consistency and reliability of the ranking results.

[0022] By using connectivity detection and topology sorting algorithms, the problem of isolated nodes caused by incomplete data can be handled, thus improving the robustness of the algorithm.

[0023] By employing a multi-dimensional model quality assessment system, we can quantitatively evaluate model performance, support continuous optimization, and ensure that the ranking results meet user expectations.

[0024] By using a weight learning mechanism based on optimization theory, weight calculation is transformed from a simple formula into an adaptive learning process, which significantly improves weight accuracy and system performance. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.

[0026] Figure 1 This invention provides an architecture diagram of an intelligent information sorting model.

[0027] Figure 2 A flowchart of an intelligent scheduling and control method for an integrated energy system provided in an embodiment of the present invention;

[0028] Figure 3 This is an architecture diagram of an intelligent scheduling and control device for an integrated energy system provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0030] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0031] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0032] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in detail below with reference to specific embodiments and accompanying drawings.

[0033] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0034] This application provides a method based on... Figure 1 The information intelligent sorting model architecture shown in this invention forms a complete closed-loop system. The entire system consists of six core functional modules, two key data structures, and a feedback optimization path. All parts work together to achieve the intelligent transformation from user historical data to personalized sorting results.

[0035] like Figure 1As shown, the system's data flow follows a clear top-down main process. First, the data acquisition module obtains users' historical information sorting records from the information system, performs data cleaning, deduplication, and standardization, providing high-quality input data for subsequent processing. The processed, standardized historical sorting data is passed to the graph construction module, which calculates the positional relationship of each pair of information items in the historical data and calculates priority weights. During weight calculation, the system can selectively activate a weight optimization submodule based on the Adam algorithm, improving the accuracy of weight calculation through adaptive learning rate and moment estimation techniques. The output of the graph construction module is a weighted priority graph, a directed graph data structure where nodes represent information items, directed edges represent priority relationships, and edge weights represent the strength of the relationship.

[0036] The weighted priority graph is then processed by the conflict resolution module. Since users may exhibit inconsistent preferences for the same pair of information items at different times or in different contexts, the graph may contain bidirectional edges, meaning that relationships such as A being preferred over B and B being preferred over A exist simultaneously. The conflict resolution module identifies these conflicts through bidirectional edge detection and resolves them based on indicators such as weight and confidence level, removing the direction with the smaller weight and generating a consistent habit graph without bidirectional edges. The resolved graph is then passed to the connectivity analysis module, which uses a depth-first search algorithm to identify weakly connected components and isolated nodes in the graph. It then processes isolated nodes by adding edges, ensuring the integrity and connectivity of the graph structure.

[0037] The complete graph structure is then processed by the sorting generation module, which applies a topological sorting algorithm to each connected component. Based on the priority constraints defined by directed edges, the topological sorting algorithm arranges the nodes in the graph into a linear sequence, ensuring that if an edge A→B exists, A must be ranked before B. For multiple connected components, the system merges them according to predefined rules (such as component size, average weight, etc.), ultimately generating a complete linear sorted sequence. This is the personalized sorting result output by the system.

[0038] To ensure ranking quality and support continuous improvement, the linear ranking sequence is fed into the evaluation module for quality assessment. The evaluation module calculates multiple metrics, including coverage (the proportion of information items included in the ranking compared to historical occurrences), violation rate (the proportion of rankings that conflict with historical records), and satisfaction score, to comprehensively evaluate model performance. The evaluation results are not only output as a model quality report but are also passed back to the graph construction and conflict resolution modules via a feedback optimization path (shown by the dashed arrows in the diagram). Based on the evaluation feedback, the system can dynamically adjust weight calculation parameters and conflict resolution strategies, achieving model self-optimization and performance improvement. This closed-loop feedback mechanism enables the system to continuously evolve with data accumulation and changes in user habits, maintaining long-term high performance.

[0039] The overall architecture design embodies modularity, scalability, and adaptability. Modules are connected through standardized data interfaces, with clear functional boundaries, facilitating independent development, testing, and maintenance. The weight optimization submodule is marked with a dashed box, indicating it is an optional enhancement component. The base system can calculate weights using a simple inverse distance formula, and the optimization algorithm is activated only when higher precision is required. The introduction of a feedback optimization path enables the system to self-learn, automatically adjusting parameters based on actual performance, reducing manual intervention. This design not only improves the system's intelligence level but also enhances its adaptability and robustness across different application scenarios.

[0040] Example 1

[0041] like Figure 2 As shown, this embodiment provides an intelligent information sorting method based on user habit learning, including the following steps:

[0042] S1 obtains multiple historical information sorting records of the user, performs data cleaning and standardization processing on the historical information sorting records, and obtains standardized historical sorting data;

[0043] S2, based on the standardized historical sorting data, statistically analyzes the positional relationship of each pair of information items in the historical sorting data, calculates the priority weight between each pair of information items, and constructs a weighted priority graph.

[0044] S3 performs conflict detection on the weighted priority graph, identifies information item pairs with bidirectional priority relationships, resolves conflict directions according to weight size, and generates a consistent habit graph;

[0045] S4 performs connectivity detection on the consistent habit graph, identifies weakly connected components and isolated nodes, and obtains a complete graph structure representation;

[0046] S5 uses a topological sorting algorithm to process each connected component in the complete graph structure representation, generating a linear sorting sequence that conforms to user habits;

[0047] S6 calculates the consistency index between the linear sorting sequence and the historical sorting data to obtain the model quality evaluation result.

[0048] Specifically, the core objective of step S1 is to extract valuable sorting information from the original user operation records and, through systematic cleaning and standardization, lay a reliable data foundation for subsequent habit learning. In practical applications, users' historical information sorting records are usually scattered and stored in the operation logs of information systems, database transaction records, or user behavior tracking systems. This raw data often contains a lot of noise, duplicate records, and inconsistent formats.

[0049] First, the system retrieves all sorting operation records for a specific user within a certain time window (e.g., the last 3-6 months) from the backend database. Each record typically contains several key fields: a sorting item list recording the final order of information items determined by the user, a timestamp identifying the specific time the sorting operation occurred, a user identifier ensuring the accuracy of data attribution, and an operation context that may contain business scenario information at the time the sorting occurred. The amount of these raw records can be considerable, potentially reaching hundreds or even thousands for active users.

[0050] After acquiring the raw data, the system performs deduplication as the first data cleaning step. The deduplication criterion is to compare the complete content and order of the sorting item lists. If two records have identical sorting item sets and are in the same order, they are considered duplicate records. This duplication may stem from user errors, duplicate records in the system, or redundancy during data synchronization. Deduplication not only reduces data redundancy but, more importantly, prevents certain sorting patterns from being over-reinforced due to duplicate records, leading to biased habit learning. During deduplication, the system retains the record with the most recent timestamp, as it better reflects the user's current true preferences.

[0051] Next, missing value detection and integrity verification are performed. The system checks whether the necessary fields of each record are complete, paying particular attention to whether there are null values, undefined item identifiers, or missing position indexes in the sorting item list. Records with too few information items (e.g., fewer than 3 items) are filtered out because the sorting relationship information contained in such records is too sparse to provide sufficient reference value for habit learning. In addition, the system also verifies the continuity and uniqueness of the position indexes to ensure that each information item has a clear and unique position in the sorting.

[0052] Data standardization is one of the most critical steps in this process. Since users may use different terms to refer to the same information item at different times or in different scenarios—for example, "Project A," "Project A," "prjA," or "Project A" might actually refer to the same business object—the system needs to establish a terminology mapping table to unify these variations. The standardization process includes: converting all information item identifiers to a unified naming convention, eliminating case differences, handling synonyms and abbreviations, and resolving inconsistent encoding formats. This process may require combining a business knowledge base or natural language processing technology to achieve intelligent matching.

[0053] The standardization of position indexes is equally important. The position information in the original records may be represented in different ways, such as counting from 0 or from 1, or using an alphabetical sequence (A, B, C, etc.). The system uniformly converts all position indexes into a consecutive integer sequence starting from 1, ensuring that subsequent calculations of position relationships have a consistent reference system. For special cases involving并列 positions (e.g., two items sharing the same priority), the system will perform an expansion process according to predefined rules and assign a unique serial number to each item.

[0054] After the above processing, the system generates a standardized historical sorting dataset. This dataset has a unified data structure, and each record contains: a standardized user ID, a normalized timestamp (uniformly in the UTC time zone), a list of standardized information item IDs, a consecutive sequence of position indexes, and an optional metadata field (such as operation scenario, device type, etc.). This cleaned dataset not only eliminates the noise and inconsistencies in the original data but also provides high-quality input for subsequent statistical analysis and pattern recognition, ensuring the accuracy and reliability of habit learning.

[0055] The core task of step S2 is to transform the user's historical sorting records into a weighted directed graph structure, which can systematically represent the preference intensity of the user for the priority relationships between different information items. This transformation process is not just a simple data structure transformation but a knowledge extraction process that extracts continuous preference metrics from discrete sorting instances and constructs a global priority network from local pairwise relationships.

[0056] First, the system extracts all possible relationships between information item pairs from the standardized historical sorting data. For each sorting record containing n information items, theoretically,

[0057] unordered item pairs can be generated, but considering the directionality, actually n(n - 1) ordered item pairs will be generated. The system traverses each record. For any two information items i and j, if i appears before j in the sorting (i.e., pos(i) < pos(j)), a directed edge from i to j is established, denoted as i → j. This extraction process will generate a candidate set of information item pairs, which contains all instances of priority relationships shown by the user in all historical records.

[0058] Next, the system performs a detailed positional statistical analysis on each candidate information item pair. For information item pair (i,j), the system records its specific performance in each historical record: the positional difference d = |pos(i) - pos(j)| reflects the distance between the two items in the ranking, and this distance value implies the strength of the priority relationship—generally, the closer the distance, the more sensitive the user is to the relative position of the two items, and the clearer the priority relationship; the direction indicator records whether i precedes j, and the statistical distribution of this Boolean value reflects the consistency of user preferences. The system establishes a detailed statistical profile for each information item pair, including its positional difference sequence in all relevant records, the proportion of directional consistency, and the number of times they co-occur.

[0059] Weight calculation is the core technical step in this process. The most basic weight calculation strategy is the inverse distance function, whose basic idea is: the smaller the positional distance, the stronger the priority relationship, and the larger the weight should be. The specific formula is as follows: Where d is the location distance and p is an adjustable exponential parameter. When p=1, the weight is inversely proportional to the distance, which is suitable for linear decay scenarios; when p=2, the weight is inversely proportional to the square of the distance, which more strongly penalizes distant relationships, suitable for scenarios emphasizing local priority. For example, if information item A is at position 2 and information item B is at position 5, then the distance d=3. With p=1, the weight is 1 / 3≈0.333, and with p=2, the weight is 1 / 9≈0.111. The system can also use other weight strategies, such as exponential decay weight w =exp(-λd), where λ is the decay rate. This strategy decays faster when the distance is large and can effectively filter weak correlations.

[0060] For pairs of information items that appear repeatedly in multiple historical records, the system needs to aggregate the weights of multiple observations to obtain a comprehensive priority strength assessment. The simplest aggregation strategy is direct summation. The advantage of this method is its simplicity and intuitiveness; the more times a value appears and the larger its weight in a single instance, the greater the final weight. However, this method has significant limitations: it is sensitive to outliers, and an error in a weight calculation can severely affect the result; it assumes that all historical records are equally important, ignoring the factor of temporal evolution; and it uses linear accumulation, failing to capture the nonlinear interaction effects that may exist between weights.

[0061] To overcome the limitations of simple accumulation, the system can introduce more complex aggregation mechanisms. Time-weighted aggregation considers the temporal evolution of user habits, assigning a time decay coefficient α to each observation. Recent records receive higher weights, ensuring the model can track the latest changes in user habits. Weighted power average provides a more flexible aggregation method; by adjusting the power parameter p, different aggregation effects can be achieved—p=1 corresponds to a weighted arithmetic mean, p=2 corresponds to a weighted root mean square, p→∞ approaches the maximum value, and p→-∞ approaches the minimum value.

[0062] In addition to merging weight values, the system also calculates weighted reset confidence to quantify the reliability of priority relationships. Confidence is defined as follows: σ is the standard deviation of the weight sequence, μ is the mean, and ε is a small constant to prevent division by zero. If the weight of a certain information item is very stable across different records (small standard deviation), the confidence level is high, indicating that users' preferences for this priority relationship are consistent; conversely, if the weight values ​​fluctuate greatly, the confidence level is low, indicating that users' preferences may be unstable or ambiguous. Confidence information has important reference value in subsequent conflict resolution and ranking generation.

[0063] Finally, the system organizes all calculated weights and confidence scores into a weighted directed graph data structure. Nodes in the graph represent information items, and directed edges represent priority relationships. Each edge has two attributes: a weight value indicating the strength of the priority relationship and a confidence score indicating the reliability of the relationship. The graph is stored using an adjacency list representation, with each node maintaining a list of outgoing edges. Each element in the list is a triple (target node, weight, confidence score). This data structure efficiently supports graph traversal operations and flexibly stores rich edge attribute information, providing a solid foundation for subsequent conflict detection and topology sorting.

[0064] The core issue that step S3 addresses is the inherent contradiction in user habits. In real-world applications, users may exhibit inconsistent or even opposite preferences in ranking the same pair of information items at different times and in different contexts. This phenomenon manifests as bidirectional edges in a weighted priority graph—edges pointing from A to B, and edges pointing from B to A. If these conflicting relationships are left unaddressed, topological sorting algorithms will fail to execute (due to the existence of loops). More importantly, they reflect the uncertainty and complexity within user habits, requiring scientific methods to identify and resolve them.

[0065] The first step in conflict detection is to systematically scan the weighted priority graph to identify all pairs of information items with bidirectional priority relationships. The system traverses each edge (A, B) in the graph, checking if the reverse edge (B, A) also exists. This checking process can be efficiently implemented by maintaining a hash table of edges, with a time complexity of O(E), where E is the number of edges. For each detected bidirectional edge pair, the system records complete information for both directions: the weight WAB and confidence confAB of the forward edge, the weight WBA and confidence confBA of the reverse edge, and the number and time distribution of historical records involved in each edge. This information constitutes a detailed profile of the conflict pair, providing a basis for subsequent conflict resolution decisions.

[0066] Conflict analysis is a crucial step in understanding the complexity of user habits. The system conducts in-depth analysis of each conflict pair to attempt to understand the reasons for the conflict. Temporal distribution analysis examines the distribution pattern of the priority relationship between the two directions along the timeline: if A→B mainly appears in earlier records, while B→A mainly appears in recent records, this may indicate a shift in user habits; if records in the two directions alternate over time, this may suggest that user preferences are influenced by contextual factors, leading to different choices in different scenarios. Weight difference analysis compares the weight strength of the two directions: if |WAB-WBA| is large, it indicates a significant user preference for a particular direction, and the conflict may originate from a few abnormal records; if the weights of the two directions are similar, it indicates that user preferences are indeed uncertain and require more careful handling.

[0067] The choice of conflict resolution strategy directly affects the quality of the final generated consistency habit graph. The maximum weight strategy is the most intuitive method: compare the values ​​of WAB and WBA, retain the direction with the larger weight, and delete the direction with the smaller weight. The logic of this strategy is that the direction with the larger weight represents a stronger or more frequent user preference and should be considered the dominant direction. For example, if WAB = 2.5 and WBA = 0.8, then keep A→B and delete B→A. The net weight strategy goes a step further: calculate the net weight Wnet = WAB - WBA. If Wnet > 0, retain A→B and update its weight to Wnet; if Wnet < 0, retain B→A and update its weight to |Wnet|. This strategy not only determines the direction but also adjusts the weight values ​​to reflect the relative strength difference between the two directions.

[0068] In practical applications, the system also sets a weight difference threshold Δthreshold to handle boundary cases. If |WAB - WBA| < Δthreshold, it indicates that the weights in the two directions are very close, and the user's preference is highly uncertain. For this situation, the system can adopt several strategies: completely delete both edges to avoid introducing unreliable priority relationships; retain the edge with the larger weight but reduce its confidence to reflect its uncertainty; or introduce third-party information (such as business rules or domain knowledge) to assist in decision-making. The threshold setting needs to be optimized according to the specific application scenario, with typical values ​​between 0.1 and 0.5.

[0069] Confidence information plays a crucial role in conflict resolution. Even if WAB > WBA, if confAB is much smaller than confBA, it indicates that while the A→B direction has a high weight, its reliability is low (possibly due to a few extreme records), while B→A, although with a lower weight, is more stable and reliable. In this case, the system can calculate a comprehensive score:

[0070] (Where β is a balancing parameter, such as 0.5), the direction to retain is determined based on the overall score rather than simple weights. This method achieves a better balance between strength and reliability, generating a more robust consistency graph.

[0071] The result of conflict resolution is the generation of a consistent habit graph, which is a directed graph without bidirectional edges. In this graph, there is at most one edge between each pair of information items. The direction of the edge represents the user's dominant preference direction after conflict resolution, and the weight of the edge reflects the strength of this preference. The system generates a detailed conflict resolution report, recording the total number of conflicts, the resolution decision for each conflict pair and its basis, and the edge information that was deleted. This information not only helps to understand the complexity of user habits but also provides valuable feedback for the continuous optimization of the model.

[0072] The goal of step S4 is to analyze the topology of the consistent habit graph, identifying connected components and isolated nodes to prepare for subsequent topology sorting. This step, seemingly a pure application of graph theory algorithms, actually embodies a profound understanding of the completeness of user habits and data coverage. An ideal habit graph should be strongly connected or at least weakly connected, meaning that all information items have direct or indirect priority relationships. However, in practical applications, due to incomplete data, the randomness of user operations, or the independence of information items, the graph often contains multiple unconnected connected components or even isolated nodes.

[0073] The first step in connectivity detection is to initialize the necessary data structures. The system creates a visit flag array `visited[]`, with a length equal to the total number of nodes in the graph, and initializes all values ​​to `false`. This array is used to mark which nodes have been visited during graph traversal, avoiding duplicate visits and infinite loops. Simultaneously, the system prepares a list to store the identified connected components, with each connected component represented by a set of nodes.

[0074] Depth-first search (DFS) is the core algorithm for identifying connected components. The system starts from the first unvisited node and performs a DFS traversal. During the traversal, the system not only visits the successor nodes reachable by the current node through outgoing edges, but also visits the predecessor nodes reachable by incoming edges, because we are identifying weakly connected components (ignoring the directionality of edges, as long as there is a path between nodes). Specifically, for the current node v, the system recursively visits all nodes u that satisfy the following conditions: (1) there is an edge v→u, or (2) there is an edge u→v, and (3) u has not yet been visited. Each visited node is marked as visited[u]=true and added to the set of connected components currently being constructed.

[0075] When a Depth-First Search (DFS) traversal is complete, the system identifies a connected component. This connected component contains all nodes reachable from the starting node via directed edges (direction ignored). The system saves this connected component to the result list and then continues searching for the next unvisited node as a new starting point for the next round of DFS. This process is repeated until all nodes have been visited. Ultimately, the system obtains a list of connected components, where each component is a set of nodes, and there are no edges connecting different components.

[0076] Analyzing connected components provides crucial insights into the structure of user habits. Large connected components (containing numerous nodes) typically correspond to groups of closely related information items that users frequently interact with together. These items exhibit rich priority relationships, and users have a clear understanding of their relative order. Small connected components may represent relatively independent subsets of information items that rarely appear simultaneously with other items in user interactions, thus lacking cross-group priority relationships. The system calculates metrics for each connected component, such as size (number of nodes), internal edge density (ratio of actual edges to possible edges), and average weight. This statistical information helps in understanding the modular structure of user habits.

[0077] Identifying isolated nodes is a special case of connected component analysis. An isolated node is a node that has neither outgoing nor incoming edges, forming a connected component containing only a single node. The existence of isolated nodes typically stems from several reasons: the item rarely appears in the user's history, making it impossible to establish sufficient priority relationships; the item always appears alone and never appears in the sorting process alongside other items; or all edges of the node are deleted during conflict resolution. The system collects all isolated nodes into a special set for special processing.

[0078] Handling isolated nodes is a key technical challenge in this step. If isolated nodes are ignored, they will not appear in the final sorting result, which obviously does not meet user expectations. The system employs a connection strategy based on historical position statistics to handle isolated nodes. For each isolated node, the system backtracks to the original historical sorting data and calculates the node's average position among all records containing it. For example, if node C appears in positions 2, 3, 3, 4, and 5 in 5 records, the average position is (2+3+3+4+5) / 5=3.4. Then, the system searches for other nodes with similar average positions in the consistent habit graph and establishes connecting edges.

[0079] The specific connection strategy is as follows: For an isolated node C with an average position of p, the system finds nodes with an average position in the interval [p-1, p] as predecessors, establishing an edge precursor→C; and finds nodes with an average position in the interval [p, p+1] as successors, establishing an edge C→successor. The weight of the edges is calculated based on the positional distance, with closer nodes having greater weights. If no suitable node is found within a specified interval, the system will gradually expand the search range until at least one predecessor and one successor are found, or the preset maximum search radius is reached. This method ensures that isolated nodes can be reasonably inserted into the sorted sequence, and their positions are consistent with the statistical patterns in historical data.

[0080] The generation of supplementary edges requires careful handling to avoid introducing unreliable priority relationships. The system calculates a low confidence value (e.g., 0.3-0.5) for each supplementary edge, reflecting that these edges are based on statistical inference rather than direct observation. Weights are calculated using a conservative strategy, typically set to small values ​​to ensure that supplementary edges do not excessively influence the ranking results. The system also checks whether supplementary edges will create new conflicts with existing edges; if so, it adjusts the direction or weight of the supplementary edges to ensure graph consistency.

[0081] After processing isolated nodes, the system obtains a complete graph structure representation. This graph has better connectivity, with most, if not all, nodes connected to the main connected components. The system re-executes connectivity checks to verify whether isolated nodes have been successfully connected and counts changes in the number of connected components. The final graph structure not only retains the explicit priority relationships from user experience but also supplements missing relationships through reasonable inference, laying the foundation for generating a complete and coherent sorting sequence.

[0082] Step S5 is the core output of the entire method. Its task is to transform the priority relationship network represented by the graph structure into a linear sorting sequence. This sequence must satisfy all priority constraints (i.e., if there is an edge A→B, then A must be placed before B) and conform to the user's overall habitual pattern as much as possible. Topological sorting algorithms provide the theoretical basis for achieving this goal, but in practical applications, complex problems such as multi-connected components, tie breaking, and loop detection need to be handled.

[0083] The first step in topological sorting is to calculate the in-degree of each node, which is the number of edges pointing to that node. In-degree reflects how many other nodes a node is "dependent on" or "constrained" by. The system iterates through all edges in the graph, incrementing the in-degree counter of node v by 1 for each edge (u, v). Initially, all nodes have an in-degree of 0; after the traversal, each node has an accurate in-degree value. Nodes with an in-degree of 0 are particularly important; they have no predecessor nodes, are not subject to any priority constraints, and can serve as starting points for sorting. These nodes represent "highest priority" information items in the user's habit, and they should generally be placed at the beginning of the sequence.

[0084] The system adds all nodes with an in-degree of 0 to a candidate queue. This queue maintains a set of nodes that can be safely added to the sorting result. "Safe" means that adding these nodes to the result will not violate any priority constraints because all their predecessor nodes (if any) have already been added to the result. In the initial stage of the algorithm, the candidate queue contains all nodes with an in-degree of 0; as the algorithm progresses, more nodes will have their in-degree become 0 as their predecessors are processed, thus adding them to the candidate queue.

[0085] Tie-breaking is a crucial decision point in topological sorting. When there are multiple nodes in the candidate queue, the algorithm needs to select one to join the sorting result, and this choice affects the specific form of the final sequence. Although all possible choices can produce an effective topological sort that satisfies priority constraints, different choices will lead to differences in the "quality" of the sequence. The system provides several tie-breaking strategies for selection: the alphabetical order strategy selects the node with the smallest node identifier in lexicographical order. This strategy ensures the determinism and repeatability of the sorting result, but may not conform to the user's actual preferences; the out-degree priority strategy selects the node with the largest out-degree, i.e., the node with the most successor nodes. This strategy tends to process nodes with a large "influence range" first, which helps to release more nodes faster; the weight priority strategy calculates the total out-edge weight of each candidate node and selects the node with the largest weight sum. This strategy most directly reflects the strength of the user's preferences and usually produces a sorting that best suits the user's habits.

[0086] The algorithm's main loop is an iterative process. In each iteration, the system selects a node (current) from the candidate queue according to the tie-breaking strategy. node This is added to the end of the results list. Then, the system updates the current... node In-degree of all successor nodes: for each outgoing edge current node →successor, decrement the in-degree of successor by 1, because current node The node has already been processed and no longer constrains the successor. If the in-degree of a successor node becomes 0 after the update, it means that all its predecessors have been processed and it can be safely added to the sorting; the system adds it to the candidate queue. This process is repeated continuously, processing one node at a time, until the candidate queue is empty.

[0087] Verifying the correctness of the algorithm is essential. When the candidate queue is empty, the system checks whether the length of the result list is equal to the total number of nodes in the graph. If they are equal, it means that all nodes have been successfully sorted, and the algorithm terminates normally; if they are not equal, it means that there are still nodes that have not been processed, which can only happen if there is a cycle in the graph. The existence of a cycle means that there is a set of nodes that depend on each other to form a closed loop, and no node's in-degree can be reduced to 0. Although all bidirectional edges should have been eliminated in the conflict resolution in step S3, cycle detection is still required because there may be cycles with a length greater than 2 (such as A→B→C→A).

[0088] The loop handling strategy depends on the specific application requirements. A conservative strategy involves reporting an error and requiring manual intervention, allowing the user to check the data or adjust the conflict resolution parameters. An aggressive strategy involves automatically breaking the loop by removing the edge with the smallest weight in the loop to eliminate the circular dependency, and then re-performing the topology sort. The system records detailed information about the loop, including the nodes contained in the loop, the weights of the edges, and their confidence levels. This information helps in understanding the cause of the loop, which may be due to a genuine circular preference in the user's habits, data noise, or incomplete conflict resolution.

[0089] For graphs containing multiple connected components, the system needs to perform a topological sort on each component separately and then merge the results. The merging strategy can be based on several criteria: sorting by component size in descending order, with larger components (containing more nodes) ranked first, which aligns with the intuition of "processing important ones first"; sorting by the average weight of the components, with components with higher weights ranked first, reflecting the strength of the user's overall preference; or sorting by the average position of the nodes in the component in historical data, with components ranked earlier ranked first, maintaining consistency with historical habits. The system can combine multiple criteria to calculate a comprehensive score to determine the order of the components.

[0090] The resulting linear sorted sequence is an ordered list of information items that satisfies all priority constraints extracted from the consistency habit graph and reflects the user's overall preference pattern through tie-breaking and component merging strategies. This sequence can be directly applied to information systems as the user's default sorting scheme, reducing the workload of manual adjustments. The position of each information item in the sequence has a clear basis, traceable to specific historical records and priority relationships, ensuring the interpretability and reliability of the sorting results.

[0091] The core objective of step S6 is to quantitatively evaluate the quality of the generated personalized ranking model, identify its strengths and weaknesses, and continuously improve its performance through a systematic optimization process. This step not only provides a comprehensive verification of all the preceding steps but is also a crucial link in forming a closed-loop feedback mechanism, ensuring that the system can continuously evolve as data accumulates and user habits change.

[0092] Coverage rate is the primary indicator for evaluating the integrity of the model. The system counts all different information items that have appeared in the user's historical records to form a complete set of information items U. Then, it checks the generated sorting sequence and counts the number of information items included in it to form the sorted item set S. The coverage rate is defined as |S| / |U|, that is, the proportion of information items covered by the sorting sequence among all information items that have appeared in history. A high coverage rate (such as over 90%) indicates that the model can handle most of the information items commonly used by users and has good integrity; a low coverage rate may imply data sparsity issues, where some information items cannot be incorporated into the model because they appear too few times or always appear in isolation. The system will list in detail the uncovered information items and analyze their characteristics to provide a basis for improving data collection or model algorithms.

[0093] The number of violations is the core indicator for evaluating the accuracy of the model. The system traverses all the user's historical sorting records again. For each pair of information items (i, j) in each record, it checks their relative positions in the generated sorting sequence. If in the historical record, i is ranked before j (pos_history(i) < pos_history(j)), but in the generated sequence, j is ranked before i (pos_generated(j) < pos_generated(i)), it is counted as one violation. The system accumulates the number of violations in all records and calculates the violation rate: the number of violations divided by the total number of information item pair comparisons. A low violation rate (such as below 10%) indicates that the generated sorting is highly consistent with the user's historical habits, and the model accurately captures the user's preferences; a high violation rate indicates that there are systematic biases in the model, which may be due to inaccurate weight calculation, inappropriate conflict resolution strategies, or unreasonable tie-breaking strategies for topological sorting.

[0094] The satisfaction score provides a comprehensive quality measure. The simplest definition is satisfaction = 1 - violation rate, which directly links satisfaction with accuracy. A more complex definition can introduce a weighting mechanism, assigning different penalty weights to different types of violations: if the violated edge has a high weight (a priority relationship strongly preferred by the user), the penalty should be heavier; if the violated edge has a low confidence (a relationship with unstable user preferences), the penalty can be lighter. The system can also calculate the severity of the position deviation: if i and j are adjacent in history but far apart in the generated sequence, this is more serious than just their positions being swapped. By comprehensively considering the number, type, and severity of violations, the system calculates a satisfaction score from 0 to 100, which intuitively reflects the quality of the model.

[0095] Conflict analysis provides a deeper understanding of the model's inherent contradictions. The system reviews all conflict pairs identified in step S3, statistically analyzing the total number of conflicts, the proportion of conflict pairs among all information item pairs, and the distribution of conflict weight differences. A high conflict rate (e.g., above 30%) may indicate unstable user habits or significant noise in the data; a low conflict rate suggests relatively consistent user habits. The system also analyzes the effectiveness of conflict resolution: for each resolved conflict pair, it checks whether the retained direction aligns with most historical records and calculates the accuracy of the resolution decision. If the resolution accuracy is low, it indicates that the current resolution strategy (e.g., the maximum weight strategy) may not be suitable for the user, and other strategies (e.g., the net weight strategy or the confidence-weighted strategy) need to be tried.

[0096] Time consistency analysis evaluates the model's adaptability to evolving user habits. The system divides historical records into multiple time windows, such as the most recent month, 1-3 months ago, and 3-6 months ago. For each time window, consistency metrics (violation rate, satisfaction, etc.) between the generated ranking and the records within that window are calculated. Ideally, the model should have the highest consistency with recent records, gradually decreasing with earlier records, indicating that the model has successfully captured the user's latest preferences. If the model has low consistency with all time windows, it indicates poor overall model quality; if it has high consistency with earlier records but low consistency with recent records, it indicates that the model is overfitting to old data and failing to track habit changes, requiring enhanced time decay mechanisms.

[0097] Based on the evaluation results, the system generates a detailed quality assessment report. The report uses a structured format and includes the following sections: an executive summary providing numerical values ​​and overall ratings (Excellent / Good / Average / Poor); a detailed indicators section listing all calculated indicators and their specific values, accompanied by visualizations (such as time trend charts of violation rates, conflict distribution histograms, etc.); a problem diagnosis section identifying the model's main problems, such as "low coverage, with 15% of information items not included," and "a violation rate of 20% compared to recent records, indicating insufficient time adaptability"; and an optimization suggestion section proposing specific improvement directions based on the diagnostic results, such as "recommending to reduce the time decay constant and increase the weighting of recent data," and "recommending to adopt a confidence-weighted conflict resolution strategy."

[0098] Optimization is a crucial step in transforming evaluation feedback into model improvements. Based on optimization suggestions, the system adjusts relevant algorithm parameters or strategy selections. Parameter optimization includes: adjusting the exponential parameter p of the inverse distance weights; if the accuracy of local priority relationships (adjacent items) is insufficient, the value of p can be increased to strengthen proximity relationships; adjusting the time decay constant T. decay If time consistency analysis shows that the model is not well adapted to recent data, the T value can be reduced. decayTo enhance the time decay effect; adjust the weight difference threshold for conflict resolution. If conflict analysis shows that a large number of boundary conflicts are incorrectly resolved, the threshold can be increased to adopt a more conservative resolution strategy. Strategy optimization includes: switching the weight aggregation method from simple accumulation to time-weighted power average; switching the conflict resolution strategy from maximum weight to net weight or confidence weight; and switching the tie-breaking strategy for topological sorting from alphabetical order to weight priority.

[0099] Optimization effect verification is a necessary step to ensure the effectiveness of the improvement. The system re-executes steps S1 to S5 using the optimized parameters and strategies to generate a new ranking sequence, and then recalculates all evaluation indicators. By comparing the changes in indicators before and after optimization, the system can quantify the optimization effect: if the violation rate decreases from 20% to 12% and the satisfaction score increases from 80 to 88, the optimization is successful; if some indicators improve but others deteriorate, analysis and trade-offs are needed, and multi-objective optimization methods may be required to find a balance; if all indicators show no significant improvement or even deteriorate, the optimization direction may be incorrect, requiring re-diagnosis of the problem or trying other optimization strategies.

[0100] A continuous optimization mechanism ensures the model maintains high quality over the long term. The system establishes a regular evaluation plan, such as automatically performing a quality assessment weekly or monthly, to monitor trends in model performance. When a significant performance decline is detected (e.g., a drop in satisfaction score exceeding 5 points), the optimization process is automatically triggered. The system also supports incremental learning; when a user performs a new ranking operation, new data is added to the training set, and the system quickly adapts to changes in user habits by incrementally updating weights and re-executing conflict resolution, without needing to rebuild the entire model from scratch. Through this closed-loop evaluation-optimization-validation mechanism, the system can continuously improve the quality of personalized ranking, providing users with increasingly accurate and habit-aligned intelligent ranking services.

[0101] Specifically, S1 includes the following sub-steps:

[0102] S1.1: Extract historical sorting records of users from the system's backend database, including a list of sorting items, sorting timestamps, user identifiers, and other information. For example, extract all sorting operation records of users within the past 6 months from the operation logs of the information management system. Each record contains fields such as a list of information item IDs, operation time, and user ID.

[0103] S1.2: Perform deduplication on the historical information sorting records, deleting identical sorting records to obtain deduplicated sorting records. By comparing the content and order of the sorting item list, duplicate records are identified and deleted to avoid the same operation being counted repeatedly in the statistics.

[0104] S1.3: Perform missing value detection on the deduplicated sorted records to identify records with missing information items or incomplete positional information, and generate a valid record set. Check the completeness of each record, and delete records with fewer than 3 information items to ensure that there are enough sorting relationships available for learning.

[0105] S1.4: Standardize the format of the identifiers and position indices of each information item in the valid record set to obtain the standardized historical sorting data. Standardize the information item names to resolve issues such as synonyms and abbreviations. For example, unify "Project A", "Project A", and "prjA" into the standard identifier "ProjectA" to ensure terminology consistency.

[0106] After the above processing, a cleaned and standardized historical sorted dataset is obtained, which serves as the input for subsequent steps.

[0107] Specifically, S2 includes the following sub-steps:

[0108] S2.1: Extract all simultaneously occurring information item pairs from the standardized historical sorted data to generate a candidate information item pair set. Traverse each historical record; for any two information items i and j in the record, if i appears before j, establish a directed edge i→j and add this edge to the candidate set.

[0109] S2.2: Statistically analyze the positional differences and order of each information item pair in the candidate information item pair set across all historical records to obtain positional statistics. For information item pair (i,j), record its positional difference d=|pos(i)-pos(j)| and direction indication (whether i precedes j) in each historical record.

[0110] S2.3: Based on the location statistics, the priority weight of each information item pair is calculated using the inverse distance function, and the weighted priority map is constructed. The inverse distance weighting formula is used. Where d is the positional distance and p is the exponential parameter (typically p=1 or p=2). For example, if information item A is located at position 2 in a record and information item B is located at position 5, then the distance d=3 and the weight wAB=1 / 3=0.333.

[0111] S2.4: Identify information item pairs that appear repeatedly in multiple historical records from the standardized historical sorting data, and generate a set of duplicate item pairs. Scan all historical records, count the number of times each information item pair appears, and mark item pairs that appear more than once as duplicate item pairs.

[0112] S2.5: For each information item pair in the set of repeated items, extract its corresponding single weight value in each historical record to obtain a weight sequence. For example, if information item pair (A, B) appears in 5 records, the corresponding weight sequence is {0.333, 0.5, 0.25, 0.4, 0.2}.

[0113] S2.6: Perform accumulation and aggregation processing on the weight sequence to construct the weighted priority graph. A simple accumulation strategy is used to add all values ​​in the weight sequence to obtain the final weights. .

[0114] For the example above, the final weight is 0.333+0.5+0.25+0.4+0.2=1.683.

[0115] S2.7: Based on the calculated weight values, construct an adjacency list representation of the weighted directed graph. Nodes in the graph represent information items, directed edges represent priority relationships, and edge weights represent priority strength. Each node in the adjacency list stores the target nodes of all its outgoing edges and their corresponding weights.

[0116] After the above processing, a complete weighted priority network structure is obtained, which reflects the user's personalized ranking preferences.

[0117] Example 2

[0118] This embodiment enhances the weight aggregation process in step S2.6 based on embodiment 1, specifically including the following sub-steps:

[0119] S2.6.1: For each information item pair in the set of repeated items, calculate the time decay weight based on the time of each occurrence to obtain the time weighting coefficient.

[0120] Define time decay function ,in For the current time, For the first The time of the record. This represents the decay time constant (e.g., 30 days). More recent records have a higher weighting coefficient, reflecting the time evolution of user habits.

[0121] S2.6.2: Based on the time weighting coefficients and the weight sequence, the weights of each individual iteration are fused using a weighted power average formula to obtain the fused weight value.

[0122] Using the weighted power average formula: ,in For power-law parameters. When When it is a weighted arithmetic mean, The time is the weighted root mean square.

[0123] For example, for the weight sequence {0.333, 0.5, 0.25, 0.4, 0.2} and the time coefficient {0.9, 0.85, 0.8, 0.75, 0.7}, the fusion weight is calculated using p=1.

[0124] S2.6.3: Calculate the ratio of the standard deviation to the mean of the weighted sequence to obtain the weighted reliability.

[0125] Calculate the mean of the weighted sequence and standard deviation Confidence level is defined as ,in To prevent division by zero by small constants. High confidence indicates that the priority relationship is consistent across different records, demonstrating strong reliability.

[0126] S2.6.4: Add the fusion weight value and the weight reset confidence as edge attributes to the graph structure to generate enhanced edge data.

[0127] In the edge data structure of the adjacency list, in addition to storing the target node and weight, the confidence value is also stored, forming a triple (target node, fusion weight, confidence).

[0128] S2.6.5: Based on the enhanced edge data and the candidate information items, construct the adjacency list representation of the graph and construct the weighted priority graph.

[0129] By traversing all information item pairs, the enhanced edge data is added to the adjacency list of the corresponding source node, ultimately forming a complete weighted priority graph.

[0130] This embodiment improves the accuracy and reliability of weight calculation by introducing time decay, weighted fusion, and confidence quantification.

[0131] This embodiment systematically enhances the weight aggregation process in step S2.6 of Embodiment 1. By introducing a time decay mechanism, a multi-dimensional weighted fusion strategy, and a confidence quantification method, the accuracy and reliability of priority weight calculation are significantly improved. This enhancement scheme fully considers the dynamic evolution of user habits, enabling the generated weighted priority graph to more accurately reflect the user's current true preferences, rather than simply treating all historical data equally.

[0132] The core idea of ​​step S2.6.1 is to assign differentiated importance weights to historical records at different points in time, so that recent records contribute more to the final weight, while the influence of earlier records gradually diminishes. This design is based on an important observation: user preferences and habits are not static, but evolve over time, with changes in the business environment and the development of personal cognition. A user's information sorting method that they frequently used three months ago may no longer be suitable for their current workflow; conversely, the operation records of the most recent week often better represent the user's latest needs and preferences.

[0133] The system first obtains the current time as a reference point, denoted as . This time is typically in Unix timestamp format, in seconds or milliseconds, to ensure the accuracy of time calculations. For each information item pair in the set of duplicate items, the system extracts the timestamp of each occurrence of that item pair in the historical record. Suppose a certain information item pair... It appeared five times in the user's history. The timestamps of these five records are as follows: Arranged in chronological order from morning to night.

[0134] decay time constant The choice of time period has a significant impact on model performance. In this embodiment, it is recommended to use 30 days as the default value, which means that the time weight coefficient of a record older than 30 days will decay to [a lower value]. That is, approximately 37% of the weight is retained; records from 60 days ago decay to... Retain approximately 14% weight; records from 90 days ago decay to... Only about 5% of the weight is retained. This decay rate is suitable for most information management scenarios, making full use of historical data while quickly adapting to changing habits. For scenarios where user habits change rapidly, such as news reading and social media browsing, the weight can be... Setting it to a smaller value, such as 7 days or 14 days, makes the model more sensitive to the latest preferences; for scenarios where user habits are relatively stable, such as enterprise document management and scientific research data organization, it can be... Set a larger value, such as 60 days or 90 days, to make full use of long-term accumulated habitual data.

[0135] In actual calculations, the system calculates a time-weighted coefficient for each historical occurrence of each information item pair. For example, assuming the current time is January 15, 2024, and a certain information item pair has appeared three times in history, on December 20, 2023, January 5, 2024, and January 12, 2024, using a 30-day decay constant, the three records are 26 days, 10 days, and 3 days from now, respectively. Substituting these values ​​into the formula, the calculated time-weighted coefficients are: approximately 0.420 for the first record, approximately 0.717 for the second record, and approximately 0.905 for the third record. It is clear that more recent records receive higher weight coefficients, and these coefficients will play a crucial role in the subsequent weight fusion process.

[0136] The calculation of time-weighted coefficients also requires consideration of some boundary cases and special handling. If the timestamp of a record is later than the current time (this may be due to system clock desynchronization or data entry errors), the system will set the time interval to zero, assign the record the maximum weight coefficient of 1.0, and record a warning message for subsequent investigation. If the time interval is too large, causing the calculated weight coefficient to be less than a certain threshold (such as 0.001), the system can choose to set it directly to zero, thus reducing the amount of calculation without significantly affecting the results. The system will also check the validity of timestamps to ensure that all time values ​​are within a reasonable range, avoiding calculation errors caused by abnormal data.

[0137] The task of step S2.6.2 is to combine the multiple single weight values ​​generated by the same information item pair in multiple historical records with the time weighting coefficient calculated in the previous step into a comprehensive weight value. This fusion process is not a simple arithmetic average, but adopts a more flexible and powerful weighted power average method, which can adjust the fusion strategy according to different application needs and achieve a balance between conservative and aggressive estimation.

[0138] Power parameter The choice of determines the mathematical properties of fusion. When When this happens, the formula degenerates into a weighted arithmetic mean, which is the most commonly used and intuitive averaging method. The calculated result is located in the middle of all single weights, without bias towards extreme values. In specific calculations, first, each single weight w... k Multiply the weights by their corresponding time coefficients to obtain time-weighted values; then sum all these weighted values; finally, divide by the sum of all time coefficients (normalization process) to obtain the final weight. The advantages of this method are its simplicity, stable results, and suitability for most application scenarios.

[0139] when At this point, the formula becomes a weighted root mean square (RMS) calculation. This fusion method is more sensitive to larger weight values ​​and can amplify the influence of high weights. The calculation process is as follows: first, square each individual weight, then multiply it by the time coefficient and sum the results, finally taking the square root. This method is suitable for scenarios where strong priority relationships need to be emphasized. If a certain information item shows a very strong priority relationship (large weight value) in some records, the weighted root mean square will ensure that this strong relationship is fully reflected in the final weight and is not overly diluted by other weaker records.

[0140] In theory, It can take any positive real value, different Different values ​​correspond to different fusion strategies. When As the weighted power average approaches infinity, it approaches the maximum weight, meaning the final weight is primarily determined by the record with the highest weight. This extreme strategy is suitable for scenarios that only focus on the strongest priority relationship. As the weighted power average approaches zero, it approximates the weighted geometric average. This strategy is sensitive to all weight values; any excessively small weight will significantly lower the final result. It is suitable for scenarios requiring consistency across all records. When the value is negative, the formula tends to be a harmonic average, which is biased towards smaller weight values. This is useful in some special applications, but is rarely used in priority weight fusion.

[0141] Let's illustrate the calculation process with a concrete numerical example. Suppose a certain information item pair appears five times in history, and the single-weight sequence calculated using the inverse distance function is... The corresponding time weighting factor is .use The weighted arithmetic mean is calculated as follows: First, calculate the weight of each item, which is respectively... , , , , ;

[0142] Then sum them up to get ;

[0143] The sum of time coefficients is ;

[0144] The final fusion weight is .

[0145] If adopted The weighted root mean square is calculated as follows: First, the product of the square of each term and the time coefficient is calculated, which is respectively... , , , , ;

[0146] Summation yields Divide by the sum of time coefficients to obtain Finally, the square root is obtained. As can be seen, the fusion weight obtained by the root mean square method (0.358) is slightly higher than that of the arithmetic mean (0.341). This is because the root mean square method gives more importance to larger single weights (such as 0.5).

[0147] In practical applications, the system typically provides The configuration options for this value allow users or system administrators to adjust it according to specific needs. For most information sorting scenarios, it is recommended to use [the specified option]. The weighted arithmetic mean is used because it provides stable and predictable fusion results without being overly biased towards any extreme cases. For scenarios requiring strong priority relationships, such as the sequencing of steps in critical business processes, this approach can be tried. Or a larger value. The system can also automatically select the optimal value through cross-validation or A / B testing. Value, that is, trying different The value is used to evaluate the consistency between the generated sorted sequence and the user's actual operation, selecting the one with the highest consistency. The value is used as the final configuration.

[0148] Step S2.6.3 introduces the key concept of weighted confidence, used to quantify the reliability and stability of a priority relationship. Even if two information item pairs have the same fusion weight value, their reliability can differ greatly: one may be based on multiple highly consistent observations, while the other may be based on a few highly fluctuating observations. The confidence index can distinguish between these two cases, providing an important decision-making basis for subsequent conflict resolution and ranking generation.

[0149] The confidence level is calculated based on the statistical dispersion of the weight sequence. The system first calculates the mean of the weight sequence, denoted as... This is the arithmetic mean of all individual weight values. The mean reflects the central tendency of the information item in relation to priority and is the typical level of the weight. Then, the standard deviation of the weight sequence is calculated, denoted as . This is a classic statistic for measuring the dispersion of weight values.

[0150] The larger the standard deviation, the greater the difference in the weight values ​​of the information item pair in different historical records, and the unstable user preference for this priority relationship; the smaller the standard deviation, the more concentrated the weight values, and the more consistent the user preference.

[0151] Two comparative examples illustrate the significance of confidence levels. Example 1: Information item pair The weight sequence in the five historical records is as follows mean Standard deviation Confidence level The value is very close to 1, indicating that this priority relationship is highly stable and reliable. Example 2: Information item pair The weight sequence in the five historical records is as follows mean (Same as Example 1), but standard deviation Confidence level The value is only about 0.5, indicating that although the average weights are the same, the reliability of this priority relationship is far lower than that of Example 1.

[0152] In practical applications, confidence information plays a crucial role in multiple stages. During conflict resolution, when the weights of two directions are close, the system can use confidence to break the tie: choosing the direction with higher confidence, even if its weight is slightly smaller, because higher confidence means that direction has more consistent support. During topology sorting, if selection is needed from multiple candidate nodes, the system can prioritize nodes whose edges have higher average confidence, ensuring that the sorting decision is based on more reliable priority relationships. During model evaluation, the system can calculate the average confidence of all edges as an indicator of the overall model quality: a high average confidence indicates that user habits are generally stable and consistent, and the model has good reliability; a low average confidence may indicate unstable user habits or data quality issues, requiring more cautious application of the model results.

[0153] The calculation of confidence scores can be further extended and optimized. For example, a time-weighted standard deviation can be introduced, giving higher weight to recent records when calculating dispersion, making the confidence score more reflective of the stability of current habits. A lower threshold for confidence scores can be set, such as 0.3 or 0.5, allowing for special marking or direct filtering of edges with confidence scores below the threshold to prevent unreliable priority relationships from affecting the final result. The confidence score can also be combined with the edge weights to calculate a comprehensive score, such as... (in (It is a balancing parameter), and in subsequent processing, a comprehensive score is used instead of a simple weight value to achieve a unified consideration of strength and reliability.

[0154] The task of step S2.6.4 is to integrate the previously calculated fusion weight values ​​and confidence scores into the graph data structure to form enhanced edge data. This step, seemingly simple, is actually a crucial step in transforming abstract numerical calculation results into an operable graph structure representation, laying the data foundation for subsequent graph algorithm processing.

[0155] In a basic weighted directed graph, each edge typically contains only two pieces of information: a source node and a target node (defining the direction of the edge), and a weight value (defining the strength of the edge). This simple edge representation is expanded in this embodiment to include an enhanced edge with three attributes: a target node identifier, indicating which information item the edge points to; and a fusion weight value, calculated in step S2.6.2. This reflects the strength of the priority relationship; the weighted confidence level is the one calculated in step S2.6.3. This reflects the reliability of the priority relationship.

[0156] The enhanced edge data is organized in the form of triples, and can be represented as follows: For example, if the information item Pointing to information item If an edge has a fusion weight of 0.341 and a confidence level of 0.986, then the data representation of this edge is as follows: This triplet structure can be implemented in computer memory in several ways: the most direct way is to define a structure or object containing three fields. In object-oriented programming languages, an Edge class can be created, containing three member variables: targetNode, weight, and confidence. In functional programming languages, tuples or record types can be used. In database systems, each edge can be stored as a row, containing four columns: source node ID, target node ID, weight, and confidence.

[0157] The storage of edge data requires a balance between access efficiency and memory usage. For sparse graphs (where the number of edges is much smaller than the square of the number of nodes), adjacency lists are the most commonly used storage structure. In an adjacency list representation, each node maintains a list storing all edges originating from that node. Specifically, the system creates a hash table or dictionary where the key is the node identifier and the value is a list of outgoing edges from that node. For each node... Its outgoing edge list may contain multiple triples, such as ,express point to , , There are three nodes, and each edge has its own weight and confidence level.

[0158] When constructing the enhanced edge data, the system iterates through all candidate information item pairs. For each item pair $(i, j)$, if the fusion weights were calculated in step S2.6.2... If the weight is greater than a certain minimum threshold (e.g., 0.01, filtering out weak relations with excessively small weights), the system creates a new relationship from... point to The edge. The three attributes of the edge are set as follows: the target node is... , weight is The confidence level is calculated in step S2.6.3. This triple is added to the node. The list of outgoing edges. If the node The list of outgoing edges does not yet exist (this is the first one from...). (For the starting edge), the system will first create an empty list, and then add the edge data.

[0159] Enhanced edge data can also include optional metadata to support more advanced features. For example, it can record the number of historical records the edge is based on, which is useful for debugging and analysis; it can record the maximum and minimum values ​​of the weight sequence, providing information on the range of weight changes; it can record the time of the most recent observation to determine if the priority relationship is still active; it can record whether the edge was processed in conflict resolution, and the specific resolution decision, facilitating traceability and auditing. This metadata can extend triples into more complex data structures, such as quintuples or objects, and can be flexibly configured according to specific application needs.

[0160] Data validation is a crucial step in constructing augmented edge data. The system needs to check the integrity and rationality of the data for each edge: the weight value must be a positive number, typically between 0 and 1 (if a normalized inverse distance function is used) or within a reasonable upper bound; the confidence score must be between 0 and 1, as it is defined based on probability; and the target node must be a valid node identifier existing in the node set. If any abnormal data is found, the system will log a warning or error message and, depending on the configuration, decide whether to skip the edge, use the default value, or abort the entire processing flow.

[0161] Step S2.6.5 is the final step in the entire weight aggregation and enhancement process. Its task is to organize all the enhanced edge data generated earlier into a complete graph structure, forming the final weighted priority graph. This graph is the foundational data structure for all subsequent processing (collision detection, topology sorting, etc.), and its construction quality directly affects the performance and accuracy of the entire system.

[0162] Graph construction begins with initialization. The system first creates an empty graph object, which internally maintains a set of nodes and a set of edges. The node set contains all information items that have appeared in the history, with each node represented by a unique identifier, which can be the ID, name, or other unique key of the information item. The edge set is organized in the form of an adjacency list, which, as mentioned earlier, is a mapping from node identifiers to a list of outgoing edges. Initially, the edge set is empty and is gradually filled as augmenting edge data is added.

[0163] The system iterates through the set of candidate information item pairs, which contains all information item pairs that have appeared at least once in the historical record. For each item pair in the set... The system checks whether enhanced edge data has been generated for it. If the enhanced edge data was successfully created in step S2.6.4... arrive Once an edge is identified as an enhanced edge (i.e., its weight is greater than the minimum threshold and the data is valid), the system adds that edge to the graph. Specifically, this involves locating the node in the graph's adjacency list. The list of outgoing edges is used; if the list does not exist, it is created, and then the triples are generated. Add to the end of the list.

[0164] During the edge addition process, the system needs to handle some special cases. The first is duplicate edge detection: theoretically, for each pair of information items... Ideally, only one edge should be generated, but due to the complexity of the data processing flow, duplicate edges may be added. The system checks the target node before adding an edge. Is it already on the node? If an edge already exists in the outgoing edge list, the configuration determines whether to overwrite the old edge (using the newly calculated weights and confidences), retain the old edge (ignoring the new data), or report an error. The overwrite strategy is typically used to ensure the latest calculation results are used.

[0165] Secondly, self-loop detection: a self-loop is an edge that points from a node to itself, i.e. In the context of priority relations, self-loops are meaningless (an information item cannot take precedence over itself), therefore the system should filter out all self-loops. When adding an edge, the system checks if the source node and the target node are the same; if they are, the edge is skipped and a warning message is recorded. The appearance of self-loops usually indicates a logical error in the data processing flow, which needs to be investigated and corrected.

[0166] Graph construction also involves node management. While adding edges is the primary operation, the system also needs to maintain a complete set of nodes. When traversing information item pairs, the system adds all encountered node identifiers to the node set, ensuring that a node appears in the graph even if it has no outgoing edges (only incoming edges or is completely isolated). The node set can be implemented using a hash set or a dictionary, supporting fast membership checks and traversal operations. In addition to its identifier, each node can also be associated with attributes such as its display name, type, and frequency of occurrence in historical records; these attributes are useful for visualization and analysis.

[0167] After construction, the system performs integrity checks and statistical analysis on the graph. Integrity checks include: verifying that the target node of all edges exists in the node set to avoid dangling references; checking for isolated nodes (without both incoming and outgoing edges) and counting their number and proportion; and verifying that the graph size is within the expected range, such as whether the number of nodes matches the total number of information items in the historical records and whether the number of edges is reasonable (usually it should be much smaller than the square of the number of nodes, because not all information item pairs have priority relationships).

[0168] Statistical analysis provides a deeper understanding of the graph structure. The system calculates and reports the following statistical indicators: total number of nodes, reflecting the scale of information items involved in user operations; total number of edges, reflecting the number of identified priority relationships; average out-degree, i.e., how many outgoing edges each node has on average, reflecting the density of priority relationships; average in-degree, reflecting how many other nodes each node depends on on average; weight distribution, such as minimum weight, maximum weight, average weight, and median weight, to help understand the strength distribution of priority relationships; confidence distribution, such as average confidence and the proportion of low-confidence edges (e.g., how many edges have a confidence of less than 0.5), reflecting the overall reliability of priority relationships.

[0169] The resulting weighted priority graph is a complete, consistent, and information-rich data structure. It not only contains all priority relationships from user habits but also characterizes the strength and reliability of each relationship through two dimensions: weight and confidence. This graph provides the necessary input for subsequent conflict detection: by checking for the existence of bidirectional edges (both... There are also This approach can identify inconsistencies in user habits; by comparing the weights and confidence levels of bidirectional edges, reasonable conflict resolution decisions can be made. The graph also provides the foundation for topological sorting: the topological sorting algorithm traverses the graph, generating a linear sorting sequence based on the direction and weight of the edges. By introducing time decay, weighted fusion, and confidence quantification, this embodiment significantly improves the quality of the graph, making it more accurately reflect the user's current true preferences, laying a solid foundation for generating high-quality personalized sorts.

[0170] Example 3

[0171] Step S3: Detection and resolution of personal habit conflicts

[0172] Conflict detection is performed on the weighted priority graph to identify information item pairs with bidirectional priority relationships. Conflict directions are resolved according to the weights to generate a consistent habit graph.

[0173] Specifically, this step includes the following sub-steps:

[0174] S3.1: Perform bidirectional edge detection on the weighted priority graph, identify information item pairs that simultaneously have forward and reverse edges, and generate a list of conflict pairs.

[0175] Scan all edges in the weighted graph. For each edge (A, B), check if there is also a reverse edge (B, A). If so, mark the node pair (A, B) as a conflict pair and record the weights WAB and WBA for the two directions.

[0176] S3.2: For each conflict pair in the list of conflict pairs, compare the weights of the forward edge and the reverse edge to determine the direction to be retained.

[0177] For a conflicting pair (A, B), compare the values ​​of WAB and WBA. If WAB > WBA, retain the A→B direction; if WBA > WAB, retain the B→A direction. This strategy is called the maximum weight strategy, which prioritizes retaining the direction with the stronger user preference.

[0178] S3.3: Based on the retained direction, delete the edges in the direction with a weight lower than a preset threshold, and generate the consistent habit graph.

[0179] Set a weight difference threshold Δthreshold (e.g., 0.1). If |WAB - WBA| < Δthreshold, it means the preference strengths in the two directions are similar, and the two edges can be deleted or the edge with the larger weight can be retained. For conflict pairs with significant weight differences, delete the edge in the direction with the smaller weight. After conflict resolution, a consistent habit graph without bidirectional edges is obtained.

[0180] This step improves the consistency of ranking results by extracting stable core habit patterns from the ranking differences of users at different times through conflict detection and resolution.

[0181] Example 4

[0182] Step S4: Graph connectivity detection and component analysis

[0183] The consistency graph is subjected to connectivity detection to identify weakly connected components and isolated nodes, resulting in a complete graph structure representation.

[0184] Specifically, this step includes the following sub-steps:

[0185] S4.1: Initialize the access tag array for the consistency habit graph and generate a node access status table.

[0186] Create a boolean array visited[] with a length equal to the number of nodes in the graph. Initialize all values ​​to false to mark whether a node has been visited.

[0187] S4.2: Based on the node access status table, a depth-first search algorithm is used to traverse each node and identify each weakly connected component.

[0188] Starting with the first unvisited node, perform a depth-first search (DFS), recursively visiting all adjacent nodes of the current node (including neighbors of outgoing and incoming edges, since it is a weakly connected component). Mark the visited nodes as true and add them to the current connected component set. Repeat this process until all nodes have been visited, resulting in multiple weakly connected components.

[0189] S4.3: Perform node statistics on each weakly connected component, identify components that contain only a single node, and generate a set of isolated nodes.

[0190] Iterate through all connected components and count the number of nodes in each component. If a component contains only one node, that node is an isolated node and is added to the isolated node set.

[0191] S4.4: For each isolated node in the set of isolated nodes, establish connection edges with adjacent nodes based on the average position in the historical sorting data, and generate a supplementary edge set.

[0192] For each isolated node, analyze its average position in the historical sorted data. If the node typically appears within a certain position range, find other nodes within that range and establish connecting edges. For example, if isolated node C is located at position 3 on average in the historical records, while nodes B and D are located at positions 2 and 4 respectively, then establish edges B→C and C→D, with weights calculated based on positional distance.

[0193] S4.5: Add the supplementary edge set to the consistent habit graph to obtain the complete graph structure representation.

[0194] Add the supplementary edges to the graph's adjacency list and update the graph structure. Re-perform connectivity checks to ensure that isolated nodes are connected to the main connected components.

[0195] This step ensures the integrity of the graph structure through connectivity detection and isolated node processing, providing a reliable foundation for subsequent topology sorting.

[0196] Example 5

[0197] Step S5: Personalized Topological Sort Generation

[0198] A topological sorting algorithm is used to process each connected component in the complete graph structure representation to generate a linear sorting sequence that conforms to user habits.

[0199] Specifically, this step includes the following sub-steps:

[0200] S5.1: Calculate the in-degree value of each node in a connected component, which is the number of edges pointing to that node.

[0201] Traverse all edges in the graph, count the number of times each node is the target node, and obtain the in-degree array indegree[].

[0202] S5.2: Determine the set of nodes with an in-degree of 0 as the starting point for sorting.

[0203] Scan the in-degree array and add all nodes with an in-degree of 0 to the candidate queue. These nodes have no predecessors and can be used as the starting point for sorting.

[0204] S5.3: Choose an appropriate strategy to break a draw, such as alphabetical order, out-degree priority, or weight priority.

[0205] When there are multiple nodes in the candidate queue, one node needs to be selected to join the sorting result. Tie-breaking strategies include: selecting by alphabetical order of node identifiers, selecting in descending order by node out-degree (number of successor nodes), and selecting in descending order by the total outgoing edge weight of the node. This embodiment uses a weight-first strategy, selecting the node with the largest total outgoing edge weight.

[0206] S5.4: Initialize the result list (result) and the candidate queue (queue), and add nodes with an in-degree of 0 to the candidate queue.

[0207] Create an empty list `result` to store the sorting results, and add the nodes with an in-degree of 0 identified in step S5.2 to the queue.

[0208] S5.5: When the candidate queue is not empty, select a node according to the tie-breaking strategy.

[0209] Select the node with the largest total outgoing edge weight from the queue. node .

[0210] S5.6: Add the selected node to the results list.

[0211] will current node Add to the end of the result list.

[0212] S5.7: Update the in-degree of all successor nodes of the selected node (decrease by 1).

[0213] Traverse current node For all outgoing edges, for each successor node successor, decrement its in-degree by 1: indegree[successor] -= 1.

[0214] S5.8: Add successor nodes with an in-degree of 0 to the candidate queue.

[0215] Check the successor nodes updated in step S5.7. If the in-degree of a node becomes 0, add it to the queue.

[0216] S5.9: Repeat steps S5.5 to S5.8 until the candidate queue is empty.

[0217] Repeat the above steps until the queue is empty, indicating that all nodes have been added to the sorting result.

[0218] S5.10: Check if all nodes have been added to the results list. If not, there is a circular dependency.

[0219] Compare the length of the result with the total number of nodes in the graph. If they are not equal, it indicates the existence of a cycle, making topological sorting impossible. In this case, cycle detection and breaking strategies can be used, such as deleting the edge with the smallest weight to break the cycle.

[0220] S5.11: Merge the sorting results of each connected component into a final sort.

[0221] If the graph contains multiple connected components, perform a topological sort on each component, and then merge the sorting results according to the component size or other rules to obtain the final linear sorted sequence.

[0222] This step uses a topological sorting algorithm to transform the graph structure into a linear sort that conforms to user habits, thus realizing the core function of personalized sorting.

[0223] Example 6

[0224] Step S6: Model Quality Assessment and Optimization

[0225] The consistency index between the linear sorting sequence and the historical sorting data is calculated to obtain the model quality evaluation result.

[0226] Specifically, this step includes the following sub-steps:

[0227] S6.1: Calculate the coverage metric to evaluate the model's coverage of common information items for users.

[0228] Coverage is defined as the ratio of the number of information items included in the generated sort to the total number of information items that have appeared in the user's history. For example, if there are 25 different information items in the user's history and the generated sort includes 20 of them, then the coverage is 20 / 25 = 80%.

[0229] S6.2: Calculate the number of violations and count the number of conflicts between the generated ranking and historical preferences.

[0230] Iterate through the user's historical sorting records. For each record, check if the relative order of information item pairs in the generated sort matches the historical record. If A precedes B in the historical record, but B precedes A in the generated sort, this is counted as a violation. Count all violations and normalize them to a violation rate.

[0231] S6.3: Calculate the satisfaction score and assess the proportion of generated rankings that conform to historical habits.

[0232] The satisfaction score is defined as: 1 - violation rate. For example, if the violation rate is 15%, the satisfaction score is 85%.

[0233] S6.4: Analyze the conflict situation, including the total number of conflicts, intensity distribution, and cause analysis.

[0234] The number of conflict pairs identified in step S3 is counted, the distribution of conflict weight differences is analyzed, and the main causes of conflict (such as changes in user habits, data noise, etc.) are identified.

[0235] S6.5: Calculate the time consistency index to evaluate the model's adaptability to users' recent preferences.

[0236] The historical records are divided into two parts by time: recent (e.g., the last month) and earlier. The consistency between the generated ranking and the records in both parts is calculated. If the consistency of the recent records is significantly higher than that of the earlier records, it indicates that the model can adapt to the evolution of user habits.

[0237] S6.6: Generate a comprehensive quality assessment report, including all indicators and their explanations.

[0238] By integrating the above indicators, an evaluation report is generated, including information such as coverage rate, violation rate, satisfaction score, conflict analysis, and time consistency, providing a basis for optimization.

[0239] S6.7: Determine the optimization direction based on the evaluation results, such as adjusting weight strategies, conflict resolution strategies, etc.

[0240] Analyze the evaluation report to identify weaknesses in the model. For example, if the number of violations is too high, the weight calculation strategy needs to be optimized; if the coverage is insufficient, the conflict resolution strategy needs to be adjusted.

[0241] S6.8: Perform parameter optimization or algorithm adjustment to improve model performance.

[0242] Depending on the optimization direction, adjust relevant parameters or algorithms. For example, adjust the exponential parameter p of the inverse distance weight, or change the conflict resolution threshold Δthreshold.

[0243] S6.9: Compare the model performance before and after optimization to confirm the optimization effect.

[0244] The sorting was regenerated using the optimized parameters, and all metrics were calculated and compared with those before optimization to confirm the performance improvement.

[0245] This step, through multi-dimensional quality assessment and continuous optimization, ensures that the sorting results meet user expectations and improves the system's usability.

[0246] Example 7

[0247] This embodiment provides a weight learning method based on stochastic non-convex non-smooth optimization as an enhancement to step S2.3 in embodiment 1.

[0248] S2.3.1: For the location statistics, define a loss function that includes a frequency term, a location consistency term, and a regularization term, and establish a weight optimization objective.

[0249] For information item pairs Define the loss function:

[0250] The first item is the frequency item, which encourages weighting and... The first term is proportional to the frequency of occurrence of the relation; the second term is the positional consistency term, which requires the weights to match the actual positional distance; the third term is the regularization term, which prevents overfitting. For distance weighting function, This is the mapping function from weights to distance. For regularization functions (such as) Regular expression |w| or SCAD regular expression divides the history records into Each batch contains [number] batches, and each batch contains [number] batches. Record number. In the... In the next iteration, based on the time decay weight Perform weighted random sampling to select a batch. Recent records have a higher probability of being selected.

[0251] S2.3.3: Calculate the subgradient of the loss function with respect to the weight variables for the current batch of data, and obtain the subgradient estimate.

[0252] Calculate the batch loss function about The subgradient. For the absolute value term, the subgradient is the sign function; for... Regularization, subgradient is For SCAD regularization, according to The subgradient is calculated piecewise across the range of values. This yields the subgradient estimate. .

[0253] S2.3.4: Based on the subgradient estimate, the weight variables are updated using the subgradient descent method, and the weights are constrained to be non-negative by the projection operator to obtain the updated weight values.

[0254] Projected subgradient update: ,in For learning rate, For operators that project onto a nonnegative field.

[0255] S2.3.5: Perform iterative averaging on the updated weight values ​​to construct the weighted priority graph.

[0256] Employing a tail averaging strategy, for the latter The weights of each iteration are averaged to obtain the final weights. The final weights of all information item pairs are then assembled into a weighted priority graph.

[0257] This embodiment improves weight accuracy by transforming weight calculation from a simple formula into an adaptive learning process through weight learning based on optimization theory.

[0258] This embodiment provides a novel weight calculation paradigm, upgrading the weight calculation method based on the simple inverse distance formula in Embodiment 1 to an adaptive weight learning framework based on modern optimization theory. The core idea of ​​this shift is that weights are no longer directly calculated using predefined mathematical formulas, but rather learned as solutions to the optimization problem by minimizing a carefully designed loss function. The advantage of this method lies in its ability to simultaneously consider multiple objectives and constraints, automatically balance the influence of different factors, and extract weight values ​​from the data that better reflect the actual situation, significantly improving the accuracy and robustness of the weights.

[0259] While the traditional inverse distance formula is simple and intuitive, it has inherent limitations. It only considers locational distance, neglecting other important information such as the frequency of the priority relationship in history, the consistency of the locational relationship across different records, and the reasonable range of weight values. Furthermore, the parameters in the inverse distance formula are manually set, lacking a data-driven optimization mechanism, making it difficult to adapt to the specific needs of different users and application scenarios. This embodiment introduces an optimization framework that incorporates all these factors, allowing the data itself to guide the determination of weights, thus achieving a shift from experience-driven to data-driven approaches.

[0260] The core of the optimization framework is the loss function, which quantifies the difference between candidate weight values ​​and ideal weight values. By minimizing the loss function, the system can find the optimal or near-optimal weight configuration. The loss function designed in this embodiment has non-convex and non-smooth characteristics, reflecting the inherent complexity of the weight learning problem. Non-convexity means that the loss function may have multiple local minima, and the optimization process requires special strategies to avoid getting trapped in poor local solutions; non-smoothness stems from the absolute value terms and certain regularization terms included in the loss function, which are not differentiable at some points and need to be handled using generalized derivative concepts such as subgradients. To efficiently solve such optimization problems, this embodiment adopts the stochastic subgradient descent algorithm, an optimization method widely used in machine learning, particularly suitable for handling large-scale data and non-smooth objective functions.

[0261] The core task of step S2.3.1 is to design a reasonable loss function, transforming the weight learning problem into a mathematical optimization problem. The design of the loss function needs to comprehensively consider multiple objectives: ensuring that the learned weights reflect the statistical regularities in historical data, while also guaranteeing the rationality and generalization ability of the weight values ​​themselves. The loss function designed in this embodiment consists of three key parts, each corresponding to a specific optimization objective, which are combined through weighted summation to form a unified objective function.

[0262] The first item is the frequency item, designed to ensure that the weight is proportional to the frequency of the priority relationship in the historical records. The basic logic is: if a pair of information items frequently appears in a certain order in the history, it indicates a strong user preference for that priority relationship, and it should be assigned a larger weight; conversely, if a certain order only appears occasionally, the weight should be relatively small. The frequency item is calculated by traversing all historical records containing the information item pair and summing the contribution of each record. The contribution of each record is determined by two parts: first, an indicator function, which checks whether the order of the information items in that record is indeed from front to back; only records with the correct order will generate a positive contribution; second, a distance weight function, which assigns different weights based on the distance between the two information items in the record, with closer items receiving larger weights, reflecting the assumption that priority relationships with close proximity are more reliable.

[0263] The coefficient before the frequency term is negative because the optimization goal is to minimize the loss function, and we want the weights to be proportional to the frequency—that is, the higher the frequency, the greater the weight, and the smaller the loss. By adding a negative sign before the frequency term, the absolute value of the negative value of the frequency term increases as the weight increases, thus reducing the total loss and guiding the optimization algorithm to increase the weights. This design cleverly transforms "maximizing frequency matching" into a part of "minimizing the loss function." The specific form of the distance weight function can be chosen in various ways, commonly including the inverse distance function, the exponential decay function, or the Gaussian kernel function. Different function forms lead to different weight distribution characteristics, and the appropriate form can be selected and optimized according to the specific application scenario.

[0264] The second term is the positional consistency term, designed to ensure that the learned weight values ​​match the actual positional distances observed in historical records. This term is based on an important observation: weights are essentially a quantification of the strength of priority relationships, and this strength should be intrinsically related to the relative position of information items in the ranking sequence. If we define a mapping function from weights to positional distances, then the predicted distances calculated using the weights should be as close as possible to the actual distances in historical records. The positional consistency term quantifies this mismatch by calculating the difference between the predicted and actual distances and summing the differences across all historical records.

[0265] The difference is measured using an absolute value function, a loss function that is relatively robust to outliers. Compared to squared loss, absolute value loss penalizes extreme biases less, preventing the optimization process from overemphasizing a few outliers and thus improving the stability of the learned weights. The weight-to-distance mapping function needs to be designed based on the domain of the weights and the range of the distance. A simple choice is a linear mapping, where the predicted distance equals the weight multiplied by a certain scaling factor; more complex choices include nonlinear mappings, such as logarithmic or power function mappings, which can more flexibly model the relationship between weights and distance. The parameters of the mapping function can be determined through cross-validation or grid search, selecting the parameter configuration that minimizes the loss on the validation set.

[0266] The third term is the regularization term, designed to prevent overfitting and improve the generalization ability of the weights. Overfitting is a common problem in machine learning, referring to a model's excessive fitting of the details and noise of the training data, resulting in poor performance on new data. In the context of weight learning, overfitting may manifest as some weight values ​​being too large or too small, being overly sensitive to individual historical records, and lacking stability. The regularization term, by imposing constraints or penalties on the weight values ​​themselves, guides the optimization algorithm to find simpler and smoother weight configurations.

[0267] This embodiment supports multiple regularization functions, each with its specific effects and applicable scenarios. L1 regularization, also known as Lasso regularization, is the sum of the absolute values ​​of the weights. A key characteristic of L1 regularization is its ability to produce sparse solutions, meaning many weight values ​​are exactly zero. In weight learning, this translates to automatic feature selection, filtering out unimportant priority relationships and simplifying the model structure. SCAD regularization, short for Smooth Truncation of Absolute Bias Regularization, is a more advanced regularization method that combines the sparsity of L1 regularization with the smoothness of L2 regularization. SCAD regularization imposes a stronger penalty on small weights, encouraging them to shrink to zero, while imposing a weaker penalty on large weights, allowing important priority relationships to maintain larger weights, thus avoiding the over-shrinkage problem that can occur with L1 regularization.

[0268] The three coefficients in the loss function are key parameters for balancing different optimization objectives. The first coefficient controls the importance of the frequency term; its larger value indicates that the optimization process prioritizes matching historical frequencies. The second coefficient controls the importance of the location consistency term; its larger value indicates that the optimization process prioritizes matching actual location distances. The third coefficient controls the regularization strength; its larger value indicates stronger constraints on the weights, resulting in a simpler model but potentially underfitting. The settings of these three coefficients need to be tuned according to the specific application. A common method is to use cross-validation, trying different combinations of coefficients, evaluating their performance on the validation set, and selecting the optimal combination. In practice, two coefficients can be fixed initially, and a grid search can be performed on the third coefficient, followed by iterative optimization to gradually approach the optimal configuration.

[0269] The design of the loss function also needs to consider computational efficiency. Since the loss function needs to be calculated repeatedly during the optimization process, its computational complexity directly affects the running time of the entire algorithm. In the loss function designed in this embodiment, both the frequency term and the positional consistency term involve traversing historical records, and the time complexity is proportional to the number of records; the regularization term only involves the calculation of the weight values ​​themselves, and the time complexity is constant. To improve efficiency, the system can pre-calculate and cache some intermediate results, such as the positional distance of each information item in each record, to avoid repeated calculations. For large-scale data, a strategy of random sampling or mini-batch processing can be adopted, using only a portion of the data each time to calculate an approximate value of the loss function, which significantly reduces computational costs while ensuring optimization effectiveness.

[0270] Step S2.3.2 introduces the core mechanism of stochastic optimization: mini-batch stochastic gradient descent. In traditional batch gradient descent, each iteration requires the entire training data to calculate the gradient, which leads to excessive computational costs and slow iteration speed when the data volume is huge. The mini-batch method significantly improves iteration efficiency by using only a small portion of the data to calculate an approximate value of the gradient each time, enabling the algorithm to process large-scale datasets within a reasonable time. This embodiment further introduces a time-weighted sampling strategy based on the standard mini-batch method, making recent historical records more likely to be selected into the batch, thus allowing the optimization process to pay more attention to the user's latest habits.

[0271] Batch partitioning is the first step in random sampling. The system divides a historical dataset containing N records into B batches, each containing approximately N divided by B records. The batch size B is a parameter that requires trade-offs: a smaller B results in larger batches, more data used in each iteration, and more accurate gradient estimation, but also higher computational costs; a larger B results in smaller batches, faster computation in each iteration, but a larger variance in gradient estimation, which may lead to instability in the optimization process. In practice, the commonly used batch size range is 32 to 256 records, and the specific value can be adjusted according to the data scale and computational resources. For large-scale datasets containing tens of thousands of records, larger batch sizes such as 128 or 256 can be chosen; for small to medium-sized datasets with only a few thousand records, smaller batch sizes such as 32 or 64 can be chosen.

[0272] The innovation of this embodiment lies in time-weighted sampling. In standard random sampling, each record has an equal probability of being selected, meaning that an old record from three months ago and a new record from yesterday have the same impact on the optimization process. However, as discussed in Embodiment 2, user habits and preferences evolve over time, and recent records better reflect current real needs. To make the optimization process focus more on recent data, this embodiment calculates a time decay weight for each historical record, which decays exponentially with the age of the record. The calculation formula for the time decay weight is the same as the time weighting coefficient in Embodiment 2, using an exponential function, with parameters including the current time, the recording time, and the decay time constant.

[0273] In the t-th iteration, the system needs to select a batch from N historical records. The selection process uses weighted random sampling, meaning the probability of each record being selected is proportional to its time decay weight. Specifically, the system first calculates the time decay weight for all records, then normalizes the weights so that the sum of all weights equals 1, obtaining the sampling probability for each record. Next, the system uses these probabilities to perform random sampling without replacement, selecting a batch size of records to form the current batch. Sampling without replacement ensures that the same record will not appear repeatedly in a batch, avoiding information redundancy.

[0274] Weighted random sampling can be implemented using various algorithms. A simple method is roulette wheel selection: the probability interval from 0 to 1 is divided into N segments, each segment's length equal to the sampling probability of the corresponding record. A random number between 0 and 1 is generated, and the segment it falls into determines the selected record. This process is repeated batch-size times to obtain a complete batch. The time complexity of roulette wheel selection is the batch size multiplied by the number of records, which can be slow for large-scale datasets. A more efficient method is aliasing sampling, which uses preprocessing to construct a special data structure, making each sampling take constant time. The total time complexity is reduced to the number of records plus the batch size, significantly improving efficiency.

[0275] The effect of time-weighted sampling is that recent records are used more frequently during the optimization process. For example, if a record from one week ago has a time decay weight of 0.8, while a record from two months ago has a weight of 0.2, then the former is four times more likely to be selected into the batch than the latter. Throughout the optimization process, recent records are repeatedly sampled and used, and their cumulative contribution to the gradient becomes dominant, thus guiding the weights to adjust in a direction that better aligns with the latest habits. Meanwhile, although older records are sampled less frequently, they are not completely ignored; they still have the potential to influence the optimization process. This ensures that the model does not completely forget historical information, achieving a balance between old and new habits.

[0276] Batch randomness is a key characteristic of the stochastic gradient descent algorithm. Since each iteration uses randomly selected batches, the content of these batches differs across iterations, resulting in different calculated gradients. This introduces randomness and noise. While this randomness makes the optimization path less smooth than batch gradient descent, it also brings some unexpected benefits: it helps the algorithm escape local minima, explore a wider solution space, and sometimes find better global solutions; it also acts as an implicit regularization, preventing the model from overfitting to certain data patterns. To control the impact of randomness, the system can set a random seed to ensure the repeatability of the experiment; alternatively, it can use a strategy of averaging multiple runs to reduce the impact of random fluctuations on the final result.

[0277] Step S2.3.3 involves calculating the subgradient of the loss function with respect to the weight variables, which is the basis for updating the weights in the optimization algorithm. In the standard gradient descent algorithm, we calculate the gradient of the loss function, i.e., the partial derivative of the loss function with respect to each variable, and then update the variables in the opposite direction of the gradient to decrease the value of the loss function. However, the loss function in this embodiment contains absolute value terms and some non-smooth regularization terms, which are not differentiable at certain points, making the traditional gradient concept no longer applicable. The subgradient is a generalization of the gradient concept to non-smooth functions, providing a theoretical basis and computational tool for optimizing non-smooth functions.

[0278] The mathematical definition of a subgradient is: for a function f at a point x, if there exists a vector g such that for any point y, the value of the function at y is greater than or equal to the value of the function at x plus the inner product of g and y minus x, then g is a subgradient of f at x. The geometric meaning of this definition is: the subgradient defines a supporting hyperplane that is tangent to the function at point x, and the graph of the function lies entirely above the hyperplane. For differentiable functions, the subgradient is the ordinary gradient; for non-differentiable but continuous functions, the subgradient is a set containing all vectors that satisfy the above conditions.

[0279] For the absolute value term in the loss function, calculating the subgradient is relatively simple. The derivative of the absolute value function is +1 for positive numbers and -1 for negative numbers, and it is not differentiable at zero. However, the subgradient is a closed interval from -1 to +1. In practical calculations, a sign function is usually used to represent the subgradient of the absolute value: when the variable is positive, the subgradient is +1; when the variable is negative, the subgradient is -1; when the variable is zero, the subgradient can take any value between -1 and +1, with 0 being a common choice. The absolute value term in the location consistency term is the absolute value of the difference between the predicted distance and the actual distance, and the subgradient is equal to the sign of the difference multiplied by the derivative of the predicted distance with respect to the weights.

[0280] For the L1 regularization term, the subgradient is calculated similarly to the absolute value. The L1 regularization term is the sum of the absolute values ​​of the weights. Calculating the subgradient for each weight variable yields a sign function for that weight. When the weight is positive, the subgradient is positive 1, encouraging a decrease in weight; when the weight is negative, the subgradient is negative 1, encouraging an increase in weight; when the weight is zero, the subgradient can take any value between negative 1 and positive 1. This subgradient characteristic of L1 regularization is precisely why it can produce sparse solutions: when the weight is close to zero, the uncertainty of the subgradient allows the optimization algorithm to push the weights precisely to zero, thereby achieving feature selection.

[0281] The calculation of the subgradient for the SCAD regularization term is more complex because SCAD is a piecewise defined function with different expressions for different weight value intervals. SCAD regularization is typically defined in three segments: when the absolute value of the weight is less than a certain threshold, SCAD equals the absolute value of the weight multiplied by a coefficient, and the subgradient is the sign of the weight multiplied by that coefficient; when the absolute value of the weight is between the threshold and another larger threshold, SCAD is a quadratic function, and the subgradient is the derivative of this quadratic function; when the absolute value of the weight is greater than the second threshold, SCAD is a constant, and the subgradient is zero. During calculation, the system needs to first determine which interval the current weight value falls into, and then apply the corresponding subgradient formula.

[0282] The calculation of the batch subgradient involves averaging the subgradients of all records in the current batch. For each record in the batch, the system calculates its contribution to the loss function, and then calculates the subgradient of this contribution with respect to the weights. Since the loss function is the sum of the contributions of all records, according to the linear property of the subgradient, the subgradient of the total loss function is equal to the sum of the subgradients of each record. In the mini-batch method, we only calculate the sum of the subgradients of the records in the batch, and then divide it by the batch size to obtain the average subgradient, which serves as an unbiased estimate of the subgradient of all data. Although this estimate has some variance, its expected value equals the true subgradient, and it tends towards the correct optimization direction in multiple iterations.

[0283] The implementation of subgradient calculation requires careful attention to numerical stability. When calculating the sign function, if the value of a variable is very close to zero, errors in sign determination may occur due to the limitations of floating-point precision. To avoid this problem, the system can set a small threshold; when the absolute value of a variable is less than this threshold, it is treated as zero, and the subgradient is set to zero or another predefined value. When calculating the subgradient involving division, it is necessary to check whether the denominator is zero or close to zero. If so, a small positive number is used to replace it to avoid numerical overflow. For terms that may produce very large or very small values, numerical pruning techniques can be used to limit the subgradient to a reasonable range, preventing gradient explosion or vanishing.

[0284] The calculation of subgradients can also be simplified using automatic differentiation techniques. Modern deep learning frameworks such as TensorFlow or PyTorch provide automatic differentiation capabilities, enabling the automatic calculation of gradients and subgradients of complex functions. By expressing the loss function as a combination of operations supported by these frameworks, the system can call the framework's automatic differentiation interface to automatically obtain the subgradient, eliminating the need for manual derivation and coding. This not only reduces development workload but also lowers the possibility of errors and improves code maintainability. For the loss function in this embodiment, it can be constructed using basic operations provided by the framework, such as absolute value functions, summation functions, and regularization functions, and then the subgradient can be calculated by calling the backpropagation interface.

[0285] Step S2.3.4 executes the core operation of the optimization algorithm: updating the weight variables based on the calculated subgradients. This step uses the projective subgradient descent method, which adds a projection operation to the standard subgradient descent to ensure that the updated weights satisfy specific constraints. In the weight learning problem, an important constraint is that the weights must be non-negative, because negative weights are meaningless under the semantics of priority relations. The projection operation maps potentially constraint-violation weight values ​​back to the feasible region, ensuring that the optimization process always takes place in the effective solution space.

[0286] The basic update formula for subgradient descent is: new weights equal old weights minus the learning rate multiplied by the subgradient. The learning rate is a positive number that controls the step size of each update. The choice of learning rate has a significant impact on the optimization process: if the learning rate is too large, the update step size is too large, which may cause the optimization process to oscillate or even diverge, failing to converge to the optimal solution; if the learning rate is too small, the update step size is too small, the optimization process is slow, requiring many iterations to approach the optimal solution, and may even get stuck in a local minimum. In practice, a decreasing learning rate strategy is usually adopted, that is, the learning rate is gradually reduced as the number of iterations increases. A larger learning rate is used in the early stages to quickly approach the optimal solution, and a smaller learning rate is used in the later stages for fine-tuning to improve convergence accuracy.

[0287] Common learning rate decay strategies come in several forms. The simplest is fixed step size, where the learning rate remains constant throughout the optimization process. This strategy is simple to implement but often not optimal. More commonly used is time decay, where the learning rate equals the initial learning rate divided by 1 plus a decay factor multiplied by the number of iterations. This strategy causes the learning rate to decrease linearly with the number of iterations. Another is step decay, where the learning rate is multiplied by a factor less than 1 at fixed iteration intervals, such as halving the learning rate every 100 iterations. This strategy works well in practice and is easy to tune. There is also exponential decay, where the learning rate equals the initial learning rate multiplied by the decay rate raised to the power of the number of iterations. This strategy causes the learning rate to decrease exponentially, decreasing rapidly in the early stages and slowly in later stages.

[0288] This embodiment recommends using a learning rate strategy that is inversely proportional to the square root of the iteration count; that is, the learning rate equals the initial learning rate divided by the square root of the iteration count plus 1. This strategy has a solid theoretical foundation in stochastic optimization theory and can guarantee the convergence of the algorithm on non-convex and non-smooth problems. Specifically, for a loss function that meets certain conditions, the stochastic subgradient descent algorithm using this learning rate strategy will have its average iteration points converge to the neighborhood of the optimal solution at a certain rate. Square root decreasing is slower than linear decreasing but faster than fixed step size, achieving a good balance between convergence speed and stability.

[0289] The projection operation is performed after the subgradient update. A standard subgradient update can produce negative weight values, which is unreasonable under the semantics of priority weights. The projection operation maps these negative values ​​to zero, ensuring that all weights are non-negative. Specifically, the projection operation is an element-wise maximization function: for each weight variable, it takes the maximum of its value and zero; if the weight is positive, it remains unchanged; if the weight is negative or zero, it is set to zero. Mathematically, this operation is called projection to the non-negative quadrant, a special case of nearest-point projection, which finds the point in the feasible region closest to a given point.

[0290] The projection operation not only ensures the constraint is satisfied but also has some subtle effects on the optimization process. When a weight becomes negative after an update and is projected to zero, this effectively tells the algorithm that the optimal value of this weight might be zero, and the corresponding priority relationship might be unimportant or nonexistent. In subsequent iterations, if the subgradient continues to push this weight in the negative direction, it will remain at zero; only when the subgradient becomes negative, pushing the weight in the positive direction, will it leave zero. This mechanism complements the sparsity effect of L1 regularization, jointly promoting the automatic elimination of unimportant weights.

[0291] The complete process of projective subgradient update is as follows: First, starting from the current weight value, subtract the learning rate multiplied by the subgradient to obtain an intermediate weight value; then, apply the projection operation to this intermediate value, setting negative values ​​to zero, to obtain the final updated weight value. This process is performed independently for each weight variable because the non-negativity constraint is element-wise, and there is no coupling between different weights. In implementation, vectorized operations can be used to update all weights at once, improving computational efficiency. Modern numerical computing libraries such as NumPy or PyTorch provide efficient vectorized maximization functions that can be directly applied to the weight vector.

[0292] The update process also requires monitoring the optimization progress. The system can calculate the loss function value under the current weight configuration in each iteration or every few iterations to observe whether the loss is decreasing. If the loss continues to decrease, it indicates that the optimization is progressing normally; if the loss stops decreasing or begins to increase, it may be due to an improper learning rate setting, getting stuck in a local minimum, or being close to the optimal solution. The system can also calculate the change in weights, i.e., the difference between the current weights and the weights in the previous iteration. If the change is very small, it indicates that the optimization is close to convergence, and early termination can be considered. This monitoring information can be output to logs or a visualization interface to help users understand the optimization status and promptly identify and resolve problems.

[0293] Step S2.3.5 is the final stage of the optimization process. Its task is to extract the final weight values ​​from the weight sequence generated by multiple iterations and construct a weighted priority graph using these weights. Due to the randomness of stochastic optimization algorithms, the weight values ​​obtained in different iterations will fluctuate to some extent, and directly using the weights from the last iteration may not be the optimal choice. This embodiment uses an iterative averaging technique to reduce the impact of random fluctuations by averaging the weights from multiple iterations, resulting in more stable and reliable final weights.

[0294] The basic idea of ​​iterative averaging is that although the weights in a single iteration may deviate from the optimal value, the average value of multiple iterations will tend towards the optimal value. This idea has a rigorous mathematical proof in stochastic optimization theory: for optimization problems and algorithms that meet certain conditions, the average value at each iteration converges to the optimal solution at a certain rate, and this convergence rate is often better than the convergence rate of a single iteration. By averaging, we are actually using the law of large numbers to allow random noise to cancel each other out, extracting a stable signal.

[0295] This embodiment employs a tail averaging strategy, meaning it only averages the weights from the latter half of the iterations, ignoring the first half. The motivation for this strategy is that in the early stages of optimization, the weight values ​​may be far from the optimal solution, containing significant errors; as iterations progress, the weights gradually approach the optimal solution, and the errors decrease. If all iterations are averaged, the large errors from the early stages would contaminate the average, reducing the quality of the final result. By using only the latter half of the iterations, we eliminate the early unstable phase and utilize only the near-convergence stable phase, thus obtaining a more accurate average.

[0296] Specifically, assuming a total of T iterations are performed, the tail average calculation begins at iteration T / 2+1 and ends at iteration T, taking the arithmetic mean of the weights across these T / 2 iterations. For each weight variable, the final weight equals the sum of its values ​​across these T / 2 iterations divided by T / 2. This calculation is performed independently for all weight variables, resulting in a complete final weight vector. The tail average calculation can be performed incrementally during the optimization process: the system maintains an accumulator, and after each iteration, it checks whether the second half of the optimization has begun. If so, the current weight is added to the accumulator; after optimization, the accumulator is divided by the number of iterations in the second half to obtain the average value.

[0297] The choice of the breakpoint in the tail averaging strategy is an adjustable parameter. This embodiment suggests using half as the breakpoint, i.e., the latter half of the iterations, which is an empirically effective choice. In some cases, a more conservative breakpoint, such as three-quarters, can be used, i.e., only the last quarter of the iterations are used. This further improves the quality of the mean but also reduces the number of samples involved in the averaging, potentially increasing variance. A more aggressive breakpoint, such as one-third, can also be used, using the last two-thirds of the iterations. This increases the number of samples and reduces variance but may include some iterations that have not yet fully converged. The choice of breakpoint can be optimized through cross-validation. Different breakpoints are tried, the performance of the final weights on the validation set is evaluated, and the optimal configuration is selected.

[0298] Besides tail averaging, several other averaging strategies are available. Total averaging is the simplest strategy, averaging over all T iterations. It's simple to implement but can be affected by earlier iterations. Weighted averaging assigns different weights to different iterations, such as linearly increasing weights, with later iterations receiving larger weights. This strategy has theoretical advantages but requires additional parameter tuning. Exponential moving average is an online averaging method that maintains an average estimate. Each iteration updates the average with a weighted combination of new weights and the old average, controlled by a decay coefficient. This method is memory efficient and suitable for very large-scale problems, but requires careful selection of the decay coefficient.

[0299] After obtaining the final weights, the system begins constructing a weighted priority graph. This process is similar to the graph construction in Examples 1 and 2, but the source of the weights differs: here, the weights are obtained through optimization learning, rather than being calculated using a simple formula. The system iterates through all information item pairs. For each pair, it checks whether its final weight is greater than a minimum threshold. If so, a directed edge is added to the graph from the first information item to the second information item, and the edge weight is set to the final weight value. If confidence scores or other auxiliary information are also calculated during the optimization process, they can also be stored as attributes of the edges.

[0300] Graph construction also includes several post-processing steps. First is weight normalization: although weights may vary within a wide range during optimization, it's generally desirable for the final graph to have weights between 0 and 1 for easier subsequent processing and interpretation. The system can normalize all weights by dividing them by the maximum weight, making the maximum weight 1, and scaling other weights proportionally. Second is sparsity: the optimized weights may have many small values ​​close to zero. Edges corresponding to these small weights have little impact on sorting but increase the graph's storage and computational overhead. The system can set a sparsity threshold, deleting edges with weights less than the threshold and retaining only the more important edges with larger weights. This not only improves efficiency but also reduces noise.

[0301] The completed weighted priority graph is a complete data structure containing all priority relationships and their strengths learned from historical data. This graph can be stored and transmitted in multiple formats: adjacency list format is suitable for sparse graphs, saving space; adjacency matrix format is suitable for dense graphs, with fast access speed; edge list format is simple, intuitive, and easy to serialize. The system can also generate visualizations for the graph, drawing nodes as circles and edges as arrows, with the thickness or color of the edges representing the weight, helping users intuitively understand the structure of priority relationships.

[0302] This embodiment introduces a weight learning framework based on optimization theory, elevating weight calculation from a simple formula calculation to a data-driven adaptive learning process. This shift brings several advantages: First, the optimization framework can simultaneously consider multiple objectives, such as frequency matching, positional consistency, and regularization, flexibly balancing these objectives through the design of the loss function to obtain more comprehensive and reasonable weights; second, the time-weighted sampling mechanism makes the optimization process focus more on recent data, allowing the learned weights to quickly adapt to changes in user habits; third, the stochastic optimization algorithm is efficient and scalable, capable of handling large-scale historical data and completing learning within a reasonable timeframe; finally, the iterative averaging technique reduces the impact of random fluctuations, improving the stability and reliability of the final weights. These advantages work together to significantly improve the accuracy of the weights, laying a solid foundation for generating high-quality personalized rankings.

[0303] Example 8

[0304] This embodiment enhances step S2.3.4 based on embodiment 7 by employing an adaptive optimization algorithm.

[0305] A1: Initialize the first-order moment estimator and the second-order moment estimator of the subgradient estimate to establish the initial state of the moment estimate.

[0306] Initialize first-order moments Second moment Set the attenuation rate , .

[0307] A2: Based on the initial state of the moment estimate and the subgradient estimate, the first-order moment estimate is updated using the exponential moving average method to obtain the updated first-order moment.

[0308] calculate:

[0309] A3: Based on the initial state of the moment estimate and the square of the subgradient estimate, the second-order moment estimate is updated using the exponential moving average method to obtain the updated second-order moment.

[0310] calculate:

[0311] A4: Correct the deviations of the updated first-order moments and the updated second-order moments to obtain the corrected moment estimates.

[0312] A5: Based on the corrected moment estimation, the weight update step size is calculated using the adaptive learning rate formula, and the updated weights are projected onto the feasible region using the projection operator to obtain the updated weight values.

[0313] This embodiment improves convergence speed and stability by introducing the adaptive learning rate mechanism of the Adam optimizer and adjusting it in conjunction with the characteristics of subgradients.

[0314] This embodiment, based on Embodiment 3, significantly upgrades and improves the weight update mechanism by introducing an adaptive optimization algorithm to replace the standard subgradient descent method. The core idea of ​​this improvement is to no longer use a uniform fixed learning rate for all weight variables, but instead dynamically calculate a personalized adaptive learning rate for each weight variable based on its historical gradient information. This adaptive mechanism can automatically adjust the update speed of different weights, using a smaller learning rate for weights with drastic gradient changes to maintain stability, and a larger learning rate for weights with gentle gradient changes to accelerate convergence, thereby significantly improving the overall convergence speed and stability of the optimization algorithm.

[0315] While the standard subgradient descent method used in Example 3 theoretically guarantees convergence, it has some inherent limitations in practice. The most significant problem is the difficulty in choosing the learning rate: if a global learning rate applicable to all weights is chosen, a contradictory phenomenon often occurs where some weights update too quickly, leading to oscillations, while others update too slowly, resulting in slow convergence. This is because different weight variables have different gradient scales and change characteristics, and their learning rate requirements differ. Manually adjusting the learning rate for each weight is clearly impractical, especially when the number of weights is large. Adaptive optimization algorithms solve this problem automatically, allowing the algorithm itself to determine the optimal learning rate for each weight based on the observed gradient history.

[0316] The adaptive optimization algorithm used in this embodiment is a variant of the Adam algorithm, specifically tailored for subgradient optimization. Adam stands for Adaptive Moment Estimation, one of the most popular optimization algorithms in deep learning and machine learning, widely favored for its excellent performance and robustness. The core mechanism of the Adam algorithm is to maintain exponential moving average estimates of the first and second moments of the gradient for each parameter, and then use these moment estimates to calculate the adaptive learning rate. The first moment estimate captures the average direction of the gradient, similar to the momentum term in the momentum method, which can accelerate convergence and reduce oscillations; the second moment estimate captures the average of the squares of the gradient, reflecting the magnitude of gradient changes, and is used to adjust the learning rate.

[0317] Step A1 is the preparation phase of the adaptive optimization algorithm, which involves initializing the various state variables and hyperparameters required by the algorithm. Although these initialization settings seem simple, they have a significant impact on the algorithm's performance and need to be configured appropriately based on theoretical guidance and practical experience.

[0318] The first-moment estimate variables are initialized as a zero vector, meaning that for each weight variable, its corresponding first moment is initially zero. This initialization choice is natural and reasonable: before optimization begins, we haven't observed any gradient information, so we have no prior knowledge of the average gradient direction; zero is a neutral starting point and won't bias any direction. In subsequent iterations, the first-moment estimate is gradually updated based on the observed subgradients, gradually accumulating information about the gradient direction. In the early stages of optimization, the first-moment estimate quickly adjusts from zero to a value reflecting the true gradient direction; in the later stages, it tends to stabilize, fluctuating slightly around the true gradient direction.

[0319] The second-moment estimators are also initialized as zero vectors, with the initial value of the second moment for each weight variable being zero. The second-moment estimator is used to track the moving average of the squared gradient, reflecting the magnitude or volatility of the gradient change. Initializing to zero means that we initially assume the magnitude of the gradient change is unknown and needs to be learned through actual observation. The second-moment estimate gradually increases during iteration because the square of the gradient is always non-negative, and the accumulated average value grows from zero. The magnitude of the second moment reflects the instability of the gradient of the corresponding weight: if the gradient of a weight changes significantly in different iterations, its second-moment estimate will be large; if the gradient is relatively stable, the second-moment estimate will be small.

[0320] The decay rate parameter is a key hyperparameter controlling the speed of the exponential moving average. This embodiment sets two decay rates: the decay rate of the first moment and the decay rate of the second moment. The decay rate of the first moment is typically set to 0.9, meaning that when calculating the moving average, the weight of historical information decays at a rate of 0.9, and the weight of the current observation is 1 minus 0.9, which equals 0.1. This setting makes the first moment estimation sensitive to the gradients of the most recent ten iterations, enabling it to respond quickly to changes in gradient direction while retaining some historical memory, thus providing a smoothing effect. If the first moment decay rate is set larger, such as 0.95 or 0.99, the moving average will be smoother and retain historical information for a longer period, but the response speed will be slower; if it is set smaller, such as 0.8 or 0.7, the response speed will be faster, but it may be too sensitive and easily affected by noise.

[0321] The decay rate of the second moment is typically set to 0.999, a value very close to 1, meaning that the second moment estimate has a strong memory of historical information, and the moving average changes very slowly. The motivation for this setting is that the statistical properties of the squared gradient are generally more stable than the gradient itself, requiring a longer observation period to obtain a reliable estimate. Using a decay rate close to 1, the second moment estimate averages the squared gradients over approximately one thousand iterations, providing a stable, low-variance estimate and avoiding drastic fluctuations in the learning rate caused by individual outliers. In some applications, if the optimization process is found to be overly sensitive to changes in the learning rate, the second moment decay rate can be further increased to 0.9999 to make the learning rate more stable; conversely, if a faster adaptation of the learning rate to gradient changes is desired, it can be reduced to 0.99 or 0.995.

[0322] The default values ​​of 0.9 and 0.999 for these two decay rate parameters are recommended settings in the original Adam algorithm paper. Extensive experimental verification has shown they perform well across various machine learning tasks, and they are therefore widely adopted as the standard configuration. In most cases, using these default values ​​yields satisfactory performance without the need for tuning. However, in certain special cases, such as optimization problems with very specific structures or data with unique statistical properties, fine-tuning of these parameters may be necessary to achieve optimal performance. Tuning methods typically involve grid search or random search: trying a set of candidate values, such as choosing the first-order moment decay rate between 0.8 and 0.95, and the second-order moment decay rate between 0.99 and 0.9999; running the optimization algorithm on each set of parameters; evaluating the convergence speed and final performance; and selecting the best-performing combination.

[0323] Besides the moment estimation variables and decay rate, the initialization phase requires setting other hyperparameters and auxiliary variables. The global learning rate is a scaling factor used to control the overall update step size. Although the Adam algorithm calculates an adaptive learning rate for each weight, these adaptive learning rates are multiplied by the global learning rate, making the global learning rate still an important parameter. The default global learning rate for the Adam algorithm is typically set to 0.001, which is a reasonable starting point for many tasks. The numerical stability term is a small positive number, such as 10 to the power of -8, used to prevent division by zero errors. When calculating divisions involving second-order moment estimation, this decimal is added to the denominator to ensure that division can proceed correctly even if the second-order moment estimate is zero.

[0324] Initialization also includes allocating storage space for each weight variable to hold its corresponding first and second moment estimates. In implementation, these moment estimates are typically organized as vectors or matrices of the same shape as the weight vectors, allowing for efficient vectorization operations. For example, if there are one thousand weight variables, two vectors of length one thousand are created, one to store the first moment estimate and the other to store the second moment estimate. These vectors are initially filled with zeros and then updated in each iteration based on the observed subgradients. Modern numerical libraries provide efficient vector and matrix operations, enabling these updates to be performed in parallel, fully utilizing the hardware's computational power.

[0325] Step A2 performs the update of the first-order moment estimate, which is one of the core operations of the adaptive optimization algorithm. The first-order moment estimate can be understood as an exponentially weighted moving average of the gradient. It combines the currently observed subgradient and historically accumulated gradient information to provide a smooth, low-noise gradient estimate to guide the direction of weight updates.

[0326] The exponential moving average (EM) is a classic time series smoothing technique. Its basic idea is that the new average equals the old average multiplied by a decay factor, plus the current observation multiplied by 1 minus the decay factor. The ingenuity of this formula lies in the fact that it only needs to store one average variable to synthesize information from all historical observations, and it assigns different weights to observations at different times: recent observations have a larger weight, while older observations have a smaller weight, with the weights decaying exponentially over time. This weighting method aligns perfectly with our intuition: during optimization, the most recent gradient information better reflects the current optimization state and should be given more attention; while gradient information from much earlier times may be outdated and should be gradually de-emphasized.

[0327] In the t-th iteration, the system first obtains the subgradient estimate calculated for the current batch. This value is the output of step S2.3.3 and reflects the local gradient information of the current batch data with respect to the loss function. Then, the system reads the first-order moment estimate saved from the previous iteration. This value integrates all gradient information from the first iteration to the t-1th iteration. Next, the system multiplies the old first-order moment estimate by the first-order moment decay rate, which is equivalent to attenuating historical information to make room for new information. Simultaneously, the current subgradient is multiplied by 1 and the first-order moment decay rate is subtracted; this represents the weight of the new information. Finally, the attenuated historical information and the weighted new information are added together to obtain the updated first-order moment estimate.

[0328] This update process is element-wise, meaning that for each weight variable, there is an independent first-moment estimate, and updates are performed based on the subgradient components corresponding to that weight. The first-moment estimates of different weights are independent of each other, and each tracks the gradient history of its corresponding weight. In a vectorized implementation, the first-moment estimates of all weights can be organized into one vector, and the subgradients of all weights into another vector. Then, vector multiplication and addition can be used to update the first-moments of all weights at once, which is much more efficient than updating each weight in a loop.

[0329] The physical meaning of first-order moment estimation can be understood from multiple perspectives. From a statistical perspective, it is an estimate of the expected value of the gradient. If the gradient is a random variable, the first moment is the mean of that random variable. In stochastic optimization, because each iteration uses randomly sampled mini-batches of data, the calculated gradient contains random noise. First-order moment estimation, by averaging multiple observations, reduces the influence of noise and extracts the true trend of the gradient. From a dynamical perspective, first-order moment estimation is similar to momentum in physics; it accumulates the inertia of the optimization process, making the optimization path smoother, enabling more efficient traversal of flat regions, and accelerating convergence.

[0330] The update of the first-moment estimate also possesses some interesting mathematical properties. If we recursively expand the update formula, we can find that the current first-moment estimate is actually a weighted sum of all historical subgradients, with the weights decaying exponentially over time. Specifically, the weight of the subgradient in the current first moment at iteration t is 1 minus the decay rate multiplied by the zeroth power of the decay rate; the weight of the subgradient at iteration t-1 is 1 minus the decay rate multiplied by the first power of the decay rate; the weight of the subgradient at iteration t-2 is 1 minus the decay rate multiplied by the square of the decay rate, and so on. These weights form a geometric series, summing to 1, which means that the first-moment estimate is a normalized weighted average that does not increase infinitely with the number of iterations.

[0331] The decay rate of the first-moment estimation determines the effective window size of historical information. When the decay rate is 0.9, it can be roughly estimated that the first-moment estimation is mainly affected by the most recent ten iterations, and the influence of earlier iterations has decayed to a negligible level. This effective window can be determined by calculating the power of the decay rate equal to a small threshold. For example, 0.9 to the power of 10 is approximately 0.35, and 0.9 to the power of 20 is approximately 0.12, indicating that the information weights from twenty iterations ago have been reduced to about one-tenth of their original value. This limited memory characteristic allows the first-moment estimation to adapt to changes in gradient distribution during optimization. If the topography of the loss function changes during optimization, the first-moment estimation will gradually forget the old gradient patterns and learn the new ones.

[0332] In practical applications, the updates of first-order moment estimates are very stable and reliable, rarely requiring special handling. However, in some extreme cases, such as when the numerical range of the subgradient is very large, numerical overflow or underflow may occur. To prevent this, the system can prune the subgradient, limiting it to a reasonable range, such as between -10 and +10, with values ​​outside the range truncated to the boundary values. This gradient pruning technique is widely used in deep learning and effectively prevents the gradient explosion problem. Another potential issue is that if the optimization process is very long, the first-order moment estimate may accumulate rounding errors, leading to a decrease in accuracy. This situation is rare in practice, but if it does occur, one can consider periodically resetting the first-order moment estimate or using a higher-precision numerical type.

[0333] Step A3 updates the second-order moment estimate, which is another core operation of the adaptive optimization algorithm. The second-order moment estimate tracks the exponentially weighted moving average of the squared subgradient, which reflects the magnitude or fluctuation of the gradient change and is used to adjust the learning rate for each weight.

[0334] The update formula for the second-order moment estimate is very similar in form to that of the first-order moment estimate, both being exponential moving averages. However, there is a key difference: the second-order moment estimate uses the square of the subgradient, not the subgradient itself. In the t-th iteration, the system first calculates the square of the current subgradient, which is an element-wise squaring operation, i.e., squaring each component of the subgradient vector. Then, the second-order moment estimate from the previous iteration is multiplied by the second-order moment decay rate to attenuate the historical information. Next, the current squared subgradient is multiplied by 1 and the second-order moment decay rate is subtracted to obtain a weighted value for the new information. Finally, the attenuated historical information and the weighted new information are added together to obtain the updated second-order moment estimate.

[0335] The calculation of the square of the subgradient requires attention to numerical stability. Since squaring amplifies the value, if the absolute value of the subgradient is large, its square may become extremely large, even exceeding the range of floating-point numbers and causing overflow. To prevent this, the system can prune the subgradient before squaring to ensure its absolute value does not exceed a certain upper limit. Another approach is to use logarithmic space calculation, i.e., calculate twice the logarithm of the absolute value of the subgradient instead of directly squaring it. This is numerically more stable, but requires adjustments in subsequent steps. In most practical applications, the numerical range of the subgradient is reasonable, and direct squaring is not a problem; however, this must be considered when dealing with special problems.

[0336] The physical meaning of second-moment estimation can be understood from the perspective of variance. In statistics, second moments are closely related to variance: if the first moment is the mean, the variance is the second moment minus the square of the first moment. Although we don't explicitly calculate the variance in the Adam algorithm, the second-moment estimation does reflect the dispersion of the gradient. If the gradient of a weight varies greatly across iterations, sometimes being a large positive value and sometimes a large negative value, the average of its squared gradients will be large, and the second-moment estimate will also be large; if the gradient is relatively stable, always fluctuating within a small range, the second-moment estimate will be small. This information is very useful for adjusting the learning rate: weights with large gradient fluctuations require smaller learning rates to avoid oscillations, while weights with stable gradients can use larger learning rates to accelerate convergence.

[0337] The decay rate for second-moment estimation is typically set to a value close to 1, such as 0.999, which allows the second-moment estimation to have a long memory of historical information. The reason for this design choice is that the statistical properties of the squared gradient are usually more stable than the gradient itself, requiring more samples to obtain a reliable estimate. If a small decay rate is used, the second-moment estimation will be too sensitive to short-term gradient fluctuations, leading to frequent and drastic changes in the learning rate and affecting the stability of the optimization. Using a decay rate close to 1, the second-moment estimation averages the long-term gradient statistics, providing a stable, low-variance estimate, making learning rate adjustments smoother and more reliable.

[0338] Similar to the first-order moment estimate, the second-order moment estimate can also be recursively expanded into a weighted sum of the squares of all historical subgradients, with the weights decaying exponentially over time. When the decay rate is 0.999, the effective window size is approximately one thousand iterations, meaning that the second-order moment estimate primarily reflects the average level of the squared gradients over the most recent one thousand iterations. This long window ensures the stability of the second-order moment estimate; even if there are anomalously large or small gradients in a few iterations, they will not significantly affect the second-order moment estimate because their weights are diluted in the long-term average.

[0339] A key characteristic of the second-moment estimate is that it is always non-negative because it is a weighted average of squared values, and squared values ​​are always non-negative. This property is crucial for calculating the adaptive learning rate, as the learning rate calculation involves taking the square root of the second-moment estimate, and only non-negative numbers can have their square roots. The range of the second-moment estimate is from zero to positive infinity. Zero indicates that the gradient is always zero, a situation rarely seen in practice, usually occurring only when the optimization has fully converged to the critical point. A smaller second-moment estimate indicates small gradient fluctuations and a smooth optimization process; a larger second-moment estimate indicates large gradient fluctuations, an unstable optimization process, or a complex loss function.

[0340] When implementing second-order moment estimation updates, memory efficiency must be considered. Since second-order moment estimation requires storing an estimate for each weight variable, memory overhead can become problematic if the number of weights is large. In large-scale optimization problems, the number of weights can reach millions or even billions, requiring a corresponding amount of storage space for the second-order moment estimation. Fortunately, second-order moment estimation updates are element-wise, requiring no additional temporary storage and can be performed in-place—that is, modifications are made directly at the memory location storing the second-order moment estimate without allocating new memory. Modern optimization libraries typically highly optimize these operations, using SIMD instructions or GPU parallel computing to accelerate vector operations, improving computational speed while maintaining memory efficiency.

[0341] Step A4 performs bias correction, a key innovation of the Adam algorithm, to address the bias problem in moment estimation in the early stages of optimization. The root of this problem lies in the initialization of moment estimation: we initialize both the first and second moments to zero, but the actual mean and mean squared gradients are usually not zero. In the early stages of optimization, moment estimation has not yet accumulated enough information and will be severely biased towards the initial value of zero, resulting in systematically underestimating the value. This affects the calculation of the learning rate, making the optimization too slow in the initial stages.

[0342] The mechanism of bias can be understood through mathematical analysis. Consider the update process of first-order moment estimation. After the first iteration, the first moment equals 1 minus the decay rate multiplied by the first subgradient. This value is significantly smaller than the true mean gradient because it only includes one observation and is scaled by the small coefficient of 1 minus the decay rate. After the second iteration, the first moment equals the decay rate multiplied by the previous first moment plus 1 minus the decay rate multiplied by the current subgradient. Although it includes two observations, it is still systematically smaller than the true mean due to the cumulative effect of exponential decay. This bias gradually decreases with the increase of the number of iterations because moment estimation gradually accumulates more information, but the bias is significant in the early stages.

[0343] The bias correction method involves scaling the moment estimate by dividing it by a correction factor. For the first moment, the correction factor is 1 minus the decay rate raised to the power of t, where t is the current iteration number. This correction factor is small in the early stages of optimization, amplifying the corrected first moment and compensating for the underestimation caused by initialization to zero. As the number of iterations increases, the correction factor gradually approaches 1, and the correction effect gradually weakens because the moment estimate has accumulated sufficient information, and the bias is already small. For the second moment, the correction method is exactly the same, except that the decay rate of the second moment is used.

[0344] The correction factor is designed based on a precise mathematical analysis of the bias. It can be proven that if the true gradient mean is a constant, then the expected value of the uncorrected first-moment estimate equals the true mean multiplied by 1 minus the decay rate to the power of t; therefore, dividing by this factor yields an unbiased estimate. Similarly, the expected value of the uncorrected second-moment estimate equals the true squared mean of the gradient multiplied by 1 minus the second-moment decay rate to the power of t; dividing by this factor also yields an unbiased estimate. This correction method is theoretically accurate and has proven highly effective in practice.

[0345] The impact of bias correction is most significant in the early stages of optimization. In the first iteration, the correction factor for the first moment is 1 minus 0.9^1, which equals 0.1. This means the corrected first moment is 10 times the uncorrected value. The correction factor for the second moment is 1 minus 0.999^1, which equals 0.001. The corrected second moment is 1000 times the uncorrected value. This significant amplification ensures that even with only one observation, the moment estimate provides a reasonable value and avoids an abnormally small learning rate. As iterations progress, the correction factors increase rapidly and approach 1: at the tenth iteration, the first moment correction factor is approximately 0.65, and the second moment correction factor is approximately 0.01; at the hundredth iteration, the first moment correction factor is approximately 0.9999, and the second moment correction factor is approximately 0.095; at the thousandth iteration, both correction factors are very close to 1, and the effect of the correction is negligible.

[0346] Bias correction not only addresses numerical issues but also positively impacts optimization dynamics. By providing more accurate moment estimates early on, bias correction allows optimization algorithms to move rapidly toward the optimum using a reasonable learning rate from the outset, rather than being overly cautious and slow in the early stages. This accelerates the overall convergence process and reduces the number of iterations required to reach a given accuracy. In some problems, the speedup effect of bias correction can be several times greater, especially in the early stages of optimization when progress is fastest.

[0347] When implementing bias correction, it's necessary to track the current iteration number t, which is typically a simple counter incremented after each iteration. Calculating the correction factor involves exponentiation, specifically calculating the decay rate raised to the power of t, which can be computationally expensive when t is large. An optimization technique utilizes the recursive property of exponentiation: the decay rate raised to the power of t equals the decay rate raised to the power of t minus 1 multiplied by the decay rate. Therefore, the power of the decay rate can be maintained in each iteration and updated via multiplication, instead of recalculating the power each time. This reduces the complexity of exponentiation from logarithmic to constant time. While the practical benefits of this optimization are limited on modern computers, it can be useful in computationally constrained environments.

[0348] The bias-corrected moment estimates form the basis for subsequent calculations of the adaptive learning rate. The corrected first moment provides an unbiased estimate of the gradient direction, indicating which direction the weights should be updated; the corrected second moment provides an unbiased estimate of the gradient variability, indicating how the learning rate should be adjusted. These two estimates combined enable the Adam algorithm to calculate a personalized update step size for each weight that considers both direction and magnitude, achieving efficient adaptive optimization.

[0349] Step A5 is the final and most crucial step in the entire adaptive optimization process. It transforms the previously calculated corrected moment estimate into actual weight updates and ensures that the updated weights satisfy the non-negativity constraint through a projection operation. This step integrates the calculation of the adaptive learning rate, the updating of weights, and the satisfaction of constraints, representing a perfect combination of algorithm theory and practice.

[0350] The core innovation of the Adam algorithm lies in the calculation of the adaptive learning rate. Unlike standard gradient descent, which uses a uniform fixed learning rate, Adam calculates a personalized learning rate for each weight variable. This learning rate is obtained by dividing the global learning rate by the square root of the corrected second-moment estimate. The square root operation is introduced to transform the second-moment estimate (the mean of the squared gradients) into an estimate of the gradient magnitude, since the standard deviation of the gradient is equal to the square root of the mean of the squared gradients. A small numerical stabilization term is added to prevent division by zero errors; when the second-moment estimate is very small, the denominator will not become zero, thus avoiding numerical overflow.

[0351] This adaptive learning rate design is intuitively reasonable. For weights with large gradient fluctuations, the second moment estimate is large, and the square root is also large, resulting in a small adaptive learning rate. This allows for smaller update steps for these weights, avoiding oscillations caused by gradient noise. For weights with stable gradients, the second moment estimate is small, resulting in a large adaptive learning rate. These weights can move forward in larger steps, accelerating convergence. This automatic adjustment mechanism allows weights with different characteristics to update at a rate suitable for their own characteristics, making the overall optimization process more efficient and stable.

[0352] The weight update formula combines an adaptive learning rate and a corrected first-moment estimate. The update direction is determined by the first-moment estimate, which is a smoothed estimate of the gradient and indicates the direction of the steepest descent of the loss function. The update step size is determined by the product of the adaptive learning rate and the first-moment estimate, which comprehensively considers the global learning speed, the local gradient magnitude, and the degree of gradient variability. Specifically, the new weights equal the old weights minus the adaptive learning rate multiplied by the corrected first moment. This is a standard gradient descent step, but the learning rate is adaptive, and the gradient is smoothed and corrected.

[0353] The global learning rate is a hyperparameter that needs to be tuned, as it controls the overall optimization speed. The default global learning rate for the Adam algorithm is 0.001, which is a reasonable starting point for many tasks. If the optimization process converges too slowly, you can try increasing the global learning rate, such as to 0.01 or 0.1, which will accelerate convergence but may also lead to instability. If the optimization process oscillates or diverges, you can try decreasing the global learning rate, such as to 0.0001 or 0.00001, which will improve stability but may slow down the convergence speed. Tuning the global learning rate can be automated through learning rate scheduling strategies, such as gradually decreasing the learning rate during optimization or dynamically adjusting the learning rate based on validation set performance.

[0354] Numerical stabilization terms are typically set to 10 to the power of -8, a sufficiently small value that won't significantly impact normal computation but effectively prevents division-by-zero errors. When the second-moment estimate is very small, such as when the gradient of a weight is consistently close to zero, its second-moment estimate will also be close to zero. Without a numerical stabilization term, calculating the learning rate would result in a huge, even infinitum-like, value due to division by a near-zero number. Adding a numerical stabilization term ensures the denominator is at least this small constant, keeping the learning rate within a finite range. In some applications, if the optimization process is found to be sensitive to the choice of the numerical stabilization term, its value can be adjusted, such as to 10 to the power of -7 or 10 to the power of -9, to observe the impact on performance.

[0355] The projection operation is performed after the weight update to ensure that the updated weights satisfy the non-negativity constraint. This operation is exactly the same as the projection operation in Example 3: for each weight variable, the maximum value between it and zero is taken; if the weight is positive, it remains unchanged; if the weight is negative, it is set to zero. The projection operation guarantees the semantic rationality of the weights because negative weights are meaningless in priority relationships. The projection operation is also related to L1 regularization and sparsity: when a weight is projected to zero, if subsequent gradients continue to push it in the negative direction, it will remain at zero, achieving automatic feature selection.

[0356] The overall performance of the adaptive optimization algorithm significantly outperforms standard subgradient descent. By calculating a personalized learning rate for each weight, the Adam algorithm automatically adapts to the different characteristics of various weights without requiring manual tuning of the learning rate for each weight. By using moment estimation to smooth gradients, the Adam algorithm reduces the impact of random noise, making the optimization path more stable. Through bias correction, the Adam algorithm provides accurate estimates early in the optimization process, accelerating convergence. These advantages make Adam one of the most popular optimization algorithms today, widely used in deep learning, machine learning, and various optimization problems.

[0357] In practical applications of weight learning, the improvements brought by adaptive optimization algorithms are multifaceted. First, the convergence speed is significantly improved; the number of iterations required to achieve the same optimization accuracy may be reduced by half or even more, saving considerable computation time when dealing with large-scale data. Second, optimization stability is enhanced; even with complex loss function topologies and multiple local minima, the Adam algorithm can steadily move towards better solutions with fewer oscillations or divergences. Third, the difficulty of hyperparameter tuning is reduced; although Adam still requires setting some hyperparameters, the default values ​​work well in most cases, eliminating the need for fine-tuning the learning rate as required by standard gradient descent. Finally, the quality of the final solution is often better; because Adam can explore the solution space more effectively, it has a greater chance of finding better local or global optima.

[0358] This embodiment elevates the efficiency and effectiveness of weight learning to a new level by introducing an adaptive optimization mechanism based on the Adam algorithm. Moment estimation provides an accurate characterization of gradient statistics, bias correction ensures the unbiasedness of the estimation, adaptive learning rate enables personalized update strategies, and projection operations guarantee constraint satisfaction. The organic combination of these techniques makes the weight learning process more intelligent, efficient, and robust, providing strong technical support for generating high-quality weighted priority graphs and ultimately improving the performance of the entire personalized ranking system.

[0359] Example 9

[0360] This embodiment provides an intelligent information sorting device based on user habit learning, such as... Figure 3 As shown, it includes:

[0361] Data acquisition module: This module acquires multiple historical information sorting records for a specific user, performs data cleaning and standardization on these records, and obtains standardized historical sorting data. This module implements the functions of step S1 in Example 1, including sub-functions such as data extraction, deduplication, missing value detection, and format standardization.

[0362] The graph construction module is used to statistically analyze the positional relationship of each pair of information items in the historical sorting data based on the standardized historical sorting data, calculate the priority weights between each pair of information items, and construct a weighted priority graph. This module implements the functions of step S2 in Embodiment 1, including sub-functions such as information item pair extraction, position statistics, weight calculation, duplicate item pair processing, and weight aggregation.

[0363] Conflict resolution module: This module performs conflict detection on the weighted priority graph, identifies pairs of information items with bidirectional priority relationships, resolves conflict directions according to weight magnitude, and generates a consistent habit graph. This module implements the functions of step S3 in embodiment 3, including sub-functions such as bidirectional edge detection, weight comparison, and edge deletion.

[0364] Connectivity analysis module: This module performs connectivity detection on the consistent custom graph, identifies weakly connected components and isolated nodes, and obtains a complete graph structure representation. This module implements the functions of step S4 in Example 4, including sub-functions such as DFS traversal, connected component identification, isolated node detection, and edge generation.

[0365] The sorting generation module is used to process each connected component based on the complete graph structure representation and employ a topological sorting algorithm to generate a linear sorted sequence that conforms to user habits. This module implements the functions of step S5 in embodiment 5, including sub-functions such as in-degree calculation, candidate queue management, tie breaking, and sorting result generation.

[0366] Evaluation module: This module calculates the consistency index between the linear sorted sequence and historical sorted data to obtain the model quality evaluation result. This module implements the functions of step S6 in Example 6, including sub-functions such as coverage calculation, violation count statistics, satisfaction scoring, and comprehensive report generation.

[0367] The modules are connected through standardized data interfaces to form a complete intelligent information sorting system. The output of the data acquisition module serves as the input of the graph construction module, and the output of the graph construction module serves as the input of the conflict resolution module. This process is repeated sequentially, and finally, the evaluation module outputs the quality assessment results and feeds them back to the graph construction module and the conflict resolution module for parameter optimization.

[0368] This device, through its modular design, realizes a complete process for personalized information sorting, and has good scalability and maintainability.

[0369] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

[0370] A computer program is stored on a machine-readable storage medium, which, when executed by a processor, performs the steps described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0371] In addition, this disclosure also provides a computer program product, on which a computer program is stored. When the computer program is run by a processor, it executes the steps provided in any of the above embodiments of this disclosure. For details, please refer to the above method embodiments, which will not be repeated here.

[0372] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium, which can be a volatile or non-volatile computer-readable storage medium. In another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0373] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices and apparatuses described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0374] 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0375] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0376] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0377] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. An information intelligent sorting method based on user habit learning, characterized in that, Includes the following steps: Obtain multiple historical information sorting records of the user, perform data cleaning and standardization processing on the historical information sorting records, and obtain standardized historical sorting data; Based on the standardized historical ranking data, the positional relationship of each pair of information items in the historical ranking data is statistically analyzed, the priority weights between each pair of information items are calculated, and a weighted priority graph is constructed. This includes: extracting all simultaneously occurring pairs of information items from the standardized historical ranking data to generate a candidate pair of information items set; statistically analyzing the positional differences and order of each pair of information items in the candidate pair of information items set in each historical record to obtain positional statistics; calculating the priority weights of each pair of information items using an inverse distance function based on the positional statistics; aggregating the priority weights of multiple occurrences of the information item pairs to obtain a comprehensive priority strength, and simultaneously calculating the weighted reset confidence to quantify the reliability of the comprehensive priority strength; and constructing the weighted priority graph based on the comprehensive priority strength and the weighted reset confidence. Conflict detection is performed on the weighted priority graph to identify information item pairs with bidirectional priority relationships. Conflict directions are resolved according to the weights to generate a consistent habit graph. The consistency graph is subjected to connectivity detection to identify weakly connected components and isolated nodes, resulting in a complete graph structure representation. The topological sorting algorithm is used to process each connected component in the complete graph structure representation to generate a linear sorting sequence that conforms to user habits. The consistency index between the linear sorting sequence and the historical sorting data is calculated to obtain the model quality evaluation result.

2. The method according to claim 1, characterized in that, The historical information sorting records are cleaned and standardized to obtain standardized historical sorting data, including: The historical information sorting records are deduplicated by deleting identical sorting records to obtain the deduplicated sorting records. Missing value detection is performed on the deduplicated sorted records to identify records with missing information items or incomplete position information, and a valid record set is generated. The identifiers and position indices of each information item in the valid record set are processed to unify their formats, resulting in the standardized historical sorted data.

3. The method according to claim 1, characterized in that, The positional relationship of each pair of information items in the historical sorted data is statistically analyzed, the priority weights between each pair of information items are calculated, and a weighted priority graph is constructed, including: Identify pairs of information items that appear repeatedly in multiple historical records from the standardized historical sorting data, and generate a set of duplicate item pairs; For each information item pair in the set of duplicate items, extract its corresponding single weight value in each historical record to obtain a weight sequence; The weight sequence is accumulated and aggregated to construct the weighted priority graph.

4. The method according to claim 3, characterized in that, The weighted priority graph is constructed by accumulating and aggregating the weight sequences, including: For each information item pair in the set of repeated items, the time decay weight is calculated based on the time of each occurrence to obtain the time weighting coefficient; Based on the time weighting coefficients and the weight sequence, the weights of each single iteration are fused using a weighted power average formula to obtain the fused weight value. The weighted reliability is obtained by calculating the ratio of the standard deviation to the mean of the weighted sequence. The fusion weight value and the weight reset confidence are added as edge attributes to the graph structure to generate enhanced edge data; Based on the enhanced edge data and candidate information items, an adjacency list representation of the graph is constructed, and the weighted priority graph is constructed.

5. The method according to claim 1, characterized in that, Conflict detection is performed on the weighted priority graph to identify information item pairs with bidirectional priority relationships. Conflict directions are resolved based on weight magnitude to generate a consistent habit graph, including: Bidirectional edge detection is performed on the weighted priority graph to identify information item pairs that simultaneously have forward and reverse edges, and a list of conflict pairs is generated. For each conflict pair in the list of conflict pairs, compare the weights of the forward edge and the reverse edge to determine the direction to retain; Based on the retained direction, edges with weights below a preset threshold are deleted to generate the consistent habit graph.

6. The method according to claim 1, characterized in that, The consistency graph is subjected to connectivity testing to identify weakly connected components and isolated nodes, resulting in a complete graph structure representation, including: Initialize the access tag array for the consistency habit graph and generate a node access status table; Based on the node access status table, a depth-first search algorithm is used to traverse each node and identify each weakly connected component. Node statistics are performed on each weakly connected component to identify components that contain only a single node, and a set of isolated nodes is generated. For each isolated node in the set of isolated nodes, establish connection edges with adjacent nodes based on the average position in the historical sorting data, and generate a supplementary edge set; Adding the supplementary edge set to the consistent habit graph yields the complete graph structure representation.

7. An intelligent information sorting device based on user habit learning, characterized in that, include: The data acquisition module is used to acquire multiple historical information sorting records of the user, perform data cleaning and standardization processing on the historical information sorting records, and obtain standardized historical sorting data. The graph construction module is used to, based on the standardized historical sorting data, statistically analyze the positional relationship of each pair of information items in the historical sorting data, calculate the priority weight between each pair of information items, and construct a weighted priority graph. Specifically, the graph construction module is used to: extract all simultaneously occurring pairs of information items from the standardized historical sorting data to generate a candidate information item pair set; and statistically analyze the positional differences and order of each pair of information items in the candidate information item pair set in each historical record to obtain positional statistics data. Based on the location statistics, the priority weight of each information item pair is calculated using the inverse distance function; The priority weights of the information item pairs that appear multiple times are aggregated to obtain the comprehensive priority strength. At the same time, the weight reset confidence is calculated to quantify the reliability of the comprehensive priority strength. The weighted priority graph is constructed based on the comprehensive priority strength and the weight reset confidence. The conflict resolution module is used to perform conflict detection on the weighted priority graph, identify information item pairs with bidirectional priority relationships, resolve conflict directions according to weight size, and generate a consistent habit graph. The connectivity analysis module is used to perform connectivity detection on the consistent custom graph, identify weakly connected components and isolated nodes, and obtain a complete graph structure representation; The sorting generation module is used to process each connected component using a topological sorting algorithm based on the complete graph structure representation, and generate a linear sorting sequence that conforms to user habits. The evaluation module is used to calculate the consistency index between the linear sorted sequence and the historical sorted data, and obtain the model quality evaluation result.

Citation Information

Patent Citations

  • Dynamic environment-oriented self-adaptive online sorting method and system

    CN114861093A

  • Multi-level batch text parallel deduplication method, system and equipment and storage medium

    CN119203983A