A data processing method, apparatus, medium, and device
By performing specified error transformation and refresh frequency adjustment on the target data in the storage unit, the energy consumption and performance problems caused by frequent refreshes are solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202411624793.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In memory cells, frequent refresh operations not only reduce the storage performance of eDRAM, but also increase the energy consumption of refresh operations, especially when the data scale increases.
By acquiring the target data and assuming that it only has a specified error in the storage unit, data transformation is performed, the refresh frequency of the storage unit is adjusted, and the sign bit and data bit are restored when reading data, thereby reducing the refresh frequency to reduce energy consumption.
It reduces the refresh frequency of storage units, reduces energy consumption and improves storage performance, while ensuring the accuracy of data processing tasks when reading data.
Smart Images

Figure CN119576227B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification relates to the technical field of computer, and particularly relates to a data processing method and device, medium and equipment. BACKGROUND
[0002] At present, with the rapid development of technologies such as big data, cloud computing and artificial intelligence, these technologies have been widely applied. Taking the machine learning technology as an example, in the neural network application scenario, the demand for data access and storage (hereinafter referred to as memory access) is increasing. However, in the traditional storage architecture, the storage unit and the processor are separated. With the increase of memory access times, the required bandwidth and energy consumption also increase, thereby forming a bottleneck between the high-speed computing capacity of the processor and the memory access performance of the storage unit.
[0003] In order to solve this problem, in the prior art, some computing processing units are integrated into the storage unit, so that part of the data processing task can be completed directly in the storage unit, and this method is called in-memory computing. In-memory computing can greatly reduce the transmission of data between the storage unit and the processor, thereby alleviating the bandwidth bottleneck and reducing the energy consumption. At the same time, since the embedded dynamic random access memory (eDRAM) has the advantages of high storage density, fast read-write speed and low power consumption, the eDRAM is widely applied and researched in the field of in-memory computing.
[0004] However, the eDRAM also faces some challenges. In order to ensure the accuracy of the data stored in the eDRAM, the data stored in the eDRAM needs to be refreshed regularly. However, during the refresh operation, the eDRAM cannot be accessed regularly, so frequent refresh operations not only reduce the storage performance of the eDRAM, but also increase the energy consumption required for the refresh operation. Especially, with the expansion of the scale of the stored data, the energy consumption problem caused by the refresh operation becomes more prominent.
[0005] Therefore, the present specification provides a data processing method, device, medium and equipment. SUMMARY
[0006] The present specification provides a data processing method, device, medium and equipment to partially solve the above problems existing in the prior art.
[0007] The present specification adopts the following technical solutions:
[0008] The present specification provides a data processing method, comprising:
[0009] obtaining target data, the target data being composed of a symbol bit and a data bit;
[0010] In the case that the target data is assumed to be stored in a storage unit only with a specified error, the target data is converted according to a data conversion mode corresponding to the specified error, to obtain converted data;
[0011] The converted data is stored in the storage unit, and the refresh frequency of the storage unit is adjusted, and the adjusted refresh frequency is less than the previous refresh frequency;
[0012] In the execution of a data processing task for the target data, the operation of reading the converted data from the storage unit is performed to obtain read data, and the sign bit of the read data is determined according to the specified error;
[0013] According to the sign bit of the read data, the data bit of the converted data is recovered to obtain the recovered data bit;
[0014] According to the sign bit of the read data and the recovered data bit, the data processing task for the target data is performed.
[0015] Optionally, the target data is converted according to the data conversion mode corresponding to the specified error to obtain converted data, specifically including:
[0016] When the specified error is that at least part of the data stored in the storage unit is changed from zero to one, it is determined whether the sign bit of the target data is zero;
[0017] If yes, the sign bit of the target data is copied, and the copied sign bit of the target data is combined with the data bit of the target data to obtain converted data;
[0018] If no, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain converted data.
[0019] Optionally, the target data is converted according to the data conversion mode corresponding to the specified error to obtain converted data, specifically including:
[0020] When the specified error is that at least part of the data stored in the storage unit is changed from zero to one, it is determined whether the sign bit of the target data is zero;
[0021] If yes, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain converted data;
[0022] If not, the sign bit of the target data is copied, and the sign bit of the copied target data is combined with the data bit of the target data to obtain the converted data.
[0023] Optionally, the sign bit of the read data is determined according to the specified error, and specifically includes:
[0024] The sign bit of the copied target data is determined from the storage unit.
[0025] The or operation is performed on the sign bit of the copied target data according to the specified error.
[0026] The or operation is performed on the sign bit of the copied target data, and the result of the or operation is determined as the sign bit of the read data.
[0027] Optionally, the data bit of the converted data is recovered according to the sign bit of the read data to obtain a recovered data bit, and specifically includes:
[0028] It is judged whether the sign bit of the read data is zero.
[0029] If yes, the data bit of the target data is determined from the storage unit as the recovered data bit.
[0030] If not, the data bit of the inverted target data is determined from the storage unit, and the data bit of the inverted target data is inverted to obtain the recovered data bit.
[0031] Optionally, the sign bit of the read data is determined according to the specified error, and specifically includes:
[0032] The sign bit of the copied target data is determined from the storage unit.
[0033] The and operation is performed on the sign bit of the copied target data according to the specified error.
[0034] The and operation is performed on the sign bit of the copied target data, and the result of the and operation is determined as the sign bit of the read data.
[0035] Optionally, the data bit of the converted data is recovered according to the sign bit of the read data to obtain a recovered data bit, and specifically includes:
[0036] It is judged whether the sign bit of the read data is zero.
[0037] If yes, the data bit of the inverted target data is determined from the storage unit, and the data bit of the inverted target data is inverted to obtain the recovered data bit.
[0038] If not, the data bits of the target data are determined from the storage unit as the recovered data bits.
[0039] The present specification provides a data processing apparatus, comprising:
[0040] An acquisition module is configured to acquire target data, the target data being composed of symbol bits and data bits;
[0041] A conversion module is configured to convert the target data according to a data conversion mode corresponding to a specified error, to obtain converted data, under the assumption that the target data is stored in a storage unit only with the specified error.
[0042] An adjustment module is configured to store the converted data to the storage unit and adjust a refresh frequency of the storage unit, the adjusted refresh frequency being less than the unadjusted refresh frequency.
[0043] A readout module is configured to read the converted data from the storage unit to obtain readout data when performing a data processing task for the target data, and determine symbol bits of the readout data according to the specified error.
[0044] A recovery module is configured to recover data bits of the converted data according to the symbol bits of the readout data, to obtain recovered data bits.
[0045] A processing module is configured to perform the data processing task for the target data according to the symbol bits of the readout data and the recovered data bits.
[0046] The present specification provides a computer readable storage medium, the storage medium storing a computer program, the computer program being executed by a processor to implement the above data processing method.
[0047] The present specification provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data processing method when executing the program.
[0048] The above at least one technical solution adopted by the present specification can achieve the following beneficial effects:
[0049] The data processing method provided in the specification first acquires target data composed of a symbol bit and a data bit. In the case of assuming that the target data stored in the storage unit only has a specified error, the target data is converted according to a data conversion mode corresponding to the specified error to obtain converted data. The converted data is stored in the storage unit, and the refresh frequency of the storage unit is adjusted. The adjusted refresh frequency is less than the refresh frequency before adjustment. When performing a data processing task for the target data, the operation of reading the converted data from the storage unit is performed to obtain read data, and the symbol bit of the read data is determined according to the specified error. According to the symbol bit of the read data, the data bit of the converted data is recovered to obtain the recovered data bit. According to the symbol bit of the read data and the recovered data bit, the data processing task for the target data is performed.
[0050] By processing the symbol bit and the data bit of the target data respectively according to the possible specified error of the storage unit before storing the data in the storage unit, when reading the data from the storage unit for data processing task, the read data is recovered according to the processing of the target data before storage, the influence of the storage unit itself on the data stored therein is reduced, and on the premise that the read data can still complete the data processing task well, the storage unit does not have to maintain a high frequency refresh operation, that is, the refresh frequency of the refresh operation is reduced, the energy consumption caused by the refresh operation is reduced, and the storage performance of the storage unit is improved. BRIEF DESCRIPTION OF DRAWINGS
[0051] The drawings described herein are used to provide further understanding of the specification, constitute a part of the specification, the illustrative embodiments of the specification and the description thereof are used to explain the specification, and do not constitute an improper limitation on the specification. In the drawings:
[0052] Figure 1 A flowchart of a data processing method provided for the embodiments of the specification;
[0053] Figure 2 A data processing diagram provided for the specification;
[0054] Figure 3 A framework diagram of a data processing provided for the specification;
[0055] Figure 4 A schematic diagram of a data processing apparatus provided for the specification;
[0056] Figure 5 A structural schematic diagram of an electronic device corresponding to Figure 1 provided for the specification. DETAILED DESCRIPTION
[0057] For the purposes of the present description, the technical solutions and advantages, the technical solutions of the present description will be described in detail below with reference to specific embodiments of the present description and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present description, not all embodiments. Based on the embodiments in the present description, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0058] The technical solutions provided by the embodiments of the present description will be described in detail below with reference to the drawings.
[0059] Figure 1 The flowchart of the data processing method provided by the embodiments of the present description includes the following steps:
[0060] S100: Obtain target data, the target data is composed of a sign bit and a data bit.
[0061] In the present description, the data storage and reading process can be performed by the server in the embodiments of the present description. Of course, the present description does not limit the device that performs the data storage and reading process, and terminal devices such as personal computers and mobile terminals can also be used to perform the data storage and reading process. For ease of description, the following describes the terminal device as the execution subject.
[0062] In one or more embodiments of the present description, the storage unit of the data stored by the terminal device is a memory such as a Dynamic Random Access Memory (DRAM) or an eDRAM. The subsequent description takes the eDRAM as an example to represent the storage unit as the eDRAM, and introduces the subsequent steps.
[0063] In one or more embodiments of the present description, the terminal device obtains target data. The target data is composed of a sign bit and a data bit, and the number of the sign bit represents the positive and negative of the target data. The sign bit is one to represent a negative number, and the sign bit is zero to represent a positive number. For example, the target data can be binary data 11011010 (-38). The sign bit is the first digit 1, indicating that the sign of the data is negative, and the data bit is the last seven digits 1011010. The target data can also be binary data 01001101 (77). The sign bit is the first digit 0, indicating that the sign of the data is positive, and the data bit is the last seven digits 1001101.
[0064] S102: In the case where it is assumed that the target data is stored in the storage unit only with a specified error, the target data is converted according to the data conversion mode corresponding to the specified error to obtain converted data.
[0065] In one or more embodiments of the present specification, in the case of assuming that the target data is stored in the storage unit without error or only with a specified error, the terminal device converts the target data according to a data conversion mode corresponding to the specified error to obtain converted data. Wherein, the manner of determining that the target data is stored in the storage unit with the specified error is not limited in the present specification, for example, according to the initial design information of the storage unit, the specified error condition that may occur when storing data is determined.
[0066] In the present specification, the case of the specified error occurring in the storage unit can be divided into two cases:
[0067] The first kind: the data stored in the storage unit may occur from one to zero. For example, taking the data 11011010 as an example, after storing it in the storage unit, it is assumed that the data from the 3rd bit and the 8th bit from right to left will occur from 1 to 0 error, that is, 11011010 becomes 01011010.
[0068] The second kind: the data stored in the storage unit may occur from zero to one. For example, taking the data 11011010 as an example, after storing it in the storage unit, it is assumed that the data from the 3rd bit and the 8th bit from right to left will occur from 0 to 1 error, that is, 11011010 becomes 11011110.
[0069] Then, for different cases of the specified error occurring in the storage unit, different data processing methods are given in the present specification.
[0070] Specifically, when the specified error is that at least part of the data stored in the storage unit changes from one to zero, the terminal device judges whether the sign bit of the target data is zero. If yes, the terminal device copies the sign bit of the target data, and combines the copied sign bit of the target data with the data bit of the target data to obtain the converted data. If not, the terminal device copies the sign bit of the target data, and inverts the data bit of the target data, and then the terminal device combines the copied sign bit of the target data with the inverted data bit to obtain the converted data.
[0071] For example, taking the target data 11011010 as an example, its symbol bit 1 is copied, and the symbol bit becomes 11. Since the symbol bit is 1, the data bit 1011010 is inverted to obtain the inverted data bit 0100101. The symbol bit 11 after the copying process is combined with the inverted data bit 0100101 to obtain the converted data 110100101. Taking the target data 01001101 as an example, its symbol bit 0 is copied, and the symbol bit becomes 00. Since the symbol bit is 0, the data bit 1001101 is not inverted. The symbol bit 00 after the copying process is combined with the data bit 1001101 to obtain the converted data 001001101.
[0072] Of course, when the specified error is that at least part of the data stored in the storage unit is changed from 0 to 1, the terminal device determines whether the symbol bit of the target data is 0. If yes, the terminal device copies the symbol bit of the target data, inverts the data bit of the target data, and then combines the symbol bit after the copying process with the inverted data bit to obtain the converted data. If no, the terminal device copies the symbol bit of the target data, and combines the symbol bit after the copying process with the data bit of the target data to obtain the converted data.
[0073] For example, taking the target data 01001101 as an example, its symbol bit is 0, and the data bit 1001101 is inverted to obtain the inverted data bit 0110010. The symbol bit 00 after the copying process is combined with the inverted data bit 0110010 to obtain the converted data 000110010. Taking the target data 11011010 as an example, its symbol bit is 1, and the data bit 1011010 is not inverted. The symbol bit 11 after the copying process is combined with the data bit 1011010 to obtain the converted data 111011010.
[0074] S104: store the converted data into the storage unit, and adjust the refresh frequency of the storage unit. The adjusted refresh frequency is less than the refresh frequency before the adjustment.
[0075] In one or more embodiments of the present specification, after the terminal device converts the target data to obtain the converted data, the terminal device can store the converted data into the storage unit. Then, the refresh frequency of the storage unit is adjusted, so that the adjusted refresh frequency is less than the refresh frequency before the adjustment.
[0076] The refresh frequency of the refresh operation of the storage unit is reduced, which not only reduces the energy consumption caused by the refresh operation, but also improves the storage performance of the storage unit. Of course, in the present specification, the refresh frequency of the storage unit can be reduced by increasing the refresh period and the like. The manner of adjusting the refresh frequency is not limited herein.
[0077] S106: In the execution of the data processing task for the target data, an operation of reading the converted data from the storage unit is performed to obtain read data, and the sign bit of the read data is determined according to the specified error.
[0078] S108: The data bit of the converted data is recovered according to the sign bit of the read data to obtain the recovered data bit.
[0079] S110: The data processing task for the target data is performed according to the sign bit of the read data and the recovered data bit.
[0080] In one or more embodiments of the present specification, the terminal device needs to read the stored data from the storage unit when performing the data processing task for the target data. Since the target data is converted during the process of storing the data into the storage unit, the terminal device needs to perform an operation of reading the converted data from the storage unit to obtain read data. And according to the specified error, the terminal device determines the sign bit of the read data. Then, according to the sign bit of the read data, the data bit of the converted data is recovered to obtain the recovered data bit. Finally, the terminal device can form the read data according to the sign bit of the read data and the recovered data bit, and perform the data processing task for the target data based on the read data.
[0081] Specifically, when no error occurs in the converted data stored in the storage unit or only part of the converted data changes from one to zero, the terminal device determines the sign bit of the copied target data from the storage unit, and determines the operation of the sign bit of the copied target data according to the specified error occurring in the stored data. Then, the sign bit of the copied target data is operated to determine the result of the operation as the sign bit of the read data. Finally, the terminal device determines whether the sign bit of the read data is zero. If yes, the terminal device determines the data bit of the target data from the storage unit as the recovered data bit. If not, the terminal device determines the inverted data bit of the target data from the storage unit, and inverts the inverted data bit of the target data to obtain the recovered data bit.
[0082] For example, when the converted data stored in the storage unit has only partial data changed from 1 to 0, and the specified error is further that the data in the 3rd and 8th bits from the right can be changed from 1 to 0, some examples are shown below for demonstration.
[0083] First example: when the target data is 11011010, the converted data after conversion is 110100101. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 11. The sign bit of the read data is obtained by performing OR operation on 11, which is 1. Since the sign bit of the read data is 1, the data bit in the converted data is the data bit of the target data after inversion, which is 0100101. The data bit after recovery is obtained by inversion, which is 1011010. Finally, the terminal device can obtain the read data 11011010 according to the sign bit 1 of the read data and the data bit 1011010 after recovery, which is consistent with the target data.
[0084] Second example: when the target data is 01001101, the converted data after conversion is 001001101. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 00. The sign bit of the read data is obtained by performing OR operation on 00, which is 0. Since the sign bit of the read data is 0, the data bit in the converted data is the data bit 1001101 of the target data as the data bit 1001101 after recovery. Finally, the terminal device can obtain the read data 01001101 according to the sign bit 0 of the read data and the data bit 1001101 after recovery, which is consistent with the target data.
[0085] Third example: when the target data is 10011000, the converted data after conversion is 111100111. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 11. The sign bit of the read data is obtained by performing OR operation on 11, which is 1. Since the sign bit of the read data is 1, the data bit in the converted data is the data bit 1100111 of the target data after inversion, which is the data bit 0011000 after recovery. Finally, the terminal device can obtain the read data 10011000 according to the sign bit 1 of the read data and the data bit 0011000 after recovery, which is consistent with the target data.
[0086] The fourth example: when the target data is 00110111, the converted data after conversion is 000110111. When the data after conversion does not have an error in the storage unit, the sign bit in the data after conversion is the sign bit of the target data after copying, which is the leftmost two digits 00. The sign bit of the read data is 0 obtained by performing an OR operation on 00. Since the sign bit of the read data is 0, the data bit in the data after conversion is the data bit 0110111 of the target data, which is used as the data bit after recovery. Finally, the terminal device can generate the read data 00110111 according to the sign bit 0 of the read data and the data bit 0110111 after recovery, which is consistent with the target data.
[0087] However, when at least part of the data stored in the storage unit after conversion is changed from 1 to 0, from the perspective of practical application, the storage unit that can be used for storage at present cannot guarantee that the data stored therein is still 100% accurate after being read out. The data processing method provided in the specification cannot achieve 100% recovery for the data with serious errors in the storage unit, but through the data processing method, the data read out from the storage unit is closer to the target data, and the influence on the calculation result in the neural network application is smaller. Therefore, when an error occurs, for example, the error of the data in the 3rd and 8th positions from right to left changes from 1 to 0.
[0088] The first example: when the target data is 11011010, the converted data after conversion is 110100101. When the data after conversion has an error in the storage unit, the data after conversion becomes 100100001. The sign bit in the data after conversion is the sign bit of the target data after copying, which is the leftmost two digits 10. The sign bit of the read data is 1 obtained by performing an OR operation on 10. Since the sign bit of the read data is 1, the data bit in the data after conversion is the data bit 0100001 of the target data after inversion, and the data bit after inversion is 1011110. Finally, the terminal device can generate the read data 11011110 according to the sign bit 1 of the read data and the data bit 1011110 after recovery. Compared with the target data 11011010 (-90), the read data 11011110 (-94), and the data 10011010 (-26) read out without conversion, the loss caused by the scheme provided in the specification is smaller, and is very close to the original data (target data).
[0089] The second example: when the target data is 10111000, the converted data after conversion is 111000111. When the converted data in the storage unit has an error, the converted data becomes 101000011. The sign bit in the converted data is the sign bit of the copied target data, which is the leftmost two digits 10. The 10 is subjected to an OR operation, and the sign bit of the read data is 1. Since the sign bit of the read data is 1, the data bit in the converted data is the data bit of the inverted target data 1000011, which is inverted to obtain the restored data bit 0111100. Finally, the terminal device can compose the read data 10111100 according to the sign bit 1 of the read data and the restored data bit 0111100. Compared with the target data 10111000 (-56), the read data 10111100 (-60), and the data 00111000 (56) read without conversion, the loss of the scheme provided in the specification is smaller, and is extremely close to the original data (target data).
[0090] The above examples are examples in which the specified error is a change from 1 to 0, but in actual applications, there can also be a case where at least part of the converted data stored in the storage unit changes from 0 to 1. Therefore, in the specification, when at least part of the converted data stored in the storage unit changes from 0 to 1, the terminal device determines the sign bit of the copied target data from the storage unit, and determines that the terminal device performs an AND operation on the sign bit of the copied target data according to the specified error occurring in the storage unit. The sign bit of the copied target data is subjected to an AND operation, and the result of the AND operation is determined as the sign bit of the read data. Finally, the terminal device determines whether the sign bit of the read data is zero. If so, the terminal device determines the data bit of the inverted target data from the storage unit, and inverts the data bit of the inverted target data to obtain the restored data bit. If not, the terminal device determines the data bit of the target data from the storage unit as the restored data bit.
[0091] For example, when the converted data stored in the storage unit has at least part of the data changing from 0 to 1, and the specified error further has a possibility of error from 0 to 1 at the 3rd and 8th bits from the right, the following examples are given to demonstrate some examples.
[0092] The first example: when the target data is 11011010, the converted data after conversion is 111011010. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 11. The 11 is subjected to AND operation to obtain the sign bit 1 of the read data. Since the sign bit of the read data is 1, the data bit in the converted data, i.e., the data bit 1011010 of the target data, is taken as the recovered data bit. Finally, the terminal device can compose the read data 11011010 according to the sign bit 1 of the read data and the recovered data bit 1011010, which is consistent with the target data.
[0093] The second example: when the target data is 01001101, the converted data after conversion is 000110010. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 00. The 00 is subjected to AND operation to obtain the sign bit 0 of the read data. Since the sign bit of the read data is 0, the data bit in the converted data, i.e., the data bit 0110010 of the target data after inversion, is subjected to inversion to obtain the recovered data bit 1001101. Finally, the terminal device can compose the read data 01001101 according to the sign bit 0 of the read data and the recovered data bit 1001101, which is consistent with the target data.
[0094] The third example: when the target data is 10011000, the converted data after conversion is 110011000. When the converted data has no error in the storage unit, the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 11. The 11 is subjected to AND operation to obtain the sign bit 1 of the read data. Since the sign bit of the read data is 1, the data bit in the converted data, i.e., the data bit 0011000 of the target data, is taken as the recovered data bit. Finally, the terminal device can compose the read data 10011000 according to the sign bit 1 of the read data and the recovered data bit 0011000, which is consistent with the target data.
[0095] The fourth example: when the target data is 00110111, the converted data after conversion is 001001000. When the data after conversion has no error in the storage unit, the sign bit in the data after conversion is the sign bit of the target data after copying, which is the leftmost two digits 00. The sign bit of the read data is 0 after the AND operation of 00. Since the sign bit of the read data is 0, the data bit in the data after conversion is the data bit of the target data after inversion, which is 1001000. The data bit after inversion is 0110111. Finally, the terminal device can generate the read data 00110111 according to the sign bit 0 of the read data and the data bit 0110111 after inversion, which is consistent with the target data.
[0096] Similar to the above-mentioned case where the specified error is from 1 to 0, the storage unit that can be used for storage at present cannot guarantee that the data stored therein is still 100% accurate after being read out. The data processing method provided in the specification cannot achieve 100% restoration for the data with serious errors in the storage unit, but the data read out from the storage unit is closer to the target data through the data processing method. Therefore, when the error occurs, for example, the error further occurs from the right to the left of the 3rd and 8th bits, from 0 to 1.
[0097] The first example: taking the target data 01001110 as an example, the converted data after conversion is 000110001. When the data after conversion has an error in the storage unit, the data after conversion becomes 010110101. The sign bit in the data after conversion is the sign bit of the target data after copying, which is the leftmost two digits 01. The sign bit of the read data is 0 after the AND operation of 01. Since the sign bit of the read data is 0, the data bit in the data after conversion is the data bit of the target data after inversion, which is 0110101. The data bit after inversion is 1001010. Finally, the terminal device can generate the read data 01001010 according to the sign bit 0 of the read data and the data bit 1001010 after inversion. Compared with the target data 01001110 (78), the read data 01001010 (74) is stored without conversion, and the read data is 11001110 (-78), which is less loss than the storage without conversion. The scheme provided in the specification has less loss and is very close to the original data (target data).
[0098] The second example: taking the target data 01001101 as an example, the converted data after conversion is 000110010. When the converted data in the storage unit has an error, the converted data becomes 010110110, and the sign bit in the converted data is the sign bit of the target data after copying, which is the leftmost two digits 01. The 01 is subjected to an AND operation to obtain the sign bit 0 of the read data. Since the sign bit of the read data is 0, the data bit in the converted data is the data bit after inversion of the target data 0110110, and the inverted data bit is obtained after inversion to obtain the restored data bit 1001001. Finally, the terminal device can compose the read data 01001001 according to the sign bit 0 of the read data and the restored data bit 1001001. Compared with the target data 01001101 (77), the read data 01001001 (73) is not converted and stored, and the read data is 10001001 (-77). Compared with the loss caused by not converting and storing, the loss of the scheme provided in the specification is smaller, and is very close to the original data (target data).
[0099] In addition, in the specification, the terminal device can also allocate correction to the sign bit of the target data through the error correction code (ECC) method.
[0100] Figure 2 A schematic diagram of data processing provided in the specification is shown in FIG. 1. Figure 2 As shown in FIG. 1, the target data 01001101 is converted into converted data 000110010 after the sign bit is copied and the data bit is inverted. After storing it in the storage unit, it is assumed that the data in the third and eighth bits from the right changes from 0 to 1, and the converted data becomes 010110110. After reading the data, the sign bit is subjected to an AND operation to obtain the sign bit 0. Then, the data bit is restored to obtain the read data 01001001.
[0101] By copying the sign bit of the target data, the different specified errors that may occur in the storage unit are corrected, so that when reading data from the storage unit, the sign bit can be corrected through logical operation, so that the probability of sign bit error is greatly reduced. And the sign bit judges the specific operation on the data bit, improves the accuracy of the converted data and reduces the influence of the calculation result in the neural network application, reduces the frequency of refreshing operation of the storage unit, improves the storage performance of the storage unit, and reduces the energy consumption required for refreshing.
[0102] Figure 3A schematic diagram of a data processing framework is provided in the present specification. The terminal device determines whether the specified error of the storage unit is from 1 to 0. If yes, the terminal device copies the sign bit of the target data, and determines whether the sign bit is 0, so as to determine the conversion mode of the target data and store the converted data. Similarly, if the specified error of the storage unit is not from 1 to 0, the terminal device copies the sign bit of the target data, and determines whether the sign bit is 0, so as to determine the conversion mode of the target data and store the converted data. When the converted data is stored in the storage unit, an error may occur, and when the converted data is read, it is also necessary to determine whether the sign bit of the read converted data is 0, so as to determine the recovery mode of the converted data and determine the read data for data processing tasks.
[0103] In addition, in the present specification, when the data bit of the target data is inverted, the direct inversion can also not be performed, and the data bit of the target data is inverted by the two-bit complement representation method. Although the calculation process is more complex than the direct inversion in the recovery operation of the data bit of the target data, the recovery accuracy is also increased.
[0104] It is worth noting that the data processing method provided in the present specification can effectively improve the error resistance of eDRAM in-memory computing according to the error characteristic information of eDRAM and the characteristics of neural network calculation, significantly improve the maximum refresh period of eDRAM, and reduce the additional performance consumption and power consumption caused by refreshing. Moreover, according to simulation tests, for a 28nm 3T structure eDRAM in-memory computing design, the method involved in the present specification can improve the maximum refresh period by about 98-100%.
[0105] Moreover, when the eDRAM is used to store the weight data generated in the neural network training process, in the case of smaller weight values stored in the eDRAM (usually for larger neural networks), the data processing method proposed in the present specification can make more data bits not affected by the error characteristic information, reduce the error probability, and improve the error resistance effect more significantly.
[0106] On the other hand, if the eDRAM is only used to store the weight data of the neural network, the data processing method can also be applied to the refresh optimization of the near-memory computing design or the pure storage module. Further, if the DRAM is used to store the weight data of the neural network, the data processing method can also be applied to the refresh optimization of the DRAM in-memory computing, near-memory computing design or storage module, to reduce the refresh period. Moreover, if the eDRAM or DRAM has partitioned refresh management and a certain interval is used to store the weight data of the neural network, the storage interval can also use the data processing method for refresh optimization to reduce the refresh period, reduce the refresh power consumption, and improve the storage performance.
[0107] The data processing method provided in the above one or more embodiments of the present specification is based on the same idea, and the present specification also provides a corresponding data processing device, as shown in Figure 4
[0108] Figure 4 The schematic diagram of the data processing device provided in the present specification specifically includes:
[0109] The acquisition module 400 is configured to acquire target data composed of a sign bit and a data bit.
[0110] The conversion module 402 is configured to convert the target data according to a data conversion mode corresponding to a specified error, to obtain converted data, under the assumption that the target data is stored in a storage unit only with the specified error.
[0111] The adjustment module 404 is configured to store the converted data to the storage unit and adjust the refresh frequency of the storage unit, wherein the adjusted refresh frequency is less than the previous refresh frequency.
[0112] The readout module 406 is configured to perform an operation of reading the converted data from the storage unit to obtain readout data when performing a data processing task for the target data, and determine the sign bit of the readout data according to the specified error.
[0113] The recovery module 408 is configured to recover the data bit of the converted data according to the sign bit of the readout data to obtain recovered data bits.
[0114] The processing module 410 is configured to perform the data processing task for the target data according to the sign bit of the readout data and the recovered data bits.
[0115] Optionally, the conversion module 402 is configured to determine whether the sign bit of the target data is zero when the specified error is at least part of the data stored in the storage unit being zero, if yes, copy the sign bit of the target data, and combine the copied sign bit of the target data with the data bit of the target data to obtain converted data, if not, copy the sign bit of the target data, and invert the data bit of the target data, and combine the copied sign bit of the target data with the inverted data bit to obtain converted data.
[0116] Optionally, the conversion module 402 is configured to determine whether the sign bit of the target data is zero when the specified error is at least part of the data stored in the storage unit is changed from zero to one, copy the sign bit of the target data if yes, perform an inversion on the data bit of the target data, combine the copied sign bit of the target data with the inverted data bit to obtain converted data, and copy the sign bit of the target data if no, and combine the copied sign bit of the target data with the data bit of the target data to obtain converted data.
[0117] Optionally, the conversion module 402 is configured to determine the copied sign bit of the target data from the storage unit, determine to perform an OR operation on the copied sign bit of the target data according to the specified error, perform the OR operation on the copied sign bit of the target data, and determine the result of the OR operation as the sign bit of the read-out data.
[0118] Optionally, the conversion module 402 is configured to determine whether the sign bit of the read-out data is zero, determine the data bit of the target data from the storage unit as the recovered data bit if yes, and determine the inverted data bit of the target data from the storage unit and perform an inversion on the inverted data bit of the target data to obtain the recovered data bit if no.
[0119] Optionally, the conversion module 402 is configured to determine the copied sign bit of the target data from the storage unit, determine to perform an AND operation on the copied sign bit of the target data according to the specified error, perform the AND operation on the copied sign bit of the target data, and determine the result of the AND operation as the sign bit of the read-out data.
[0120] Optionally, the conversion module 402 is configured to determine whether the sign bit of the read-out data is zero, determine the inverted data bit of the target data from the storage unit and perform an inversion on the inverted data bit of the target data to obtain the recovered data bit if yes, and determine the data bit of the target data from the storage unit as the recovered data bit if no.
[0121] The specification also provides a computer readable storage medium storing a computer program, the computer program being used to execute the above-mentioned Figure 1 The specification also provides a data processing method.
[0122] The specification also provides an electronic device Figure 5 The specification also provides an electronic device Figure 5As shown, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course can also include other hardware required by the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to realize the above-mentioned Figure 1 The data processing method.
[0123] Of course, in addition to the software implementation, the present specification does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0124] In the 1990s, it was quite obvious to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented by hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a PLD by the designer programming it, rather than by asking a chip manufacturer to design and fabricate a custom integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented by "logic compiler" software, which is similar to software compilers used in program development, and the original code to be compiled is written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should be aware that, as long as the method flow is logically programmed in the above-mentioned hardware description languages and programmed into an integrated circuit, a hardware circuit implementing the logical method flow can be easily obtained.
[0125] The controller can be implemented in any suitable way, for example, the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, such as software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that, in addition to being implemented in pure computer readable program code, the controller can equally well be implemented to perform the same functions using logic gates, switches, an application specific integrated circuit, a programmable logic controller and an embedded microcontroller, etc. by means of a logical programming of the method steps. The controller can thus be considered as a hardware component, and the means comprised therein for performing the various functions can be considered as structures within the hardware component. Alternatively, the means for performing the various functions can even be considered as both a software module implementing the method and a structure within the hardware component.
[0126] The systems, apparatuses, modules or units illustrated by the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0127] For the sake of description, the above apparatuses are described in various units by functions respectively. Of course, the functions of each unit can be implemented in one or more software and / or hardware in the implementation of the present specification.
[0128] Those skilled in the art will understand that the embodiments of the present specification can be provided as a method, a system or a computer program product. Therefore, the present specification can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The specification is presented with reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing element or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 Figure 1
[0130] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 Figure 1
[0131] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1
[0132] In one typical configuration, the computing device includes one or more processors (CPU's), input / output interfaces, network interfaces, and memory.
[0133] The memory can include non-persistent memory and / or persistent memory, both of which can be volatile and / or non-volatile. Non-persistent memory can include, for example, a random access memory (RAM), which can be a volatile memory device that can require power to maintain its state. Non-persistent memory can also include, for example, a cache memory, a register found in the CPU, and / or embedded memory in the CPU. Persistent memory can include, for example, read-only memory (ROM), a flash memory, and / or a hard disk. The memory is an example of computer-readable media.
[0134] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0135] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0136] Those skilled in the art will appreciate that embodiments of the present specification can be provided as methods, systems or computer program products. Therefore, the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0137] The present specification can be described in the general context of computer-executable instructions, such as program modules, executed by computers. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
[0138] The various embodiments described in this specification are described using a numbering of embodiments approach: these are each individually integrated contributions pertaining to different aspects of the description. For each embodiment, the description focuses on the differences from the other embodiments. In particular, the description of the system embodiments is relatively brief, as the system embodiments are largely analogous to the method embodiments. The relevant parts of the description of the method embodiments are therefore referred to.
[0139] The above description is embodied in the form of embodiments only and is not intended to limit the present specification. The present specification can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.
Claims
1. A data processing method, characterized by, The method comprises the following steps: acquiring target data composed of a sign bit and a data bit; in the case of assuming that the target data stored in a storage unit only has a specified error, converting the target data according to a data conversion mode corresponding to the specified error to obtain converted data; when the specified error is that at least part of the data stored in the storage unit is changed from one to zero, it is determined whether the sign bit of the target data is zero; if yes, the sign bit of the target data is copied, and the copied sign bit of the target data is combined with the data bit of the target data to obtain the converted data; if no, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain the converted data; when the specified error is that at least part of the data stored in the storage unit is changed from zero to one, it is determined whether the sign bit of the target data is zero; if yes, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain the converted data; if no, the sign bit of the target data is copied, and the copied sign bit of the target data is combined with the data bit of the target data to obtain the converted data; storing the converted data into the storage unit and adjusting the refresh frequency of the storage unit, wherein the adjusted refresh frequency is less than the original refresh frequency; when performing a data processing task on the target data, reading the converted data from the storage unit to obtain read data, and determining the sign bit of the read data according to the specified error; restoring the data bit of the converted data according to the sign bit of the read data to obtain a restored data bit; performing the data processing task on the target data according to the sign bit of the read data and the restored data bit.
2. The method of claim 1, wherein, The method for determining the sign bit of the read data according to the specified error comprises the following steps: when the specified error is that at least part of the data stored in the storage unit is changed from one to zero, the copied sign bit of the target data is determined from the storage unit; performing an OR operation on the copied sign bit of the target data according to the specified error; performing the OR operation on the copied sign bit of the target data to determine the result of the OR operation as the sign bit of the read data.
3. The method of claim 2, wherein, The method for restoring the data bit of the converted data according to the sign bit of the read data comprises the following steps: determining whether the sign bit of the read data is zero; if yes, determining the data bit of the target data from the storage unit as the restored data bit; if no, inverting the inverted data bit of the target data to obtain the restored data bit.
4. The method of claim 1, wherein, The method for determining the sign bit of the read data according to the specified error comprises the following steps: determining the sign bit of the copied target data from the storage unit according to the specified error, wherein the specified error is that at least part of the data stored in the storage unit is changed from zero to one; determining the AND operation on the sign bit of the copied target data according to the specified error; performing the AND operation on the sign bit of the copied target data, and determining the result of the AND operation as the sign bit of the read data.
5. The method of claim 4, wherein, restoring the data bit of the converted data according to the sign bit of the read data to obtain a restored data bit, specifically including: determining whether the sign bit of the read data is zero; if yes, determining the data bit of the inverted target data from the storage unit, and inverting the data bit of the inverted target data to obtain the restored data bit; if no, determining the data bit of the target data from the storage unit as the restored data bit.
6. A data processing apparatus, characterized by, including: an obtaining module, configured to obtain target data composed of a sign bit and a data bit; a converting module, configured to convert the target data according to a data conversion mode corresponding to a specified error to obtain converted data in the case that the target data is assumed to be stored in a storage unit and only the specified error occurs, wherein when the specified error is that at least part of the data stored in the storage unit is changed from one to zero, it is determined whether the sign bit of the target data is zero; if yes, the sign bit of the target data is copied, and the copied sign bit of the target data is combined with the data bit of the target data to obtain the converted data; if no, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain the converted data; when the specified error is that at least part of the data stored in the storage unit is changed from zero to one, it is determined whether the sign bit of the target data is zero; if yes, the sign bit of the target data is copied, and the data bit of the target data is inverted, and the copied sign bit of the target data is combined with the inverted data bit to obtain the converted data; if no, the sign bit of the target data is copied, and the copied sign bit of the target data is combined with the data bit of the target data to obtain the converted data; an adjusting module, configured to store the converted data to the storage unit, and adjust the refresh frequency of the storage unit, wherein the adjusted refresh frequency is less than the original refresh frequency; a readout module, configured to read the converted data from the storage unit to obtain read data when a data processing task for the target data is performed, and determine the sign bit of the read data according to the specified error; a restoring module, configured to restore the data bit of the converted data according to the sign bit of the read data to obtain a restored data bit; a processing module, configured to perform the data processing task for the target data according to the sign bit of the read data and the restored data bit.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1-5.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the method in any one of claims 1-5.
Citation Information
Patent Citations
Data transmission system
JP2006060366A
How to control automatic character conversion
KR1019890009628A