A method and device for quickly matching similar house types based on multi-level scoring
By calculating the aspect ratio of the minimum bounding rectangle of the floor plan using a multi-level scoring method, generating a spatially connected topology graph and circulation similarity, and combining graph attention networks and hidden Markov models, the problem of inaccurate and complex matching results of similar floor plans in existing technologies is solved, achieving efficient and accurate floor plan matching and user-friendly recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- B&Q NETWORK TECH (SHANGHAI) CO LTD
- Filing Date
- 2023-09-05
- Publication Date
- 2026-06-02
AI Technical Summary
Existing similar apartment matching methods are difficult to guarantee in terms of matching quality and are complex to implement. They cannot quickly handle large amounts of data, lack model interpretability, and make it difficult for users to understand the reasons for the recommendations.
A multi-level scoring method is adopted, which calculates the aspect ratio of the minimum bounding rectangle of the floor plan, generates a spatial connectivity topology graph and circulation similarity, calculates the similarity of the topological relationship graph using graph attention network, and combines the similarity score with the Hidden Markov Model to carry out multi-level scoring and ranking recommendation.
It improves the accuracy of matching similar apartment layouts, saves computing resources, and provides clear reasons for recommendations, thus enhancing the user experience.
Smart Images

Figure CN117274640B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing, and more specifically, relates to a method and apparatus for rapid matching of similar apartment layouts based on multi-level scoring. Background Technology
[0002] In the field of interior design case matching, the market's floor plan database is constantly expanding. Users can get related recommendations for similar floor plans based on the floor plan they input. This can greatly reduce design costs by referencing existing floor plans, and it is also easier for users to accept.
[0003] However, current methods for matching apartment layouts typically employ a single similarity calculation method. Firstly, different similarity calculation methods exhibit varying accuracy and robustness across different contexts, often resulting in inconsistent quality of matched apartment layouts. Secondly, a single similarity calculation method cannot accurately account for room layout, area ratios, and functional allocation. Furthermore, using a single similarity calculation method consumes significant computational resources, making it difficult to quickly handle large datasets and lacking interpretability. Users often want to understand why a particular apartment layout is recommended and how it meets their needs.
[0004] In summary, existing methods for matching similar apartment layouts not only fail to guarantee matching quality but are also complex to implement. Therefore, a faster method for matching similar apartment layouts is needed to address these issues. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method and apparatus for rapid matching of similar apartment types based on multi-level scoring, so as to solve the problems that the matching results of similar apartment type matching methods in the prior art are difficult to guarantee and are complex to implement.
[0006] In a first aspect, embodiments of the present invention provide a method for fast matching of similar apartment types based on multi-level scoring. The method includes: obtaining a floor plan of the apartment type to be matched; obtaining the minimum bounding rectangle of the floor plan based on the floor plan, sorting and filtering the aspect ratios of the minimum bounding rectangle of the floor plan and the minimum bounding rectangle of the target apartment type to obtain a first matching result; distinguishing spatial regions based on the spatial type of the floor plan to be matched, generating a spatial connectivity topology graph, calculating the apartment type circulation lines, calculating the circulation line similarity based on the circulation lines, and obtaining a first weight result based on preset weights and circulation line similarity; obtaining a room topology graph based on the room's topology graph embedding vector, assigning different attention weights to the neighboring nodes of each node in the room topology graph, calculating the similarity between node representations through the attention weights, and calculating a second weight result based on preset weights; accumulating and sorting the first weight result and the second weight result to obtain a second matching result, and recommending various decoration schemes according to the sorting result.
[0007] In one possible implementation, the method for fast matching of similar apartment types based on multi-level scoring further includes: extracting apartment type features as observation sequence features; defining a state set according to the apartment type structure; training the apartment type to be matched based on the observation sequence samples and the state set samples; calculating the similarity score between the apartment type to be matched and the target apartment type using posterior probability; and sorting and filtering based on the similarity score to obtain a third matching result.
[0008] In the above implementation process, the calculation of the similarity score between the floor plan to be matched and the target floor plan specifically includes: the target floor plan observation sequence is O_u={O_{u1},O_{u2},...,O_{uT}}, where T represents the length of the observation sequence; the floor plan to be matched observation sequence is O_c={O_{c1},O_{c2},...,O_{cT}}; the state set is defined as S={S_1,S_2,...,S_N}, where N represents the number of states; the state transition probability matrix is defined as A={a_{ij}}, where a_{ij} represents the probability of transitioning from state S_i to state S_j; and the observation probability matrix is defined as B={b_{ij}}, where b_{ Let ij} represent the probability of observing the observation symbol O_{uj} in state S_i. Define the forward probability α_t(i) as the probability of being in state S_i at time t and observing a partial observation sequence O_u={O_{u1},O_{u2},...,O_{ut}}. Define the backward probability β_t(i) as the probability of being in state S_i at time t and observing a partial observation sequence O_u={O_{ut+1},O_{ut+2},...,O_{uT}}. Calculate the probability of the observation sequence O_c under the model based on the Hidden Markov Model, i.e., P(O_c|λ), where λ represents the parameters of the Hidden Markov Model. Take the negative logarithm of P(O_c|λ) to obtain the similarity score.
[0009] Furthermore, the step of distinguishing spatial regions based on the spatial type of the floor plan to be matched, generating a spatial connectivity topology map, calculating the floor plan circulation lines, and calculating the floor plan circulation line similarity based on the floor plan circulation lines specifically includes: obtaining circulation line features based on the floor plan circulation lines; assigning feature weights according to the circulation line features; calculating circulation line similarity based on the circulation line features, and weighting and fusing the similarity into a feature similarity score.
[0010] In the above implementation process, the movement characteristics specifically include: path length, path direction angle, number of turns of the path, and path curvature.
[0011] Furthermore, the calculation of similarity between node representations through attention weights specifically includes: learning different attention weights based on multiple attention heads using GAT; concatenating or averaging the outputs of the multiple attention heads to form a multi-head attention; and using cosine similarity to measure similarity based on the multi-head attention score.
[0012] In the above implementation process, the step of using cosine similarity to measure similarity based on multi-head attention score specifically includes: calculating the feature vector representation and multi-head attention score of each node in the floor plan to be matched, calculating the feature vector representation and multi-head attention score of each node in the target floor plan, and using cosine similarity to measure the similarity of each pair of nodes.
[0013] Secondly, embodiments of the present invention provide a fast matching device for similar apartment layouts based on multi-level scoring. The device includes: an acquisition module for acquiring the floor plan of the apartment to be matched; a first matching module for acquiring the minimum bounding rectangle of the floor plan based on the floor plan, sorting and filtering the aspect ratios of the minimum bounding rectangle of the floor plan and the minimum bounding rectangle of the target apartment to obtain a first matching result; a second matching module for distinguishing spatial regions based on the spatial type of the floor plan, generating a spatial connectivity topology graph, calculating the apartment layout circulation lines, calculating the circulation line similarity based on the circulation lines, obtaining a first weight result based on preset weights and circulation line similarity, obtaining a room topology graph based on the room's topology graph embedding vector, assigning different attention weights to the neighboring nodes of each node in the room topology graph, calculating the similarity between node representations through the attention weights, and calculating a second weight result based on preset weights; and a recommendation module for accumulating and sorting the first weight result and the second weight result to obtain a second matching result, and recommending various decoration schemes according to the sorting result.
[0014] Thirdly, embodiments of the present invention provide an electronic device. The electronic device includes one or more processors and a memory. The memory is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors perform the described method.
[0015] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the above-described method.
[0016] One or more of the above embodiments have the following advantages or beneficial effects: by adopting a multi-level similarity scoring method, the first matching similarity is first obtained by calculating the aspect ratio of the smallest bounding rectangle of the house type, the topological relationship graph similarity of the house is calculated based on the graph attention network, the circulation similarity is calculated based on the house circulation lines, and the second matching similarity is obtained by weighted calculation.
[0017] This multi-level scoring system can accurately determine the matching degree of similar apartment types, significantly improving the accuracy of matching similar apartment types and greatly saving computing resources. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of the overall process of a method for rapid matching of similar apartment types based on multi-level scoring, provided in an embodiment of the present invention;
[0020] Figure 2 This is a flowchart illustrating a method for calculating the similarity of apartment layouts based on apartment layout circulation, provided in an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of a room topology obtained by vectorizing a floor plan, as provided in an embodiment of the present invention.
[0022] Figure 4 A schematic diagram illustrating a method for calculating the similarity between node representations based on attention weights, provided in an embodiment of the present invention;
[0023] Figure 5 A flowchart illustrating a method for calculating third-order similarity based on a hidden Markov model, provided in an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of a device for rapid matching of similar apartment types based on multi-level scoring, provided in an embodiment of this application;
[0025] Figure 7 A block diagram of an electronic device for rapid matching of similar apartment layouts based on multi-level scoring, provided as an embodiment of this application. Detailed Implementation
[0026] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0029] When using expressions such as "at least one of A, B, and C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). The terms "first" and "second" are used only for naming distinction and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features.
[0030] To facilitate understanding of this embodiment, a detailed description of the multi-level scoring method for rapid matching of similar apartment layouts disclosed in this invention will be provided first. (See [link to relevant documentation]). Figure 1 The diagram illustrates a fast method for matching similar apartment layouts with multi-level scoring. This method can be executed by an electronic device and mainly includes the following steps:
[0031] S110, retrieve the floor plan of the apartment type to be matched.
[0032] Specifically, the "model to be matched" refers to a model found in the database, used to match the target model to determine its similarity. The "floor plan" refers to a plan view of a house or building represented using vector graphics. Its main elements are points, lines, and surfaces, each with its own format protocol, and the data is recorded as key-value pairs. Floor plan data includes information on walls, doors, windows, and furniture. Door and window data includes center point, length, width, and the corresponding wall ID; furniture data includes center point, length, width, and rotation angle. Floor plans can be obtained through various methods, such as developers, real estate agents, or third-party design platforms; this is not limited to these methods.
[0033] S120: Obtain the minimum bounding rectangle of the floor plan based on the floor plan to be matched, sort and filter the aspect ratios of the minimum bounding rectangle of the floor plan to be matched and the minimum bounding rectangle of the target floor plan to obtain the first matching result.
[0034] Specifically, the minimum bounding rectangle refers to the smallest rectangle that can perfectly enclose the entire floor plan. This minimum bounding rectangle is usually parallel to the length and width of the house and can contain all rooms and structures. By calculating the minimum bounding rectangle of the floor plan, the overall layout and size information of the house can be obtained. House layouts are often not regular; some special layouts may have rounded or angled outlines. The minimum bounding rectangle is a good way to grasp the overall size, layout, and structure of the house. The minimum bounding rectangle can be obtained using the rotating caliper algorithm, which is the most efficient method for finding the minimum bounding rectangle of a floor plan. First, obtain the coordinates of each room or structure from the floor plan. These coordinates can be represented as points on a two-dimensional plane. The convex hull algorithm is used to calculate the convex hull of the room coordinates. The convex hull is a convex polygon whose boundary is the smallest polygon outside the original point set. Find a pair of antiheel points on the convex hull. Antiheel points are the two points on the convex hull that are farthest apart, and the line connecting them is called the antiheel line. Construct an initial rectangle with the heel point as the diagonal. Find the smallest rectangle that can enclose the entire convex hull by rotating the initial rectangle. During each rotation, update the boundary of the smallest bounding rectangle based on the position of the boundary points. In the rotational caliper algorithm, continuously update the position and size of the smallest bounding rectangle until the smallest rectangle that can enclose the entire convex hull is found. The final smallest bounding rectangle is the smallest rectangle that can enclose the entire floor plan, providing information about the overall layout and dimensions of the house.
[0035] The target apartment type is a known apartment type used to retrieve similar apartment types. The apartment type to be matched is an apartment type from the search database used to match the target apartment type, thereby determining whether it is similar to the target apartment type. The ratio of the length and width of the smallest bounding rectangle of the apartment type to be matched to the length and width of the smallest bounding rectangle of the target apartment type is calculated. The length-to-width ratio = length / width. A length-to-width ratio close to 1 indicates that the length and width of the apartment type are relatively similar, that is, the shape tends to be square; a length-to-width ratio greater than 1 indicates that the apartment type is more elongated. By comparing the length-to-width ratios, the similarity of the shape and layout of the apartment types can be measured. The length-to-width ratios of the smallest bounding rectangles of the apartment type to be matched and the smallest bounding rectangles of the target apartment type are sorted to filter out apartment types with similar shapes and layouts, thus obtaining the first matching result.
[0036] S130: Based on the spatial type of the floor plan to be matched, distinguish spatial areas, generate a spatial connectivity topology map, calculate the floor plan circulation lines, calculate the similarity of the floor plan circulation lines, and obtain the first weight result based on the preset weight and circulation line similarity.
[0037] The spatial type distinguishes spatial areas by identifying the various functional areas within a building, such as entrances, corridors, living rooms, kitchens, bedrooms, and bathrooms. Each functional area has its specific identifier and symbol in the circulation diagram. The spatial types include active, quiet, water, and fire zones. The spatial connectivity topology diagram is a diagram used to describe the connection relationships between different areas in the space. Using the spatial area identifiers in the database of the apartment types to be matched, active, quiet, water, and fire zones are identified, and a spatial connectivity topology diagram is generated based on these spatial areas. The circulation path refers to the routes people take indoors and outdoors. People living in an apartment will generate fairly complex circulation paths, which generally include visitor circulation paths, residential circulation paths, and kitchen circulation paths. Visitor circulation paths are generated by the movement trajectories of visitors; residential circulation paths are generated by the movement trajectories of the homeowner from the bedroom to the living / dining room; and kitchen circulation paths are generated by the movement trajectories of the homeowner from the kitchen to the living / dining room. The A* algorithm can be used to calculate the apartment circulation paths. The A* algorithm is the most efficient method for finding the shortest path. It uses the starting node as the initial node, expands the current node, traverses its neighboring nodes, calculates the cost of reaching each neighbor, and continues until the shortest path to the destination is found. By backtracking through predecessor nodes, the shortest path from the starting point to the destination, i.e., the movement path, can be obtained. The kitchen route refers to the route from the kitchen to the living / dining room. The grid containing the center point of the kitchen is the initial grid, and the grid containing the center point of the living / dining room is the target grid. The calculation method for the starting grid is the same as that for the target grid. If both the starting and ending grids exist, executing the A* algorithm will yield the housework movement path for this apartment type; if either one is missing, the housework movement path for this apartment type is incomplete.
[0038] In some embodiments, see step S130. Figure 2As shown, the method for calculating the similarity of apartment layouts based on apartment layout circulation includes the following steps S210 to S230:
[0039] S210, obtains circulation features based on apartment layout.
[0040] The movement characteristics include path length, path direction angle, number of turns, and path curvature. These characteristics can be used to describe the shape and flow pattern of the movement diagram. Path length refers to the length of the current movement path; path direction angle refers to the angle of the path segment's direction relative to a reference direction (usually the horizontal direction or the positive X-axis); number of turns refers to the number of times the path segment turns during the movement of people; and path curvature refers to the degree of curvature of the path segment.
[0041] S220 assigns feature weights based on movement characteristics.
[0042] The feature weights refer to assigning different weights to different features based on their importance. For example, path length may contribute more to the similarity of the path map and can be given a higher weight. This invention provides a possible feature weight of path length 0.5, path direction angle 0.3, number of turns 0.1, and path curvature 0.1.
[0043] S230, calculate the similarity of the movement lines based on the movement line features, and then weight and fuse the similarity into a feature similarity score.
[0044] Specifically, in this embodiment of the invention, different calculation methods are selected based on different path characteristics. For example, if the path length can be calculated by calculating the distance between adjacent points to obtain the length of each line segment on the path, these distances can be calculated using Euclidean distance, Manhattan distance, or other distance metrics suitable for specific situations. Finally, by accumulating the line segment lengths, we can obtain the length of the entire path. If the path direction angle can be calculated by calculating the direction angle of each adjacent line segment on the path, the arctangent function (such as arctan2) is used to calculate the direction angle of the line segment for each adjacent point on the path. The arctangent function accepts two parameters (difference of y-coordinate and difference of x-coordinate) and returns the corresponding angle value. For example, if the path length similarity is 0.7 and the path length weight is 0.5, and the path direction angle similarity is 0.9 and the path length weight is 0.5, then the feature similarity score is 0.8.
[0045] In this embodiment of the invention, a first weight result can be obtained based on the calculated similarity of the movement path and the preset weight. The preset weight can be set in advance. In this embodiment of the invention, the preset weight of the similarity of the movement path is 0.3.
[0046] S140: Obtain the room topology graph based on the room topology graph embedding vector, assign different attention weights to the neighboring nodes of each node in the room topology graph, calculate the similarity between node representations through the attention weights, and calculate the second weight result based on the preset weights.
[0047] Specifically, a graph is generated based on the coordinates of the room's center point and its topological relationships. In the graph, each room can be represented as a node, and the topological relationships between rooms can be represented as edges. For example... Figure 3 As shown in the figure, the present invention provides a schematic diagram of a room topology obtained by vectorizing a floor plan (Graph).
[0048] In embodiments of the present invention, different attention weights are assigned to the neighboring nodes of each node in the room topology graph, and the similarity between nodes is calculated through the attention weights. The more critical the current node is, the greater the attention weight will be.
[0049] In some embodiments, see step S140. Figure 4 As shown, the method of assigning different attention weights to the neighboring nodes of each node in the room topology graph and calculating the similarity between node representations through attention weights includes the following steps S410 to S430:
[0050] S410 learns different attention weights based on multiple attention heads of GAT.
[0051] GAT is a deep learning model for processing graph data. It uses a self-attention mechanism to assign different attention weights to the neighboring nodes of each node, thereby focusing on important nodes and edges in the graph. GAT learns different attention weights by using multi-head attention, thereby capturing graph structure information at different levels. Graph structure information refers to the connection methods and relationships between nodes, as well as the hierarchical structure and organization of these relationships in the entire graph.
[0052] S420, the outputs of the multiple attention heads are spliced or averaged to form a multi-head attention.
[0053] Based on the calculated multiple attention heads, the attention is spliced together to form multi-head attention. In another embodiment of the present invention, the attention is aggregated into multi-head attention by summing and averaging the calculated attention heads.
[0054] S430 uses cosine similarity to measure similarity based on multi-head attention scores.
[0055] For each node in the floor plan to be matched, its feature vector representation and multi-head attention score are calculated. For each node in the target floor plan, its feature vector representation and multi-head attention score are also calculated. For each pair of nodes, cosine similarity is used to measure their similarity. Cosine similarity measures the similarity between two vectors by calculating the angle between them, and it can also measure the similarity between multi-head attention scores. For example, when the cosine similarity is 1, it means that the two floor plan vectors are in the same direction and the angle between them is 0 degrees, indicating that the two floor plan vectors are very similar. When the cosine similarity is -1, it means that the two floor plan vectors are in opposite directions and the angle between them is 180 degrees, indicating that the two floor plan vectors are very dissimilar. When the cosine similarity is 0, it means that the two floor plan vectors are perpendicular to each other and the angle between them is 90 degrees, indicating that there is no significant similarity between the two floor plan vectors.
[0056] In this embodiment of the invention, cosine similarity is used to measure the similarity between the apartment type to be matched and the target apartment type through the aforementioned multi-head attention score. Based on the obtained similarity and a pre-set weight ratio, a second weight result is calculated. It should be noted that the weight ratio given in this embodiment is 0.7. The second weight result is the apartment type similarity result calculated after assigning different attention weights to the neighboring nodes of each node in the apartment type topology graph, and the second weight result is calculated according to the similarity result with a weight ratio of 0.7.
[0057] S150, the first weight result and the second weight result are summed and sorted to obtain the second matching result, and each decoration scheme is recommended according to the sorting result.
[0058] Specifically, according to the preset weight ratio, the first weight result and the second weight result are obtained by weighted summation. The first weight result and the second weight result are then accumulated and sorted. The second matching result is obtained according to the sorting result. The user can then confirm whether it is similar to the target house type based on the sorting result.
[0059] Furthermore, in some embodiments, a third matching result is also included; see [link to relevant documentation] in some embodiments. Figure 5 As shown, the method for calculating the third-order similarity based on the Hidden Markov Model includes the following steps S510 to S530:
[0060] S510, extract the apartment layout features as the features of the observation sequence.
[0061] The feature extraction mentioned here refers to extracting suitable features for each floor plan as an observation sequence. Room dimensions, relative positions between rooms, and connectivity are used as observation features. Specifically, the target floor plan observation sequence is O_u = {O_{u1}, O_{u2}, ..., O_{uT}}, where T represents the length of the observation sequence, and the floor plan observation sequence to be matched is O_c = {O_{c1}, O_{c2}, ..., O_{cT}}.
[0062] S520 defines a set of states based on the apartment layout.
[0063] The defined state set refers to a suitable set of states defined according to specific needs to represent different apartment layout patterns. Each state represents a specific apartment layout.
[0064] Specifically, we define the set of states as S = {S_1, S_2, ..., S_N}, where N represents the number of states. We define the state transition probability matrix A = {a_{ij}}, where a_{ij} represents the probability of transitioning from state S_i to state S_j. We define the observation probability matrix B = {b_{ij}}, where b_{ij} represents the probability of observing the observation symbol O_{uj} in state S_i.
[0065] S530 trains the floor plan to be matched based on observation sequence samples and state set samples.
[0066] Training refers to using an existing floor plan dataset to train a Hidden Markov Model (HMM) using supervised learning. During training, the corresponding observation sequences and state sequences are used as training samples. Specifically, the observation probability matrix B = {b_{ij}} is defined, where b_{ij} represents the probability of observing the observation symbol O_{uj} in state S_i. The forward probability α_t(i) is defined as the probability of being in state S_i at time t and observing a partial observation sequence O_u = {O_{u1}, O_{u2}, ..., O_{ut}}, and the backward probability β_t(i) is defined as the probability of being in state S_i at time t and observing a partial observation sequence O_u = {O_{ut+1}, O_{ut+2}, ..., O_{uT}}.
[0067] S540 calculates the similarity score between the floor plan to be matched and the target floor plan using posterior probability, and sorts and filters based on the similarity score to obtain the third matching result.
[0068] Similarity calculation can utilize metrics such as relative entropy (Kullback-Leibler divergence) or Euclidean distance, using posterior probability as the basis for similarity measurement. Specifically, the probability of the observed sequence O_c under the model, i.e., P(O_c|λ), is calculated using a Hidden Markov Model (HMM), where λ represents the parameters of the HMM. Log-likelihood can be used as the similarity score, i.e., taking the negative logarithm of P(O_c|λ) to obtain a smaller similarity score.
[0069] like Figure 6 Based on the above embodiments, this embodiment of the invention provides a fast matching device for similar apartment types based on multi-level scoring, including: an acquisition module 51, a first matching module 52, a second matching module 53, and a recommendation module 54.
[0070] The acquisition module 51 is used to obtain the floor plan of the apartment type to be matched.
[0071] The first matching module 52 is used to obtain the minimum bounding rectangle of the floor plan based on the floor plan to be matched, sort and filter the aspect ratio of the minimum bounding rectangle of the floor plan to be matched and the minimum bounding rectangle of the target floor plan, and obtain the first matching result.
[0072] The second matching module 53 is used to distinguish spatial regions based on the spatial type of the floor plan to be matched, generate a spatial connectivity topology map, calculate the floor plan circulation lines, calculate the similarity of the floor plan circulation lines, obtain a first weight result based on preset weights and circulation line similarity, obtain a room topology map based on the room topology relationship graph embedding vector, assign different attention weights to the neighboring nodes of each node in the room topology map, calculate the similarity between node representations through attention weights, and obtain a second weight result based on preset weights.
[0073] The recommendation module 54 sums and sorts the first weight result and the second weight result to obtain the second matching result, and recommends each decoration scheme according to the sorting result.
[0074] In one possible implementation, the multi-level scoring-based rapid matching device for similar apartment layouts provided in this embodiment of the invention further includes a third matching module 55, specifically used for:
[0075] The apartment layout features are extracted as observation sequence features; a state set is defined based on the apartment layout structure; the apartment layouts to be matched are trained based on the observation sequence samples and the state set samples; the similarity score between each candidate apartment layout and the user input apartment layout is calculated using the posterior probability; and the similarity scores are sorted and filtered to obtain the third matching result.
[0076] In another possible implementation, the third matching module 55 calculates a similarity score between the floor plan to be matched and the target floor plan, specifically including:
[0077] The target apartment type observation sequence is O_u={O_{u1},O_{u2},...,O_{uT}}, where T represents the length of the observation sequence. The apartment type observation sequence to be matched is O_c={O_{c1},O_{c2},...,O_{cT}}. The state set is defined as S={S_1,S_2,...,S_N}, where N represents the number of states. The state transition probability matrix is defined as A={a_{ij}}, where a_{ij} represents the probability of transitioning from state S_i to state S_j. The observation probability matrix is defined as B={b_{ij}}, where b_{ij} represents the observed symbol observed in state S_i. The probability of O_{uj} is defined as follows: the forward probability α_t(i) is the probability of being in state S_i at time t and observing a partial observation sequence O_u={O_{u1},O_{u2},...,O_{ut}}; the backward probability β_t(i) is defined as the probability of being in state S_i at time t and observing a partial observation sequence O_u={O_{ut+1},O_{ut+2},...,O_{uT}}. The probability of the observation sequence O_c under the model is calculated based on the Hidden Markov Model, i.e., P(O_c|λ), where λ represents the parameters of the Hidden Markov Model. The negative logarithm of P(O_c|λ) is taken to obtain the similarity score.
[0078] In another possible implementation, spatial regions are distinguished based on the spatial type of the floor plan to be matched, a spatial connectivity topology graph is generated, the floor plan circulation lines are calculated, and the similarity of the floor plan circulation lines is calculated. The second matching module 53 specifically includes:
[0079] Based on the apartment layout, the circulation features are obtained, feature weights are assigned according to the circulation features, circulation similarity is calculated based on the circulation features, and the similarity is weighted and fused into a feature similarity score.
[0080] The specific features of the movement path include:
[0081] Path length, path direction angle, number of turns, and path curvature.
[0082] In another possible implementation, the second matching module 53 specifically includes: (The similarity between node representations is calculated using attention weights.)
[0083] Based on GAT, multiple attention heads learn different attention weights, and the outputs of the multiple attention heads are concatenated or averaged to form a multi-head attention. Based on the multi-head attention score, cosine similarity is used to measure similarity.
[0084] In another possible implementation, cosine similarity is used to measure similarity based on the multi-head attention score, specifically including:
[0085] For each node in the floor plan to be matched, calculate its feature vector representation and multi-head attention score. For each node in the target floor plan, calculate its feature vector representation and multi-head attention score. For each pair of nodes, use cosine similarity to measure their similarity.
[0086] Figure 7 A block diagram schematically illustrates an electronic device 1000 suitable for implementing a method for rapid matching of similar apartment layouts based on multi-level scoring according to an embodiment of the present disclosure.
[0087] like Figure 7 As shown, an electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0088] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1002 and / or RAM 1003. It should be noted that the programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0089] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0090] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0091] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1002 and / or RAM 1003 and / or one or more memories other than ROM 1002 and RAM 1003 described above.
[0092] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.
[0093] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0094] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1009, and / or installed from a removable medium 1011. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0095] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0096] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0097] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0098] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0099] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for rapid matching of similar apartment layouts based on multi-level scoring, characterized in that, The method includes: Obtain the floor plan of the apartment type to be matched; The minimum bounding rectangle of the floor plan to be matched is obtained. The aspect ratios of the minimum bounding rectangle of the floor plan to be matched and the minimum bounding rectangle of the target floor plan are sorted and filtered to obtain the first matching result. Based on the spatial type of the floor plan to be matched, spatial regions are distinguished, a spatial connectivity topology map is generated, the floor plan circulation lines are calculated, the similarity of the floor plan circulation lines is calculated, and the first weight result is obtained based on the preset weight and circulation line similarity. The room topology graph is obtained by embedding the topology graph of the room. Different attention weights are assigned to the neighboring nodes of each node in the room topology graph. The similarity between node representations is calculated by the attention weights. The second weight result is obtained based on the preset weights. The first weighted result and the second weighted result are summed and sorted to obtain the second matching result, and the various decoration schemes are recommended according to the sorting result. Extract apartment layout features as features of the observation sequence; Define a set of states based on the apartment layout; The floor plan to be matched is trained based on observation sequence samples and state set samples; The similarity score between the floor plan to be matched and the target floor plan is calculated using posterior probability. The similarity scores are then used to sort and filter the results to obtain the third matching result.
2. The method for rapid matching of similar apartment types based on multi-level scoring according to claim 1, characterized in that, The calculation of the similarity score between the floor plan to be matched and the target floor plan specifically includes: The target apartment type observation sequence is O_u={O_{u1},O_{u2},...,O_{uT}}, where T represents the length of the observation sequence. The apartment type observation sequence to be matched is O_c={O_{c1},O_{c2},...,O_{cT}}. The state set is defined as S={S_1,S_2,...,S_N}, where N represents the number of states. The state transition probability matrix is defined as A={a_{ij}}, where a_{ij} represents the probability of transitioning from state S_i to state S_j. The observation probability matrix is defined as B={b_{ij}}, where b_{ij} represents the probability of observing the observation symbol O_{uj} in state S_i. Define the forward probability α_t(i) as the probability that at time t, the user is in state S_i and has observed a partial observation sequence O_u = {O_{u1}, O_{u2}, ..., O_{ut}}. Define the backward probability β_t(i) as the probability that at time t, the user is in state S_i and has observed a partial observation sequence O_u = {O_{ut+1}, O_{ut+2}, ..., O_{uT}}. The probability of the observed sequence O_c under the model is calculated based on the Hidden Markov Model, namely P(O_c|λ), where λ represents the parameters of the Hidden Markov Model. The similarity score is obtained by taking the negative logarithm of P(O_c|λ).
3. The method for rapid matching of similar apartment types based on multi-level scoring according to claim 1, characterized in that, Based on the spatial type of the floor plan to be matched, spatial regions are distinguished, a spatial connectivity topology graph is generated, the circulation routes of the floor plans are calculated, and the similarity of the circulation routes is calculated, specifically including: Circulation characteristics are obtained based on apartment layout and circulation patterns; Assign feature weights based on the characteristics of the movement path; The similarity of movement lines is calculated based on the movement line features, and the similarity is weighted and fused into a feature similarity score.
4. The method for rapid matching of similar apartment types based on multi-level scoring according to claim 3, characterized in that, The movement characteristics specifically include: Path length, path direction angle, number of turns, and path curvature.
5. The method for rapid matching of similar apartment types based on multi-level scoring according to claim 1, characterized in that, The calculation of similarity between node representations using attention weights specifically includes: GAT-based learning of different attention weights using multiple attention heads; The outputs of the multiple attention heads are spliced together or averaged to form a multi-head attention; Based on the multi-head attention score, cosine similarity is used to measure similarity.
6. The method for rapid matching of similar apartment types based on multi-level scoring according to claim 5, characterized in that, Based on the multi-head attention score, cosine similarity is used to measure similarity, specifically including: For each node in the floor plan to be matched, calculate its feature vector representation and multi-head attention score. For each node in the target floor plan, calculate its feature vector representation and multi-head attention score. For each pair of nodes, use cosine similarity to measure their similarity.
7. A device for rapid matching of similar apartment layouts based on multi-level scoring, characterized in that, include: The acquisition module is used to obtain the floor plan of the apartment type to be matched; The first matching module is used to obtain the minimum bounding rectangle of the floor plan based on the floor plan to be matched, sort and filter the aspect ratio of the minimum bounding rectangle of the floor plan to be matched and the minimum bounding rectangle of the target floor plan, and obtain the first matching result. The second matching module is used to distinguish spatial regions based on the spatial type of the floor plan to be matched, generate a spatial connectivity topology map, calculate the floor plan circulation lines, calculate the similarity of the floor plan circulation lines, obtain the first weight result based on the preset weight and circulation line similarity, obtain the room topology map based on the room topology relationship graph embedding vector, assign different attention weights to the neighboring nodes of each node in the room topology map, calculate the similarity between node representations through the attention weights, and obtain the second weight result based on the preset weight. The recommendation module sums and sorts the first weighted result and the second weighted result to obtain the second matching result, and recommends each decoration scheme according to the sorting result.
8. An electronic device, characterized in that, include: At least one processor, at least one memory and a bus, wherein, The processor and memory communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, which can invoke the program instructions to perform the method as described in any one of claims 1 to 7.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the method as described in any one of claims 1 to 6.