Excel anti-drift anchor tracking system and method
Patent Information
- Application Number
- CN202611029391.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]因此,本发明提供了Excel抗偏移锚点追踪系统及方法,解决行列变更后图片位置发生物理偏移和难以快速回定的问题
[0035]本发明有益效果为:通过在工作表打开阶段建立行高、列宽和图片锚点之间的物理基准映射关系,实现了在后续行列变更发生后能够直接依据累计行高变化量和累计列宽变化量预测图片位置偏移方向与偏移量;通过围绕预测偏移区构建自适应邻域搜索范围并引入物理偏移一致度与邻域版面一致度联合核验,实现了在行列变更后快速从邻近版面中重新锁定正确图片锚点位置,从而提高图片锚点追踪的稳定性和恢复效率。
Smart Images

Figure CN122904865A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of office automation technology, and in particular to an Excel anti-offset anchor tracking system and method. Background Technology
[0002] With the widespread use of spreadsheets in business management, financial statistics, engineering records, and mixed text and graphics layouts, the processing technology surrounding Excel documents has gradually evolved from simply reading cell values to parsing worksheet structures, maintaining object positions, and analyzing layout linkages. In scenarios where objects such as images, icons, and screenshots are arranged together with cell content, changes in row height, column width, inserted or deleted rows and columns, and merged areas directly alter the physical position of objects within the worksheet. Therefore, relying solely on logical cell addresses for association maintenance is no longer sufficient to meet the stable anchor point tracking requirements in complex editing scenarios.
[0003] Existing technologies still have two shortcomings. First, existing Excel object association maintenance methods mostly rely on static coordinates, fixed cell positions, or local references to maintain the correspondence between image object positions and data object identifiers. When rows or columns are inserted, deleted, or adjusted in the worksheet, the actual physical position of the image object on the page will shift as a whole due to changes in the cumulative row height and cumulative column width, making it difficult to correct the original object association in a timely manner. Second, after the image position shifts, existing technologies usually lack a processing mechanism for directional searching and local verification around the predicted shift direction, making it difficult to quickly re-lock the correct image anchor point position from adjacent pages after row and column changes. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an Excel anti-offset anchor point tracking system and method to solve the problem of physical offset of image position and difficulty in quickly resetting it after row and column changes.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides an Excel anti-offset anchor point tracking method, which includes: when an Excel document is opened, performing unified physical coordinate conversion on the row height, column width, merged area, image object position, and associated cell position of the current worksheet to generate an image anchor point physical reference mapping table; when a row and column change event caused by insertion, deletion, or adjustment of rows and columns is detected, extracting the cumulative row height change and cumulative column width change before the target image anchor point position to generate a physical offset prediction vector and a prediction offset area; constructing an adaptive neighborhood search range based on the physical offset prediction vector, prediction offset area, merged area span, and current layout non-empty cell distribution; extracting the current candidate anchor point set within the adaptive neighborhood search range, and extracting a historical reference candidate set from the image anchor point physical reference mapping table; verifying and scoring the current candidate anchor point set and the historical reference candidate set, determining the target candidate anchor point, updating the image anchor point position according to the target candidate anchor point, refreshing the image anchor point physical reference mapping table, and returning to the listening state.
[0008] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps for generating the image anchor point physical reference mapping table are as follows:
[0009] When an Excel document is opened, it reads the visible area, row height, column width, merged area, cell text, cell style, image object position, and associated cell position, and generates a snapshot of the worksheet's physical coordinates.
[0010] Based on the physical coordinate snapshot of the worksheet, the row height and column width of each row are cumulatively converted into horizontal and vertical physical positions. The image object coverage boundary, associated cell boundary and merged span are extracted to generate physical reference entries for image anchor points.
[0011] Based on the image anchor point physical reference entries, the image object identifier, anchor point physical coordinates, anchor point binding row and column positions, associated cell identifiers, and local layout features are bound and recorded to generate an image anchor point physical reference mapping table.
[0012] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps for generating the physical offset prediction vector and the prediction offset region are as follows:
[0013] When a row / column change event is detected, extract the row height, column width, row and column number, insertion / deletion type, adjustment direction, and target image anchor point binding row and column position before and after the change, and generate a row / column change record;
[0014] Based on the row and column change records, the changes in row height and column width are accumulated for the affected rows and columns before the anchor point of the target image is bound to the row and column position, respectively. Combined with the merged area span correction, a physical offset prediction vector is generated.
[0015] Based on the physical offset prediction vector, the original anchor point physical coordinates, and the image object size, an expansion is generated to create a prediction offset region.
[0016] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps for constructing the adaptive neighborhood search range are as follows:
[0017] Based on the magnitude and direction of the physical offset prediction vector, the coverage boundary of the prediction offset area, the span of the merged area, and the size of the target image object, determine the row direction expansion amount and the column direction expansion amount, and generate the neighborhood expansion parameters.
[0018] Based on the neighborhood expansion parameters, combined with the distribution of non-empty cells in the current worksheet, the boundaries of merged regions, and the edge positions of image objects, directional expansion and boundary clipping are performed on the predicted offset area to generate an adaptive neighborhood search range.
[0019] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps of extracting the current candidate anchor point set within the adaptive neighborhood search range are as follows:
[0020] Based on the adaptive neighborhood search range, the cell boundaries, merged region boundaries, image object boundaries, and non-empty text positions within the range are scanned to generate the current location cell set;
[0021] Based on the current set of positioning units, extract the physical coordinates, row and column numbers, local text content, local style features, and merging span information corresponding to the candidate positions to generate the current set of candidate anchor points.
[0022] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps for extracting the historical reference candidate set from the image anchor point physical reference mapping table are as follows:
[0023] Extract the original anchor point physical coordinates, bound row and column positions, associated cell identifiers, local text features, local style features, and merged span information corresponding to the target image object identifier from the image anchor point physical reference mapping table, and generate a historical reference template.
[0024] Based on the historical reference template, the physical coordinates of the original anchor points are aligned with the predicted offset area, and the associated cell identifiers are matched with the local layout of the current worksheet to generate a historical reference candidate set.
[0025] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps for verifying and scoring the current candidate anchor point set and the historical reference candidate set to determine the target candidate anchor point are as follows:
[0026] Based on the current candidate anchor point set and the historical reference candidate set, verify the consistency of physical offset, text neighborhood, style neighborhood and merging boundary corresponding to the candidate position, and generate candidate verification scores;
[0027] Based on the candidate verification scores, the candidate positions are sorted and the candidate position with the best score is selected as the target candidate anchor point.
[0028] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the specific steps of updating the image anchor point position according to the target candidate anchor point are as follows:
[0029] Based on the target candidate anchor points, rewrite the physical coordinates of the anchor points corresponding to the image objects, the row and column positions of the anchor points, and the positions of the associated cells to generate anchor point update records;
[0030] Based on the anchor point update record, refresh the active mapping content in the image anchor point physical baseline mapping table, write the current worksheet version information into the history of the corresponding image object identifier, determine the update execution channel, and generate the execution transaction page.
[0031] As a preferred embodiment of the Excel anti-offset anchor point tracking method of the present invention, the steps of refreshing the image anchor point physical reference mapping table and returning to the listening state are as follows:
[0032] Based on the execution transaction page, the updated anchor point physical coordinates, bound row and column positions, and associated cell positions are written into the activity mapping table, and the old mapping content is replaced to generate the updated activity mapping record;
[0033] Based on the updated activity mapping record, clean up the temporary processing record and candidate cache corresponding to this row and column change event, release the listening channel and reattach it to the updated anchor point position, and return to the listening state.
[0034] Secondly, this invention provides an Excel anti-offset anchor point tracking system, comprising: a baseline mapping module, used to perform unified physical coordinate conversion on the row height, column width, merged area, image object position, and associated cell position of the current worksheet when the Excel document is opened, generating an image anchor point physical baseline mapping table; an offset calculation module, used to extract the cumulative row height change and cumulative column width change before the target image anchor point position when a row / column change event caused by insertion, deletion, or adjustment of rows / columns is detected, generating a physical offset prediction vector and a predicted offset area; a neighborhood search module, used to construct an adaptive neighborhood search range based on the physical offset prediction vector, predicted offset area, merged area span, and the distribution of non-empty cells in the current layout; a candidate verification module, used to extract the current candidate anchor point set within the adaptive neighborhood search range and extract the historical reference candidate set from the image anchor point physical baseline mapping table; and an update execution module, used to verify and score the current candidate anchor point set and the historical reference candidate set, determine the target candidate anchor point, update the image anchor point position according to the target candidate anchor point, refresh the image anchor point physical baseline mapping table, and return to the listening state.
[0035] The beneficial effects of this invention are as follows: By establishing a physical baseline mapping relationship between row height, column width, and image anchor points during the worksheet opening stage, it is possible to directly predict the image position offset direction and offset based on the cumulative changes in row height and column width after subsequent row and column changes; by constructing an adaptive neighborhood search range around the predicted offset area and introducing joint verification of physical offset consistency and neighborhood layout consistency, it is possible to quickly re-lock the correct image anchor point position from the neighboring layout after row and column changes, thereby improving the stability and recovery efficiency of image anchor point tracking. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart of the Excel anti-offset anchor point tracking system and method.
[0038] Figure 2 A flowchart for generating a physical reference mapping table for image anchor points.
[0039] Figure 3 A flowchart for generating the physical offset prediction vector and the prediction offset region.
[0040] Figure 4 A flowchart for determining target candidate anchor points. Detailed Implementation
[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0042] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0043] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0044] Reference Figures 1-4 As an embodiment of the present invention, this embodiment provides an Excel anti-offset anchor point tracking system and method, including the following steps:
[0045] S1. When an Excel document is opened, perform a unified physical coordinate conversion on the row height, column width, merged area, image object position, and associated cell position of the current worksheet, and generate an image anchor point physical reference mapping table.
[0046] When an Excel document is opened, it reads the visible area, row height, column width, merged areas, cell text, cell styles, image object positions, and associated cell positions, and generates a snapshot of the worksheet's physical coordinates.
[0047] The specific process is as follows: when the Excel document is opened, the displayed row and column ranges are extracted from the current worksheet as the boundaries of the visible area. The row height is read row by row number, and the column width is read column by column number. The merged cell range definition and the coverage boundary of each merged range are read. The cell display text and cell style are read cell by cell along the row and column directions. The left edge position, top edge position, width range, and height range of each image object in the current worksheet are read one by one, and the position of the associated cell corresponding to the image object is locked. Then, the row height and column width are cumulatively converted into the vertical and horizontal physical coordinates of the worksheet, so that the position of the image object, the position of the associated cell, and the local layout content fall into the same physical position expression method, and a worksheet physical coordinate snapshot is generated.
[0048] Based on the worksheet's physical coordinate snapshot, the row height and column width of each row are cumulatively converted into horizontal and vertical physical positions. The image object coverage boundaries, associated cell boundaries, and merged spans are extracted to generate physical reference entries for image anchor points.
[0049] The specific process is as follows: based on the physical coordinate snapshot of the worksheet, read the left, right, top, and bottom boundaries of the image coverage area one by one for each image object; read the boundary position and row and column number of the associated cells bound to the image object; extract the text content, style distribution, and merging span of the local area where the associated cells are located; then determine the initial physical coordinates of the image anchor point based on the distance relationship between the center position of the image coverage area and the image object relative to the boundary of the associated cells; and organize the image object identifier, initial physical coordinates, bound row and column position, associated cell identifier, local text features, local style features, and merging span into the same record content to generate the physical benchmark entry for the image anchor point.
[0050] Based on the image anchor point physical reference entries, the image object identifier, anchor point physical coordinates, anchor point binding row and column positions, associated cell identifiers, and local layout features are bound and recorded to generate an image anchor point physical reference mapping table.
[0051] The specific process is as follows: based on the physical benchmark entries of the image anchor points, corresponding benchmark record items are created according to the image object identifiers. The physical coordinates of the anchor points, the bound row and column positions, the associated cell identifiers, local text features, local style features, merge spans, and worksheet version information are written into the same mapping record. Then, all mapping records are arranged according to the order of the image objects in the worksheet to generate an image anchor point physical benchmark mapping table, and the correspondence between the image object identifiers, the current active mapping positions, and the listening status is established.
[0052] S2. When a row or column change event caused by insertion, deletion, or adjustment of rows or columns is detected, the cumulative row height change and cumulative column width change in front of the anchor point of the target image are extracted to generate a physical offset prediction vector and a prediction offset area.
[0053] When a row / column change event is detected, the row height, column width, row / column number, insertion / deletion type, adjustment direction, and target image anchor point binding row / column position before and after the change are extracted to generate a row / column change record.
[0054] The specific process is as follows: when an Excel worksheet undergoes row insertion, row deletion, column insertion, column deletion, row height adjustment, or column width adjustment, the starting row and column numbers, ending row and column numbers, change type, and change direction corresponding to the change event are read. The row height and column width values before and after the change are extracted respectively. Then, the target image anchor point binding row and column position is read from the image anchor point physical reference mapping table according to the image object identifier. It is determined whether the changed row and column is located before the target image anchor point binding row and column position or has a crossing relationship with the target image anchor point. The row and column numbers, the size values before and after the change, the change type, the change direction, and the target image anchor point binding row and column position are written into the same event content in a unified record order to generate a row and column change record.
[0055] Based on the row and column change records, the changes in row height and column width are accumulated for the affected rows and columns before the target image anchor point is bound to the row and column position, respectively. Combined with the merged area span correction, a physical offset prediction vector is generated.
[0056] The specific process is as follows: based on the row and column change records, determine whether the affected row is located before the target image anchor point binding row and whether the affected column is located before the target image anchor point binding column. For the affected rows located before the target image anchor point, calculate the row height change by subtracting the row height before the change from the row height after the change and accumulate the changes. For the affected columns located before the target image anchor point, calculate the column width change by subtracting the column width before the change from the column width after the change and accumulate the changes. For merged areas that have a crossing relationship with the image object binding area, correct the accumulated results according to the span of the merged area to obtain the horizontal offset and vertical offset. Write the horizontal offset, vertical offset, and offset direction into the same record content to generate a physical offset prediction vector.
[0057] It should be noted that the physical offset prediction vector refers to the predicted displacement result of the image anchor point, which is composed of the cumulative column width change and the cumulative row height change. The horizontal component represents the predicted movement of the image object in the column direction, and the vertical component represents the predicted movement of the image object in the row direction.
[0058] Based on the physical offset prediction vector, the original anchor point physical coordinates, and the image object size, an expansion is generated to create a prediction offset region.
[0059] The specific process is as follows: based on the physical offset prediction vector, the original anchor point physical coordinates and image object size of the target image object are read from the image anchor point physical reference mapping table. The original anchor point physical coordinates are translated along the direction of the physical offset prediction vector to obtain the prediction center position. Then, the width and height range of the image object are used as the basic coverage boundary, and the expansion processing is performed around the prediction center position in combination with the merging region span and the length of the local blank area to form a rectangular or strip-shaped region containing the expected landing point of the image object, thus generating the prediction offset area.
[0060] It should be noted that the predicted offset area refers to the limited search area formed around the expected landing point of the image object, which is used to converge the subsequent search range to a local layout that matches the physical offset of the row and column changes.
[0061] S3. Based on the physical offset prediction vector, the predicted offset area, the span of the merged area, and the distribution of non-empty cells on the current page, construct an adaptive neighborhood search range.
[0062] Based on the magnitude and direction of the physical offset prediction vector, the coverage boundary of the prediction offset area, the span of the merged region, and the size of the target image object, the row direction expansion amount and the column direction expansion amount are determined, and the neighborhood expansion parameters are generated.
[0063] The specific process involves decomposing the magnitude and direction of the physical offset prediction vector to obtain the offset change relationship corresponding to the row and column directions. The coverage boundary of the predicted offset area is compared with the span of the merged area to determine the coverage range of the predicted offset area in the row and column directions. Then, the size of the target image object is mapped to the coverage range of the predicted offset area. Combining the influence of the magnitude and direction of the physical offset prediction vector on the row and column directions, the row expansion amount and column expansion amount are determined respectively, and neighborhood expansion parameters are generated.
[0064] Based on the neighborhood expansion parameters, combined with the distribution of non-empty cells in the current worksheet, the boundaries of merged regions, and the edge positions of image objects, directional expansion and boundary clipping are performed on the predicted offset area to generate an adaptive neighborhood search range.
[0065] The specific process is as follows: the expansion direction and range of the predicted offset area in the current worksheet are determined according to the neighborhood expansion parameters. The predicted offset area is then expanded in a directional manner along the expansion direction to the continuously existing non-empty cell distribution area. The expanded range is then compared with the boundary of the merged area, and the part that exceeds the boundary of the merged area is removed. Finally, the expanded range is compared with the edge position of the image object, and the area that matches the edge position of the image object is retained to generate an adaptive neighborhood search range.
[0066] S4. Extract the current candidate anchor point set within the adaptive neighborhood search range, and extract the historical reference candidate set from the image anchor point physical benchmark mapping table.
[0067] Based on the adaptive neighborhood search range, the cell boundaries, merged region boundaries, image object boundaries, and non-empty text positions within the range are scanned to generate the current location cell set.
[0068] The specific process is as follows: determine the corresponding row and column coverage area based on the adaptive neighborhood search range; read the positional relationship of each cell boundary within the adaptive neighborhood search range; extract the boundaries of merged regions falling within the adaptive neighborhood search range; mark the overlapping positions of image object boundaries within the adaptive neighborhood search range; scan and register the non-empty text positions within the adaptive neighborhood search range cell by cell; and then map the cell boundaries, merged region boundaries, image object boundaries, and non-empty text positions to the same positioning content to generate the current positioning unit set.
[0069] Based on the current set of positioning units, extract the physical coordinates, row and column numbers, local text content, local style features, and merging span information corresponding to the candidate positions to generate the current set of candidate anchor points.
[0070] The specific process is as follows: based on the cell boundaries, merged area boundaries, image object boundaries, and non-empty text positions recorded in the current positioning unit set, each candidate position is read accordingly. The physical coordinates and row and column numbers of the candidate positions in the current worksheet are organized. Local text content is read from the surrounding areas of the candidate positions. Local style features are extracted from the cells corresponding to and adjacent to the candidate positions. The merge span information is determined in combination with the merged area boundaries where the candidate positions are located. Then, the physical coordinates, row and column numbers, local text content, local style features, and merge span information are arranged item by item according to the candidate positions to generate the current candidate anchor point set.
[0071] Extract the original anchor point physical coordinates, bound row and column positions, associated cell identifiers, local text features, local style features, and merged span information corresponding to the target image object identifier from the image anchor point physical reference mapping table, and generate a historical reference template.
[0072] The specific process is as follows: Locate the corresponding record in the image anchor point physical reference mapping table according to the target image object identifier, and read the original anchor point physical coordinates, bound row and column positions, associated cell identifiers, local text features, local style features, and merged span information from the corresponding record in sequence. Organize the original anchor point physical coordinates and bound row and column positions, and arrange the associated cell identifiers, local text features, local style features, and merged span information in a matching manner. Then, write them into the unified content according to the same record corresponding to the target image object identifier to generate a historical reference template.
[0073] Based on the historical reference template, the physical coordinates of the original anchor points are aligned with the predicted offset area, and the associated cell identifiers are matched with the local layout of the current worksheet to generate a historical reference candidate set.
[0074] The specific process is as follows: based on the original anchor point physical coordinates recorded in the historical reference template, the original anchor point physical coordinates are mapped to the corresponding positions in the predicted offset area. The positional relationship between the original anchor point physical coordinates and the predicted offset area is aligned. Then, the associated cell identifiers are read from the historical reference template, and the associated cell identifiers are matched with the cell positions, layout distribution, and adjacency relationships in the current worksheet's local layout. The position alignment results and the corresponding arrangement results are arranged in the same candidate record order to generate a historical reference candidate set.
[0075] S5. Verify and score the current candidate anchor point set and the historical reference candidate set, determine the target candidate anchor point, update the image anchor point position according to the target candidate anchor point, refresh the image anchor point physical reference mapping table, and return to the listening state.
[0076] Based on the current candidate anchor point set and the historical reference candidate set, verify the consistency of physical offset, text neighborhood, style neighborhood and merging boundary corresponding to the candidate position, and generate candidate verification scores.
[0077] The specific process is as follows: based on the current candidate anchor point set and the historical reference candidate set, each candidate position is compared accordingly. The physical coordinates, local text content, local style features, and merging span information in the current candidate anchor point set are checked item by item with the corresponding content in the historical reference candidate set. The physical offset consistency is determined based on the positional correspondence between physical coordinates, the text neighborhood consistency is determined based on the correspondence between adjacent content in local text content, the style neighborhood consistency is determined based on the correspondence between adjacent styles in local style features, and the merging boundary consistency is determined based on the boundary correspondence between merging span information. Then, the physical offset consistency, text neighborhood consistency, style neighborhood consistency, and merging boundary consistency corresponding to each candidate position are organized in a unified recording order to generate a candidate verification score.
[0078] The expression for the candidate verification score is as follows:
[0079] ;
[0080] in, Indicates the first The candidate verification score corresponding to each candidate position. The serial number identifier indicating the candidate position. Indicates the first Physical offset consistency of each candidate location Indicates the first Text neighborhood consistency corresponding to each candidate position Indicates the first Style neighborhood consistency for each candidate position Indicates the first Consistency of merge boundaries corresponding to each candidate position This represents the weighting coefficient corresponding to the physical offset consistency. This represents the weight coefficient corresponding to the text neighborhood consistency. This represents the weighting coefficient corresponding to the consistency of the style neighborhood. The weighting coefficients corresponding to the consistency of the merge boundary. This represents the coupling coefficient between text neighborhood consistency and style neighborhood consistency. This represents the coupling coefficient between physical offset consistency and merge boundary consistency. This represents the differential inhibition coefficient.
[0081] It should be noted that, It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; This was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples; It was obtained through statistical analysis of the image anchor point recovery results in the historical row and column change samples.
[0082] Based on the candidate verification scores, the candidate positions are sorted and the candidate position with the best score is selected as the target candidate anchor point.
[0083] The specific process is as follows: based on the candidate verification score, the physical offset consistency, text neighborhood consistency, style neighborhood consistency, and merge boundary consistency of each candidate position are read one by one in the order of the candidate records. The scores are then combined into a total score according to the preset weights. The total scores of all candidate positions are then sorted, and the candidate position with the highest score and compatible with the size of the target image object is selected as the target candidate anchor point. The candidate physical coordinates, row and column numbers, and associated cell positions of the target candidate anchor point are written into the target record.
[0084] Based on the target candidate anchor points, rewrite the physical coordinates of the anchor points, the row and column positions of the anchor points, and the positions of the associated cells corresponding to the image objects, and generate anchor point update records.
[0085] The specific process is as follows: based on the target candidate anchor point, read the candidate physical coordinates, row and column number, and associated cell position from the target record; then read the original active mapping content of the target image object from the image anchor point physical reference mapping table; rewrite the original anchor point physical coordinates, original bound row and column positions, and original associated cell positions to the new values corresponding to the target candidate anchor point; and write the rewritten anchor point physical coordinates, bound row and column positions, associated cell positions, current worksheet version information, and update time into the same record content, thereby generating an anchor point update record.
[0086] Based on the anchor point update record, refresh the active mapping content in the image anchor point physical baseline mapping table, write the current worksheet version information into the history of the corresponding image object identifier, determine the update execution channel, and generate the execution transaction page.
[0087] The specific process is as follows: Based on the image object identifier and corresponding update content recorded in the anchor point update record, the active mapping content of the corresponding image object identifier is located in the image anchor point physical baseline mapping table. The anchor point position content, bound position content, and associated feature content in the anchor point update record are written into the corresponding fields, and the active mapping content is refreshed. Then, the current worksheet version information is read from the current worksheet and written into the history record of the corresponding image object identifier. Based on the image object identifier, update position content, and update content, the anchor point update record is read and organized item by item. The update content is mapped to the update execution channel. Finally, the image object identifier, update position content, update content, and update execution channel are written into the same page content in a unified record order to generate the execution transaction page.
[0088] Based on the execution transaction page, the updated anchor point physical coordinates, bound row and column positions, and associated cell positions are written into the activity mapping table, and the old mapping content is replaced to generate the updated activity mapping record.
[0089] The specific process is as follows: based on the record content in the execution transaction page, locate the old version mapping content corresponding to the execution transaction page in the active mapping table, write the updated anchor point physical coordinates, bound row and column positions, and associated cell positions into the corresponding positions in the active mapping table, and overwrite the old version mapping content with the written content to make the position record in the active mapping table consistent with the updated content in the execution transaction page, and replace the old version mapping content.
[0090] Based on the updated activity mapping record, clean up the temporary processing record and candidate cache corresponding to this row and column change event, release the listening channel and reattach it to the updated anchor point position, and return to the listening state.
[0091] The specific process involves locating and clearing each temporary processing record and candidate cache generated during the handling of this row and column change event, removing the intermediate record corresponding to this row and column change event from the activity content, releasing the occupancy status of the listening channel, and reattaching the listening channel to the updated anchor point position to ensure that subsequent listening content corresponds to the updated anchor point position, and returning to the listening state.
[0092] This embodiment also provides an Excel anti-offset anchor tracking system, including: a baseline mapping module, used to uniformly rewrite the row height, column width, merged area, image object position, and associated cell position of the current worksheet when the Excel document is opened, generating an image anchor physical baseline mapping table; an offset calculation module, used to extract the cumulative row height change and cumulative column width change before the target image anchor position when row and column change events caused by insertion, deletion, or adjustment are detected, generating a physical offset prediction vector and a predicted offset area; a neighborhood search module, used to construct an adaptive neighborhood search range based on the physical offset prediction vector, predicted offset area, merged area span, and the distribution of non-empty cells in the current layout; a candidate verification module, used to extract the current candidate anchor set within the adaptive neighborhood search range and extract the historical reference candidate set from the image anchor physical baseline mapping table; and an update execution module, used to verify and score the current candidate anchor set and the historical reference candidate set, determine the target candidate anchor, update the image anchor position according to the target candidate anchor, refresh the image anchor physical baseline mapping table, and return to the listening state.
[0093] In summary, this invention establishes a physical baseline mapping relationship between row height, column width, and image anchor points during the worksheet opening phase. This enables the direct prediction of image position offset direction and amount based on the cumulative changes in row height and column width after subsequent row and column changes. By constructing an adaptive neighborhood search range around the predicted offset area and introducing joint verification of physical offset consistency and neighborhood layout consistency, the invention achieves rapid re-locking of the correct image anchor point position from neighboring layouts after row and column changes, thereby improving the stability and recovery efficiency of image anchor point tracking.
[0094] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An Excel anti-offset anchor point tracking method, characterized in that, include: When an Excel document is opened, the row height, column width, merged area, image object position, and associated cell position of the current worksheet are uniformly converted to physical coordinates to generate an image anchor point physical reference mapping table. When a row or column change event caused by insertion, deletion or adjustment of rows or columns is detected, the cumulative row height change and cumulative column width change in front of the anchor point of the target image are extracted to generate a physical offset prediction vector and a prediction offset area. An adaptive neighborhood search range is constructed based on the physical offset prediction vector, the predicted offset area, the span of the merged area, and the distribution of non-empty cells on the current page. Extract the current candidate anchor point set within the adaptive neighborhood search range, and extract the historical reference candidate set from the image anchor point physical benchmark mapping table; The current candidate anchor point set and the historical reference candidate set are verified and scored to determine the target candidate anchor point. The image anchor point position is updated according to the target candidate anchor point, the image anchor point physical reference mapping table is refreshed, and the listening state is returned.
2. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for generating the physical reference mapping table for image anchor points are as follows: When an Excel document is opened, it reads the visible area, row height, column width, merged area, cell text, cell style, image object position, and associated cell position, and generates a snapshot of the worksheet's physical coordinates. Based on the physical coordinate snapshot of the worksheet, the row height and column width of each row are cumulatively converted into horizontal and vertical physical positions. The image object coverage boundary, associated cell boundary and merged span are extracted to generate physical reference entries for image anchor points. Based on the image anchor point physical reference entries, the image object identifier, anchor point physical coordinates, anchor point binding row and column positions, associated cell identifiers, and local layout features are bound and recorded to generate an image anchor point physical reference mapping table.
3. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for generating the physical offset prediction vector and the prediction offset region are as follows: When a row / column change event is detected, extract the row height, column width, row and column number, insertion / deletion type, adjustment direction, and target image anchor point binding row and column position before and after the change, and generate a row / column change record; Based on the row and column change records, the changes in row height and column width are accumulated for the affected rows and columns before the anchor point of the target image is bound to the row and column position, respectively. Combined with the merged area span correction, a physical offset prediction vector is generated. Based on the physical offset prediction vector, the original anchor point physical coordinates, and the image object size, an expansion is generated to create a prediction offset region.
4. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for constructing the adaptive neighborhood search range are as follows: Based on the magnitude and direction of the physical offset prediction vector, the coverage boundary of the prediction offset area, the span of the merged area, and the size of the target image object, determine the row direction expansion amount and the column direction expansion amount, and generate the neighborhood expansion parameters. Based on the neighborhood expansion parameters, combined with the distribution of non-empty cells in the current worksheet, the boundaries of merged regions, and the edge positions of image objects, directional expansion and boundary clipping are performed on the predicted offset area to generate an adaptive neighborhood search range.
5. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for extracting the current candidate anchor point set within the adaptive neighborhood search range are as follows: Based on the adaptive neighborhood search range, the cell boundaries, merged region boundaries, image object boundaries, and non-empty text positions within the range are scanned to generate the current location cell set; Extract the physical coordinates, row and column numbers, local text content, local style features, and merged span information of the candidate positions from the current location unit set to generate the current candidate anchor point set.
6. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for extracting the historical reference candidate set from the image anchor point physical benchmark mapping table are as follows: Extract the original anchor point physical coordinates, bound row and column positions, associated cell identifiers, local text features, local style features, and merged span information corresponding to the target image object identifier from the image anchor point physical reference mapping table, and generate a historical reference template. Based on the historical reference template, the physical coordinates of the original anchor points are aligned with the predicted offset area, and the associated cell identifiers are matched with the local layout of the current worksheet to generate a historical reference candidate set.
7. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for verifying and scoring the current candidate anchor point set and the historical reference candidate set to determine the target candidate anchor point are as follows: Based on the current candidate anchor point set and the historical reference candidate set, verify the consistency of physical offset, text neighborhood, style neighborhood and merging boundary corresponding to the candidate position, and generate candidate verification scores; Based on the candidate verification scores, the candidate positions are sorted and the candidate position with the best score is selected as the target candidate anchor point.
8. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The specific steps for updating the image anchor point position based on the target candidate anchor point are as follows: Based on the target candidate anchor points, rewrite the physical coordinates of the anchor points corresponding to the image objects, the row and column positions of the anchor points, and the positions of the associated cells to generate anchor point update records; Based on the anchor point update record, refresh the active mapping content in the image anchor point physical baseline mapping table, write the current worksheet version information into the history of the corresponding image object identifier, determine the update execution channel, and generate the execution transaction page.
9. The Excel anti-offset anchor point tracking method as described in claim 1, characterized in that, The process of refreshing the image anchor point physical reference mapping table and returning to the listening status is as follows: Based on the execution transaction page, the updated anchor point physical coordinates, bound row and column positions, and associated cell positions are written into the activity mapping table, and the old mapping content is replaced to generate the updated activity mapping record; Based on the updated activity mapping record, clean up the temporary processing record and candidate cache corresponding to this row and column change event, release the listening channel and reattach it to the updated anchor point position, and return to the listening state.
10. An Excel anti-offset anchor point tracking system, based on the Excel anti-offset anchor point tracking method according to any one of claims 1 to 9, characterized in that, include: The baseline mapping module is used to uniformly convert the row height, column width, merged area, image object position and associated cell position of the current worksheet when an Excel document is opened, and generate an image anchor point physical baseline mapping table. The offset calculation module is used to extract the cumulative row height change and cumulative column width change in front of the anchor point of the target image when row and column change events caused by insertion, deletion or adjustment are detected, and generate a physical offset prediction vector and a prediction offset area. The neighborhood search module is used to construct an adaptive neighborhood search range based on the physical offset prediction vector, the predicted offset area, the span of the merged area, and the distribution of non-empty cells on the current page. The candidate verification module is used to extract the current candidate anchor point set within the adaptive neighborhood search range and extract the historical reference candidate set from the image anchor point physical benchmark mapping table. The update execution module is used to verify and score the current candidate anchor point set and the historical reference candidate set, determine the target candidate anchor point, update the image anchor point position according to the target candidate anchor point, refresh the image anchor point physical benchmark mapping table, and return to the listening state.