Collaborative recommendation method, device and system based on shared healthy diet and medium

By constructing family health data vectors and dietary demand vectors, using knowledge graphs to identify conflicts and optimize the generation of a unified diet plan, the problems of differences in health status and dietary preferences among family members are solved, and collaborative recommendation of diet plans at the family level is achieved.

CN120636696APending Publication Date: 2025-09-12GUANGZHOU AIHAMA INTERNET OF THINGS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510620796.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing health management systems find it difficult to collaboratively manage differences in health status and dietary preferences among family members, resulting in the inability to generate optimized dietary plans that meet the overall needs of the family.

Method used

By constructing family health data vectors and dietary demand vectors, using knowledge graphs to identify conflicts and construct objective functions, and using gradient descent method to optimize and generate a unified dietary plan.

Benefits of technology

It enables the generation of shared diet plans that take into account the health needs of every family member while ensuring nutritional balance, and supports diverse health management scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120636696A_ABST
    Figure CN120636696A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a collaborative recommendation method, device and system based on shared healthy diet and a medium, and the method comprises the steps: obtaining health data and diet demand data of each user in a family; generating a family health data vector based on the health data of each user, generating a family diet demand vector based on the diet demand data of each user, and constructing a knowledge graph based on the family health data vector and the family diet demand vector; determining a conflict function value between the members based on the difference of each diet demand component in the diet demand vector and the corresponding weight; forming a member pair set by the member pairs of which the conflict function values are positive numbers, constructing an objective function based on the diet demand vector of each member and the member pair set, and solving the objective function to obtain a unified diet scheme of the family; according to the invention, a family shared diet scheme which can meet individual demands and balance conflicts can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a collaborative recommendation method, device, system and medium based on sharing healthy diet. Background Art

[0002] Existing health management systems mainly focus on the health data monitoring of individual users and single-dimensional dietary recommendations, and fail to effectively solve the collaborative management problems caused by differences in health status, dietary preferences, and nutritional needs among family members. Specifically, in a typical family scenario, there are often situations where hypertensive patients who need to strictly control salt intake live together with manual laborers who need high-calorie dietary supplements. Such users have significant contradictions in key parameters such as nutritional intake thresholds and dietary taboos. Traditional recommendation algorithms usually adopt independent optimization strategies and can only generate idealized diet plans for a single user. When faced with complex scenarios where the needs of multiple users are intertwined, it is impossible to build a joint analysis model of multi-dimensional health parameters, and it is difficult to establish a quantitative mediation mechanism for nutritional conflicts, resulting in the output diet plans often losing sight of one thing while neglecting another.

[0003] The core limitations of the current technology system are: First, the data processing layer lacks a collaborative modeling framework for multi-user health data, failing to uniformly represent and correlate heterogeneous data such as family members' health indicators and nutritional needs. Second, the algorithm design layer lacks a knowledge graph-based conflict identification mechanism, making it impossible to analyze the contradictions and synergy potential between different family members' dietary needs through structured knowledge networks. Third, the system architecture layer lacks a dynamic optimization closed loop, which can neither detect the risk of nutritional imbalance under multi-objective constraints in real time nor lack collaborative recommendation strategies for family-shared diet scenarios. This technical deficiency makes it difficult for existing systems to generate optimal diet plans that meet the overall needs of the family while ensuring individual health goals, seriously restricting the practical application value of health management systems. Summary of the Invention

[0004] In view of this, the purpose of the embodiments of the present invention is to provide a collaborative recommendation method, device, system and medium based on sharing healthy diet to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.

[0005] In one aspect, an embodiment of the present invention provides a collaborative recommendation method based on sharing healthy diets, the method comprising the following steps: Obtain health data and dietary needs data for each user in the family; Generate a family health data vector based on each user's health data, generate a family dietary needs vector based on each user's dietary needs data, and construct a knowledge graph based on the family health data vector and the family dietary needs vector; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; the edges in the knowledge graph are used to represent the relationship between nodes, and each edge has a corresponding weight; determining conflict function values ​​between members based on differences and corresponding weights of the dietary demand components in the dietary demand vector; Member pairs with positive conflict function values ​​are formed into a member pair set, an objective function is constructed based on the dietary demand vector of each member and the member pair set, and the objective function is solved to obtain a unified dietary plan for the family.

[0006] Optionally, generating a family health data vector based on the health data of each user includes: Performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming each health data component into a health data vector of the user; The health data vectors of multiple users are weighted and aggregated by setting weights to obtain a family health data vector.

[0007] Optionally, generating a family dietary demand vector based on dietary demand data of each user includes: Performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming each health data component into a health data vector of the user; By setting weights, the health data vectors of multiple users are weighted and summarized to obtain the family dietary demand vector.

[0008] Optionally, determining the conflict function value between members based on the difference and corresponding weight of each dietary demand component in the dietary demand vector includes: Combine each family member into a pair, and calculate the difference between each dietary demand component in the dietary demand vector of the two members in the pair. The difference values ​​are weighted and summed based on the weights of the corresponding dietary demand components. The square root of the weighted summation result is added to the preset tolerance threshold to obtain the conflict function value of the member pair.

[0009] Optionally, constructing an objective function based on the dietary requirement vector of each member and the member pair set includes: Individual demand items constructed based on each member's dietary demand vector; The member pairs whose conflict function values ​​are positive are formed into a member pair set, and a penalty term is constructed based on the member pair set; The objective function is constructed based on individual demand terms and penalty terms.

[0010] Optionally, the objective function is expressed as: ; in: Represents the vector representation of the unified diet plan; i is the member number, N is the total number of members, is the dietary demand vector of the i-th member; C is the set of all conflicting member pairs; is a hyperparameter used to balance individual deviation and conflict penalties.

[0011] Optionally, solving the objective function to obtain a unified family diet plan includes: The dietary demand vectors of all members are matched according to the dietary demand components and the average is calculated to obtain the initial unified dietary vector of the objective function; The gradient of the individual demand item in the objective function is calculated using the gradient descent method. The initial unified diet vector is iteratively updated based on the gradient until the individual demand item converges to the optimal solution, thereby obtaining a unified diet plan for the family.

[0012] On the other hand, an embodiment of the present invention provides a collaborative recommendation device based on sharing healthy diet, comprising: The first module is used to obtain the health data and dietary needs data of each user in the family; The second module is configured to generate a family health data vector based on each user's health data, generate a family dietary needs vector based on each user's dietary needs data, and construct a knowledge graph based on the family health data vectors and the family dietary needs vectors; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; and the edges in the knowledge graph represent the relationship between the nodes, with each edge having a corresponding weight. A third module is configured to determine conflict function values ​​between members based on differences and corresponding weights of various dietary demand components in the dietary demand vector; The fourth module is used to form a member pair set from member pairs with positive conflict function values, construct an objective function based on the dietary demand vector of each member and the member pair set, and solve the objective function to obtain a unified dietary plan for the family.

[0013] On the other hand, an embodiment of the present invention provides a collaborative recommendation system based on sharing healthy diets, including: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0014] On the other hand, an embodiment of the present invention provides a computer-readable storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to perform the above method.

[0015] The embodiments of the present invention include the following beneficial effects: This embodiment integrates the multi-dimensional health data and dietary needs of family members to build a dynamic collaborative optimization model, converts metabolic indicators, nutritional needs and other parameters into computable vector data, and uses knowledge graphs to analyze the conflicts and commonalities in dietary needs between different members, and then generates a family shared diet plan that takes into account the health needs of each member through multi-user data integration, conflict identification and collaborative optimization. The method realizes data collaborative processing and collaborative recommendation of family-level dietary plans under the premise of ensuring nutritional balance through mathematical modeling, vector data expression, functional relationships and algorithmic formulas. The system includes health data integration, real-time recommendation engine and visual interaction module, which can flexibly adapt to diverse scenarios such as chronic disease management and nutritional regulation during special physiological periods, support the generation of multiple customized unified diet plans, and provide intelligent decision support for health management platforms. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 This is a schematic flow chart of the steps of a collaborative recommendation method based on sharing healthy diets provided by an embodiment of the present invention; Figure 2 This is a structural block diagram of a collaborative recommendation device based on shared healthy diet provided by an embodiment of the present invention; Figure 3 This is a structural block diagram of a collaborative recommendation system based on sharing healthy diets provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0019] It should be noted that although the device schematics illustrate a modular division and the flowcharts illustrate a logical sequence, in some cases, the steps shown or described may be performed in a different order than the modular division in the device or the sequence in the flowcharts. The terms "first," "second," and so on in the specification, claims, and drawings are used to distinguish similar items and are not necessarily used to describe a specific order or precedence.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0021] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0023] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0024] The purpose of this invention is to provide a collaborative recommendation algorithm that can integrate family members' health data, identify conflicts in dietary needs, and generate a family-shared diet plan that takes into account the health needs of all parties. To achieve this purpose, the present invention provides the following technical solutions: Multi-user data integration: By collecting the health data of each family member (such as blood pressure, blood sugar, weight, exercise volume, etc.) and individual dietary needs (such as low salt, low fat, high protein, high energy, etc.), and using a unified modeling method to vectorize the data.

[0025] A knowledge graph is constructed containing nodes such as family members' dietary needs, nutritional content, and food types. By establishing relationships and dependencies between nodes (e.g., the conflict between a low-salt diet and a high-energy diet), conflicts and commonalities in dietary needs are identified. For any two dietary need vectors, a conflict function is defined to determine whether there is a conflict. Furthermore, the adjacency matrix of the nodes in the graph is used to weight conflicts, ensuring that the individual characteristics of each member are taken into account during global collaborative optimization.

[0026] Collaborative Optimization: Based on multi-user data and conflict analysis results, an objective function is constructed. Multi-objective collaborative optimization is achieved through large-scale models (such as deep neural networks or hybrid optimization models). Optimization objectives are set and a unified diet plan is generated. If conflicting member pairs exist, a balance coefficient is introduced. By solving this optimization problem, a family-shared diet plan is obtained that both meets individual needs and balances conflicts.

[0027] like Figure 1 As shown, Figure 1 An embodiment of the present invention provides a collaborative recommendation method based on sharing healthy diets, the method comprising the following steps: S100, obtaining health data and dietary demand data of each user in the family; S200, generating a family health data vector based on the health data of each user, generating a family dietary needs vector based on the dietary needs data of each user, and constructing a knowledge graph based on the family health data vector and the family dietary needs vector; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; and edges in the knowledge graph are used to represent the relationship between nodes, and each edge has a corresponding weight; S300, determining conflict function values ​​between members based on differences and corresponding weights of various dietary demand components in the dietary demand vector; S400 , forming a member pair set from member pairs with positive conflict function values, constructing an objective function based on the dietary demand vector of each member and the member pair set, and solving the objective function to obtain a unified dietary plan for the family.

[0028] Specifically, the health data and dietary demand data of each user in the family are obtained, and the health data and dietary demand data are cleaned and vectorized to obtain the health data vector and dietary demand vector of each user; the health data vector and dietary demand vector of each user are weighted and summarized to obtain the family health data vector and family dietary demand vector.

[0029] This paper presents a dietary recommendation algorithm that integrates multi-user health data, analyzes knowledge graph conflicts, and performs collaborative optimization. The algorithm encompasses data modeling, graph knowledge construction, algorithmic conflict resolution, and multi-objective optimization methods, making it suitable for designing and implementing healthy dietary plans for families.

[0030] In some improved embodiments, generating a family health data vector based on health data of each user includes: S211, performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming a health data vector for the user from each health data component; S212 , performing weighted aggregation on the health data vectors of multiple users by setting weights to obtain a family health data vector.

[0031] In some improved embodiments, generating a family dietary demand vector based on dietary demand data of each user includes: S221, performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming a health data vector for the user from each health data component; S222: performing weighted aggregation on the health data vectors of multiple users by setting weights to obtain a family dietary demand vector.

[0032] Specifically, multi-user data integration is first performed; 1. Data modeling and preprocessing; Data modeling and preprocessing are the foundation of the entire system. Their purpose is to ensure that collected family health and dietary data can be accurately and uniformly represented as vectors, providing reliable input for subsequent multi-user data integration and algorithm optimization. The following details each step of this process.

[0033] Data collection specifically includes: Health data: including blood pressure, blood sugar, heart rate, BMI, weight, exercise steps, etc. Data is automatically collected through smart bracelets, home health monitoring devices, medical records and home health apps.

[0034] Dietary needs data: This includes indicators such as low salt, low fat, high energy, and high protein, as well as the user's dietary preferences and allergies. This data can be entered by the user or evaluated by a professional nutritionist and entered into the system.

[0035] The following is an example of a specific case: (1) Member A (patient with hypertension): Blood pressure: 135 / 85 mmHg; Blood glucose: 5.8mmol / L; BMI: 24; Dietary requirements: low salt (salt intake is recommended to be controlled below 3 grams per day), moderate protein; (2) Member B (manual laborer): Blood pressure: 120 / 70 mmHg; Blood glucose: 6.0 mmol / L; BMI: 26; Dietary requirements: high energy (daily energy intake is recommended to be increased to about 2500 kcal) and high protein; When data is collected, it will be accompanied by a timestamp, device identification, and measurement accuracy information to ensure the timeliness and accuracy of the data. For example, a measurement record of member A is: Record A: {Time: 2025-03-01 08:00, Blood Pressure: 135 / 85, Blood Sugar: 5.8, BMI: 24, Dietary Requirements: Low Salt}.

[0036] 2. Data modeling and preprocessing, including: Data cleaning, including: Outlier processing: Statistical analysis (e.g., mean, standard deviation) is used to eliminate abnormal measurements. For example, if a blood pressure measurement record is significantly higher than a family member's usual reading (e.g., 200 / 110 mmHg), it is considered abnormal and will be eliminated.

[0037] Data smoothing and filtering: Use moving average or Kalman filtering methods for continuous data (such as heart rate and step count) to reduce noise interference.

[0038] Data normalization; In order to process data of different dimensions in a unified way, a normalization method is used. For example, for a certain indicator X: ; in and are the minimum and maximum values ​​of the indicator in history respectively; Vectorized representation, specifically including: health data vector; For each member i, define the health data vector: ; For example, assuming that blood pressure, blood sugar, and BMI are vectorized, then: The health vector of member A can be expressed as: , where each component is a normalized value.

[0039] The health vector of member B is, for example: .

[0040] Dietary requirements vector; Similarly, for dietary needs, set corresponding indicators for each need.

[0041] For example, suppose we create a vector for low salt, energy intake, and protein requirements: , where: For member A (low salt demand is obvious): , indicating that salt intake requirements are low (the lower the value, the stricter the requirement), and energy and protein intake are at a moderate level.

[0042] For member B (high energy demand): ; The values ​​here can be pre-set by a nutritionist based on actual health indicators, or automatically learned through data mining.

[0043] Through the above-mentioned data collection, cleaning, normalization and vectorization, the system converts data from different sources and dimensions into a unified format, ensuring the comparability and numerical significance of various indicators during subsequent multi-user data integration.

[0044] 3. Multi-user data integration, including: Multi-user data integration aims to effectively integrate the data of each family member, thereby building a unified model that reflects the overall health status and dietary needs of the whole family, laying the foundation for subsequent conflict detection and collaborative optimization.

[0045] Weighted aggregation model; The health status and dietary needs of each family member may have different influence weights on the design of the overall unified diet plan. Individual data are weighted and aggregated to calculate the overall health profile and dietary demand trends of the family.

[0046] weighted aggregation of health data; For N family members, the family overall health vector F is given by: ; The weight Determined based on the member's health risks, disease management needs, or other key indicators.

[0047] For example, for members with high blood pressure, the system can assign a higher weight to ensure that low salt control is prioritized.

[0048] Integration of dietary needs; Similarly, the dietary requirements vector can be integrated using a weighted average: ; in is the weight parameter of dietary needs, and its setting can also be determined according to factors such as health urgency and the importance of dietary preferences.

[0049] Case description: Take the aforementioned family as an example: Weight setting: Assume that member A (hypertensive patient) is given weight , member B gives .

[0050] Health data integration: If the health vector of member A is ; The health vector of member B is ; The calculation formula for the family health data vector is as follows: ; Dietary needs integration: Assume that member A's dietary demand vector is ; Member B's ; If the weight of dietary demand is assumed to be consistent with health risk, the family dietary demand vector is: ; This result suggests that within the overall dietary approach, the system will balance the need for low salt (reflected by a lower first component) with the need for moderately increased energy and protein intake.

[0051] The system also regularly updates each member's weight and vector value based on daily feedback from the family (for example, actual intake and changes in health indicators recorded through the app). Through continuous iteration, the model can be adjusted in real time to ensure the long-term effectiveness of the diet plan.

[0052] Next, knowledge graph construction and conflict detection are carried out; 1. Knowledge graph construction; 1.1, Node definition; In order to fully describe the family's dietary needs and nutritional characteristics, the knowledge graph G = (V, E) constructed in this paper includes the following three main types of nodes: Dietary requirement nodes: "Low salt", "High energy", "High protein", "Low fat", etc. These nodes reflect the user's basic dietary requirements; Nutritional component nodes: including "sodium", "energy", "protein", "fat", "dietary fiber", etc.; Food category nodes: such as "vegetables", "whole grains", "lean meat", "nuts", etc., represent the actual optional food categories, helping to recommend specific food combinations later.

[0053] 1.2, edge construction and weight setting; Edges in the graph are used to describe the relationships between nodes. These relationships can reflect positive or negative influences. The weight corresponding to each edge is represented by the weight matrix A. For example: Edge between "low salt" and "sodium": weight , indicating low salt requirements to reduce sodium intake.

[0054] Edge between "High Energy" and "Energy": Weight , indicating that high energy demand is positively correlated with energy intake.

[0055] Between "low salt" and "cardiovascular health": weight , indicating that a low-salt diet can help improve cardiovascular health.

[0056] These weights can be determined by nutrition experts through statistical historical data, or they can be adaptively adjusted through machine learning methods.

[0057] 1.3, construct case description; Take member A and member B as an example: Member A (patient with hypertension, low salt requirement); Dietary requirements vector: ,in Stands for strict salt control (low salt), Represent energy and protein requirements respectively, with intermediate values ​​(such as 0.5~0.6).

[0058] Member B (manual worker, high energy demand); Dietary requirements vector: ,in (Salt requirements are relatively loose), (high energy demand), (Protein needs are moderate).

[0059] In the knowledge graph, there is a potential contradiction between the "low salt" node and the "high energy" node: On the one hand, a low-salt diet may limit the intake of certain high-energy foods (such as processed foods); on the other hand, high energy needs often require the intake of more energy-dense foods. The graph uses intuitive node-edge relationships to illustrate this contradiction and provide a basis for subsequent conflict detection.

[0060] In some improved embodiments, determining the conflict function value between members based on the differences and corresponding weights of the dietary requirement components in the dietary requirement vector includes: S310, each member of the family is combined into a member pair, and the difference value of each dietary demand component in the dietary demand vector of the two members in the member pair is calculated. S320 , performing weighted summation on each difference value based on the weight of the corresponding dietary demand component, taking the square root of the weighted summation result and adding the result to a preset tolerance threshold to obtain a conflict function value of the member pair.

[0061] 2. Conflict detection algorithm; 2.1, conflict function definition; In order to quantify the contradictions in dietary needs among different family members, the present invention uses the following conflict function to calculate the conflict function value between members: ; in: are the dietary demand vectors of members i and j respectively; is the Euclidean distance; is the preset tolerance threshold (currently set to 0.2); when When it is greater than 0, it indicates that there is a conflict in dietary needs among members.

[0062] 2.2 Adjustment mechanism based on knowledge graph; In order to more precisely capture the differences between key indicators, the present invention uses the weight matrix A in the knowledge graph to adjust the conflict detection. The adjusted conflict function is defined as: ; in: They respectively represent the importance weights of demand indicators such as "salt", "energy" and "protein" in the knowledge graph.

[0063] Weight setting example: Regarding the "salt" requirement, since it is particularly critical for patients with hypertension, set ; Energy requirement setting ; Protein requirement setting ; Example calculation: For members A and B: Difference calculation: ; ; ; Weighted sum: 1.2*0.09=0.108; 1.0*0.09=0.09; 0.8*0.01=0.008; Summary: 0.108+0.09+0.008=0.206; Take the square root: ; The adjusted conflict function is: ; because >0, indicating that the conflict still exists, and because a higher weight is given to the "salt" indicator, the difference in low-salt demand is magnified in the conflict assessment, which is more in line with the consideration of actual health risks.

[0064] In some improved embodiments, constructing an objective function based on the dietary requirement vector of each member and the member pair set includes: S411, individual demand items constructed based on the dietary demand vectors of each member; S412, forming a member pair set from member pairs whose conflict function values ​​are positive, and constructing a penalty term based on the member pair set; S413, constructing an objective function based on individual demand terms and penalty terms.

[0065] Then, collaborative optimization and solution generation are carried out; By constructing an objective function and solving it using an optimization algorithm, a unified dietary plan is obtained that can both meet the individual dietary needs of each family member and balance conflicting needs.

[0066] 1. Objective function design; In the previous steps, through data integration and knowledge graph construction, the dietary demand vector of each family member has been obtained. and the conflict function values ​​between members (Weighted In order to take into account individual needs and demand conflicts, the objective function is designed.

[0067] In some improved embodiments, the objective function is expressed as: ; in: Represents the vector representation of the unified diet plan; i is the member number, N is the total number of members, is the dietary demand vector of the i-th member; C is the set of all conflicting member pairs; is a hyperparameter used to balance individual deviation and conflict penalties.

[0068] It should be noted that the first Diet plan to ensure generation Be as close as possible to the individual needs of each family member. Penalties are imposed on detected demand conflicts, thereby playing a role in reconciling contradictions in the overall optimization.

[0069] In some improved embodiments, solving the objective function to obtain a unified family diet plan includes: S421, averaging the dietary demand vectors of all members according to their dietary demand components to obtain an initial unified dietary vector of the objective function; S422, using the gradient descent method to calculate the gradient of the individual demand item in the objective function, and iteratively updating the initial unified diet vector based on the gradient until the individual demand item converges to the optimal solution, thereby obtaining a unified diet plan for the family.

[0070] 2. Solution method; Because the objective function is continuous, it can be solved using a variety of numerical optimization methods, such as gradient descent, Newton's method, or optimizers in deep neural networks (such as Adam). In this case, for ease of explanation, we use gradient descent.

[0071] 2.1 Gradient descent solution steps; (1) Initialization; Generally, the initial solution can be set to the mean of all individual demand vectors, that is: ; For two members, if and ,but: ; (2) Gradient calculation; For the objective function The relevant part (the first term), the gradient is: ; In addition, if the conflicting terms also If the conflict term is related, the corresponding gradient needs to be calculated. However, in this example, the conflict term mainly reflects the differences between individual needs and is more used to guide the balance strategy.

[0072] (3) Iterative update; The update formula is: ; in is the learning rate, until Converge to the optimal solution .

[0073] 2.2, combined with the description of conflicting items; The conflict term is usually given by: ; For example, we have calculated that for members A and B: ; By introducing a weight matrix (e.g. giving higher weight to salt demand), the adjusted conflict function After calculation, we get about 0.254.

[0074] In the objective function, this part of the term is multiplied by the hyperparameter (If set = 1), a conflict penalty term is formed, which allows the optimization process to take into account both individual needs and narrow the gap between the two sides when the conflict is large.

[0075] Let's take a case study involving two family members: Case data: Member A (hypertensive patient); dietary requirement vector: ; Note: Low salt requirements are high, and energy and protein requirements are at a medium level.

[0076] Member B (manual laborer); dietary demand vector: ; Description: It has a higher energy requirement and a looser salt requirement.

[0077] Objective function instance; Construct the objective function: ; Assumptions =1, and the aforementioned conflicting items , whose square is approximately .

[0078] Comparison of two different weighting schemes: 1.1, initial mean solution ( ); make ; Calculation error: ; ; Total: 0.0475 + 0.0475 = 0.095, plus the conflict term .

[0079] 1.2, slightly leaning towards Member A's solution (e.g. ); make ; The calculation shows that: ; Calculation error: ; ; Total: 0.0304 + 0.0684 = 0.0988, plus the conflict term .

[0080] In this case, by experimenting with different fusion weights (i.e. different value), the system can automatically select the objective function The smallest solution. Here is the mean solution The obtained objective function value is slightly lower, indicating that the mean solution may be more ideal when considering the needs of both members and conflict constraints.

[0081] 4. Dynamic adjustment and feedback mechanism; In actual application, the health status and dietary feedback of family members will be continuously updated, and the system can adjust according to the data recorded daily: Individual Dietary Requirements Vector The value of The weight of each member and demand conflict tolerance threshold ; Optimizing the target The value of , thus updating and generating a new unified diet plan in real time .

[0082] For example, if continuous monitoring shows that member A's blood pressure has improved significantly, the system may relax its low salt requirement (adjust accordingly). medium and low salt content or reduce the corresponding weight), and then adjust the optimal solution To better reflect the current health status.

[0083] By constructing an objective function that incorporates individual distances and conflict penalties and solving it using numerical methods such as gradient descent, this method automatically generates a unified diet plan through collaborative optimization that balances the dietary needs of each family member and the conflict balance. This multi-objective collaborative optimization method not only provides a precise mathematical tool for developing a unified family diet plan, but also lays a solid foundation for dynamic adjustment and personalized customization in practical applications.

[0084] See Figure 2 , an embodiment of the present invention provides a collaborative recommendation device based on sharing healthy diet, comprising: The first module is used to obtain the health data and dietary needs data of each user in the family; The second module is configured to generate a family health data vector based on each user's health data, generate a family dietary needs vector based on each user's dietary needs data, and construct a knowledge graph based on the family health data vectors and the family dietary needs vectors; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; and the edges in the knowledge graph represent the relationship between the nodes, with each edge having a corresponding weight. A third module is configured to determine conflict function values ​​between members based on differences and corresponding weights of various dietary demand components in the dietary demand vector; The fourth module is used to form a member pair set from member pairs with positive conflict function values, construct an objective function based on the dietary demand vector of each member and the member pair set, and solve the objective function to obtain a unified dietary plan for the family.

[0085] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0086] See Figure 3 , an embodiment of the present invention provides a collaborative recommendation system based on sharing healthy diet, including: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0087] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0088] In addition, the embodiments of the present application further disclose a computer program product or computer program, which is stored in a computer-readable storage medium. The processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above-mentioned method. Similarly, the contents of the above-mentioned method embodiment are all applicable to the present storage medium embodiment, and the functions specifically implemented by the present storage medium embodiment are the same as those of the above-mentioned method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned method embodiment.

[0089] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0090] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0091] The terms "first," "second," "third," "fourth," and the like (if any) in the specification of the present application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in orders other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or apparatus.

[0092] It should be understood that in this application, "at least one (item)" means one or more, and "more" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or plural.

[0093] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0094] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0095] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0096] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the portion that contributes to the prior art, or all or part 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 multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store programs, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0097] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A collaborative recommendation method based on sharing healthy diet, characterized in that: The method comprises the following steps: Obtain health data and dietary needs data for each user in the family; Generate a family health data vector based on each user's health data, generate a family dietary needs vector based on each user's dietary needs data, and construct a knowledge graph based on the family health data vector and the family dietary needs vector; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; the edges in the knowledge graph are used to represent the relationship between nodes, and each edge has a corresponding weight; determining conflict function values ​​between members based on differences and corresponding weights of the dietary demand components in the dietary demand vector; Member pairs with positive conflict function values ​​are formed into a member pair set, an objective function is constructed based on the dietary demand vector of each member and the member pair set, and the objective function is solved to obtain a unified dietary plan for the family.

2. The method according to claim 1, characterized in that Generating a family health data vector based on the health data of each user includes: Performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming each health data component into a health data vector of the user; The health data vectors of multiple users are weighted and aggregated by setting weights to obtain a family health data vector.

3. The method according to claim 1, characterized in that Generating a family dietary demand vector based on dietary demand data of each user includes: Performing outlier processing, data smoothing and filtering, and data normalization on the user's health data to obtain multiple health data components of the user, and forming each health data component into a health data vector of the user; By setting weights, the health data vectors of multiple users are weighted and summarized to obtain the family dietary demand vector.

4. The method according to claim 1, wherein The determining of the conflict function value between members based on the difference and corresponding weight of each dietary demand component in the dietary demand vector includes: Combine each family member into a pair, and calculate the difference between each dietary demand component in the dietary demand vector of the two members in the pair. The difference values ​​are weighted and summed based on the weights of the corresponding dietary demand components. The square root of the weighted summation result is added to the preset tolerance threshold to obtain the conflict function value of the member pair.

5. The method according to claim 1, wherein The objective function is constructed based on the dietary requirement vector of each member and the member pair set, including: Individual demand items constructed based on each member's dietary demand vector; The member pairs whose conflict function values ​​are positive are formed into a member pair set, and a penalty term is constructed based on the member pair set; The objective function is constructed based on individual demand terms and penalty terms.

6. The method according to claim 1, characterized in that The expression of the objective function is: ; in: Represents the vector representation of the unified diet plan; i is the member number, N is the total number of members, is the dietary demand vector of the i-th member; C is the set of all conflicting member pairs; is a hyperparameter used to balance individual deviation and conflict penalties.

7. The method according to claim 5, characterized in that Solving the objective function to obtain a unified family diet plan includes: The dietary demand vectors of all members are matched according to the dietary demand components and the average is calculated to obtain the initial unified dietary vector of the objective function; The gradient of the individual demand item in the objective function is calculated using the gradient descent method. The initial unified diet vector is iteratively updated based on the gradient until the individual demand item converges to the optimal solution, thereby obtaining a unified diet plan for the family.

8. A collaborative recommendation device based on sharing healthy diet, characterized in that: include: The first module is used to obtain the health data and dietary needs data of each user in the family; The second module is configured to generate a family health data vector based on each user's health data, generate a family dietary needs vector based on each user's dietary needs data, and construct a knowledge graph based on the family health data vectors and the family dietary needs vectors; wherein the nodes in the knowledge graph include dietary needs nodes, nutrient component nodes, and food category nodes; and the edges in the knowledge graph represent the relationship between the nodes, with each edge having a corresponding weight. A third module is configured to determine conflict function values ​​between members based on differences and corresponding weights of various dietary demand components in the dietary demand vector; The fourth module is used to form a member pair set from member pairs with positive conflict function values, construct an objective function based on the dietary demand vector of each member and the member pair set, and solve the objective function to obtain a unified dietary plan for the family.

9. A collaborative recommendation system based on sharing healthy diet, characterized by: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is configured to perform the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Cited By

  • Multi-user portrait-based shopping mall system intelligent recommendation decision-making method and platform

    CN121235797A