WO2014056330A1 - Data writing method and device - Google Patents

Data writing method and device Download PDF

Info

Publication number
WO2014056330A1
WO2014056330A1 PCT/CN2013/076988 CN2013076988W WO2014056330A1 WO 2014056330 A1 WO2014056330 A1 WO 2014056330A1 CN 2013076988 W CN2013076988 W CN 2013076988W WO 2014056330 A1 WO2014056330 A1 WO 2014056330A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
memory
absolute difference
written
data writing
Prior art date
Application number
PCT/CN2013/076988
Other languages
French (fr)
Chinese (zh)
Inventor
方运潭
李华伟
李晓维
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014056330A1 publication Critical patent/WO2014056330A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C13/00Digital stores characterised by the use of storage elements not covered by groups G11C11/00, G11C23/00, or G11C25/00
    • G11C13/0002Digital stores characterised by the use of storage elements not covered by groups G11C11/00, G11C23/00, or G11C25/00 using resistive RAM [RRAM] elements
    • G11C13/0021Auxiliary circuits
    • G11C13/0069Writing or programming circuits or methods

Definitions

  • the present invention relates to data storage technologies, and in particular, to a data writing method and apparatus, and belongs to the field of electronic technology. Background technique
  • PCM Phase Change Memory
  • SRAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • PCM can maintain the stored data after the power is cut off, the storage density is higher, and there is almost no leakage. , and has better scalability and the ability to tolerate soft errors. Therefore, PCM has received extensive attention from industry and academia, and has great potential to replace traditional memory as a next-generation memory product.
  • PCM prototypes and even started mass production of PCM.
  • a data writing method including:
  • writing the data to be written to the memory includes:
  • the different data bits are updated according to the data to be written.
  • the data is video data or image data.
  • a data writing device including an absolute difference obtaining module, a control module, and a data writing module, wherein:
  • the absolute difference obtaining module is configured to obtain an absolute difference between the data to be written and the stored data in the memory
  • the control module is configured to determine whether the absolute difference is greater than a preset threshold; and when the determination is yes, controlling the data writing module to perform an operation;
  • the data writing module is configured to write the data to be written into the memory.
  • control module is further configured to perform bit-by-bit data comparison between the data to be written and the stored data to determine different data bits; The absolute difference is greater than a preset threshold, and the data writing module is controlled to update the different data bits.
  • control module includes a threshold comparison unit, a data bit comparison unit, a gate unit, and a switch unit, where:
  • the threshold comparison unit is configured to compare the absolute difference with the preset threshold, and provide a comparison result of whether the absolute difference is greater than the preset threshold to the gating unit;
  • the data bit comparing unit is configured to perform bit-by-bit data comparison between the data to be written and the stored data, and provide a comparison result of whether each data bit is the same to the gating unit;
  • the gating unit is configured to: if the absolute difference is greater than the preset threshold, provide a comparison result of whether the data bits are the same to the switch unit, if the absolute difference is less than or equal to the pre- Setting a threshold, the comparison result that the absolute difference is less than or equal to the preset threshold is provided to the Switch unit
  • the switching unit is connected between the data writing module and the memory, and is configured to be turned on for different data bits when the comparison result of the data bits is received, and to enable the data writing a connection between the module and the memory; otherwise, in a closed state, disconnecting the data write module from the memory.
  • the threshold comparison unit is a comparator
  • the data bit comparison unit is an exclusive OR gate
  • the same OR gate, and/or the gating unit is a multiplexer, and/or the switching unit is a tri-state gate.
  • the memory is a phase change memory or a resistive memory or a magnetic memory .
  • a storage device including a non-volatile memory for storing data; and any data writing device of an embodiment of the present invention.
  • the non-volatile memory is a phase change memory or a resistive memory or a magnetic memory.
  • the absolute difference between the two is compared with a preset threshold to determine the absolute difference. Whether it is within the tolerance range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated. Otherwise, the write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced.
  • FIG. 1 is a schematic flow chart of a data writing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of an example of a control module according to an embodiment of the present invention.
  • 4 is a circuit diagram of a data writing device according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
  • the data writing method of the embodiment of the present invention is performed, for example, by a data writing device, which can be integrated with a memory or independently of a memory, and can be used to implement the present invention.
  • the data writing method of the example is performed, for example, by a data writing device, which can be integrated with a memory or independently of a memory, and can be used to implement the present invention.
  • the data writing method of the example is performed, for example, by a data writing device, which can be integrated with a memory or independently of a memory, and can be used to implement the present invention.
  • the data writing method of the example is performed, for example, by a data writing device, which can be integrated with a memory or independently of a memory, and can be used to implement the present invention.
  • FIG. 1 is a schematic flow chart of a data writing method according to an embodiment of the present invention. As shown in FIG. 1, the data writing method includes:
  • the data writing device acquires new data to be written into the memory
  • the corresponding stored old data is read from the memory, and the new data is compared with the old data, and the absolute difference between the two is calculated.
  • the absolute value of the value For example, the new data is 64 (in binary representation 01000000) and the old data is 62 (in binary representation 00111 110).
  • the old data corresponding to the new data may be data recording the same information, for example, the pixel value of the recorded video.
  • the data writing device can acquire new data by any means, and can directly receive new data input by the user or acquire new data from any other device.
  • the data writing device and the periodic parameter detecting device report the newly detected parameters to the data writing device in cycles, and each time the data writing device receives the new data, the new data is written with the written data.
  • the corresponding parameters entered into the memory are compared and the absolute difference between the two is calculated.
  • the user selects an appropriate threshold in advance according to the needs of the application, and the threshold is an error threshold acceptable to the user.
  • the user configures the selected threshold into the data writing device. For example, for video applications, the user can tolerate slight deviations in pixel values. The difference between pixels with data of 64 and 62 is small, and changing the pixel size of 64 to 62 has little effect on video quality. Based on this error tolerance feature of the video application, the user can set the threshold of the video application to 2.
  • the data writing device After the data writing device obtains the absolute difference between the new data and the old data in step 101, the obtained absolute difference is compared with a pre-stored threshold to determine whether the absolute difference is greater than a threshold, for example, the above new When the data is 64 and the old data is 62, the absolute difference between the two is 2, and the threshold is 2, then the absolute difference is judged not to be greater than the threshold.
  • a threshold for example, the above new When the data is 64 and the old data is 62, the absolute difference between the two is 2, and the threshold is 2, then the absolute difference is judged not to be greater than the threshold.
  • new data is written to the memory to update the old data only when the result of the determination in step 102 is that the absolute difference is greater than the threshold. If the absolute difference is less than or equal to the threshold, then the difference between the new data and the old data is considered to be within the tolerance range acceptable to the user, and the old data is not updated, i.e., the stored data in the memory is maintained.
  • the absolute difference between the two is compared with a preset threshold to determine whether the absolute difference is Within the deviation range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated, otherwise
  • the write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced.
  • the memory is a new type of non-volatile memory with high write power consumption and limited write life, such as PCM, resistive memory (RRAM), and magnetic memory (MRAM), the data writing method of the above embodiment is beneficial. The effect is more obvious, which effectively improves the energy efficiency and life of the memory.
  • the data writing device reads the data stored in the memory, and when the data to be written is written to the memory in step 103, the specific reading and writing operation can be implemented in any manner.
  • a data writing device is implemented by a hardware circuit
  • a circuit for performing a data writing operation and a circuit for performing a data reading operation can be designed according to different memory characteristics. The embodiments of the present invention do not limit this.
  • writing the data to be written into the memory includes:
  • the different data bits are updated according to the data to be written. Specifically, when performing a data write operation in step 103, by comparing the data to be written with the stored data bit by bit, it is determined which data bits are the same, which data bits are different, and only are updated for different data bits. .
  • the pixel value to be written is 64 (in binary representation of 01000000), and the stored pixel value is 61 (in binary representation of 00111 101), Judging to know the pixel value to be written and existing If the absolute difference of the stored pixel values is greater than the threshold, the "01000000" and "001 11101" are compared bit by bit, and the data writing operation is performed only for the different data bits between the two, thereby further reducing the memory. Data write operation.
  • the experiment by the inventor of the present invention confirmed that, with the foreman video sequence as an example, compared with the existing write operation method (ie, the method of not reducing the write operation), the total number of writes of the memory after using the above data write method From 60,825,600 to 12,300,360 times, the maximum number of writes to memory has been reduced from 300 to 157, and energy efficiency and lifetime are significantly better than existing write operations.
  • the threshold reasonably and setting the threshold to 2
  • the structural similarity of the video is 0.9954, which is close to 1, and the video quality is still very good.
  • the above data writing method is not limited to being combined with the bit-by-bit data comparison writing method, and the method can be combined with other existing data writing methods, such as data inversion coding, to further reduce the memory write operation.
  • FIG. 2 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention.
  • the data writing device 20 includes an absolute difference obtaining module 21, a control module 22, and a data writing module 23, wherein:
  • the absolute difference obtaining module 21 is configured to obtain an absolute difference between the data to be written and the stored data in the memory;
  • the control module 22 is configured to determine whether the absolute difference is greater than a preset threshold; and when the determination is yes, control the data writing module 23 to perform an operation;
  • the data writing module 23 is configured to write the data to be written into the memory.
  • the specific flow of the data writing operation performed by the data writing device 20 is the same as the data writing method of the embodiment of the present invention, and therefore will not be described herein.
  • the absolute difference between the two is compared with a preset threshold to determine whether the absolute difference is Within the deviation range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated, otherwise The write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced.
  • the memory is a new type of non-volatile memory with high write power consumption and limited write life, for example
  • Resistive Memory RRAM
  • Magnetic Memory MRAM
  • the data writing operation of the memory writing device of the above embodiment is more effective, and the energy efficiency and lifetime of the memory are effectively improved.
  • control module is further configured to perform bit-by-bit data comparison between the data to be written and the stored data to determine different data bits; if it is determined that the absolute difference is known The value is greater than a preset threshold, and the data writing module is controlled to update the different data bits.
  • FIG. 3 is a schematic structural diagram of an example of a control module according to an embodiment of the present invention.
  • the control module 30 includes a threshold comparison unit 31, a data bit comparison unit 32, a gate unit 33, and a switch unit 34, where:
  • the threshold comparison unit 31 is configured to compare the absolute difference with the preset threshold, and provide a comparison result of whether the absolute difference is greater than the preset threshold to the strobe unit 33;
  • the data bit comparing unit 32 is configured to perform bit-by-bit data comparison between the data to be written and the stored data, and provide a comparison result of whether the data bits are the same to the gating unit 33;
  • the gating unit 33 is configured to: if the absolute difference is greater than the preset threshold, provide a comparison result of whether the data bits are the same to the switch unit 34, if the absolute difference is less than or equal to The preset threshold is provided, the comparison result that the absolute difference is less than or equal to the preset threshold is provided to the switch unit 34;
  • the switch unit 34 is connected between a data writing module (not shown in FIG. 3) and a memory (not shown in FIG. 3) for receiving a comparison result of whether the data bits are the same, Different data bits are turned on to turn on the connection between the data writing module and the memory; otherwise, in the off state, the connection between the data writing module and the memory is disconnected.
  • Each of the above control modules 30 can be implemented using an electronic device/circuit.
  • FIG. 4 is a circuit diagram of a data writing device 40 according to another embodiment of the present invention.
  • the video application is taken as an example for illustration.
  • each pixel in a video frame is represented by 8 bits (ie, 8 data bits), as shown in Figure 4 for data bits D0-D7.
  • the data writing device 40 is preliminarily configured with a threshold Th indicating a pixel deviation that the user can tolerate, and the threshold Th is a non-negative integer and is determined according to the user's request for video quality.
  • a read circuit 41 a write circuit 42 (ie, a data write module), an absolute difference calculator 43 (ie, an absolute difference acquisition module), and a control module are included, wherein the control In the module, the comparator 44 is used as the threshold comparison unit, the exclusive OR gate 45 is used as the data bit comparison unit, and the multiplexer (MUX) 46 is used as the strobe unit, and the three-state gate 47 with the high level conduction is used as the Switch unit.
  • the comparator 44 is used as the threshold comparison unit
  • the exclusive OR gate 45 is used as the data bit comparison unit
  • the multiplexer (MUX) 46 is used as the strobe unit
  • the three-state gate 47 with the high level conduction is used as the Switch unit.
  • the read circuit 41 and the write circuit 42 are used to read data from and write data to the memory, respectively, which can be directly implemented using a read/write circuit design method of an existing memory (for example, PCM).
  • PCM read/write circuit design method of an existing memory
  • the absolute difference calculator 43 is used to calculate the absolute difference between the new data Din to be written and the old data Dout read by the read circuit 41.
  • the absolute difference calculator 43 is connected to the comparator 44 to supply the absolute difference between the new data Din and the old data Dout to the comparator 44.
  • the comparator 44 stores the pre-configured threshold Th, and compares the absolute difference from the absolute difference calculator 43 with the threshold Th. For example, if the absolute difference is greater than the threshold Th, "11111111" is output, if the absolute difference is less than or equal to the threshold Th, output "00000000".
  • the comparator 44 uses the comparison result as the control signal of the multiplexer 46, and uses the comparison result as the "0" input signal of the multiplexer 46.
  • the new data Din and the old data Dout also serve as two inputs of the XOR gate 45, and the XOR gate 45 performs an exclusive OR operation on the new data Din and the old data Dout, and takes the result of the exclusive OR operation as the multiplexer 46. "1" input signal.
  • the multiplexer 46 is configured to strobe the first "0" input signal and the "1" input signal according to the control signal; when the control signal is "11111111”, strobe the "1" input signal, That is: the first "1” input signal is output to the self-connected tri-state gate 47; when the control signal is "00000000", the "0" input signal is gated, gp: the "0" input signal is output a three-state gate 47 connected to itself;
  • each pixel in the video frame is 8 bits
  • eight tristate gates 47 can be employed, and 8 bits of the signal output by the multiplexer 46 correspond to eight tristate gates 47-one. Due to this example The three-state gate 47 is turned on with a high level. Therefore, when the comparison result of the comparator 44 is "00000000", the eight tristate gates 47 are not turned on, and the write operation of the write circuit 42 is prohibited; when the comparator 44 When the comparison result is "1 111 111 1", the XOR operation result of the XOR gate 45 determines which of the three tri-state gates 47 is turned on and which is not, BP: Only the new data Din and the old data Dout are different. The bit corresponding to the three-state gate 47 is turned on, allowing the write operation of the write circuit 42.
  • the write circuit 42 can write the new data Din to the corresponding memory cell only when the tri-state gate 47 is turned on.
  • the hardware circuit of the above data writing device 40 is simple in implementation and low in area overhead.
  • circuit structure shown in FIG. 4 is only one example of the data writing device of the embodiment of the present invention, and those skilled in the art can apply the principle of the data writing device according to the embodiment of the present invention to the circuit structure and/or the specific The circuit components are modified.
  • a three-state gate with a low-level conduction is equivalent to: replacing the XOR gate with the same OR gate, and adding an inverse between the comparator and the input port of the "0" input signal of the multiplexer. Phase device.
  • the data writing device of the above embodiment can reasonably reduce the number of write operations by configuring a threshold greater than 0, when the data accuracy is extremely strict, it can also be implemented by setting the threshold to 0. Some data is written to the operation.
  • a storage device includes: a non-volatile memory for storing data; and any one of the data writing devices provided in the above embodiments.
  • the non-volatile memory may be a phase change memory or a resistive memory or a magnetic memory.

Abstract

Provided in an embodiment of the present invention are a data writing method and device, the method comprising: acquiring the absolute difference value between the to-be-written data and the data pre-stored in a memory; determining whether the absolute difference value is greater than a preset threshold; if yes, then writing the to-be-written data into the memory; otherwise, not performing the data writing operation. The data writing method and device provided in the embodiment of the present invention can effectively reduce the number of memory write operations, thus reducing undesirable effects thereof.

Description

数据写入方法及装置 本申请要求于 2012 年 10 月 10 日提交中国专利局、 申请号为 201210381337.2、 发明名称为"数据写入方法及装置 "的中国专利申请的优先 权, 其全部内容通过引用结合在本申请中。 技术领域  The present application claims priority to Chinese Patent Application No. 201210381337.2, entitled "Data Writing Method and Apparatus", filed on October 10, 2012, the entire contents of which are hereby incorporated by reference. Combined in this application. Technical field
本发明涉及数据存储技术, 尤其涉及一种数据写入方法及装置, 属于电 子技术领域。 背景技术  The present invention relates to data storage technologies, and in particular, to a data writing method and apparatus, and belongs to the field of electronic technology. Background technique
相变存储器(Phase Change Memory, PCM)是一种新型的非易失性存储 器, 它通过非晶态下的高电阻和结晶态下的低电阻分别来表示逻辑值 0和逻 辑值 1。相比于传统的静态随机存储器( Static Random Access Memory, SRAM) 和动态随机存储器 (Dynamic Random Access Memory, DRAM) , PCM在断 电后仍能保持所存储的数据, 存储密度更高, 几乎没有漏电, 而且具有更好 的可扩展性和容忍软错误的能力。 因此, PCM受到工业界和学术界的广泛关 注, 并有很大潜力替代传统存储器成为下一代存储器产品。 目前, 有些公司 已经制造出 PCM原型甚至开始量产 PCM。  Phase Change Memory (PCM) is a new type of non-volatile memory that represents a logic value of 0 and a logic value of 1, respectively, by a high resistance in the amorphous state and a low resistance in the crystalline state. Compared with the traditional Static Random Access Memory (SRAM) and Dynamic Random Access Memory (DRAM), the PCM can maintain the stored data after the power is cut off, the storage density is higher, and there is almost no leakage. , and has better scalability and the ability to tolerate soft errors. Therefore, PCM has received extensive attention from industry and academia, and has great potential to replace traditional memory as a next-generation memory product. Currently, some companies have already built PCM prototypes and even started mass production of PCM.
虽然 PCM具有诸多优势, 但是其写能耗高、 写次数有限、 写延迟大, 这 些与写操作有关的不良因素影响了 PCM的实际应用。因此, 如何降低在使用 PCM过程中由于写操作所带来的不良效果, 是极具意义的研究课题。 发明内容 针对现有技术中存在的缺陷, 本发明实施例提供一种数据写入方法及装 置, 用于有效减少对存储器进行写操作的次数, 从而降低所带来的不良效果。  Although PCM has many advantages, its write power consumption is high, write times are limited, and write latency is large. These bad factors related to write operations affect the practical application of PCM. Therefore, how to reduce the adverse effects caused by the write operation in the process of using PCM is a very significant research topic. SUMMARY OF THE INVENTION In view of the deficiencies in the prior art, embodiments of the present invention provide a data writing method and apparatus for effectively reducing the number of write operations to a memory, thereby reducing the adverse effects.
第一方面, 提供一种数据写入方法, 包括:  In a first aspect, a data writing method is provided, including:
获取待写入数据与存储器中已存储数据的绝对差值;  Obtaining an absolute difference between the data to be written and the stored data in the memory;
判断所述绝对差值是否大于预设阈值; 若判断为是, 则将所述待写入数据写入所述存储器; 否则, 不执行数据 写入操作。 Determining whether the absolute difference is greater than a preset threshold; If the determination is yes, the data to be written is written to the memory; otherwise, the data write operation is not performed.
在第一方面的第一种可能的实现方式中, 所述若判断为是, 则将所述待 写入数据写入所述存储器, 具体包括:  In a first possible implementation manner of the first aspect, if the determining is yes, writing the data to be written to the memory includes:
若判断为是,对所述待写入数据与所述已存储数据进行逐位的数据比较, 确定不同的数据位;  If the determination is yes, the data to be written and the stored data are compared bit by bit, and different data bits are determined;
根据所述待写入数据, 对所述不同的数据位进行更新。  The different data bits are updated according to the data to be written.
结合第一方面或第一方面的第一种可能的实现方式, 在第一方面的第二 种可能的实现方式中, 所述数据为视频数据或图像数据。  In conjunction with the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the data is video data or image data.
第二方面, 提供一种数据写入装置, 包括绝对差值获取模块、 控制模块 和数据写入模块, 其中:  In a second aspect, a data writing device is provided, including an absolute difference obtaining module, a control module, and a data writing module, wherein:
所述绝对差值获取模块, 用于获取待写入数据与存储器中已存储数据的 绝对差值;  The absolute difference obtaining module is configured to obtain an absolute difference between the data to be written and the stored data in the memory;
所述控制模块, 用于判断所述绝对差值是否大于预设阈值; 仅当判断为 是时, 控制所述数据写入模块执行操作;  The control module is configured to determine whether the absolute difference is greater than a preset threshold; and when the determination is yes, controlling the data writing module to perform an operation;
所述数据写入模块用于将所述待写入数据写入所述存储器。  The data writing module is configured to write the data to be written into the memory.
在第二方面的第一种可能的实现方式中, 所述控制模块还用于对所述待 写入数据与所述已存储数据进行逐位的数据比较, 确定不同的数据位; 若判 断获知所述绝对差值大于预设阈值, 控制所述数据写入模块对所述不同的数 据位进行更新。  In a first possible implementation manner of the second aspect, the control module is further configured to perform bit-by-bit data comparison between the data to be written and the stored data to determine different data bits; The absolute difference is greater than a preset threshold, and the data writing module is controlled to update the different data bits.
结合第二方面的第一种可能的实现方式, 在第二方面的第二种可能的实 现方式中, 所述控制模块包括阈值比较单元、 数据位比较单元、 选通单元和 开关单元, 其中:  With reference to the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, the control module includes a threshold comparison unit, a data bit comparison unit, a gate unit, and a switch unit, where:
所述阈值比较单元用于将所述绝对差值与所述预设阈值进行比较, 并将 所述绝对差值是否大于所述预设阈值的比较结果提供给所述选通单元;  The threshold comparison unit is configured to compare the absolute difference with the preset threshold, and provide a comparison result of whether the absolute difference is greater than the preset threshold to the gating unit;
所述数据位比较单元用于对所述待写入数据与所述已存储数据进行逐位 的数据比较, 并将各数据位是否相同的比较结果提供给所述选通单元;  The data bit comparing unit is configured to perform bit-by-bit data comparison between the data to be written and the stored data, and provide a comparison result of whether each data bit is the same to the gating unit;
所述选通单元用于若所述绝对差值大于所述预设阈值, 则将所述各数据 位是否相同的比较结果提供给所述开关单元, 若所述绝对差值小于等于所述 预设阈值, 则将所述绝对差值小于等于所述预设阈值的比较结果提供给所述 开关单元; The gating unit is configured to: if the absolute difference is greater than the preset threshold, provide a comparison result of whether the data bits are the same to the switch unit, if the absolute difference is less than or equal to the pre- Setting a threshold, the comparison result that the absolute difference is less than or equal to the preset threshold is provided to the Switch unit
所述开关单元连接在所述数据写入模块与所述存储器之间, 用于当接收 到所述各数据位是否相同的比较结果时, 针对不同的数据位开启, 导通所述 数据写入模块与所述存储器之间的连接; 否则, 处于关闭状态, 断开所述数 据写入模块与所述存储器之间的连接。  The switching unit is connected between the data writing module and the memory, and is configured to be turned on for different data bits when the comparison result of the data bits is received, and to enable the data writing a connection between the module and the memory; otherwise, in a closed state, disconnecting the data write module from the memory.
结合第二方面的第二种可能的实现方式, 在第二方面的第三种可能的实 现方式中, 所述阈值比较单元为比较器, 和 /或所述数据位比较单元为异或门 或同或门, 和 /或所述选通单元为多路选择器, 和 /或所述开关单元为三态门。  In conjunction with the second possible implementation of the second aspect, in a third possible implementation of the second aspect, the threshold comparison unit is a comparator, and/or the data bit comparison unit is an exclusive OR gate The same OR gate, and/or the gating unit is a multiplexer, and/or the switching unit is a tri-state gate.
结合第二方面或第二方面的第一至三中任一种可能的实现方式, 在第二 方面的第四种可能的实现方式中, 所述存储器为相变存储器或阻性存储器或 磁存储器。  With reference to the second aspect or any one of the first to third aspects of the second aspect, in a fourth possible implementation manner of the second aspect, the memory is a phase change memory or a resistive memory or a magnetic memory .
第三方面, 提供一种存储设备, 包括非易性存储器, 用于存储数据; 和 本发明实施例的任一数据写入装置。  In a third aspect, a storage device is provided, including a non-volatile memory for storing data; and any data writing device of an embodiment of the present invention.
在第三方面的第一种可能的实现方式中, 所述非易性存储器为相变存储 器或阻性存储器或磁存储器。  In a first possible implementation of the third aspect, the non-volatile memory is a phase change memory or a resistive memory or a magnetic memory.
根据本发明实施例的数据写入方法及装置, 通过获取待写入数据与存储 器中已存储数据的绝对差值, 将两者的绝对差值与预设阈值进行比较, 以判 断该绝对差值是否在用户接受的偏差范围内, 并仅当该绝对差值超出用户接 受的偏差范围, 即绝对差值大于预设阈值时, 将待写入数据写入存储器, 对 相应的已存储数据进行更新, 否则, 不执行写操作, 从而能够有效、 合理地 降低对存储器执行写操作所带来的不良效果。 附图说明  According to the data writing method and device of the embodiment of the present invention, by obtaining the absolute difference between the data to be written and the stored data in the memory, the absolute difference between the two is compared with a preset threshold to determine the absolute difference. Whether it is within the tolerance range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated. Otherwise, the write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附 图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创 造性劳动性的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. It is obvious that the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those skilled in the art without any inventive labor.
图 1为本发明一个实施例的数据写入方法的流程示意图。  FIG. 1 is a schematic flow chart of a data writing method according to an embodiment of the present invention.
图 2为本发明一个实施例的数据写入装置的结构示意图。  FIG. 2 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention.
图 3为本发明实施例中控制模块的一个示例的结构示意图。 图 4为本发明另一实施例的数据写入装置的电路示意图。 具体实施方式 本发明实施例的数据写入方法例如由一个数据写入装置来执行, 该数 据写入装置既可以与存储器集成设置, 也可以独立于存储器设置, 其均能 够用于实现本发明实施例的数据写入方法。 FIG. 3 is a schematic structural diagram of an example of a control module according to an embodiment of the present invention. 4 is a circuit diagram of a data writing device according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION The data writing method of the embodiment of the present invention is performed, for example, by a data writing device, which can be integrated with a memory or independently of a memory, and can be used to implement the present invention. The data writing method of the example.
图 1为本发明一个实施例的数据写入方法的流程示意图。如图 1所示, 该数据写入方法包括:  FIG. 1 is a schematic flow chart of a data writing method according to an embodiment of the present invention. As shown in FIG. 1, the data writing method includes:
101, 获取待写入数据与存储器中已存储数据的绝对差值;  101. Acquire an absolute difference between the data to be written and the stored data in the memory.
具体地, 数据写入装置获取到待写入存储器的新数据时, 从存储器中 读取相应的已存储的旧数据, 对新数据与旧数据进行比较, 计算两者的绝 对差值,即差值的绝对值。例如,新数据为 64(以二进制表示为 01000000 ), 旧数据为 62 (以二进制表示为 00111 110 ) 。 其中, 与新数据"相应的 "的 旧数据, 可以是记录同一信息的数据, 例如记录视频的像素值。 数据写入 装置可以通过任意方式获取新数据, 既可以直接接收用户输入的新数据, 也可以从任意其它设备获取新数据。 例如, 数据写入装置与周期性参数检 测设备, 该设备按周期将新检测到的参数上报给数据写入装置, 则数据写 入装置每次接收到新数据时, 将该新数据与已写入存储器的相应参数进行 比较, 计算两者的绝对差值。  Specifically, when the data writing device acquires new data to be written into the memory, the corresponding stored old data is read from the memory, and the new data is compared with the old data, and the absolute difference between the two is calculated. The absolute value of the value. For example, the new data is 64 (in binary representation 01000000) and the old data is 62 (in binary representation 00111 110). Among them, the old data corresponding to the new data may be data recording the same information, for example, the pixel value of the recorded video. The data writing device can acquire new data by any means, and can directly receive new data input by the user or acquire new data from any other device. For example, the data writing device and the periodic parameter detecting device report the newly detected parameters to the data writing device in cycles, and each time the data writing device receives the new data, the new data is written with the written data. The corresponding parameters entered into the memory are compared and the absolute difference between the two is calculated.
102, 判断所述绝对差值是否大于预设阈值;  102. Determine whether the absolute difference is greater than a preset threshold.
具体地, 用户预先根据应用的需求选择合适的阈值, 该阈值为用户可 以接受的错误阈值。 用户将所选择的阈值配置到数据写入装置中。 例如, 针对视频应用, 用户能够容忍像素值的轻微偏差, 数据为 64和 62的像素 之间的差别很小, 将数据为 64的像素改为 62对视频质量的影响也很小。 基于视频应用的这种差错容忍特性,用户可以将视频应用的阈值设定为 2。  Specifically, the user selects an appropriate threshold in advance according to the needs of the application, and the threshold is an error threshold acceptable to the user. The user configures the selected threshold into the data writing device. For example, for video applications, the user can tolerate slight deviations in pixel values. The difference between pixels with data of 64 and 62 is small, and changing the pixel size of 64 to 62 has little effect on video quality. Based on this error tolerance feature of the video application, the user can set the threshold of the video application to 2.
当数据写入装置在歩骤 101中获取到新数据与旧数据的绝对差值后, 将所获得的绝对差值与预先存储的阈值进行比较, 判断绝对差值是否大于 阈值, 例如, 上述新数据为 64、 旧数据为 62时, 两者的绝对差值为 2, 且阈值为 2 , 则判定绝对差值不大于阈值。  After the data writing device obtains the absolute difference between the new data and the old data in step 101, the obtained absolute difference is compared with a pre-stored threshold to determine whether the absolute difference is greater than a threshold, for example, the above new When the data is 64 and the old data is 62, the absolute difference between the two is 2, and the threshold is 2, then the absolute difference is judged not to be greater than the threshold.
103, 若判断为是, 则将所述待写入数据写入所述存储器; 否则, 不 执行数据写入操作。 103. If the determination is yes, the data to be written is written into the memory; otherwise, no Perform a data write operation.
具体地, 仅当歩骤 102的判断结果为绝对差值大于阈值时, 将新数据 写入存储器, 以对旧数据进行更新。 若绝对差值小于或等于阈值, 则认为 新数据与旧数据之间的差异在用户可以接受的偏差范围内, 不对旧数据进 行更新, 即维持所述存储器中的已存储数据不变。  Specifically, new data is written to the memory to update the old data only when the result of the determination in step 102 is that the absolute difference is greater than the threshold. If the absolute difference is less than or equal to the threshold, then the difference between the new data and the old data is considered to be within the tolerance range acceptable to the user, and the old data is not updated, i.e., the stored data in the memory is maintained.
根据本发明实施例的数据写入方法, 通过获取待写入数据与存储器中 已存储数据的绝对差值, 将两者的绝对差值与预设阈值进行比较, 以判断 该绝对差值是否在用户接受的偏差范围内, 并仅当该绝对差值超出用户接 受的偏差范围, 即绝对差值大于预设阈值时, 将待写入数据写入存储器, 对相应的已存储数据进行更新, 否则, 不执行写操作, 从而能够有效、 合 理地降低对存储器执行写操作所带来的不良效果。  According to the data writing method of the embodiment of the present invention, by obtaining the absolute difference between the data to be written and the stored data in the memory, the absolute difference between the two is compared with a preset threshold to determine whether the absolute difference is Within the deviation range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated, otherwise The write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced.
当存储器为写能耗高、 写寿命有限的新型非易性存储器时, 例如为 PCM、 阻性存储器 (RRAM) 、 磁存储器 (MRAM) 时, 采用上述实施例 的数据写入方法所获得的有益效果更为明显, 有效提高了存储器的能效和 寿命。  When the memory is a new type of non-volatile memory with high write power consumption and limited write life, such as PCM, resistive memory (RRAM), and magnetic memory (MRAM), the data writing method of the above embodiment is beneficial. The effect is more obvious, which effectively improves the energy efficiency and life of the memory.
上述数据写入方法中, 数据写入装置读取存储器中已存储的数据, 以 及在歩骤 103中将待写入数据写入存储器时, 具体的读写操作可以采用任 意方式实现。 例如当采用硬件电路实现数据写入装置时, 用于进行数据写 入操作的电路和用于进行数据读取操作的电路可以根据不同的存储器特 性而进行设计。 本发明实施例对此不做限制。  In the above data writing method, the data writing device reads the data stored in the memory, and when the data to be written is written to the memory in step 103, the specific reading and writing operation can be implemented in any manner. For example, when a data writing device is implemented by a hardware circuit, a circuit for performing a data writing operation and a circuit for performing a data reading operation can be designed according to different memory characteristics. The embodiments of the present invention do not limit this.
进一歩地, 在上述数据写入方法中, 所述若判断为是, 则将所述待写 入数据写入所述存储器, 具体包括:  Further, in the above data writing method, if the determination is yes, writing the data to be written into the memory includes:
对所述待写入数据与所述已存储数据进行逐位的数据比较, 确定不同 的数据位;  Comparing the data to be written with the stored data by bit by bit to determine different data bits;
若判断为是, 根据所述待写入数据, 对所述不同的数据位进行更新。 具体地, 在歩骤 103中执行数据写入操作时, 通过将待写入数据与已 存储数据进行逐位比较, 确定哪些数据位相同, 哪些数据位不同, 并仅针 对不同的数据位进行更新。 例如, 以上述视频应用的像素值为例, 若预设 的阈值为 2, 待写入像素值为 64 (以二进制表示为 01000000 ) , 已存储像 素值为 61 (以二进制表示为 00111 101 ) , 判断获知待写入像素值与已存 储像素值的绝对差值大于阈值, 则对" 01000000"与" 001 11101 "进行逐位比 较, 并仅针对两者之间的不同数据位进行数据写入操作, 从而进一歩减少 了对存储器的数据写入操作。 经本发明的发明人实验证实: 以 foreman视频序列为例, 与现有的写 操作方法 (即: 不使用减少写操作的方法) 相比, 使用上述数据写入方法 后, 存储器总的写次数从 60,825,600减少为 12,300,360次, 存储器的最大 写次数从 300减少为 157, 能效和寿命均明显优于现有的写操作方法。 通 过合理设置阈值, 以阈值设置为 2为例, 视频的结构相似度为 0.9954, 接 近于 1, 视频质量仍然很好。 If the determination is yes, the different data bits are updated according to the data to be written. Specifically, when performing a data write operation in step 103, by comparing the data to be written with the stored data bit by bit, it is determined which data bits are the same, which data bits are different, and only are updated for different data bits. . For example, taking the pixel value of the above video application as an example, if the preset threshold is 2, the pixel value to be written is 64 (in binary representation of 01000000), and the stored pixel value is 61 (in binary representation of 00111 101), Judging to know the pixel value to be written and existing If the absolute difference of the stored pixel values is greater than the threshold, the "01000000" and "001 11101" are compared bit by bit, and the data writing operation is performed only for the different data bits between the two, thereby further reducing the memory. Data write operation. The experiment by the inventor of the present invention confirmed that, with the foreman video sequence as an example, compared with the existing write operation method (ie, the method of not reducing the write operation), the total number of writes of the memory after using the above data write method From 60,825,600 to 12,300,360 times, the maximum number of writes to memory has been reduced from 300 to 157, and energy efficiency and lifetime are significantly better than existing write operations. By setting the threshold reasonably and setting the threshold to 2, the structural similarity of the video is 0.9954, which is close to 1, and the video quality is still very good.
上述数据写方法不局限于只与逐位数据比较写方法结合, 该方法也可 与其它现有数据写方法, 如数据翻转编码等相结合, 进一歩减少存储器的 写操作。  The above data writing method is not limited to being combined with the bit-by-bit data comparison writing method, and the method can be combined with other existing data writing methods, such as data inversion coding, to further reduce the memory write operation.
图 2为本发明一个实施例的数据写入装置的结构示意图。如图 2所示, 该数据写入装置 20包括绝对差值获取模块 21、控制模块 22和数据写入模 块 23, 其中:  FIG. 2 is a schematic structural diagram of a data writing apparatus according to an embodiment of the present invention. As shown in FIG. 2, the data writing device 20 includes an absolute difference obtaining module 21, a control module 22, and a data writing module 23, wherein:
所述绝对差值获取模块 21,用于获取待写入数据与存储器中已存储数 据的绝对差值;  The absolute difference obtaining module 21 is configured to obtain an absolute difference between the data to be written and the stored data in the memory;
所述控制模块 22, 用于判断所述绝对差值是否大于预设阈值; 仅当判 断为是时, 控制所述数据写入模块 23执行操作;  The control module 22 is configured to determine whether the absolute difference is greater than a preset threshold; and when the determination is yes, control the data writing module 23 to perform an operation;
所述数据写入模块 23用于将所述待写入数据写入所述存储器。  The data writing module 23 is configured to write the data to be written into the memory.
上述数据写入装置 20执行数据写入操作的具体流程与本发明实施例 的数据写入方法相同, 故此处不再赘述。  The specific flow of the data writing operation performed by the data writing device 20 is the same as the data writing method of the embodiment of the present invention, and therefore will not be described herein.
根据本发明实施例的数据写入装置, 通过获取待写入数据与存储器中 已存储数据的绝对差值, 将两者的绝对差值与预设阈值进行比较, 以判断 该绝对差值是否在用户接受的偏差范围内, 并仅当该绝对差值超出用户接 受的偏差范围, 即绝对差值大于预设阈值时, 将待写入数据写入存储器, 对相应的已存储数据进行更新, 否则, 不执行写操作, 从而能够有效、 合 理地降低对存储器执行写操作所带来的不良效果。  According to the data writing apparatus of the embodiment of the present invention, by obtaining the absolute difference between the data to be written and the stored data in the memory, the absolute difference between the two is compared with a preset threshold to determine whether the absolute difference is Within the deviation range accepted by the user, and only when the absolute difference exceeds the deviation range accepted by the user, that is, the absolute difference is greater than the preset threshold, the data to be written is written into the memory, and the corresponding stored data is updated, otherwise The write operation is not performed, so that the adverse effect of performing a write operation on the memory can be effectively and reasonably reduced.
当存储器为写能耗高、 写寿命有限的新型非易性存储器时, 例如为 PCM, 阻性存储器 (RRAM) 、 磁存储器 (MRAM) 时, 采用上述实施例 的数据写入装置对存储器进行数据写入操作所获得的有益效果更为明显, 有效提高了存储器的能效和寿命。 When the memory is a new type of non-volatile memory with high write power consumption and limited write life, for example In the case of PCM, Resistive Memory (RRAM), Magnetic Memory (MRAM), the data writing operation of the memory writing device of the above embodiment is more effective, and the energy efficiency and lifetime of the memory are effectively improved.
进一歩地, 在上述数据写入装置中, 控制模块还用于对所述待写入数 据与所述已存储数据进行逐位的数据比较, 确定不同的数据位; 若判断获 知所述绝对差值大于预设阈值, 控制所述数据写入模块对所述不同的数据 位进行更新。  Further, in the data writing device, the control module is further configured to perform bit-by-bit data comparison between the data to be written and the stored data to determine different data bits; if it is determined that the absolute difference is known The value is greater than a preset threshold, and the data writing module is controlled to update the different data bits.
根据上述数据写入装置, 进一歩减少了对存储器的数据写入操作。 图 3为本发明实施例中控制模块的一个示例的结构示意图。 如图 3所 示, 控制模块 30包括阈值比较单元 31、 数据位比较单元 32、 选通单元 33 和开关单元 34, 其中:  According to the above data writing device, the data writing operation to the memory is further reduced. FIG. 3 is a schematic structural diagram of an example of a control module according to an embodiment of the present invention. As shown in FIG. 3, the control module 30 includes a threshold comparison unit 31, a data bit comparison unit 32, a gate unit 33, and a switch unit 34, where:
所述阈值比较单元 31用于将所述绝对差值与所述预设阈值进行比较, 并将所述绝对差值是否大于所述预设阈值的比较结果提供给所述选通单 元 33 ;  The threshold comparison unit 31 is configured to compare the absolute difference with the preset threshold, and provide a comparison result of whether the absolute difference is greater than the preset threshold to the strobe unit 33;
所述数据位比较单元 32用于对所述待写入数据与所述已存储数据进 行逐位的数据比较, 并将各数据位是否相同的比较结果提供给所述选通单 元 33 ;  The data bit comparing unit 32 is configured to perform bit-by-bit data comparison between the data to be written and the stored data, and provide a comparison result of whether the data bits are the same to the gating unit 33;
所述选通单元 33 用于若所述绝对差值大于所述预设阈值, 则将所述 各数据位是否相同的比较结果提供给所述开关单元 34,若所述绝对差值小 于等于所述预设阈值, 则将所述绝对差值小于等于所述预设阈值的比较结 果提供给所述开关单元 34;  The gating unit 33 is configured to: if the absolute difference is greater than the preset threshold, provide a comparison result of whether the data bits are the same to the switch unit 34, if the absolute difference is less than or equal to The preset threshold is provided, the comparison result that the absolute difference is less than or equal to the preset threshold is provided to the switch unit 34;
所述开关单元 34连接在数据写入模块(图 3中未示出 )与存储器(图 3 中未示出) 之间, 用于当接收到所述各数据位是否相同的比较结果时, 针对不同的数据位开启, 导通所述数据写入模块与所述存储器之间的连 接; 否则, 处于关闭状态, 断开所述数据写入模块与所述存储器之间的连 接。  The switch unit 34 is connected between a data writing module (not shown in FIG. 3) and a memory (not shown in FIG. 3) for receiving a comparison result of whether the data bits are the same, Different data bits are turned on to turn on the connection between the data writing module and the memory; otherwise, in the off state, the connection between the data writing module and the memory is disconnected.
上述控制模块 30中的各单元均可采用电子器件 /电路来实现。  Each of the above control modules 30 can be implemented using an electronic device/circuit.
下面以一个具体电路为例, 对应用上述控制模块 30 的数据写入装置 的具体实现和操作流程进行详细说明。  The specific implementation and operation flow of the data writing device applying the above control module 30 will be described in detail below by taking a specific circuit as an example.
图 4为本发明另一实施例的数据写入装置 40的电路示意图。参照图 4, 并以视频应用为例进行说明。 例如, 视频帧中每个像素以 8比特 (即 8个 数据位) 表示, 如图 4中所示的数据位 D0-D7。 数据写入装置 40中预先 配置有指示用户可容忍的像素偏差的阈值 Th, 阈值 Th为非负的整数, 并 根据用户对视频质量的要求来确定。 FIG. 4 is a circuit diagram of a data writing device 40 according to another embodiment of the present invention. Referring to Figure 4, The video application is taken as an example for illustration. For example, each pixel in a video frame is represented by 8 bits (ie, 8 data bits), as shown in Figure 4 for data bits D0-D7. The data writing device 40 is preliminarily configured with a threshold Th indicating a pixel deviation that the user can tolerate, and the threshold Th is a non-negative integer and is determined according to the user's request for video quality.
在图 4所示的数据写入装置 40中, 包括读电路 41、 写电路 42 (即数 据写入模块) 、 绝对差值计算器 43 (即绝对差值获取模块) 和控制模块, 其中, 控制模块中, 采用比较器 44作为阈值比较单元, 采用异或门 45作 为数据位比较单元, 采用多路选择器 (MUX) 46 作为选通单元为, 采用 高电平导通的三态门 47作为开关单元。  In the data writing device 40 shown in FIG. 4, a read circuit 41, a write circuit 42 (ie, a data write module), an absolute difference calculator 43 (ie, an absolute difference acquisition module), and a control module are included, wherein the control In the module, the comparator 44 is used as the threshold comparison unit, the exclusive OR gate 45 is used as the data bit comparison unit, and the multiplexer (MUX) 46 is used as the strobe unit, and the three-state gate 47 with the high level conduction is used as the Switch unit.
其中, 读电路 41和写电路 42分别用于从存储器中读取数据和向存储 器写入数据, 它们可以直接使用现有的存储器(例如为 PCM)的读写电路 设计方法来实现。  Among them, the read circuit 41 and the write circuit 42 are used to read data from and write data to the memory, respectively, which can be directly implemented using a read/write circuit design method of an existing memory (for example, PCM).
绝对差值计算器 43用于计算待写入的新数据 Din与读电路 41读出的 旧数据 Dout之间的绝对差值。 绝对差值计算器 43与比较器 44连接, 将 新数据 Din与旧数据 Dout之间的绝对差值提供给比较器 44。  The absolute difference calculator 43 is used to calculate the absolute difference between the new data Din to be written and the old data Dout read by the read circuit 41. The absolute difference calculator 43 is connected to the comparator 44 to supply the absolute difference between the new data Din and the old data Dout to the comparator 44.
比较器 44存储预先配置的阈值 Th, 将来自绝对差值计算器 43 的绝 对差值与阈值 Th 进行比较, 例如, 若绝对差值大于阈值 Th, 输出 "11111111", 若绝对差值小于等于阈值 Th, 输出" 00000000"。 比较器 44 将比较结果作为多路选择器 46 的控制信号, 并将比较结果作为多路选择 器 46的第" 0"路输入信号。  The comparator 44 stores the pre-configured threshold Th, and compares the absolute difference from the absolute difference calculator 43 with the threshold Th. For example, if the absolute difference is greater than the threshold Th, "11111111" is output, if the absolute difference is less than or equal to the threshold Th, output "00000000". The comparator 44 uses the comparison result as the control signal of the multiplexer 46, and uses the comparison result as the "0" input signal of the multiplexer 46.
新数据 Din和旧数据 Dout还作为异或门 45的两个输入, 异或门 45 对新数据 Din和旧数据 Dout进行异或操作, 并将异或操作的结果作为多 路选择器 46的第" 1"路输入信号。  The new data Din and the old data Dout also serve as two inputs of the XOR gate 45, and the XOR gate 45 performs an exclusive OR operation on the new data Din and the old data Dout, and takes the result of the exclusive OR operation as the multiplexer 46. "1" input signal.
多路选择器 46用于根据控制信号,对第" 0"路输入信号和第" 1"路输入 信号进行选通; 当控制信号为 "11111111"时, 选通第 "1"路输入信号, 即: 将第 "1"路输入信号输出给自身连接的三态门 47 ; 当控制信号为 "00000000"时, 选通第 "0"路输入信号, gp : 将第" 0"路输入信号输出给自 身连接的三态门 47;  The multiplexer 46 is configured to strobe the first "0" input signal and the "1" input signal according to the control signal; when the control signal is "11111111", strobe the "1" input signal, That is: the first "1" input signal is output to the self-connected tri-state gate 47; when the control signal is "00000000", the "0" input signal is gated, gp: the "0" input signal is output a three-state gate 47 connected to itself;
当视频帧中每个像素为 8比特时, 可以采用 8个三态门 47, 多路选择 器 46输出的信号的 8个比特与 8个三态门 47—一对应。 由于此示例中采 用高电平导通的三态门 47, 因此, 当比较器 44的比较结果为 "00000000" 时, 8个三态门 47均不导通, 禁止写电路 42的写操作; 当比较器 44的比 较结果为" 1 111 111 1"时, 异或门 45的异或操作结果决定 8个三态门 47中 哪个导通、 哪个不导通, BP : 仅新数据 Din和旧数据 Dout不相同的比特 位对应三态门 47导通, 允许写电路 42的写操作。 When each pixel in the video frame is 8 bits, eight tristate gates 47 can be employed, and 8 bits of the signal output by the multiplexer 46 correspond to eight tristate gates 47-one. Due to this example The three-state gate 47 is turned on with a high level. Therefore, when the comparison result of the comparator 44 is "00000000", the eight tristate gates 47 are not turned on, and the write operation of the write circuit 42 is prohibited; when the comparator 44 When the comparison result is "1 111 111 1", the XOR operation result of the XOR gate 45 determines which of the three tri-state gates 47 is turned on and which is not, BP: Only the new data Din and the old data Dout are different. The bit corresponding to the three-state gate 47 is turned on, allowing the write operation of the write circuit 42.
由于三态门 47连接在写电路 42与存储器的各存储单元之间, 因此仅 当三态门 47导通时, 写电路 42能够将新数据 Din写入相应的存储单元。  Since the tri-state gate 47 is connected between the write circuit 42 and each memory cell of the memory, the write circuit 42 can write the new data Din to the corresponding memory cell only when the tri-state gate 47 is turned on.
上述数据写入装置 40的硬件电路实现简单, 面积开销低。  The hardware circuit of the above data writing device 40 is simple in implementation and low in area overhead.
图 4所示的电路结构仅为本发明实施例的数据写入装置的一个示例, 本领域的技术人员能够基于本发明实施例的数据写入装置的原理, 对电路 结构和 /或采用的具体电路元件进行修改。例如,采用低电平导通的三态门, 相当地: 用同或门替换异或门, 并在比较器与多路选择器的第" 0"路输入 信号的输入端口之间增设一个反相器。  The circuit structure shown in FIG. 4 is only one example of the data writing device of the embodiment of the present invention, and those skilled in the art can apply the principle of the data writing device according to the embodiment of the present invention to the circuit structure and/or the specific The circuit components are modified. For example, a three-state gate with a low-level conduction is equivalent to: replacing the XOR gate with the same OR gate, and adding an inverse between the comparator and the input port of the "0" input signal of the multiplexer. Phase device.
此外, 上述实施例的数据写入装置虽然可以通过配置大于 0的阈值来 合理减少写操作的次数, 但当对数据准确性要求极为严格时, 其也可以通 过将阈值配置为 0, 来实现现有的数据写入操作。  In addition, although the data writing device of the above embodiment can reasonably reduce the number of write operations by configuring a threshold greater than 0, when the data accuracy is extremely strict, it can also be implemented by setting the threshold to 0. Some data is written to the operation.
另一个实施例中, 一种存储设备, 包括: 非易性存储器, 用于存储数 据; 和上述实施例中提供的任意一个数据写入装置。  In another embodiment, a storage device includes: a non-volatile memory for storing data; and any one of the data writing devices provided in the above embodiments.
具体的, 非易性存储器可以为相变存储器或阻性存储器或磁存储器。 最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修 改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不 使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。  Specifically, the non-volatile memory may be a phase change memory or a resistive memory or a magnetic memory. It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 书 claims
1、 一种数据写入方法, 其特征在于, 包括: 1. A data writing method, characterized by including:
获取待写入数据与存储器中已存储数据的绝对差值; Get the absolute difference between the data to be written and the data stored in the memory;
判断所述绝对差值是否大于预设阈值; Determine whether the absolute difference is greater than a preset threshold;
若判断为是, 则将所述待写入数据写入所述存储器; 否则, 不执行数据 写入操作。 If the determination is yes, the data to be written is written into the memory; otherwise, the data writing operation is not performed.
2、根据权利要求 1所述的数据写入方法,其特征在于,所述若判断为是, 则将所述待写入数据写入所述存储器, 具体包括: 2. The data writing method according to claim 1, wherein if the determination is yes, then writing the data to be written into the memory specifically includes:
若判断为是,对所述待写入数据与所述已存储数据进行逐位的数据比较, 确定不同的数据位; If it is determined to be yes, compare the data to be written and the stored data bit by bit to determine the different data bits;
根据所述待写入数据, 对所述不同的数据位进行更新。 The different data bits are updated according to the data to be written.
3、 根据权利要求 1-2所述的任一数据写入方法, 其特征在于, 所述数据 为视频数据或图像数据。 3. Any data writing method according to claims 1-2, characterized in that the data is video data or image data.
4、 一种数据写入装置, 其特征在于, 包括绝对差值获取模块、 控制模块 和数据写入模块, 其中: 4. A data writing device, characterized by including an absolute difference acquisition module, a control module and a data writing module, wherein:
所述绝对差值获取模块, 用于获取待写入数据与存储器中已存储数据的 绝对差值; The absolute difference acquisition module is used to obtain the absolute difference between the data to be written and the data stored in the memory;
所述控制模块, 用于判断所述绝对差值是否大于预设阈值; 仅当判断为 是时, 控制所述数据写入模块执行操作; The control module is used to determine whether the absolute difference is greater than a preset threshold; only when the determination is yes, control the data writing module to perform an operation;
所述数据写入模块用于将所述待写入数据写入所述存储器。 The data writing module is used to write the data to be written into the memory.
5、 根据权利要求 4所述的数据写入装置, 其特征在于, 所述控制模块还 用于对所述待写入数据与所述已存储数据进行逐位的数据比较, 确定不同的 数据位; 若判断获知所述绝对差值大于预设阈值, 控制所述数据写入模块对 所述不同的数据位进行更新。 5. The data writing device according to claim 4, wherein the control module is also used to compare the data to be written and the stored data bit by bit to determine different data bits. ; If it is determined that the absolute difference is greater than the preset threshold, control the data writing module to update the different data bits.
6、 根据权利要求 5所述的数据写入装置, 其特征在于, 所述控制模块包 括阈值比较单元、 数据位比较单元、 选通单元和开关单元, 其中: 6. The data writing device according to claim 5, characterized in that the control module includes a threshold comparison unit, a data bit comparison unit, a gating unit and a switch unit, wherein:
所述阈值比较单元用于将所述绝对差值与所述预设阈值进行比较, 并将 所述绝对差值是否大于所述预设阈值的比较结果提供给所述选通单元; The threshold comparison unit is used to compare the absolute difference with the preset threshold, and provide the comparison result of whether the absolute difference is greater than the preset threshold to the gating unit;
所述数据位比较单元用于对所述待写入数据与所述已存储数据进行逐位 的数据比较, 并将各数据位是否相同的比较结果提供给所述选通单元; 所述选通单元用于若所述绝对差值大于所述预设阈值, 则将所述各数据 位是否相同的比较结果提供给所述开关单元, 若所述绝对差值小于等于所述 预设阈值, 则将所述绝对差值小于等于所述预设阈值的比较结果提供给所述 开关单元; The data bit comparison unit is used to perform a bit-by-bit data comparison between the data to be written and the stored data, and provide a comparison result of whether each data bit is the same to the gating unit; The gating unit is used to provide the comparison result of whether the data bits are the same to the switching unit if the absolute difference is greater than the preset threshold. If the absolute difference is less than or equal to the preset threshold, If a threshold is set, then the comparison result that the absolute difference is less than or equal to the preset threshold is provided to the switch unit;
所述开关单元连接在所述数据写入模块与所述存储器之间, 用于当接收 到所述各数据位是否相同的比较结果时, 针对不同的数据位开启, 导通所述 数据写入模块与所述存储器之间的连接; 否则, 处于关闭状态, 断开所述数 据写入模块与所述存储器之间的连接。 The switch unit is connected between the data writing module and the memory, and is used to turn on different data bits when receiving a comparison result of whether the data bits are the same, and conduct the data writing. The connection between the module and the memory; otherwise, it is in a closed state and the connection between the data writing module and the memory is disconnected.
7、 根据权利要求 6所述的数据写入装置, 其特征在于, 所述阈值比较单 元为比较器, 和 /或所述数据位比较单元为异或门或同或门, 和 /或所述选通单 元为多路选择器, 和 /或所述开关单元为三态门。 7. The data writing device according to claim 6, characterized in that: the threshold comparison unit is a comparator, and/or the data bit comparison unit is an XOR gate or an XOR gate, and/or the The gating unit is a multiplexer, and/or the switch unit is a three-state gate.
8、 根据权利要求 4-7所述的任一数据写入装置, 其特征在于, 所述存储 器为相变存储器或阻性存储器或磁存储器。 8. The data writing device according to any one of claims 4 to 7, characterized in that the memory is a phase change memory, a resistive memory or a magnetic memory.
9、 一种存储设备, 其特征在于, 包括: 9. A storage device, characterized by including:
非易性存储器, 用于存储数据; 和 Non-volatile memory, used to store data; and
根据权利要求 4-7中所述的任一数据写入装置。 A data writing device according to any one of claims 4-7.
10、 根据权利要求 9所述的存储设备, 其特征在于, 所述非易性存储器 为相变存储器或阻性存储器或磁存储器。 10. The storage device according to claim 9, characterized in that the non-volatile memory is a phase change memory, a resistive memory or a magnetic memory.
PCT/CN2013/076988 2012-10-10 2013-06-08 Data writing method and device WO2014056330A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210381337.2 2012-10-10
CN201210381337.2A CN103730155B (en) 2012-10-10 2012-10-10 Method for writing data and device

Publications (1)

Publication Number Publication Date
WO2014056330A1 true WO2014056330A1 (en) 2014-04-17

Family

ID=50454197

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/076988 WO2014056330A1 (en) 2012-10-10 2013-06-08 Data writing method and device

Country Status (2)

Country Link
CN (1) CN103730155B (en)
WO (1) WO2014056330A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016008070A1 (en) * 2014-07-14 2016-01-21 华为技术有限公司 Data writing method and device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105468533B (en) * 2014-09-10 2019-02-19 华为技术有限公司 Method for writing data, device and memory
CN106155596B (en) * 2016-08-03 2020-01-17 深圳市文鼎创数据科技有限公司 Data writing method and device
CN109510739A (en) * 2018-12-26 2019-03-22 上海新储集成电路有限公司 A kind of data transmission method applied to data center
CN111308140A (en) * 2020-02-28 2020-06-19 宁波三星医疗电气股份有限公司 Difference type active reporting meter reading method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5784320A (en) * 1996-09-27 1998-07-21 Intel Corporation Method and apparatus for reducing power consumption in a memory by employing a conditional write controller
CN101329907A (en) * 2008-07-24 2008-12-24 中国科学院上海微系统与信息技术研究所 System and method for reducing programming power consumption of phase-change memory
CN102043591A (en) * 2010-11-24 2011-05-04 清华大学 Write operation method for phase-change random access memory (PRAM)
CN102592665A (en) * 2011-10-24 2012-07-18 北京时代全芯科技有限公司 High-speed data writing structure and writing method for phase change memory

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW462015B (en) * 2000-05-22 2001-11-01 Inst Information Industry Data access method capable of reducing the number of erasing to flash memory and data patch and access device using the same
NZ562200A (en) * 2007-10-04 2008-11-28 Arc Innovations Ltd Method and system for updating a stored data value in a non-volatile memory
JP5359570B2 (en) * 2009-06-03 2013-12-04 富士通株式会社 Memory test control apparatus and memory test control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5784320A (en) * 1996-09-27 1998-07-21 Intel Corporation Method and apparatus for reducing power consumption in a memory by employing a conditional write controller
CN101329907A (en) * 2008-07-24 2008-12-24 中国科学院上海微系统与信息技术研究所 System and method for reducing programming power consumption of phase-change memory
CN102043591A (en) * 2010-11-24 2011-05-04 清华大学 Write operation method for phase-change random access memory (PRAM)
CN102592665A (en) * 2011-10-24 2012-07-18 北京时代全芯科技有限公司 High-speed data writing structure and writing method for phase change memory

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016008070A1 (en) * 2014-07-14 2016-01-21 华为技术有限公司 Data writing method and device
CN105518790A (en) * 2014-07-14 2016-04-20 华为技术有限公司 Data writing method and device
CN105518790B (en) * 2014-07-14 2019-05-28 华为技术有限公司 The method and device of data write-in

Also Published As

Publication number Publication date
CN103730155A (en) 2014-04-16
CN103730155B (en) 2018-05-29

Similar Documents

Publication Publication Date Title
TWI551992B (en) Improving resistive memory write operation with merged reset
WO2014056330A1 (en) Data writing method and device
CN107408099B (en) Impedance compensation based on detecting sensor data
EP3382565B1 (en) Selective noise tolerance modes of operation in a memory
JP5337277B1 (en) Magnetic random access memory and memory system
TW202034173A (en) Reduce system active power based on memory usage patterns
US10163502B2 (en) Selective performance level modes of operation in a non-volatile memory
US11615214B2 (en) Cryptographic key management
TW201835778A (en) Providing single data rate (sdr) mode or double data rate (ddr) mode for the command and address (ca) bus of registering clock drive (rcd) for dynamic random access memory (dram)
US10553286B2 (en) Tailoring timing offsets during a programming pulse for a memory device
CN110362271A (en) The soft reading of side
EP2881951A1 (en) Write operation method and device for phase-change memory
Xu et al. Encoding separately: An energy-efficient write scheme for MLC STT-RAM
US20240004787A1 (en) Techniques for suspend operations
US20220148639A1 (en) Training for chip select signal read operations by memory devices
US11886266B2 (en) Dynamic power control
US9824737B2 (en) Memory circuit and method for operating a first and a second set of memory cells in direct memory access mode with refresh
US11704047B2 (en) Temperature readings for memory devices to reduce temperature compensation errors
US10224928B1 (en) On-die impedance calibration
US9305647B2 (en) Write operation method and device for phase change memory
US10838901B1 (en) System and method for a reconfigurable controller bridge chip
US8971105B2 (en) Methods and apparatuses for controlling memory write sequences
KR101521032B1 (en) Pipeline architecture for scalable performance on memory
US11830555B2 (en) Bias for data retention in fuse ROM and flash memory
US20220092014A1 (en) Method and apparatus to dynamically disable ethernet ports during system power on

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13845949

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13845949

Country of ref document: EP

Kind code of ref document: A1