A matrix real-time processing method and system based on local rank-one update write-back

CN122884874APending Publication Date: 2026-10-09SHANGHAI KANBAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611045929.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

本发明的目的在于提供一种基于局部秩一增量写回的矩阵实时处理方法及系统,用于解决现有技术中全量重建路径过长、简单平滑缺少联动感知、后置规则裁剪作用滞后以及局部补丁方案缺少约束的问题

Benefits of technology

(一)计算效率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884874A_ABST
    Figure CN122884874A_ABST
Patent Text Reader

Abstract

The application discloses a kind of matrix real-time processing method and system based on local rank one incremental write back, it is related to computer data processing technical field.The method includes: obtaining target value matrix P and processing output matrix W;Generation rolling window change rate matrix R and intercept window data;Only to the upper triangular column pair calculation linkage index and aggregation;Generation constraint scaling factor by bounded constraint mapping;Only to the local slice of current update time scaling obtains candidate slice;Through dead zone control and the last time submitted slice comparison, form output slice and output change element index set;Construct slice increment vector and selection vector, form local rank one or zero rank increment by outer product and write back current update time corresponding row.The application limits single update to the rank one or zero rank incremental write back of local slice for current time, reduces data handling capacity and write amplification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer data processing technology, and in particular to a real-time matrix processing method and system that generates constraint strength based on the inter-column linkage relationship within a window in a continuously refreshed scenario, and performs dead zone filtering and local rank-one incremental write-back only on the local slices corresponding to the current update time. Background Technology

[0002] In online processing scenarios driven by continuous data streams, the system typically needs to correct the current output matrix based on the changes in multiple columns within the most recent window. This type of scenario is widely found in intelligent recommendation, risk control, model inference, resource scheduling, and industrial control systems. Unlike offline batch processing, online scenarios often simultaneously require high refresh rates, low single-update times, low output jitter, and low write-back overhead.

[0003] From a computer architecture perspective, matrix data is typically stored contiguously in memory in row-major or column-major order, with each element occupying several bytes. When the system corrects the matrix with a high-frequency refresh cycle, if a full matrix write-back method is used, each refresh requires moving tens of thousands or even hundreds of thousands of floating-point values ​​from the processor to system memory, causing the memory bus bandwidth to be crowded out by a large number of invalid data transfers. These transfers include a large number of elements that have not undergone effective changes, creating a severe write amplification effect. Simultaneously, this causes frequent cache line evictions and reloadings, leading to cache thrashing and reducing the real-time performance of the entire system.

[0004] In existing technologies, four approaches are typically used to achieve real-time matrix correction: The first is the full reconstruction approach, which reconstructs the correlation matrix and covariance matrix with each refresh, and may even continue to perform global optimization, inverse matrix solving, or full matrix rebalancing; the second is the post-rule interception approach, which prunes the output matrix by a rule engine or threshold filter after it is formed; the third is the simple smoothing or simple thresholding approach, which scales the current output result by a fixed ratio, performs exponential smoothing, or static threshold suppression; and the fourth is the local write-patch approach, which directly assigns values ​​to local elements only when local anomalies are detected, but does not explicitly analyze the degree of inter-column linkage within the window.

[0005] Each of the existing solutions has its drawbacks. For full reconstruction solutions, even if only a local slice corresponding to a single time slice needs to be corrected at the current moment, the system still has to bear the reconstruction and solution costs at the whole matrix level, resulting in long processing paths, high refresh latency, significant computational redundancy, and large-scale data rewriting during downstream write-back. For post-rule interception solutions, their timing is delayed, usually only performing post-processing pruning on the final output, unable to apply continuous constraints during matrix formation, and difficult to provide fine-grained responses to multi-column synchronous enhancements. For simple smoothing or thresholding solutions, they do not explicitly perceive the inter-column linkage relationship, making it difficult to distinguish between individual noise and systemic linkage increases, resulting in a disconnect between constraint strength and the actual window state. For local write patching solutions, although they have the characteristics of local updates, without linkage perception, constraint mapping, and dead zone suppression, they often only perform temporary repairs at the result layer, failing to consistently achieve the comprehensive effect of less computation, less writing, and less jitter.

[0006] In some existing solutions, although local assignment operations can be mathematically represented as rank-one, without prior processing such as window linkage perception, bounded constraint mapping, and dead zone filtering, the rank-one form only reflects the mathematical expression of the update result and is difficult to directly form a complete real-time processing solution suitable for continuous refresh scenarios.

[0007] Furthermore, the real challenge in online systems lies not in the single local assignment itself, but in how to establish an orderly functional chain of linkage perception, constraint scaling factorization, perturbation suppression, and write-back range control during continuous refresh. Without window-level linkage aggregation, the system cannot adaptively determine the current correction strength based on the common state of multiple columns; without bounded constraint mapping, linkage indicators are difficult to stably transform into executable constraint scaling factors; without dead-zone control, small fluctuations near the threshold will continuously trigger write-backs; and without local write-back constraints, all the aforementioned optimizations may still be canceled out by full matrix write-backs at the final execution layer.

[0008] Therefore, a common drawback of existing technologies is the lack of a real-time matrix processing chain specifically designed for local slices corresponding to the current update moment. This chain should be able to quickly extract the inter-column linkage strength from the window data, continuously map this strength to the local constraint scaling factor at the current update moment, suppress invalid updates through dead-zone control, and ultimately limit the single-cycle write-back operation to a local rank-one or zero-rank increment. Only when the above steps are organically linked can the system simultaneously achieve lower computational load, lower write-back load, and lower output jitter.

[0009] It should be pointed out that in some studies on large model reinforcement learning, there is a solution that uses global singular value decomposition to analyze the parameter gradient update matrix and extracts the rank-one subspace characteristics to guide the update. Such solutions rely on neural network backpropagation and global SVD decomposition, and the processing objects are model parameter gradients, which have high computational cost and are essentially different from the local time-slice matrix correction in the online inference process.

[0010] For intuitive comparison, the main problems of the prior art can be summarized as follows.

[0011] Table 1 Comparison table of prior art problems Summary of the Invention The object of the present invention is to provide a real-time matrix processing method and system based on local rank-one incremental write-back, which is used to solve the problems in the prior art of too long full reconstruction path, lack of linkage perception in simple smoothing, delayed effect of post rule clipping and lack of constraints in local patch solutions. A processing flow sequentially composed of upper triangular column pair traversal, linkage aggregation, bounded constraint mapping, local slice scaling, dead zone control, and local write-back is constructed. The system does not need to start a global solution process, and only completes local constraint processing and local write-back operations for the current update period.

[0012] To achieve the above objective, the technical solution adopted by the present invention is: A real-time matrix processing method based on local rank-one incremental write-back, comprising the following steps: obtaining a target value matrix P and an output matrix to be processed W aligned along a first dimension, wherein columns of the matrix are used to characterize the numerical states of multiple processing objects at the same time, and rows of the matrix correspond to refresh moments; performing difference and normalization processing on the target value matrix P according to adjacent moments to generate a rolling window change rate matrix R, and intercepting window data with a window length L at the current update moment t ; performing pairwise column traversal on the window data , only calculating linkage indicators for upper triangular column pairs satisfying a < b, skipping invalid column pairs whose column standard deviation is lower than a preset variance protection threshold, and aggregating the linkage indicators of all valid column pairs into an aggregated linkage indicator at the current update moment ; wherein a and b are both column indices for identifying the a-th column and the b-th column of the window data ; inputting the aggregated linkage indicator into a bounded constraint mapping unit, and generating a constraint scaling factor at the current update moment according to a preset parameter set , wherein is limited by upper and lower bounds; The constraint scaling factor As the control variable for the local slice corresponding to the current update time, it is applied only to the local slice in matrix W corresponding to the current update time. Perform scaling to obtain candidate slices ; The candidate slice Slices submitted at the previous time step Perform element-by-element comparisons. For elements whose changes are below the dead zone threshold θ, retain their original submitted values. For elements whose changes are above or equal to the dead zone threshold θ, adopt candidate values ​​to form the output slice at the current update time. Output the set of indexes of the elements that have changed. ; Output slice at the current update time Compared to the original slice at the current update time Construct slice increment vector from the difference between them Among them, for , ;for , ; and the selection vector corresponding to the current update time t. As a row positioning vector Its t-th component is 1, and the remaining components are 0; among them, for The j-th component, This represents the value of the j-th element in the candidate slice. Let j be the value of the j-th element in the original slice. Represents a T-dimensional real vector space; according to Constructing a single-period matrix increment And only write the matrix increment back to the row corresponding to the current update time of matrix W; where, when When it is a non-zero vector, It is a rank-one matrix; when When it is a zero vector, Since it is a zero-rank matrix, no matrix data writing will be performed in this refresh cycle; Enter the next refresh cycle and repeat the above steps.

[0013] On the other hand, the present invention also provides a real-time matrix processing system based on local rank-one incremental write-back, comprising: The data acquisition module is used to acquire the target value matrix P aligned to the first dimension and the output matrix W to be processed. The rate of change generation module is used to perform difference and normalization processing on the target value matrix P at adjacent time points to generate a rolling window rate of change matrix R, and to extract window data of window length L at the current update time t. ; a linkage aggregation module, configured to process the window data to perform pairwise column traversal, only calculate linkage indicators for upper triangular column pairs satisfying a < b, skip invalid column pairs, and aggregate the linkage indicators of all valid column pairs into an aggregated linkage indicator at the current update time ; wherein, a and b are both column indexes, configured to identify the window data the a-th column and the b-th column in; a constraint mapping module, configured to map the aggregated linkage indicator s_t to a constraint scaling factor at the current update time wherein is limited by upper and lower bounds; a local slice scaling module, configured to scale the constraint scaling factor only on the local slice corresponding to the current update time in the matrix W perform scaling processing to obtain a candidate slice ; a dead zone control module, configured to compare the candidate slice with the submitted slice at the previous moment element by element to form an output slice at the current update time and output an changed element index set ; a local write-back module, configured to use the output slice at the current update time and the original slice to construct a slice increment vector based on the difference therebetween , use a selection vector as a row positioning vector, construct it according to to construct a single-cycle matrix increment , and only write the matrix increment back to the row corresponding to the current update time of the matrix W; the local write-back module is further configured to enter a write-back suppression state when is a zero vector, and no data writing is initiated to the matrix storage unit in this refresh cycle; an output end of the data acquisition module is connected to an input end of the change rate generation module, an output end of the change rate generation module is connected to an input end of the linkage aggregation module, an output end of the linkage aggregation module is connected to an input end of the constraint mapping module, an output end of the constraint mapping module is connected to an input end of the local slice scaling module, an output end of the local slice scaling module is connected to an input end of the dead zone control module, and an output end of the dead zone control module is connected to an input end of the local write-back module.

[0014] In another aspect, the present invention further provides a real-time matrix processing coprocessor based on local rank-one incremental write-back, configured to execute the above-mentioned real-time matrix processing method based on local rank-one incremental write-back, comprising: A window data caching unit, configured to store rate-of-change data at the most recent L time instants and maintain window data in a circular buffer manner; An upper triangular traversal and linkage aggregation engine, comprising a column pair address generator, an invalid column pair filter, a parallel linkage index calculation array and an accumulation aggregator; wherein the column pair address generator only generates column pair addresses satisfying a < b, the invalid column pair filter is configured to skip invalid column pairs according to variance or standard deviation, and the accumulation aggregator is configured to aggregate linkage indexes of valid column pairs into an aggregated linkage index ; A bounded constraint mapping unit, configured to according to output a constraint scaling factor ; A local slice scaling and dead zone comparator array, configured to slice local perform parallel scaling to obtain candidate slices , perform element-by-element comparison with committed slices at the previous time instant, and form a changed element index set with element indexes whose variation is higher than or equal to a dead zone threshold θ and output a slice increment vector and ; A rank-one write-back engine, comprising a slice increment generator, a selection vector generator, a sparse address generator and a write-back arbiter; wherein the sparse address generator is configured to according to generate write-back addresses corresponding to non-zero increment elements, and the write-back arbiter is configured to only submit addresses and values corresponding to non-zero increment elements to a matrix storage unit; A parameter control register set, configured to configure window length L, an initial constraint threshold, a scaling slope, a minimum scaling lower bound, a dead zone threshold and a fallback mode flag; when is a zero vector or is empty, the rank-one write-back engine enters a write-back suppression state, and no data writing is initiated to the matrix storage unit in the current refresh cycle.

[0015] In another aspect, the present invention further provides an electronic device, comprising a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device is caused to execute the above real-time matrix processing method based on local rank-one incremental write-back.

[0016] Compared with the prior art, the beneficial effects of the present invention are: (1) Computational efficiency This invention reduces the number of column pairs processed from M(M-1) to M(M-1) / 2 by only traversing the upper triangular column pairs and filtering out invalid ones. When the number of columns M=20, the number of column pairs decreases from 380 to 190, a reduction of 50%. Correspondingly, the sample size for window-level linkage calculation decreases by approximately 50%, and when the window length L=60 and M=20, the sample size decreases from 22800 to 11400. The processing cost of the linkage statistical stage is significantly reduced.

[0017] (ii) Write back the scope This invention compresses the single-cycle write-back range from an entire matrix to a single slice corresponding to the current update time. When the first dimension length T=1000 and M=20, an entire matrix write-back requires processing 20,000 elements. This invention, however, has a maximum write-back number of only M=20 elements per cycle, resulting in a 99.9% reduction in the write-back range.

[0018] Building upon this, dead-zone control further reduces the actual write volume. After dead-zone filtering, only elements with changes exceeding the dead-zone threshold are physically written. Taking an example where 70% of the elements in the current slice fall into the dead zone, the actual number of elements written back decreases from 20 to 6, and the actual update volume decreases by 70%.

[0019] (iii) Memory bandwidth usage The number of bytes written per cycle decreases synchronously with the write-back range. Based on an estimate of four bytes for float32 storage, writing back an entire matrix requires approximately 80,000 bytes; this invention writes back approximately 80 bytes per slice; after dead-zone filtering, it is only about 24 bytes, a decrease of more than two orders of magnitude.

[0020] The number of cache lines touched per cycle decreased synchronously. Based on a 64-byte cache line, a full matrix write-back touches approximately 1250 cache lines, a single slice write-back touches approximately 2 lines, and after dead-zone filtering, approximately 1 line is touched. Therefore, cache line loading, eviction, and write amplification effects are effectively suppressed, alleviating the memory bus bandwidth congestion problem.

[0021] (iv) Updating the structure A single update converges from a global rewrite to a local rank-one or zero-rank increment. The single-period matrix increment consists solely of the outer product of the selection vector e_t and the slice increment vector d_t, operating at the row corresponding to the current update time. The update range is well-defined, and the structure is interpretable. This local rank-one or zero-rank increment is used to limit the write-back range of the single-period matrix, without requiring global matrix inversion or global rebalancing as a necessary step.

[0022] The aforementioned technical effects are achieved through a combination of processes including linkage aggregation, bounded constraint mapping, dead zone control, and local write-back. If any key process is missing, the system degenerates into the existing technical approach, losing its corresponding beneficial effects. Specific degradation details are shown in Table 2.

[0023] Table 2. Comparison of Degradation Due to Missing Key Elements For easy and intuitive comparison, the following two comparison tables present the structural differences and quantitative differences between the present invention and the prior art, respectively.

[0024] Table 3. Structural Comparison between Prior Art and the Invention Table 4. Quantization Comparison Table under Example Parameters Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating the method of the present invention; Figure 2 This is a schematic diagram of the module structure of the system of the present invention; Figure 3 This is a schematic diagram of the traversal and linkage aggregation of the upper triangular column pairs in this invention; Figure 4 This is a schematic diagram of the local rank-one incremental write-back of the present invention; Figure 5 This is a comparison chart of the quantitative effects of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific parameters. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.

[0027] This invention provides a real-time matrix processing method based on local rank-one incremental write-back, which can run in a computer system including a processor, system memory, and cache. Matrix data is preferably stored as a contiguous floating-point array, using float32 or float64 format. Both the output matrix W and the target matrix P are stored contiguously in system memory in row-major order, with row indices corresponding to refresh times and column indices corresponding to the processed objects. In a typical cache architecture, the size of a level-one data cache line is 64 bytes, and a float32 element occupies 4 bytes. When a write operation is performed on the matrix, the processor loads the entire cache line containing the target address into the cache, modifies it, and then writes it back to memory. If write operations are sparse and concentrated, only a small number of cache lines are touched; if the entire matrix is ​​written back in a scattered manner, it will trigger a large number of cache line loading and evictions, consuming memory bandwidth and creating a write amplification effect.

[0028] The present invention provides a real-time matrix processing method based on local rank-one incremental write-back, the specific steps of which are as follows: Step S1: Obtain the target value matrix and the output matrix to be processed; like Figure 1 and Figure 2 As shown, the data acquisition module obtains the target value matrix. and the output matrix to be processed Where T is the length of the first dimension, representing the total number of refresh times; M is the number of columns, representing the number of processing objects or control channels. Each column of P corresponds to the target value of a processing object at each time, and each row corresponds to a refresh time; W is used to carry the output results that need to be updated online. The matrix columns are used to represent the numerical state of multiple processing objects at the same time, and the two matrices are aligned by row, that is, the i-th row corresponds to the same refresh time.

[0029] The system also maintains a previously committed slice buffer of length M, used to store the current slice after the most recent actual write-back. Initially, the first row of W can be used as the initial committed slice.

[0030] like Figure 1 As shown, the system starts by obtaining the target value matrix and the output matrix to be processed, and then sequentially performs the following steps: generating the rate of change matrix, window truncation, traversing the upper triangular column pairs, linked aggregation, bounded constraint mapping, local slice scaling, dead zone control, and local rank-one or rank-zero incremental write-back. Figure 1 Explain the timing relationship between steps S1 to S7, and describe the data transfer order between each step.

[0031] The above steps are by Figure 2 The shown functional modules are executed. Figure 2 The modular structure of the system of this invention is shown: the data acquisition module, the rate of change generation module, the linkage aggregation module, the constraint mapping module, the local slice scaling module, the dead zone control module, and the local write-back module are connected in sequence. The output of the linkage aggregation module is connected to the input of the constraint mapping module, the output of the constraint mapping module is connected to the input of the local slice scaling module, and the output of the dead zone control module is connected to the input of the local write-back module. The main inputs, main outputs, and functional descriptions of each module are detailed in Table 5 below.

[0032] Table 5. Schematic diagram of module input-output relationship By defining the input and output boundaries, it can be further demonstrated that the technical solution of the present invention is an achievable engineering production line.

[0033] Step S2: Generate the rate of change matrix and extract window data. The change rate generation module performs difference and normalization processing on the target value matrix P according to adjacent time instants, and generates a rolling window change rate matrix R. For the element at the i-th row and j-th column of the target value matrix P , the change rate has a calculation formula as follows: wherein, is the element at the -th row and the -th column of the target value matrix P; is a denominator protection threshold, for example = 0.01; is the absolute value of, when is smaller than , is directly used to replace the denominator, so as to enhance numerical stability. The change rate matrix R is composed of all , R is also of T×M dimension, corresponding to the rows of P. The change rate matrix R also preferably adopts a continuous memory layout, so as to perform vectorized traversal in a compiled numerical kernel.

[0034] In order to reduce the window interception overhead, the system uses a circular buffer to store the change rate data of the last L time instants. The buffer is continuously allocated in memory and is cyclically used logically. When a new time instant comes, a new row of change rate data overwrites the oldest row, and the pointer pointing to the starting point of the current window is updated, so that it is not necessary to move the entire window data.

[0035] At the current update time t, window data with length L is intercepted from the circular buffer , whose corresponding row index range is {t-L+1, t-L+2, …, t}. If t < L, short window interception can be performed using the actual existing sample length, or a warm-up strategy can be adopted to start linkage aggregation only after the sample size reaches L.

[0036] Step S3: Upper triangular column pair traversal and linkage aggregation as shown in Figure 3 , the linkage aggregation module performs pairwise column traversal on said window data , and only calculates linkage indicators for upper triangular column pairs satisfying a < b. Figure 3 the upper triangular region in corresponds to the effective column pair set , the Figure 3 is used to illustrate that symmetric column pairs are not calculated repeatedly, and show the path where the linkage indicators of each effective column pair converge to the aggregated linkage indicator . This traversal method avoids repeated calculation of symmetric column pairs (a,b) and (b,a), and reduces the number of column pairs from M(M-1) to M(M-1) / 2. Wherein, both a and b are column indices, used to identify the window data The values ​​of columns a and b in the array are both from 1 to M, where M is the column number.

[0037] Before performing column pair traversal, the linked aggregation module first calculates the standard deviation of each column within the current window. Let the window sequence of the j-th column be... Its standard deviation is denoted as .like Less than the preset variance protection threshold (For example If the column is considered to have too low a fluctuation, all related column pairs are marked as invalid and skipped to avoid introducing meaningless noise correlation values.

[0038] For a valid upper triangular column pair (a, b), calculate the linkage index. In this embodiment, the Pearson correlation coefficient is used, and the calculation formula is as follows: ; Where cov(·) represents covariance. For each valid column pair, the Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient, or normalized covariance value can be calculated as a correlation index.

[0039] The aggregated linkage index at the current update time is obtained by arithmetically averaging the linkage indices of all valid column pairs. : ; in, This represents the effective number of column pairs. For different business scenarios, weighted average, grouped average, or weighted aggregation that assigns higher weights to highly volatile column pairs can also be used. When it is zero, it can be Set it to zero, the previous valid value, or the preset rollback value, and mark this update as a low confidence period.

[0040] The specific execution process is as follows: initialization , For a from 1 to M-1: For b from a+1 to M: like or If so, skip this iteration. Calculate according to the above formula like ,but Otherwise, set according to the rollback strategy. For example, set it to 0 or the previous valid value and mark it as a low confidence period.

[0041] By processing only the effective column pairs in the upper triangle, the computational load and memory access volume of the linked aggregation are reduced by about half, directly alleviating the processor load and data loading pressure.

[0042] Step S4: Bounded Constraint Mapping The constraint mapping module will aggregate the linkage indicators The bounded constraint mapping unit in the input coprocessor generates the constraint scaling factor for the current update time based on a preset parameter set. ,in Constrained by upper and lower bounds, its linear mapping function is: ; in, As the initial constraint threshold, when Below hour, Keep it at 1; k is the scaling slope, controlling the constraint as... The speed at which it rises and falls; To minimize scaling and prevent over-compression, the `clip(x,low,high)` function truncates `x` to the interval [low,high]. A typical set of parameters is... k=0.5 , Restricted to Within the interval. For systems requiring smoother control, piecewise linear, exponential decay, or lookup table functions can also be used to generate the control. As long as the mapping relationship satisfies monotonically bounded, it is acceptable.

[0043] The constraint mapping module can obtain multiple sets of preset parameters from the parameter management module. The system presets multiple sets of parameters to adapt to different fluctuation levels, business states, or device modes. Each parameter set includes at least a window length L and an initial constraint threshold. Scaling slope k, minimum scaling lower bound Dead zone threshold θ, variance protection threshold and denominator protection threshold Table 6 provides examples of parameter sets for three applicable scenarios.

[0044] Table 6 Example Table of Parameter Groups When external scheduling tags, fluctuation indicators, or equipment status change, the system can switch parameter groups without altering the core chain of this invention: linkage sensing, bounded constraints, dead zone filtering, and minimum write-back. If the number of valid column pairs in the current window is zero, or the aggregated linkage indicator is invalid, a rollback strategy can be adopted: for example, letting... Either retain the slice committed in the previous time step, or generate a zero increment and skip the write-back.

[0045] Step S5: Local slice scaling The local slice scaling module will use the constrained scaling factor. As the control variable for the local slice corresponding to the current update time, it is applied only to the local slice in matrix W corresponding to the current update time. Perform scaling without globally rewriting historical or future time slices. Here The t-th row is a row vector of length M; The scaled candidate slice is also a row vector of length M. The scaling formula is: Scaling is performed only on the slice corresponding to the current update moment, which is one of the important constraints of this invention. This step precisely projects window-level linkage information onto the current refresh action, ensuring that the scope of the constraint remains consistent with the current update moment, thereby creating conditions for subsequent local rank-one write-back.

[0046] Step S6: Dead Zone Control The dead zone control module will select the candidate slices Slices submitted at the previous time Perform element-by-element comparison. The values ​​stored in the aforementioned buffer represent the values ​​actually committed after the previous dead-zone control. For the j-th element, if the change in the element is less than the dead-zone threshold θ, then... Then retain the value already committed at the previous time step. If the change is greater than or equal to θ, then the candidate value is used. , This represents the value of the j-th element in the candidate slice. This forms the output slice at the current update time. .

[0047] The dead zone threshold θ can be a uniform fixed value, or it can be adaptively adjusted according to the column fluctuation level. One adaptive approach is to use window data. The standard deviation of column j Generate column-level dead zone threshold ,in This is the lower limit of the minimum dead zone. This refers to the fluctuation mapping coefficients. If a column fluctuates significantly within the current window, the corresponding dead-zone threshold is appropriately increased to prevent high-frequency jitter from continuously triggering write-backs; if a column fluctuates less, the corresponding dead-zone threshold is appropriately decreased to maintain necessary sensitivity. After adopting the adaptive dead-zone, the slice increment vector... The distribution of zero elements in the window is no longer determined solely by a fixed threshold, but is linked to the local fluctuation level of the current window.

[0048] After completing the element-by-element comparisons, the dead-time control module outputs the slice at the current update time. Simultaneously output the set of indices of the changed elements. . The definition of is: ; Where j is the column index, and its value ranges from 1 to M; Slices that were submitted at the previous time step The j-th element. The record contains the indices of all elements whose changes are higher than or equal to the dead zone threshold, which are used in subsequent step S7 to construct the slice increment vector and drive sparse write-back.

[0049] Step S7: Construct a local rank-one increment and write it back like Figure 4 As shown, the local write-back module outputs a slice at the current update time. Compared to the original slice at the current update time Construct slice increment vector from the difference between them Slice increment vector For a vector of length M, it is constructed as follows: for indices j from 1 to M, when j belongs to the set of changing element indices... hour, Take the j-th component as a candidate slice The j-th component and the original slice The difference of the j-th component; when j does not belong to hour, The j-th component takes a value of zero. This can be expressed mathematically as: ,when ; ,when ; in: for The j-th component corresponds to the numerical increment of the j-th processed object at the current update time; This represents the value of the j-th element in the original slice. This is the set of indexes of the changed elements output by the dead zone control module in step S6.

[0050] Through the above construction method Only the element increments confirmed to need updating after dead zone filtering are retained; the components corresponding to elements falling into the dead zone threshold are zero, thus... It becomes a sparse vector.

[0051] Meanwhile, the local write-back module constructs the selection vector. Its t-th component is 1, and the rest are 0, which is used to locate the row corresponding to the current update time.

[0052] Among them, the It is a vector of length T, where T is the length of the first dimension, i.e., the total number of refresh times. The t-th component is 1, and the rest are 0; choose vector Used to locate the row in matrix W corresponding to the current update time t.

[0053] Let T represent a T-dimensional real vector space.

[0054] Next, the local write-back module selects the vector. With slice increment vector outer product constructs single-period matrix increment : in for The transpose of is an M-dimensional row vector. The outer product result is a T×M matrix, where only the t-th row is equal to . The transpose of , and all other rows are zero.

[0055] Will Write back to matrix W, that is, add the corresponding element to each element of the t-th row of W. The component only updates the relevant elements in the current row, while other rows remain unchanged.

[0056] Figure 4 The comparison of three matrices is shown: the original matrix W, the local increment matrix, and the matrix W. After updating the matrix W', in In this context, only the row corresponding to the current update time is updated, while the remaining rows remain unchanged.

[0057] when When it is a non-zero vector, It is a rank-one matrix; when When it is a zero vector, Since the matrix is ​​zero-rank, no actual data writing is performed at this stage. The local write-back module only performs the actual physical write to the corresponding element in the index set I_t, writing the incremental value to the corresponding column of row t of W via the system bus. Thus, even if the current slice length is M, the actual number of write operations can be less than M, and the number of physical write operations per cycle is compressed to [value missing]. .when When the set is empty, the local write-back module enters the write-back suppression state, and no matrix data is written to memory during this refresh cycle.

[0058] After the write-back is completed, the output slice at the current time is stored in the buffer as a new committed slice for dead zone comparison in the next cycle. The system may also maintain an execution log, recording the current update time and the number of valid column pairs , aggregated linkage indicator , constraint scaling factor , the actual number of written elements and fields such as whether a rollback strategy is triggered. After completing the above write-back, the process enters the next refresh cycle, and steps S2 to S7 are repeated.

[0059] It should be further noted that the present invention does not stack correlation coefficient, threshold judgment and local assignment in parallel, but sets window-level linkage perception, constraint strength generation, perturbation suppression and write-back boundary control as a sequential processing chain with sequential dependency relationships. Among them, the traversal of upper triangular column pairs and the screening of valid column pairs define the source of linkage information; bounded constraint mapping converts linkage intensity into executable scaling amounts constrained by upper and lower bounds; local slice scaling locks the constraint scope to the current update time; dead zone control further determines which elements constitute valid increments; and local rank-one or rank-zero write-back finally limits the actual writing to the corresponding slice at the current time and its non-zero elements. Therefore, when any link is replaced with an independent rule, global recalculation or ordinary local assignment, the corresponding relationship among "perception source, constraint boundary, increment sparsity and write-back range" in the chain will be destroyed, and the comprehensive technical effect of low computation amount, low write-back amount and low jitter described in the present invention cannot be obtained.

[0060] In a specific implementation, based on the above method, the present invention further provides a real-time matrix processing system based on local rank-one incremental write-back. With reference to Figure 2 , the system includes: a data acquisition module, a change rate generation module, a linkage aggregation module, a constraint mapping module, a local slice scaling module, a dead zone control module and a local write-back module.

[0061] The data acquisition module is configured to acquire a target value matrix P and an output matrix W to be processed aligned along the first dimension, wherein columns of the matrices are used to characterize the numerical states of multiple processing objects at the same time, and rows of the matrices correspond to refresh moments. The change rate generation module is configured to perform difference and normalization processing on the target value matrix P according to adjacent moments, generate a rolling window change rate matrix R, and intercept window data with a window length L at the current update time t . The linkage aggregation module is configured to, for the window data , perform pairwise traversal on columns, only calculate linkage indicators for upper triangular column pairs satisfying a<b, skip invalid column pairs, and aggregate linkage indicators of all valid column pairs into an aggregated linkage indicator at the current update time . The constraint mapping module is configured to convert the aggregated linkage indicator Mapped to the constraint scaling factor at the current update time ,in Constrained by upper and lower bounds. The local slice scaling module is used to scale the constraint scaling factor. Only local slices of matrix W corresponding to the current update time. Perform scaling to obtain candidate slices The dead-zone control module is used to control candidate slices. Slices submitted at the previous time Perform element-by-element comparisons to form the output slice at the current update time. Output the set of indexes of the elements that have changed. The local write-back module is used to output slices at the current update time. Compared with the original slice Construct slice increment vector from the difference between them to select vectors As a row positioning vector, according to Constructing a single-period matrix increment And only write the matrix increment back to the row corresponding to the current update time of matrix W.

[0062] The connection relationships of the above modules are as follows: the output of the data acquisition module is connected to the input of the rate of change generation module; the output of the rate of change generation module is connected to the input of the linkage aggregation module; the output of the linkage aggregation module is connected to the input of the constraint mapping module; the output of the constraint mapping module is connected to the input of the local slice scaling module; the output of the local slice scaling module is connected to the input of the dead zone control module; and the output of the dead zone control module is connected to the input of the local write-back module.

[0063] During system operation, each module executes its processing sequentially according to the aforementioned connection relationships. After acquiring the target value matrix P and the output matrix W to be processed, the data acquisition module outputs the current update time index and the current original slice to the rate of change generation module. The rate of change generation module generates the rate of change matrix R and window data. The output is sent to the linkage aggregation module. The linkage aggregation module... Perform upper triangular column pair traversal and linked aggregation to generate aggregated linked indicators. The output is sent to the constraint mapping module. The constraint mapping module will... Mapped to constrained scaling factor The output is then sent to the local slice scaling module. The local slice scaling module, based on... For the current original slice Perform scaling to generate candidate slices The output is sent to the dead-time control module. The dead-time control module will... Slices submitted at the previous time Element-by-element comparison to generate the output slice for the current time step. and change index set The output is sent to the local write-back module. The local write-back module then... and Construct slice increment vector from the difference Combined with selection vector Constructing a single-period matrix increment Only for the index set The corresponding element is physically written, completing the local rank-one incremental write-back.

[0064] The system may also include a parameter management module and an exception rollback module. The parameter management module is used to store and switch between different parameter groups, which include the window length L and the initial constraint threshold. Scaling slope k, minimum scaling lower bound Dead zone threshold θ, variance protection threshold and denominator protection threshold The system includes multiple modules. The exception rollback module triggers a rollback strategy when the number of valid column pairs is zero or the aggregated linkage metric is invalid. The system may also include an execution log module to record the current update time, the number of valid column pairs, the aggregated linkage metric, the constraint scaling factor, the actual number of elements written, and whether a rollback strategy was triggered.

[0065] Based on the above method, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the matrix real-time processing method based on local rank-one incremental write-back as described in any of the above method embodiments. The processor can be any one of a central processing unit, a graphics processing unit, a digital signal processor, or an application-specific integrated circuit. The memory can be any one of random access memory, read-only memory, flash memory, or a disk storage device.

[0066] The present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the matrix real-time processing method based on local rank-one incremental write-back as described in any of the above method embodiments. The computer-readable storage medium may be a non-volatile storage medium, such as a read-only memory, flash memory, magnetic disk, or optical disk.

[0067] In one specific implementation, in the technical chain formed by the above steps, the upper triangular column pair traversal and linkage aggregation jointly generate a window-level linkage index. If this link is omitted, the system degenerates into a static smoothing or fixed threshold scheme that is unaware of inter-column linkage, and cannot dynamically determine the current correction intensity based on the common fluctuation state of the window. Bounded constraint mapping takes the window-level linkage index as input and outputs a constraint scaling factor limited by upper and lower bounds. If the bounded mapping is omitted, the linkage index cannot be stably converted into an executable continuous constraint scaling factor, and the system is prone to degenerate into over-suppression, under-suppression, or discontinuous post-pruning. Local slice scaling limits the bounded constraint scaling factor to the slice corresponding to the current update time. If the same constraint scaling factor is directly applied to the entire matrix, the write-back range control fails, and although the aforementioned linkage awareness and continuous constraints still exist, they will be offset by the global write-back cost. Dead zone control uses the slices submitted at the previous time as a reference to perform element-level retention or update selection of candidate slices, so that small perturbations do not enter the write-back vector. This step changes the write-back action from mandatory writing of candidate slices to writing only the difference greater than the threshold. Local write-back uses the slice after dead zone control as the only write-back object, and restricts the write-back position with a selection vector, thus structuring the single-cycle update into a local rank-one or zero-rank increment. Here, the rank-one increment is not named after the fact, but is an update structure derived from linkage sensing, continuous constraints, dead zone filtering, and position constraints.

[0068] Therefore, the technical contribution of the rank-one increment mentioned in this invention lies not in the abstract linear algebraic form itself, but in the fact that its input source, triggering condition, scope of action, and write-back object are all limited by the aforementioned sequential chain, thus distinguishing it from global inverse matrix correction or simple local assignment schemes. If any key link is removed, the system can still run, but it will degenerate into other processing routes and lose at least one technical effect corresponding to that link.

[0069] To verify the coordination relationship between the above steps, under the same example parameters (T=1000, M=20, L=60, ...), k=0.50 Key link comparison experiments were conducted under conditions of θ=0.05. Baseline scheme B0 represents the complete chain of the present invention. Comparative schemes A1 to A5 each removed one key link. The experimental results are shown in Table 7.

[0070] Table 7 Comparison Test Results of Key Aspects As can be seen from the table, the technical effect of the complete solution B0 is formed by multiple processing stages. Removing the upper triangular column pair traversal allows the system to still run, but the statistical overhead immediately increases. Removing the linkage aggregation allows the system to still perform local scaling, but it no longer possesses window-level linkage awareness. Removing the bounded constraint mapping causes the system to lose continuous boundary control over constraint strength. Removing dead zone control results in small changes directly entering the write-back vector. Removing local write-back causes the aforementioned optimizations to be offset by the cost of writing back the entire matrix. The above comparative experiments show that when key stages are missing, the overall technical effect will observably degrade. There is a mutually restrictive and directional relationship between the various elements: linkage aggregation determines the source of constraints, bounded mapping determines the constraint boundary, dead zone control determines incremental sparsity, and local write-back determines the final execution range.

[0071] In one specific implementation, to reduce the overhead of the interpretation layer, the generation of the rate of change, the traversal of the upper triangular column pairs, the linkage aggregation, and the local slice scaling are all performed by a compiled numerical kernel. The numerical kernel can be a just-in-time (JIT) compiled kernel, a SIMD vectorized kernel, a GPU kernel function, or other low-overhead numerical execution framework.

[0072] In one implementation, the rate of change matrix R uses a row-major contiguous storage layout, and the slice corresponding to the current update time is also stored as a contiguous array; the circular window buffer only maintains the most recent L rows of data; the dead-time control output, in addition to outputting the slice at the current update time, also outputs the set of indices of the changed elements. This is used to drive the sparse write-back path. Through the above memory layout and compiled execution method, it is not necessary to rebuild the entire intermediate structure on each refresh, nor is it necessary to use the entire matrix as the final write-back object. The resource differences between this invention and the entire matrix write-back path are shown in Table 8.

[0073] Table 8. Resource differences between the sparse write-back path and the integer matrix write-back path of this invention. In one specific implementation, such as Figure 5 As shown, the present invention is significantly superior to the traditional solution in three dimensions: column pair computation, write-back range, and actual write volume. Figure 5 The chart includes three bar charts for comparison: the left chart shows the column pair computation cost, which is 380 for traditional traversal and 190 for this invention; the middle chart shows the write-back range, which is 20,000 elements written back for the entire matrix and 20 for this invention; and the right chart shows the actual write volume, which is 20 without suppression and 6 with suppression.

[0074] Taking T=1000 and M=20 as an example, the entire matrix contains 20,000 float32 elements, corresponding to 80,000 bytes. If all elements are written back, it corresponds to approximately 1250 64-byte cache lines. In this invention, the maximum number of elements written back per slice is 20, corresponding to 80 bytes, which touches approximately 2 cache lines; if dead-time control is introduced and only 6 elements undergo valid changes, it corresponds to 24 bytes, touching approximately 1 cache line. This invention not only reduces the theoretical number of bytes written per cycle but also reduces the number of cache lines actually touched in the write-back path, resulting in a synchronous decrease in write amplification and internal data transfer volume. The quantitative comparison of system performance improvements is shown in Table 9.

[0075] Table 9 Quantitative Comparison of System Performance Improvements When the rate of change matrix R adopts a row-major sequential continuous storage layout, the window buffer is maintained by a ring overlay, and the local write-back module adopts a sparse write path driven by the set of changed element indices, the system does not need to copy the entire window during the window maintenance phase and does not need to transmit unchanged elements during the write-back phase.

[0076] In one specific implementation, the main computational cost of the present invention is decomposed. Let the window length be L, the number of columns be M, and the length of the first dimension be T. This is the set of indices of the changed elements output in step S6. For set The number of elements in the current period is the number of elements that actually change in the current period.

[0077] The main computational complexity of traversing upper triangular column pairs is approximately O(L×M×(M-1) / 2), while traversing ordered pairs requires processing all ordered pairs, with a computational complexity of approximately O(L×M×(M-1)). Under the same window length and number of columns, this invention directly halves the constant factor at the column pair statistics level.

[0078] The quantitative relationship between the columns is as follows: , which represents the total number of column pairs that need to be processed when traversing a sequence of columns; , which represents the total number of column pairs that need to be processed during the upper triangular column pair traversal.

[0079] The complexity of local slice scaling, dead zone control, and slice increment vector construction is O(M); if a sparse write-back path driven by a changing element index set is used, the actual physical write complexity can be further expressed as... A full matrix write-back path requires O(T×M) level write-back operations.

[0080] Write back the complexity relationship as follows: , which represents the complexity of the entire matrix write-back path; This indicates the complexity of simply writing back all elements of the current time slice; This represents the sparse write-back complexity of only writing back the changed elements after the dead zone filtering.

[0081] It can be seen that the present invention constrains the processing cost in both the linkage statistics stage and the write-back execution stage: the former reduces the statistical volume through upper triangular traversal and effective column pair filtering, and the latter reduces the actual write volume through local write-back and dead zone filtering.

[0082] In one specific implementation, the above method can also be embedded as a dedicated hardware coprocessor, deployed as an ASIC module, FPGA logic, AI acceleration coprocessor within a SoC, NPU, or GPU bypass coprocessor unit. This coprocessor will... Figure 2 Each software functional module shown is mapped to a hardware implementation unit, with dedicated cache, comparison, aggregation, mapping and write-back components set up around the sequential chain of window linkage perception, bounded constraint mapping, dead zone filtering and local rank one or zero rank incremental write-back. Figure 2 The data acquisition module, rate of change generation module, linkage aggregation module, constraint mapping module, local slice scaling module, dead zone control module, and local write-back module are respectively mapped in the coprocessor as a data interface, window data cache unit, upper triangular traversal and linkage aggregation engine, bounded constraint mapping unit, local slice scaling and dead zone comparator array, rank-one write-back engine, and write-back arbitration unit.

[0083] This coprocessor implementation does not merely port general software processes to hardware for sequential execution; instead, it sets up dedicated hardware units that match the data flow around the aforementioned processing flow. The window data cache unit reduces window maintenance and movement using a circular buffer. The upper triangular traversal and linkage aggregation engine only generates valid column pair addresses and skips invalid column pairs. The bounded constraint mapping unit can output a restricted scaling factor using a lookup table, piecewise linear circuit, or fixed-point arithmetic unit. The local slice scaling and dead-zone comparator array directly outputs the set of changed element indices. The rank-one write-back engine generates only the addresses and values ​​of non-zero increment elements based on the selection vector and slice increment vector. Therefore, the hardware execution path does not need to expand the complete T×M matrix increment, nor does it need to initiate a full matrix refresh. When the slice increment vector is zero or the set of changed element indices is empty, the write-back arbitrator can suppress write-back in the current cycle, reducing resource consumption from three levels: on-chip bus, cache line access, and matrix storage unit write amplification.

[0084] The window data cache unit maintains the change rate row vectors of the last L moments by adopting a circular buffer mode, only overwrites the oldest row and updates the window pointer at each new refresh moment, and does not need to move complete window data. The upper triangular traversal and linkage aggregation engine includes a column pair address generator, which only generates addresses with a < b, an invalid column pair filter, a parallel linkage index calculation array and an accumulation aggregator. The bounded constraint mapping unit can be implemented by a look-up table, a segmented linear circuit, a fixed-point or floating-point operation unit, and outputs a constraint scaling factor .

[0085] The local slice scaling and dead zone comparator array comprises M parallel multipliers and M parallel comparators, and the M parallel multipliers respectively M elements of are multiplied to obtain M elements of , and the M parallel comparators respectively compare the j-th element of with the j-th element of , the corresponding comparator outputs a valid signal and sets the j-th bit in , and finally outputs a slice increment vector and an index set .

[0086] The rank-one write-back engine comprises a slice increment generator, a selection vector generator, a sparse address generator and a write-back arbiter, and generates write-back addresses and values of non-zero increment elements only according to , and enters a write-back suppression state when is empty.

[0087] The parameter control register group is used for configuring a window length L, each protection threshold, a constraint parameter, a dead zone threshold and a fallback mode flag, and can be updated by a main processor between refresh cycles or in low-load cycles. No matter how the pipeline is divided, the final write-back range is limited to the local slice corresponding to the current update moment and its non-zero increment elements.

[0088] In some embodiments, the present invention further provides some other application scenarios. At the application level, in addition to matrix constraint execution in generative model inference, the present invention can also be applied to confidence matrix adjustment in multi-sensor fusion systems, candidate scoring matrix adjustment in recommendation systems, resource allocation matrix correction in industrial control, and intensity matrix suppression in alarm systems. In different scenarios, the service meanings of the target value matrix P and the output matrix W can be different, but as long as the system still drives the local constraint of the current update moment with window linkage information and finally forms local rank-one or zero-rank increment write-back, the present invention can be applied.

[0089] In multi-sensor fusion scenarios, the target value matrix P represents the standardized observation changes of each sensor within the most recent window, and the output matrix W represents the weight allocation matrix of each sensor at the current fusion time. When multiple sensors exhibit synchronous abnormal fluctuations within a short window, the system enhances the systematic linkage of the sensing system through coordinated aggregation, generates a continuous compression factor through bounded constraint mapping, scales the weight slice only for the current fusion time, and avoids frequent jumps caused by minor jitters through dead-zone control, ultimately forming a local rank-one incremental write-back that only updates the weights at the current time.

[0090] In the control allocation scenario, the target value matrix P can represent the recent feedback changes of multiple execution channels, and the output matrix W can represent the channel allocation matrix at the current moment. When several channels are enhanced in tandem, the system only performs bounded scaling on the current allocation slice to compress over-allocation tendencies, without needing to globally rewrite the historical allocation results.

[0091] When a matrix column can be divided into multiple column groups according to its business meaning, the system can first perform upper triangular column pair traversal and linked aggregation within the group, and then generate group-level aggregated linked indicators for each column group. Group-level constraint scaling factor This enables differentiated constraints.

[0092] In actual deployment, if the window length is insufficient, preheating can be performed; columns with variance close to zero are automatically skipped; if all elements fall into the dead zone, no writes are performed in this cycle; and missing data can be filled using a padding strategy. These processes do not alter the core logic chain of this invention.

[0093] The linkage index is not limited to the Pearson correlation coefficient, but can also use Spearman correlation coefficient, Kendall correlation coefficient, covariance normalization index, etc. The bounded constraint mapping function is not limited to a linear truncation function, but can also be a piecewise linear function, exponential function, lookup table function, or other monotone bounded function. The dead zone threshold is not limited to a uniform threshold, but can be set by column, by group, or adaptively varied. In matrix transpose storage or block storage, any slice corresponding one-to-one with the current update time can be considered an equivalent object. The local write-back is not limited to element-by-element assignment, but can use sparse writing based on index sets, vectorized block writing, etc. The local rank-one incremental write-back can be implemented by CPU, GPU, FPGA, ASIC, or a combination of hardware and software units. Any local incremental write-back method that can be represented as the outer product of the selection vector and the local increment vector, or has a substantial equivalent function and effect, should be considered an equivalent replacement of this invention.

[0094] The essential processing object of this invention is a two-dimensional numerical matrix and its local slice at the current update time in a continuously refreshed scenario, without requiring the construction of a general logical metaspace, semantic manifold alignment, Lyapunov residual evaluation, or generative model hidden state correction as a necessary prerequisite. This invention differs from solutions that rely on the aforementioned specific theoretical frameworks in terms of essential technical features and processing objects.

[0095] To avoid unduly expanding or narrowing the scope of protection, it should be noted that individual correlation calculations, individual dead-zone threshold judgments, individual local assignments, and individual outer product expressions are insufficient to constitute the complete technical solution required by this invention. If a solution only assigns values ​​to local elements at the result level without generating aggregated linkage indicators based on the inter-column linkage of the scrolling window, or without mapping the aggregated linkage indicators to the scaling control quantity at the current update time through bounded constraints, or without forming a set of changed element indices through dead-zone control and thereby limiting the actual physical write-back, it should not be automatically considered an equivalent solution of this invention simply because it can be mathematically expressed in rank-one form afterward. Conversely, any implementation method that achieves the same write-back range compression, cache line touch reduction, and write amplification suppression effects with substantially the same window linkage perception, constrained constraint mapping, dead-zone filtering, and local rank-one or zero-rank incremental write-back chain in a continuous refresh scenario, even if its linkage indicators, mapping functions, storage layout, execution kernel, or hardware form have equivalent substitutions, should fall within the scope of the technical concept of this invention.

[0096] The specific descriptions of preferred embodiments, parameter ranges, formula expressions, process sequences, forms of drawings, and application scenarios in this specification are used to illustrate the technical concept and possible implementation methods of the present invention, and should not be construed as an undue limitation on the scope of protection of the claims.

[0097] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention. Such modifications or substitutions should all fall within the scope of the invention, or any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.

Claims

1. A real-time matrix processing method based on local rank-one incremental write-back, characterized in that, Includes the following steps: Obtain the target value matrix P and the output matrix W to be processed, which are aligned according to the first dimension. The matrix columns are used to represent the numerical state of multiple processing objects at the same time, and the matrix rows correspond to the refresh time. The target value matrix P is subjected to difference and normalization processing at adjacent time points to generate a rolling window change rate matrix R, and window data of window length L is extracted at the current update time t. ; For the window data perform pairwise traversal on columns, only calculate the linkage index for upper triangular column pairs satisfying a < b, skip invalid column pairs whose column standard deviation is lower than a preset variance protection threshold, and aggregate the linkage indexes of all valid column pairs into an aggregated linkage index at the current update time ; wherein, both a and b are column indices, used to identify the window data the a-th column and the b-th column in the window data; The aggregated linkage indicators Input a bounded constraint mapping unit, and generate the constraint scaling factor for the current update time based on a preset parameter set. ,in Limited by upper and lower bounds; The constraint scaling factor As the control variable for the local slice corresponding to the current update time, it is applied only to the local slice in matrix W corresponding to the current update time. Perform scaling to obtain candidate slices ; The candidate slice Slices submitted at the previous time step Perform element-by-element comparisons. For elements whose changes are below the dead zone threshold θ, retain their original submitted values. For elements whose changes are above or equal to the dead zone threshold θ, adopt candidate values ​​to form the output slice at the current update time. Output the set of indexes of the elements that have changed. ; Output slice at the current update time Compared to the original slice at the current update time Construct slice increment vector from the difference between them Among them, for , ;for , ; and the selection vector corresponding to the current update time t. As a row positioning vector Its t-th component is 1, and the remaining components are 0; among them, for The j-th component, This represents the value of the j-th element in the candidate slice. Let j be the value of the j-th element in the original slice. Represents a T-dimensional real vector space; according to Constructing a single-period matrix increment And only write the matrix increment back to the row corresponding to the current update time of matrix W; where, when When it is a non-zero vector, It is a rank-one matrix; when When it is a zero vector, Since it is a zero-rank matrix, no matrix data writing will be performed in this refresh cycle; Enter the next refresh cycle and repeat the above steps.

2. The method according to claim 1, characterized in that, Said generating the rolling window change rate matrix R comprises: for the element in the i-th row and j-th column of the target value matrix P , the change rate , wherein, is the element in the -th row and -th column of the target value matrix P, is absolute value; is a denominator protection threshold; the change rate matrix R maintains data of the most recent L moments through a circular buffer; said calculating linkage indicators only for upper triangular column pairs satisfying a<b comprises: for column indexes a and b, the column pair linkage indicator is calculated only when a<b and the standard deviation of the a-th column and the b-th column is not lower than a preset variance protection threshold , wherein the linkage indicator is any one of Pearson correlation coefficient, Spearman correlation coefficient, Kendall correlation coefficient or normalized covariance value.

3. The method according to claim 1, characterized in that, The bounded constraint mapping unit uses a monotonic bounded function to... Mapped to , Restricted to Within the interval, The minimum scaling lower bound is used; the dead zone threshold θ is a uniform fixed value, or it can be adaptively adjusted according to the column fluctuation level. When the adaptive method is used, window data is utilized. The standard deviation of column j Generate column-level dead zone threshold ,in This is the lower limit of the minimum dead zone. These are the fluctuation mapping coefficients.

4. The method according to claim 1, characterized in that, The partial write-back step applies only to the index set. The corresponding element is physically written; the rate of change generation, upper triangular column pair traversal, linkage aggregation and local slice scaling are all executed by a compiled numerical kernel, which is at least one of a just-in-time compiled kernel, a SIMD vectorized kernel or a GPU kernel function.

5. The method according to claim 1, characterized in that, The system presets multiple sets of parameters to adapt to different fluctuation levels or business states. These parameter sets include window length L and initial constraint threshold. Scaling slope k, minimum scaling lower bound Dead zone threshold θ, variance protection threshold and denominator protection threshold Multiple; when the number of valid column pairs in the window is zero or the aggregated linked indicator is invalid, a rollback strategy is executed, wherein the rollback strategy is to make It either retains the slice that was committed in the previous time step, or generates a zero increment and skips the write-back.

6. The method according to claim 1, characterized in that, The columns of the output matrix W to be processed are divided into multiple column groups according to their business meaning or control object. Within each column group, upper triangular column pair traversal and linkage aggregation are performed to generate group-level aggregated linkage indicators. Group-level constraint scaling factor And for the current update time sub-slices belonging to the same column group, the corresponding group-level constraint scaling factor is applied to perform scaling; the output matrix W to be processed is the weight matrix, attention allocation matrix or candidate scoring matrix in the generative model inference process, or the confidence matrix in the multi-sensor fusion system, the candidate scoring matrix in the recommendation system, the resource allocation matrix in industrial control or the intensity matrix in the alarm system.

7. A real-time matrix processing system based on local rank-one incremental write-back, characterized in that, include: The data acquisition module is used to acquire the target value matrix P aligned to the first dimension and the output matrix W to be processed. The rate of change generation module is used to perform difference and normalization processing on the target value matrix P at adjacent time points to generate a rolling window rate of change matrix R, and to extract window data of window length L at the current update time t. ; a linkage aggregation module, configured to process the window data perform pairwise traversal on columns, only calculate linkage indicators for upper triangular column pairs satisfying a < b, skip invalid column pairs, and aggregate the linkage indicators of all valid column pairs into an aggregated linkage indicator at the current update time ; wherein, both a and b are column indices for identifying the window data the a-th column and the b-th column in; The constraint mapping module is used to map the aggregated linkage index s_t to the constraint scaling factor at the current update time. ,in Limited by upper and lower bounds; The local slice scaling module is used to scale the constrained scaling factor. Only local slices of matrix W corresponding to the current update time. Perform scaling to obtain candidate slices ; Dead zone control module, used to control the candidate slice Slices submitted at the previous time Perform element-by-element comparisons to form the output slice at the current update time. Output the set of indexes of the elements that have changed. ; The local write-back module is used to output a slice at the current update time. Compared with the original slice Construct slice increment vector from the difference between them to select vectors As a row positioning vector, according to Constructing a single-period matrix increment The local write-back module is also used to write the matrix increment back only to the row corresponding to the current update time of matrix W; When the vector is zero, it enters the write-back suppression state, and no data is written to the matrix storage unit during this refresh cycle; The output of the data acquisition module is connected to the input of the rate of change generation module, the output of the rate of change generation module is connected to the input of the linkage aggregation module, the output of the linkage aggregation module is connected to the input of the constraint mapping module, the output of the constraint mapping module is connected to the input of the local slice scaling module, the output of the local slice scaling module is connected to the input of the dead zone control module, and the output of the dead zone control module is connected to the input of the local write-back module.

8. A matrix real-time processing coprocessor based on local rank-one incremental write-back, used to execute the matrix real-time processing method based on local rank-one incremental write-back as described in any one of claims 1 to 6, characterized in that, include: The window data cache unit is used to store the rate of change data of the most recent L time moments, and the window data is maintained in a circular buffer manner. An upper triangular traversal and linkage aggregation engine, comprising a column pair address generator, an invalid column pair filter, a parallel linkage index calculation array and an accumulation aggregator; wherein the column pair address generator only generates column pair addresses satisfying a < b, the invalid column pair filter is configured to skip invalid column pairs according to variance or standard deviation, and the accumulation aggregator is configured to aggregate linkage indices of valid column pairs into an aggregated linkage index ; Bounded constraint mapping unit, used according to Output constraint scaling factor ; Local slice scaling and dead zone comparator array, used for local slice scaling Perform parallel scaling to obtain candidate slices It then compares each element with the previously submitted slice, and forms a set of changed element indices by indexing the elements whose changes are greater than or equal to the dead zone threshold θ. and output the slice increment vector. and ; The rank-one write-back engine includes a slice increment generator, a selection vector generator, a sparse address generator, and a write-back arbitrator; the sparse address generator is used to... Generate write-back addresses corresponding to non-zero increment elements, wherein the write-back arbitrator is used to submit only the addresses and values ​​corresponding to non-zero increment elements to the matrix storage unit; The parameter control register group is used to configure the window length L, the initial constraint threshold, the scaling slope, the minimum scaling lower bound, the dead zone threshold, and the rollback mode flag. when zero vector or When empty, the rank-one write-back engine enters the write-back suppression state, and no data is written to the matrix storage unit in this refresh cycle.

9. The coprocessor according to claim 8, characterized in that, The coprocessor is implemented as any one of an ASIC module, FPGA logic, an IP core in a system-on-a-chip, a bypass coprocessor unit in an AI acceleration chip, or a matrix update coprocessor unit in a GPU or NPU, and is connected to the main processor and matrix storage unit through an on-chip interconnect network, a high-speed bus, a DMA channel, or a cache interface.

10. An electronic device, characterized in that, The device includes a processor and a memory, wherein the memory stores a computer program, which, when executed by the processor, causes the electronic device to perform the matrix real-time processing method based on local rank-one incremental write-back as described in any one of claims 1 to 6.