Edge ai-based reram data processing method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]因此,本发明提供了基于边缘AI的ReRAM存算一体化数据处理方法及系统,解决现有方法过度依赖精确权重写入、部署后在线适配代价高的问题
[0042] The beneficial effects of this invention are as follows: By using the ReRAM array as a stable main computing carrier and limiting online updates to a small range of digital compensation parameters, this invention enables edge-side inference and online correction without frequently rewriting the main array, reducing array write burden and maintenance overhead. At the same time, by using reference samples to establish a master read relationship and triggering compensation updates in conjunction with verification results, it helps to improve inference stability and adaptability under device fluctuations, input changes, and long-term operating conditions, thereby improving the edge AI data processing efficiency and engineering feasibility based on the ReRAM in-memory computing architecture.
Smart Images

Figure CN122549593A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a ReRAM in-memory computing integrated data processing method and system based on edge AI. Background Technology
[0002] As edge intelligent terminals increasingly demand low latency, low power consumption, and localized data processing capabilities, edge AI processing technologies based on in-memory computing architectures are gradually becoming an important development direction in the fields of integrated circuits and intelligent computing. Among these, ReRAM, due to its non-volatile, high-density characteristics and ability to directly perform vector-matrix operations within the array, is widely regarded as a crucial device foundation for realizing edge-side neural network inference and near-memory computing. Existing ReRAM-based edge AI solutions typically revolve around technical links such as input quantization encoding, array mapping, array readout, error suppression, and output correction, striving to achieve local inference processing of sensing data within limited area and power budgets. Especially in edge scenarios, multi-channel time-series sensing data, after preprocessing, is directly mapped to a ReRAM array for parallel computing, and then combined with a digital domain readout module to complete classification, detection, or state recognition; this has become an important technical route for existing methods.
[0003] However, existing technologies still have two main shortcomings: First, existing solutions generally rely on accurately writing the target weights into the ReRAM array and maintaining computational accuracy through repeated calibration, which is sensitive to device discreteness and write fluctuations, resulting in high deployment costs. Second, when faced with state drift or task changes after deployment, existing solutions often adopt overall remapping or large-scale parameter rewriting to make adjustments, which incurs high online adaptation overhead and is not conducive to continuous and stable operation at the edge. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a ReRAM in-memory computing integrated data processing method and system based on edge AI, which solves the problems of existing methods that rely too much on precise weight writing and have high costs for online adaptation after deployment.
[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 a ReRAM in-memory computing integrated data processing method based on edge AI, comprising,
[0008] Collect current business data from the edge side and retrieve historical confirmed samples corresponding to the current task type to generate the current input vector and reference input vector set;
[0009] Random shaping is performed on the candidate ReRAM array to obtain a randomized connected basis, and the working state of the randomized connected basis is probed to obtain the state parameters of each column;
[0010] Based on the reference input vector group and the state parameters of each column, the connections in the random connection basis are filtered to form a frozen random backbone. The master readout relationship is established for the output of the reference input vector group based on the frozen random backbone, and a low-rank compensation branch for the output of the frozen random backbone is constructed in SRAM.
[0011] The current input vector is input into the frozen random backbone. The edge AI inference result of the current task is obtained based on the main readout relation and the low-rank compensation branch. Based on the edge AI inference result and the verification result corresponding to the reference input vector group, it is determined whether to trigger online correction.
[0012] When a correction is required, online incremental correction is performed only on low-rank compensation branches.
[0013] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the steps for generating the current input vector and the reference input vector set are as follows:
[0014] Perform unified preprocessing on current business data and historical confirmed samples on the edge side to obtain current data and reference data under the same input scale;
[0015] The current data and reference data are subjected to fixed-length quantization and differential encoding to generate the current input vector and the reference input vector group, respectively.
[0016] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the steps for obtaining the state parameters of each column are as follows:
[0017] Based on the current input vector and task deployment configuration, select a target array region that meets the conditions from the candidate ReRAM array, and perform uniform random shaping on the target array region to obtain a random connection basis;
[0018] The random connection basis is read out and the working state is probed to obtain the state parameters corresponding to each column.
[0019] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the steps for forming the frozen random backbone are as follows:
[0020] The response of each connection in the random connection basis to the reference sample is calculated based on the reference input vector set, and the reference response data corresponding to each connection is obtained.
[0021] Based on the reference response data, feature parameters of each connection are extracted, and combined with the state parameters of each column, the robustness score of each connection in the random connection basis is determined.
[0022] The connections in the random connection base are filtered based on the robustness score of each connection, a topology mask is generated, and the random connection base is frozen based on the topology mask to form a frozen random backbone.
[0023] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the step of establishing a master readout relationship based on the output of the reference input vector group on the frozen random backbone refers to loading the reference input vector group onto the frozen random backbone, obtaining the frozen backbone output features corresponding to the reference samples, and establishing a master readout relationship of the frozen random backbone based on the frozen backbone output features and the reference labels.
[0024] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the steps for constructing a low-rank compensation branch in SRAM for the frozen random backbone output are as follows:
[0025] The main output is calculated based on the reference features of the frozen random backbone output according to the main readout relationship, and a mapping relationship from the frozen random backbone output to the residual output is established based on the difference between the main output result and the reference label.
[0026] The residual output mapping relationship is decomposed into fixed-rank and low-rank components to obtain the low-rank compensation branch parameters for the frozen random trunk output. The low-rank compensation branch parameters are then deployed in SRAM to form the low-rank compensation branch for the frozen random trunk output.
[0027] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the steps of inputting the current input vector into the frozen random backbone and obtaining the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch are as follows:
[0028] Input the current input vector into the frozen random backbone to obtain the frozen backbone output features corresponding to the current input, and perform main output calculation on the frozen backbone output features based on the main readout relationship;
[0029] The residual compensation result is obtained based on the frozen main output features and low-rank compensation branches. The residual compensation result is then fused with the main output calculation result to generate the edge AI inference result for the current task.
[0030] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the step of determining whether to trigger online correction based on the edge AI inference result and the verification result corresponding to the reference input vector group is as follows:
[0031] The confidence level of the current result is calculated based on the edge AI inference result of the current task, and the verification is performed based on the reference features and reference labels corresponding to the reference input vector group to obtain the verification result of the reference sample.
[0032] Based on the current result confidence level and the verification results of the reference sample, determine whether to trigger online correction.
[0033] As a preferred embodiment of the ReRAM in-memory computing integrated data processing method based on edge AI described in this invention, the step of performing online incremental correction only on low-rank compensation branches is as follows:
[0034] When it is determined that correction is needed, the update amount of the low-rank compensation branch parameters is calculated based on the reference probability output, reference label and reference features corresponding to the reference sample, and only the low-rank compensation branch parameters are updated online.
[0035] The compensation result for the current task is recalculated based on the updated low-rank compensation branch parameters, and the final inference result for the current cycle is generated by combining the main output result of the current task.
[0036] Secondly, this invention provides a ReRAM in-memory computing integrated data processing system based on edge AI, comprising,
[0037] The data acquisition and encoding module is used to collect current business data from the edge side, retrieve historical confirmed samples corresponding to the current task type, and perform unified preprocessing, fixed-length quantization and differential encoding on the current business data and historical confirmed samples to generate the current input vector and reference input vector group.
[0038] The random connection construction module is used to select candidate ReRAM array regions based on the current input vector and task deployment configuration, perform unified random shaping to obtain a random connection basis, and perform working state probing on the random connection basis to obtain the state parameters of each column;
[0039] The random backbone formation module is used to calculate the response of each connection in the random connection basis to the reference sample based on the reference input vector set, determine the robustness score of each connection by combining the state parameters of each column, and filter and freeze the connections in the random connection basis according to the robustness score to form a frozen random backbone.
[0040] The readout compensation building module is used to establish the master readout relationship based on the output of the frozen random backbone to the reference input vector group, and to build a low-rank compensation branch for the output of the frozen random backbone in SRAM.
[0041] The inference correction module is used to freeze the random backbone of the current input vector, generate the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch, and determine whether to trigger online correction based on the edge AI inference result and the verification result corresponding to the reference input vector group. When online correction is triggered, online incremental correction is only performed on the low-rank compensation branch.
[0042] The beneficial effects of this invention are as follows: By using the ReRAM array as a stable main computing carrier and limiting online updates to a small range of digital compensation parameters, this invention enables edge-side inference and online correction without frequently rewriting the main array, reducing array write burden and maintenance overhead. At the same time, by using reference samples to establish a master read relationship and triggering compensation updates in conjunction with verification results, it helps to improve inference stability and adaptability under device fluctuations, input changes, and long-term operating conditions, thereby improving the edge AI data processing efficiency and engineering feasibility based on the ReRAM in-memory computing architecture. Attached Figure Description
[0043] 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.
[0044] Figure 1 This is a flowchart of the ReRAM in-memory computing integrated data processing method based on edge AI in Example 1.
[0045] Figure 2 This is a structural diagram of the ReRAM in-memory computing integrated data processing system based on edge AI in Example 1. Detailed Implementation
[0046] 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.
[0047] 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.
[0048] 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.
[0049] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a ReRAM in-memory computing integrated data processing method based on edge AI, including the following steps:
[0050] S1. Collect current business data from the edge side and retrieve historical confirmed samples corresponding to the current task type to generate the current input vector and reference input vector group;
[0051] S1.1: Perform unified preprocessing on the current business data and historical confirmed samples on the edge side to obtain current data and reference data under the same input scale;
[0052] Specifically, before entering online operation mode, the edge terminal first establishes a local reference sample library according to task type. For each task type, it pre-stores no less than a preset number of historical confirmed samples, and saves each historical confirmed sample along with its task type identifier, confirmation tag, and collection time. At the beginning of the current processing cycle, it reads the current task type identifier and synchronously samples multiple sensing channels of the target device according to a preset sampling cycle. It extracts the most recent segment of time-series data of consistent length from the buffer of each channel and splices them sequentially according to the preset channel order to form the original input data of the current task. The data length extracted by each channel in the same processing cycle remains consistent to ensure that the subsequent input encoding length is fixed. After forming the original input data of the current task, it retrieves historical samples from the local reference sample library that are consistent with the current task type identifier and whose tags are confirmed to be valid. It sorts the samples by collection time from most recent to oldest and calls the N most recent historical confirmed samples as reference samples for this cycle. It reads each historical confirmed sample and its corresponding confirmation tag together and combines them with the original input data of the current task to form the original data basis of the current processing cycle.
[0053] Preprocessing operations are performed on the current task's raw input data and historically confirmed samples, including removing DC bias by channel, suppressing abnormal spikes, and unifying amplitude range. Based only on the historically confirmed samples that are called, the reference mean and reference amplitude range of each channel are statistically analyzed, and the reference statistical results are used as the input processing benchmark for this cycle. The current task's raw input data and historically confirmed samples are then normalized using the input processing benchmark to obtain current data and reference data at the same input scale.
[0054] It should be noted that the current business data on the edge side refers to the multi-channel time-series sensing data collected by the edge terminal, preferably including one or more of vibration data, current data, voltage data, temperature data, pressure data, and acoustic data; the current task type is the data processing task category executed by the edge terminal for the current business scenario, used to determine the scope of historically confirmed samples and the scope of subsequent compensation parameters; the task type preferably includes at least one of state recognition task, anomaly detection task, and fault classification task.
[0055] Historically confirmed samples refer to historical data samples that have been collected during previous operations, and whose corresponding results or labels have been manually annotated, confirmed by feedback from upper-level business systems, or verified by rules.
[0056] S1.2: Perform fixed-length quantization and differential encoding on the current data and reference data to generate the current input vector and reference input vector group, respectively.
[0057] Specifically, the current task data and historically confirmed samples are uniformly converted into fixed-length quantization codes, preferably using six-bit symmetric quantization codes; differential splitting is performed on each quantization result, converting it into positive driving components and negative driving components respectively;
[0058] The edge terminal first splices all the forward driving components according to the pre-set splicing order, and then splices all the backward driving components to form the current input vector corresponding to the current task. At the same time, according to the same preprocessing rules, the same quantization rules and the same splicing order, it generates corresponding reference input vectors for each historically confirmed sample. The reference input vectors are then combined to form a reference input vector group.
[0059] S2. Perform random shaping on the candidate ReRAM array to obtain a randomized connected basis, and perform working state detection on the randomized connected basis to obtain the state parameters of each column;
[0060] S2.1: Based on the current input vector and task deployment configuration, select the target array region that meets the conditions from the candidate ReRAM array, and perform uniform random shaping on the target array region to obtain the random connection basis;
[0061] Specifically, the array input dimension for this cycle is determined based on the length of the current input vector, and the number of output columns required for the random backbone is determined based on the deployment configuration corresponding to the current task. Candidate ReRAM array blocks with an available number of input rows not less than the current input vector length, a continuous number of available columns not less than the preset number of output columns for this cycle, and a comprehensive health score higher than the preset health score threshold are retrieved from the local array status table. Physically continuous column regions within the same array block are selected as target array regions from the candidate ReRAM array blocks. Continuous column regions are easier to locate and manage in subsequent column-level working state detection, local recovery, and compensation mapping processes, and can reduce the additional control overhead caused by cross-block addressing and bus switching.
[0062] Furthermore, a unified reset pulse is executed on all memory cells within the target array area to return each memory cell to a preset high-resistance state, thereby eliminating the influence of historical residual states on the current period's random shaping results (the reset operation is only used to clear historical states and does not perform target conduction adjustment on a cell-by-cell basis).
[0063] After a unified reset, shaping pulses of the same amplitude, pulse width, and number of pulses are applied to all memory cells within the target array region. This causes each memory cell to enter a state where it is conductive but its conduction value is randomly dispersed under the same external driving conditions, thus forming a random conduction distribution within the target array region. After the random conduction distribution is formed, the edge terminal applies a fixed read voltage to the target array region and reads the measured conduction value of each memory cell row by row and column by column according to a preset row and column scanning order. The measured conduction values of each memory cell are then arranged according to the correspondence between the input row and the output column to form a random connection basis matrix.
[0064] It should be noted that the overall health score is obtained by performing a self-check on the candidate ReRAM array blocks to obtain the percentage of failed cells, the degree of fluctuation in read response, and the cumulative number of writes. Then, the various indicators are normalized and weighted summed to obtain the overall health score of the candidate ReRAM array blocks.
[0065] The health threshold is exemplarily set at 0.80 to 0.90, and more preferably at 0.85. The reason is that this range can ensure that the selected array blocks have a sufficiently low failure rate and readout fluctuation, satisfy the detectability and screening of the subsequent random connection base, and will not result in too few candidate arrays due to an excessively high threshold, thus affecting the real-time scheduling on the edge side.
[0066] The number of rows in the random connection basis matrix is the same as the length of the current input vector, and the number of columns is the same as the number of output columns required by the current task deployment configuration. It is used to characterize the connection distribution state of the target array region in this period after random shaping.
[0067] S2.2: Read out and probe the working state of the random connection basis to obtain the state parameters corresponding to each column;
[0068] Specifically, the edge terminal generates a fixed number of logical binary probe vectors for the random connection substrate. The length of each set of logical binary probe vectors is consistent with the input dimension of the random connection substrate. The logical binary probe vectors consist of forward probe markers and reverse probe markers. During loading, the forward probe markers are loaded onto the forward input of the array, and the reverse probe markers are loaded onto the reverse input of the array, thereby forming a differential probe input that matches the differential input structure of the array. In this embodiment, eight sets of logical binary probe vectors are used to perform working state probing on the random connection substrate.
[0069] Before the differential probe input is loaded, zero-drive conditions are applied to all input terminals, and readout operations are repeated a preset number of times for the target array region corresponding to the random connection substrate. The output response of each column under each zero-input readout is recorded, and the average value of each output response is used as the zero drift deviation of the column, thereby obtaining the bias state of each column of the random connection substrate under the condition of no effective input excitation.
[0070] After obtaining the zero drift deviation of each column, the edge terminal sequentially loads each set of differential probe inputs onto the target array region corresponding to the randomly connected substrate, and records the output response of each column under each set of differential probe inputs; performs zero drift correction and unified normalization on the output response of each column, extracts the gain deviation of the column based on the degree of change of the normalized response of the same column under different probe inputs, and extracts the noise intensity of the column based on the degree of dispersion of the output response of the same column under all probe inputs;
[0071] After obtaining the response sequences of each column under all probe inputs, the correlation between the response of each column and its physical neighboring columns is calculated according to the physical column address relationship of the target array region. The average result of the correlation between the response of the column and all neighboring columns is used as the crosstalk strength of the column to characterize the degree of coupling influence of the adjacent columns on the column in the working state. The minimum available conduction threshold of the cells is read from the array status table and used as the failure judgment benchmark. For each column in the random connection substrate, the number of memory cells in the column with conduction values lower than the minimum available conduction threshold is counted, and the proportion of the number of memory cells in the column to the total number of memory cells in the column is calculated to obtain the failure cell proportion of the column. ;
[0072] The edge terminal combines the zero drift deviation, gain deviation, noise intensity, crosstalk intensity, and failure unit ratio corresponding to each column in a unified order to form the state parameters of that column; and summarizes the state parameters corresponding to all columns of the random connection base in column index order to form the set of state parameters of each column of the random connection base in this period.
[0073] Zero drift deviation The expression is:
[0074]
[0075] in, For the first Ranked in Normalized digital response at sub-zero input readout This indicates the number of repeated tests with zero input.
[0076] Gain Deviation The expression is:
[0077]
[0078] In the formula, Indicates the first Gain deviation of the column, Indicates the first The average normalized response under all probe inputs is listed. Indicates the total number of probe vectors. To prevent extremely small positive numbers with a denominator of zero, Indicates the first Ranked in Normalized response to group probe input;
[0079] Noise intensity The expression is:
[0080]
[0081] In the formula, Indicates the first The average normalized digital response under all probe inputs, Indicates the first Ranked in Normalized digital response value under differential probe input;
[0082] Crosstalk strength The expression is:
[0083]
[0084] In the formula, Indicates the first The number of columns in the set of adjacent columns. Indicates the first Column and number The correlation coefficient between the probe response sequences, preferably calculated using the Pearson correlation coefficient, is used to characterize the first... Column and number The degree of linear correlation of the response sequences under all probe inputs. and They represent the first Column and number List the response sequence formed under all probe inputs. Indicates the first The set of physically adjacent columns of a column.
[0085] It should be noted that the zero-drive condition refers to the drive condition in which no effective input excitation is applied to the positive and negative input terminals of the target array region, so that all input rows are in a zero-input state; the column output response obtained under this condition is used to characterize the zero drift deviation of the corresponding column.
[0086] The minimum usable conduction threshold is a threshold determined based on the conduction distribution of the target array region during the array initialization self-test phase. Preferably, it is set to 0.08 to 0.15 times the reference conduction value according to the normalized conduction value, and more preferably 0.10 times. The reference conduction value is preferably the median conduction value of the high conduction reference cells in the target array region, or the median value of the conduction values of all cells after uniform random shaping. Cells below the minimum usable conduction threshold are judged as unusable cells.
[0087] S2.3: Record the association between the random connection base and the state parameters of each column to form a random connection resource.
[0088] Specifically, after obtaining the random connection base and the corresponding status parameters of each column, the edge terminal associates and records the random connection base with the corresponding physical array information. At the same time, it binds and records each column of status parameters with the corresponding column in the random connection base according to the column index order, so that each column of random connection data corresponds to a unique set of column status parameters. After completing the association and recording, the random connection base, each column of status parameters and the corresponding physical array information are written into the random connection resource table of the current period to form the random connection resource of the current period.
[0089] It should be noted that the physical array information includes at least the array block number, the starting column address, the ending column address, the range of input row addresses, and the timestamp of this formation.
[0090] S3. Based on the reference input vector group and the state parameters of each column, the connections in the random connection basis are filtered to form a frozen random backbone. The main readout relationship is established for the output of the reference input vector group based on the frozen random backbone, and a low-rank compensation branch for the output of the frozen random backbone is constructed in SRAM.
[0091] S3.1: Calculate the response of each connection in the random connection basis to the reference sample based on the reference input vector set, and obtain the reference response data corresponding to each connection;
[0092] Specifically, it reads the reference conduction values pre-stored in the random connection resource table, reference input vector group, and array state table. And determine the maximum quantization code value in combination with quantization rules. Normalization is performed on each connection in the random connection basis and each dimension of the input in the reference input vector to obtain normalized conduction and input values, and the normalized response of each connection to each reference sample is calculated accordingly. The normalized responses of all connections on all reference samples are stored in the order of connection index and sample index to form the reference response dataset corresponding to each connection.
[0093] Normalized conduction value and input values The expression is:
[0094]
[0095]
[0096] Normalized response The expression is:
[0097] .
[0098] S3.2: Extract the characteristic parameters of each connection based on the reference response data, and combine them with the state parameters of each column to determine the robustness score of each connection in the random connection basis;
[0099] Specifically, based on the reference response dataset, connection feature parameters are extracted for each connection in the random connection basis. This includes calculating the average activation intensity of the connection in the i-th row and j-th column across all reference samples; determining the class discrimination based on the response differences between different classes of reference samples and the response dispersion within the same class of samples; determining the time stability based on the response fluctuations of the connection across all reference sample sequences; and determining the perturbation sensitivity by applying a preset perturbation to the connection conduction value and comparing the change in the connection response before and after the perturbation. After completing the extraction of connection-level feature parameters, the obtained column state parameters, including zero drift bias, gain bias, noise intensity, crosstalk intensity, and failure unit ratio, are retrieved. The column state parameters are then subjected to min-max normalization to form column constraint parameters. The average activation intensity, class discrimination, time stability, and perturbation sensitivity of all connections are then subjected to min-max normalization, and the normalized connection feature parameters are fused with the column constraint parameters corresponding to the column where the connection is located to obtain the robustness score for each connection in the random connection basis.
[0100] Average activation intensity The expression is:
[0101]
[0102] In the formula, Indicates the total number of reference samples;
[0103] Category Distinction The expression is:
[0104]
[0105] In the formula, It is the total number of categories in the reference sample. It is the first The number of class reference samples, It is the first The set of indexes for class reference samples, It is the first Line number Column join pair Normalized response values of one reference sample, It is the first Line number The columns are concatenated over all reference samples to obtain the overall average normalized response values. It is the first Line number Column join in the first The average normalized response value on the reference sample. It is a very small positive number set to prevent the denominator from being zero;
[0106] Time stability The expression is:
[0107]
[0108] In the formula, This represents the normalized mean response of the connection across all reference samples. This represents the normalized standard deviation of the connection across all reference samples;
[0109] Disturbance sensitivity The expression is:
[0110]
[0111] In the formula, This indicates the number of perturbation repetitions, that is, the total number of times perturbation simulations are applied to this connection. It is the first Under the influence of the second disturbance, the first Line number Column join pair The perturbated normalized response value of each reference sample;
[0112] in , It is the first The second disturbance Line number Normalized conduction perturbation of column connections;
[0113] Column constraint parameters The expression is:
[0114]
[0115] In the formula, , , , and These are the normalized zero drift deviation, gain deviation, noise intensity, crosstalk intensity, and percentage of failed cells;
[0116] Robustness rating The expression is:
[0117]
[0118] In the formula, , , and These are the normalized average activation intensity, class discrimination, temporal stability, and perturbation sensitivity.
[0119] S3.3: Filter the connections in the random connection base according to the robustness score of each connection, generate a topology mask, and freeze the random connection base based on the topology mask to form a frozen random backbone.
[0120] Specifically, the robustness scores of all connections are statistically analyzed, the overall mean is calculated, and this overall mean is used as the connection filtering threshold. Based on the filtering threshold Each connection in the random connection basis is filtered one by one to generate a topology mask matrix; for example, the first... Line number The topology mask value for column joins is defined as follows:
[0121]
[0122] in, Indicates the first Line number The topology mask marker for column concatenation, when When indicates that the connection is retained, when The time indicates that the connection is cut off;
[0123] To avoid some output columns retaining too few connections after filtering, the edge terminal further reads the minimum number of connections to retain column from the task deployment configuration. And perform column integrity correction on the topology mask; if the first The number of connections retained in the column is less than Then, within that column, reselect the previous entries based on their robustness scores from highest to lowest. One connection is retained as a preserved connection, and its corresponding topology mask value is corrected to 1 to ensure that each output column still has the minimum number of valid connections after freezing; after completing the topology mask generation and correction, the topology mask matrix is... Perform element-wise multiplication with the randomly connected basis matrix to form a frozen random backbone matrix.
[0124] 2. S3.4: Load the reference input vector group into the frozen random backbone to obtain the frozen backbone output features corresponding to the reference samples, and establish the master readout relationship of the frozen random backbone based on the frozen backbone output features and the reference labels.
[0125] Specifically, the array block number, input row address range, output column address range, and the index of the retained connection corresponding to each output column in the topology mask are read from the current periodic random connection resource table. All reference input vectors and their corresponding confirmation tags are retrieved sequentially from the reference input vector group. According to the input mapping relationship corresponding to the frozen random backbone, each reference input vector is loaded into the target array region one by one. When reading each output column, time-division gating control is performed on the input rows according to the topology mask. When reading a certain output column, only the input row containing the retained connection of that column is loaded with valid input; the remaining input rows remain in a zero-drive state, thus preventing the pruned connections from participating in the output calculation of that column. The output columns are read sequentially according to this method to obtain the frozen backbone output features corresponding to each reference sample. The frozen backbone output features corresponding to all reference samples are then concatenated in column order to form a reference feature matrix.
[0126] Furthermore, the confirmation labels of each reference sample are concatenated in column order to form a reference label matrix; in the digital domain, ridge regression is used to establish the master readout relationship between the frozen random backbone output features and the reference labels, thus obtaining the master readout matrix corresponding to the frozen random backbone.
[0127] It should be noted that the master readout matrix is used to characterize the master mapping relationship between the frozen random backbone output features and the target category output under the current task type.
[0128] The frozen backbone output features are expressed as follows:
[0129]
[0130] in, Indicates the first The reference sample is in the frozen random backbone. Output features on columns This represents the activation function; in this embodiment, the ReLU function is used. It is the first in the frozen random backbone The set of input row indices that are actually used in the calculation.
[0131] S3.5: Calculate the main output based on the reference features of the frozen random backbone output according to the main readout relationship, and establish a mapping relationship from the frozen random backbone output to the residual output based on the difference between the main output result and the reference label.
[0132] Specifically, the frozen backbone output features corresponding to each reference sample are input into the main readout matrix one by one, and a linear weighted summation operation is performed according to the output channel of each category to obtain the main output result corresponding to each reference sample. The main output result is compared with the reference label matrix item by item to obtain the main output residual matrix of the frozen random backbone under the current task type. Using the reference features of the frozen random backbone output as input and the main output residual matrix as the target, a regularized linear fitting method consistent with the main readout relationship establishment process is adopted to establish the mapping relationship between the frozen random backbone output and the residual output to obtain the residual mapping matrix.
[0133] It should be noted that the linear weighted accumulation operation is as follows: the feature values of each dimension in the frozen backbone output features are multiplied by the readout coefficients of each dimension of the corresponding category output channel in the main readout matrix, and the product results are summed to obtain the main output value of the category output channel; after repeating the operation on all reference samples, the main readout output results corresponding to all reference samples are formed.
[0134] The main output residual matrix is used to characterize the residual error that has not been fully represented by the main output when relying only on the frozen random backbone and the main readout relationship; the residual mapping matrix is used to characterize the linear correlation between the frozen random backbone output features and the corresponding residual error, and serves as the target object for subsequent construction of low-rank compensation branches.
[0135] S3.6: Perform fixed-rank low-rank decomposition on the residual output mapping relationship to obtain the low-rank compensation branch parameters for the frozen random trunk output, and deploy the low-rank compensation branch parameters in SRAM to form the low-rank compensation branch for the frozen random trunk output.
[0136] Specifically, singular value decomposition is performed on the residual mapping matrix, and the first two largest singular values and their corresponding left and right singular vectors are fixedly retained to form a low-rank approximation result with a fixed rank of 2. Based on the low-rank approximation result, two levels of low-rank compensation branch parameters are constructed. The first level of parameters is used to map the frozen random backbone output features to a two-dimensional low-rank intermediate space, and the second level of parameters is used to map the two-dimensional low-rank intermediate space to the category output space, thereby forming a low-rank compensation branch with a fixed rank of 2 for the frozen random backbone output.
[0137] Furthermore, the parameters of each part are deployed according to the storage role: the frozen random backbone is kept on the corresponding ReRAM array side, and the main read matrix and low-rank compensation branch parameters are stored in SRAM or the digital storage area of the edge controller; the resource index corresponding to the frozen random backbone, the storage index of the main read matrix, the storage index of the low-rank compensation branch parameters, the corresponding task type identifier, and the online update permission flag are uniformly registered in the current cycle resource table to form backbone read resources.
[0138] It should be noted that the low-rank compensated branch parameters are small-scale high-precision parameters that can be updated in the subsequent online phase, and the frozen random trunk remains unchanged during the online operation phase; in this embodiment, the number of task categories is not less than 2, and the output dimension of the frozen random trunk is not less than 2, so the first two maximum singular values and their corresponding left and right singular vectors are fixedly retained.
[0139] S4. Input the current input vector into the frozen random backbone, obtain the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch, and determine whether to trigger online correction based on the edge AI inference result and the verification result corresponding to the reference input vector group.
[0140] S4.1: Input the current input vector into the frozen random backbone to obtain the frozen backbone output features corresponding to the current input, and perform main output calculation on the frozen backbone output features based on the main readout relationship;
[0141] Specifically, at the start of the current processing cycle, the edge terminal reads the current input vector and simultaneously reads the array block number, input row address range, output column address range, topology mask index, and master readout matrix index corresponding to the frozen random backbone from the backbone readout resources. Based on the set of retained connections corresponding to each output column in the topology mask, time-division gated readout is performed on the current input vector. When reading any output column, only the input row containing the retained connection of that column is loaded with valid input consistent with the current input vector; the remaining unretained input rows remain in a zero-drive state, thus preventing pruned connections from participating in the current column output calculation. All output columns are read out sequentially according to their order, and normalization and activation processing are performed on the readout results of each output column to obtain the frozen backbone output feature vector corresponding to the current input. Based on the master readout matrix, the master output calculation is performed on the current frozen backbone output feature vector to obtain the master output result of the current processing cycle.
[0142] The frozen backbone output feature vector is expressed as follows:
[0143]
[0144] in, Indicates the first The frozen backbone output feature vector for each processing cycle This indicates freezing the random backbone matrix. Represents the current input vector. This represents the activation function; in this embodiment, the ReLU function is used.
[0145] The main output calculation is expressed as follows:
[0146]
[0147] in, Indicates the first The main output of each processing cycle Indicates the main readout matrix. This indicates the current frozen trunk output feature vector.
[0148] It should be noted that the current input vector maintains the same quantization rules, differential coding rules, and input row mapping rules as the reference input vector group used when establishing the master readout relationship, so as to ensure that the input structure in the inference stage is consistent with that in the master readout establishment stage.
[0149] S4.2: Based on the frozen main output features and low-rank compensation branches, the residual compensation results are obtained, and the residual compensation results are fused with the main output calculation results to generate the edge AI inference results for the current task.
[0150] Specifically, the parameters A and B of the low-rank compensation branch are read, and the current frozen backbone output feature vector is used as input. First, the frozen backbone output feature vector is mapped to the low-rank intermediate space through parameter A, and then the low-rank intermediate space is mapped to the category output space through parameter B to obtain the residual compensation result of the current processing cycle. The main output result and the residual compensation result are added item by item according to the category dimension to obtain the total log output of the current processing cycle. Softmax probability normalization is performed on the total log output to obtain the probability distribution of the current input belonging to each category. The category number with the highest probability is selected as the edge AI inference result of the current task. The final inference category result of the current processing cycle, the probability distribution of each category, and the timestamp corresponding to the current processing cycle are written to the local result cache.
[0151] The residual compensation result is expressed as:
[0152]
[0153] in, Indicates the first The residual compensation results for each processing cycle and These represent the preceding and following parameters of the low-rank compensated branch, respectively. This indicates the current frozen trunk output feature vector.
[0154] S4.3: Calculate the confidence level of the current result based on the edge AI inference result of the current task, and perform verification based on the reference features and reference labels corresponding to the reference input vector group to obtain the verification result of the reference sample;
[0155] Specifically, the class probability vectors of the current processing cycle are sorted, the highest and second-highest class probabilities are extracted, and the confidence level of the current result is calculated. Based on the main readout matrix, the main output is calculated for the frozen backbone output features corresponding to each reference sample. Then, the residual error corresponding to the main output result is compensated using a low-rank compensation branch, and the main output result and the compensation result are fused to obtain the reference output probability vector of the reference sample. The reference output probability vector is compared with the one-hot label vector corresponding to the reference sample using the Euclidean distance calculation method to obtain the verification residual of the reference sample. After all reference samples have been verified, the verification residuals of each reference sample are summarized to obtain the average verification residual of the current reference sample buffer set under the current parameter state. The reference probability vectors corresponding to all reference samples are concatenated in column order to form a reference probability matrix.
[0156] The confidence level of the current result is calculated using the following expression:
[0157]
[0158] in, Indicates the first The confidence level of the current result for each processing cycle. This represents the maximum class probability in the current processing cycle. This represents the probability of the second largest category in the current processing cycle. To prevent extremely small positive numbers with a denominator of zero.
[0159] S4.4: Based on the current result confidence level and the verification results of the reference sample, determine whether to trigger online correction.
[0160] Specifically, the confidence level of the current result is compared with the confidence threshold. Compare the average verification residual with the verification residual threshold. Compare, when satisfied and When the current task inference result is confirmed as the final result of the current processing cycle, the current processing cycle status is marked as "no correction required"; when or When this happens, mark the current processing cycle status as "needs correction".
[0161] It should be noted that the confidence threshold The exemplary value range is 0.15 to 0.35, preferably 0.25. This is based on the fact that the current confidence level is determined by the relative interval between the probability of the largest class and the probability of the second largest class. If the threshold is too low, the result with unclear class boundaries will be misjudged as reliable. If the threshold is too high, the normal inference result that is acceptable will be frequently triggered for online correction.
[0162] Validate residual threshold The exemplary value range is 0.20 to 0.60, preferably 0.35. This is based on the fact that the reference residual is characterized by the Euclidean distance between the reference output probability vector and the one-hot label vector. If the threshold is too small, it will be too sensitive to quantization error and array random fluctuations. If the threshold is too large, it will not be able to reflect in time the actual decrease in the ability of the frozen random trunk and low-rank compensation branch to fit the reference sample under the current parameter state.
[0163] S5. When it is determined that correction is needed, online incremental correction is performed only on low-rank compensation branches.
[0164] S5.1: When it is determined that correction is needed, the update amount of the low-rank compensation branch parameters is calculated based on the reference probability output, reference label and reference feature corresponding to the reference sample, and only the low-rank compensation branch parameters are updated online.
[0165] Specifically, when the current processing cycle status is determined to be "needs correction", the random backbone matrix and main readout matrix remain frozen throughout the entire online correction process, and no ReRAM main array rewrite operation is performed; furthermore, the learning rate is read from the task deployment configuration table. The algorithm calculates the output layer gradient for each reference sample based on the reference probability matrix and reference label matrix, and then calculates the low-rank intermediate vector for each reference sample by combining the reference feature matrix and the current low-rank compensation branch parameters. After obtaining the output layer gradient and low-rank intermediate vector for all reference samples, the algorithm synchronously calculates the update amount of the low-rank compensation branch parameters according to the average gradient of all reference samples, and performs online updates only for the preceding compensation parameter A and the subsequent compensation parameter B. After the update is completed, the updated low-rank compensation branch parameters are written back to the SRAM or the digital storage area of the edge controller, overwriting the old parameters corresponding to the original parameter index. At the same time, the update timestamp and correction status flag corresponding to the low-rank compensation branch parameters in the trunk readout resource table are updated, thereby completing the online update only for the low-rank compensation branch parameters without changing the frozen random trunk matrix and the main readout matrix.
[0166] The gradient of the output layer is expressed as:
[0167]
[0168] in, Indicates the first The output layer gradient vector corresponding to each reference sample Indicates the first The reference probability vector of each reference sample. Indicates the first One-hot label vectors of each reference sample;
[0169] Low-rank intermediate vector The expression is:
[0170]
[0171] The update rule for the preceding compensation parameters is expressed as follows:
[0172]
[0173] In the formula, This is the pre-update compensation parameter matrix, used to map the frozen random backbone output features to a low-rank intermediate space. It is the updated preceding compensation parameter matrix. The learning rate controls the step size of parameter updates during the current round of online calibration, and is usually preset by the task deployment configuration table. It is the frozen random backbone output feature vector corresponding to the t-th reference sample;
[0174] The update rule for the subsequent compensation parameters is expressed as follows:
[0175]
[0176] In the formula, This is the post-compensation parameter matrix before the update, used to map the features of the low-rank intermediate space to the class output space. It is the updated subsequent compensation parameter matrix. It is the first The transpose of the low-rank intermediate vector of each reference sample.
[0177] S5.2: Recalculate the compensation result of the current task based on the updated low-rank compensation branch parameters, and generate the final inference result of the current cycle by combining the main output result of the current task.
[0178] Specifically, after updating the low-rank compensation branch parameters, since the input samples have not changed in the current processing cycle, and the frozen random backbone matrix and main readout matrix remain unchanged, the edge terminal does not re-trigger the ReRAM main array readout. Instead, it directly reuses the main output result and the current frozen backbone output feature vector obtained in the current processing cycle, and recalculates the compensation result of the current task using the updated low-rank compensation branch parameters. The updated compensation result is then fused with the current main output result item by item according to the category dimension to obtain the corrected current total log output. Probability normalization is performed on the corrected current total log output, and the category probability distribution corresponding to the current task is recalculated. After obtaining the updated category probability distribution, the category number with the highest probability is selected as the final inference category result of the current processing cycle. Finally, the edge terminal writes the updated final inference category result, the updated category probability distribution, the timestamp corresponding to the current processing cycle, and the online correction marker back to the local result cache as the final output result of the current processing cycle.
[0179] Reference Figure 2 This embodiment also provides a ReRAM in-memory computing integrated data processing system based on edge AI, including:
[0180] The data acquisition and encoding module is used to collect current business data from the edge side, retrieve historical confirmed samples corresponding to the current task type, and perform unified preprocessing, fixed-length quantization and differential encoding on the current business data and historical confirmed samples to generate the current input vector and reference input vector group.
[0181] The random connection construction module is used to select candidate ReRAM array regions based on the current input vector and task deployment configuration, perform unified random shaping to obtain a random connection basis, and perform working state probing on the random connection basis to obtain the state parameters of each column;
[0182] The random backbone formation module is used to calculate the response of each connection in the random connection basis to the reference sample based on the reference input vector set, determine the robustness score of each connection by combining the state parameters of each column, and filter and freeze the connections in the random connection basis according to the robustness score to form a frozen random backbone.
[0183] The readout compensation building module is used to establish the master readout relationship based on the output of the frozen random backbone to the reference input vector group, and to build a low-rank compensation branch for the output of the frozen random backbone in SRAM.
[0184] The inference correction module is used to freeze the random backbone of the current input vector, generate the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch, and determine whether to trigger online correction based on the edge AI inference result and the verification result corresponding to the reference input vector group. When online correction is triggered, online incremental correction is only performed on the low-rank compensation branch.
[0185] In summary, this invention obtains the state parameters of each column by performing random shaping on candidate ReRAM arrays and combining it with working state detection. Based on this, a frozen random backbone is formed, so that the random conduction distribution is no longer just a source of device error, but is transformed into a usable in-memory computing connection resource. At the same time, a master readout relationship is established based on the frozen random backbone, and a low-rank compensation branch for the output of the frozen random backbone is constructed in SRAM. During the online operation phase, only the low-rank compensation branch is incrementally corrected, while the frozen random backbone remains unchanged. This significantly reduces the overhead caused by overall remapping and repeated writing of the master array while ensuring the high density and low power consumption advantages of the ReRAM master array. Furthermore, this invention determines whether to trigger online correction by jointly using edge AI inference results and reference sample verification results, enabling the system to balance inference efficiency, output stability, and online adaptability in edge scenarios, thereby improving the data processing accuracy, deployment flexibility, and long-term operational reliability of the ReRAM in-memory computing architecture.
[0186] 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. A method for ReRAM data processing based on edge AI, characterized in that, include: Collect current business data from the edge side and retrieve historical confirmed samples corresponding to the current task type to generate the current input vector and reference input vector set; Random shaping is performed on the candidate ReRAM array to obtain a randomized connected basis, and the working state of the randomized connected basis is probed to obtain the state parameters of each column; Based on the reference input vector group and the state parameters of each column, the connections in the random connection basis are filtered to form a frozen random backbone. The master readout relationship is established for the output of the reference input vector group based on the frozen random backbone, and a low-rank compensation branch for the output of the frozen random backbone is constructed in SRAM. The current input vector is input into the frozen random backbone. The edge AI inference result of the current task is obtained based on the main readout relation and the low-rank compensation branch. Based on the edge AI inference result and the verification result corresponding to the reference input vector group, it is determined whether to trigger online correction. When a correction is required, online incremental correction is performed only on low-rank compensated branches.
2. The edge-AI-based ReRAM data processing method of claim 1, wherein: The steps for generating the current input vector and the reference input vector set are as follows: Perform unified preprocessing on current business data and historical confirmed samples on the edge side to obtain current data and reference data under the same input scale; The current data and reference data are subjected to fixed-length quantization and differential encoding to generate the current input vector and the reference input vector group, respectively.
3. The edge-AI-based ReRAM data processing method of claim 2, wherein: The steps to obtain the state parameters for each column are as follows: Based on the current input vector and task deployment configuration, select a target array region that meets the conditions from the candidate ReRAM arrays, and perform uniform random shaping on the target array region to obtain a random connection basis; The random connection basis is read out and the working state is probed to obtain the state parameters corresponding to each column.
4. The edge-AI-based ReRAM data processing method of claim 3, wherein: The steps for forming a frozen random backbone are as follows: The response of each connection in the random connection basis to the reference sample is calculated based on the reference input vector set, and the reference response data corresponding to each connection is obtained. Based on the reference response data, feature parameters of each connection are extracted, and combined with the state parameters of each column, the robustness score of each connection in the random connection basis is determined. The connections in the random connection base are filtered based on the robustness score of each connection, a topology mask is generated, and the random connection base is frozen based on the topology mask to form a frozen random backbone.
5. The edge-AI-based ReRAM data processing method of claim 4, wherein: The establishment of a master readout relationship based on the output of the reference input vector group on the frozen random backbone refers to loading the reference input vector group onto the frozen random backbone, obtaining the frozen backbone output features corresponding to the reference sample, and establishing a master readout relationship of the frozen random backbone based on the frozen backbone output features and the reference label.
6. The edge-AI-based ReRAM data processing method of claim 5, wherein: The steps for constructing a low-rank compensation branch for the frozen random backbone output in SRAM are as follows: The main output is calculated based on the reference features of the frozen random backbone output according to the main readout relationship, and a mapping relationship from the frozen random backbone output to the residual output is established based on the difference between the main output result and the reference label. The residual output mapping relationship is decomposed into fixed-rank and low-rank components to obtain the low-rank compensation branch parameters for the frozen random trunk output. The low-rank compensation branch parameters are then deployed in SRAM to form the low-rank compensation branch for the frozen random trunk output.
7. The ReRAM in-memory computing integrated data processing method based on edge AI as described in claim 6, characterized in that: The steps for inputting the current input vector into the frozen random backbone and obtaining the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch are as follows: Input the current input vector into the frozen random backbone to obtain the frozen backbone output features corresponding to the current input, and perform main output calculation on the frozen backbone output features based on the main readout relationship; The residual compensation result is obtained based on the frozen main output features and low-rank compensation branches. The residual compensation result is then fused with the main output calculation result to generate the edge AI inference result for the current task. 8.The edge-AI-based ReRAM data processing method of claim 7, wherein: The steps for determining whether to trigger online correction based on the edge AI inference results and the verification results corresponding to the reference input vector group are as follows: The confidence level of the current result is calculated based on the edge AI inference result of the current task, and the verification is performed based on the reference features and reference labels corresponding to the reference input vector group to obtain the verification result of the reference sample. Based on the current result confidence level and the verification results of the reference sample, determine whether to trigger online correction.
9. The edge-AI-based ReRAM processing-in-memory data processing method of claim 8, wherein: The online incremental correction is performed only on low-rank compensated branches, and the steps are as follows: When it is determined that correction is needed, the update amount of the low-rank compensation branch parameters is calculated based on the reference probability output, reference label and reference features corresponding to the reference sample, and only the low-rank compensation branch parameters are updated online. The compensation result for the current task is recalculated based on the updated low-rank compensation branch parameters, and the final inference result for the current cycle is generated by combining the main output result of the current task.
10. The edge AI-based ReRAM data processing system, according to any one of claims 1-9, wherein, include: The data acquisition and encoding module is used to collect current business data from the edge side, retrieve historical confirmed samples corresponding to the current task type, and perform unified preprocessing, fixed-length quantization and differential encoding on the current business data and historical confirmed samples to generate the current input vector and reference input vector group. The random connection construction module is used to select candidate ReRAM array regions based on the current input vector and task deployment configuration, perform unified random shaping to obtain a random connection basis, and perform working state probing on the random connection basis to obtain the state parameters of each column; The random backbone formation module is used to calculate the response of each connection in the random connection basis to the reference sample based on the reference input vector set, determine the robustness score of each connection by combining the state parameters of each column, and filter and freeze the connections in the random connection basis according to the robustness score to form a frozen random backbone. The readout compensation building module is used to establish the master readout relationship based on the output of the frozen random backbone to the reference input vector group, and to build a low-rank compensation branch for the output of the frozen random backbone in SRAM. The inference correction module is used to freeze the random backbone of the current input vector, generate the edge AI inference result of the current task based on the main readout relation and the low-rank compensation branch, and determine whether to trigger online correction based on the edge AI inference result and the verification result corresponding to the reference input vector group. When online correction is triggered, online incremental correction is only performed on the low-rank compensation branch.