CN113010114A - Data processing method and device, computer equipment and storage medium - Google Patents

Data processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113010114A
CN113010114A CN202110297670.4A CN202110297670A CN113010114A CN 113010114 A CN113010114 A CN 113010114A CN 202110297670 A CN202110297670 A CN 202110297670A CN 113010114 A CN113010114 A CN 113010114A
Authority
CN
China
Prior art keywords
data
storage
target
stored
check code
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110297670.4A
Other languages
Chinese (zh)
Inventor
董斌
倪佩佩
李向丁
潘翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kunshan Myzy Fixture Technology Co Ltd
Original Assignee
Kunshan Myzy Fixture Technology Co Ltd
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 Kunshan Myzy Fixture Technology Co Ltd filed Critical Kunshan Myzy Fixture Technology Co Ltd
Priority to CN202110297670.4A priority Critical patent/CN113010114A/en
Publication of CN113010114A publication Critical patent/CN113010114A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1012Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a data processing device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring data to be stored; determining a storage address of the data to be stored; calculating a data check code according to the data to be stored and the storage address; and storing the data to be stored, the storage address and the data check code into a data memory. The technical scheme of the embodiment of the invention can improve the accuracy of data stored in the data memory, thereby improving the reliability of the data memory.

Description

Data processing method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data processing method and device, computer equipment and a storage medium.
Background
The data memory is a memory device used for storing information in modern information technology, and its main function is to store program and various data and to complete the access of program or data automatically and at high speed during the operation of computer.
At present, although some data memories, such as Eeprom (Electrically Erasable Programmable Read-Only Memory), can store data, the data storage mode is single, and stored data may have errors, which makes it difficult to ensure the reliability of data storage.
Disclosure of Invention
Embodiments of the present invention provide a data processing method and apparatus, a computer device, and a storage medium, so as to improve accuracy of data stored in a data storage, thereby improving reliability of the data storage.
In a first aspect, an embodiment of the present invention provides a data processing method, including:
acquiring data to be stored;
determining a storage address of the data to be stored;
calculating a data check code according to the data to be stored and the storage address;
and storing the data to be stored, the storage address and the data check code into a data memory.
In a second aspect, an embodiment of the present invention further provides a data processing method, including:
acquiring a data reading address of target reading data;
reading a data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code;
calculating a temporary data check code according to the target storage address and the target storage data;
and returning the target storage data as the target reading data under the condition that the temporary data check code is determined to be consistent with the target data check code.
In a third aspect, an embodiment of the present invention further provides a data processing apparatus, including:
the data to be stored acquisition module is used for acquiring data to be stored;
the storage address determining module is used for determining the storage address of the data to be stored;
the data check code calculation module is used for calculating a data check code according to the data to be stored and the storage address;
and the data storage module is used for storing the data to be stored, the storage address and the data check code into a data memory.
In a fourth aspect, an embodiment of the present invention further provides a data processing apparatus, including:
the data reading address acquisition module is used for acquiring a data reading address of target reading data;
the data memory reading module is used for reading the data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code;
the temporary data check code calculation module is used for calculating a temporary data check code according to the target storage address and the target storage data;
and the target read data returning module is used for returning the target storage data as the target read data under the condition that the temporary data check code is determined to be consistent with the target data check code.
In a fifth aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided by any embodiment of the present invention.
In a sixth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data processing method provided in any embodiment of the present invention.
According to the embodiment of the invention, after the data to be stored is obtained, the storage address of the data to be stored is determined, and the data check code is calculated according to the data to be stored and the storage address, so that the data to be stored, the storage address and the data check code are stored in the data storage together, and the data storage ensures the reliability of data storage by using a data redundancy mode. Correspondingly, after the reading instruction of the target reading data is obtained, the data reading address of the target reading data is obtained, the data memory is read according to the data reading address, the target storage data, the target storage address and the target data check code are obtained, meanwhile, the temporary data check code is calculated according to the target storage address and the target storage data, and then the temporary data check code and the target data check code are compared and checked. And if the temporary data check code is consistent with the target data check code, determining that the target storage data is correct, and returning the target storage data as target reading data. The technical scheme can solve the problem of low reliability of data storage caused by single data storage mode of the existing data storage, thereby improving the accuracy of data storage in the data storage and further improving the reliability of the data storage.
Drawings
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an effect of an EEPROM data storage format according to an embodiment of the invention;
fig. 3 is a flowchart of a data processing method according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of a data processing apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic diagram of a data processing apparatus according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present invention, where the embodiment is applicable to a case where a data storage is used to store data to be stored and a storage address and a data check code corresponding to the data to be stored simultaneously, and the method may be executed by a data processing apparatus, which may be implemented by software and/or hardware, and may be generally integrated in a computer device and used in cooperation with the data storage for storing data. Accordingly, as shown in fig. 1, the method comprises the following operations:
and S110, acquiring data to be stored.
The data to be stored may be data that needs to be stored in the data storage.
In the embodiment of the present invention, after obtaining the data storage instruction, the computer device may obtain the data to be stored. Optionally, the data to be stored may be data in a binary format or other formats, as long as the data can be stored in the data storage, and the embodiment of the present invention does not limit the data type of the data to be stored.
And S120, determining the storage address of the data to be stored.
The storage address may be an address in the data storage where data to be stored is stored.
Correspondingly, after the data to be stored is acquired, before the data to be stored is stored in the data memory, the storage address of the data to be stored needs to be determined first, so that the data to be stored is stored in the storage address of the data memory.
And S130, calculating a data check code according to the data to be stored and the storage address.
The data check code can be used for checking the data to be stored so as to confirm the correctness of the data to be stored.
In order to ensure that the data to be stored can be correctly stored in the data memory, the embodiment of the invention can store the data to be stored in a data redundancy mode. Specifically, a data check code corresponding to the data to be stored may be calculated according to the data to be stored and the storage address, so as to confirm the correctness of the data to be stored in the data storage through the data check code.
Optionally, a check code generation algorithm may be used to generate a data check code according to data formed by splicing the storage address and the data to be stored. The Check code generation algorithm may include, but is not limited to, a Cyclic Redundancy Check (CRC) algorithm or a Longitudinal Redundancy Check (LRC) algorithm, as long as a data Check code can be generated according to a storage address and data to be stored, and the specific algorithm type of the Check code generation algorithm is not limited in the embodiment of the present invention.
S140, storing the data to be stored, the storage address and the data check code into a data memory.
Correspondingly, after the data check code corresponding to the data to be stored is obtained, the computer equipment can store the data to be stored, the storage address and the data check code to the data storage device together. And after the data to be stored is stored in the data memory, the data to be stored is the stored data in the data memory.
Optionally, in order to facilitate reading the stored data, the computer device may control to store the data to be stored, the storage address, and the data check code in the data storage according to a certain rule. For example, the storage may be performed according to the sequence of the storage address, the data to be stored, and the data check code, which is not limited in this embodiment of the present invention.
In an optional embodiment of the invention, the data storage adopts a data storage unit to store data; the data storage unit may include an address storage subunit, a valid data storage subunit, and a check code storage subunit; the storing the data to be stored, the storage address, and the data check code into a data storage may include: storing the storage address to the address storage subunit; storing the data to be stored to the effective data storage subunit; and storing the data check code to the check code storage subunit.
The data storage unit may be a storage unit storing data to be stored. The address storage subunit may be configured to store a storage address of the data to be stored, the valid data storage subunit may be configured to store the data to be stored, and the check code storage subunit may be configured to store a data check code.
Specifically, the storage address may be stored in an address storage subunit of a certain data storage unit in the data storage, the data to be stored may be stored in an effective data storage subunit of the data storage unit, and the data check code may be stored in a check code storage subunit of the data storage unit. It is understood that one data to be stored corresponds to one storage address and one data check code. Accordingly, one data to be stored can be stored using one data storage unit. It should be noted that the memory spaces occupied by the address storage subunit, the valid data storage subunit, and the check code storage subunit may be the same or different, and specifically need to be determined according to the storage type of the data storage, which is not limited in the embodiment of the present invention.
In an alternative embodiment of the present invention, the data memory may include an EEPROM, and the address storage subunit may include two byte storage units; the data storage subunit may include four byte storage units; the check code storage subunit may include two byte storage units.
EEPROM can be repeatedly erased and written, and is well suited to storing some parameters. Typically, EEPROMs are 8byte type memories with data ranges of 0-0 xff. Conventional EEPROMs typically store only valid memory data, i.e., every 8 bytes of data storage cells are used to store data. The data storage mode is single, and the accuracy of the stored data is ensured singly. There are important situations in which parameter loading is erroneous due to an error in the stored parameters of the EEPROM, for example, when data is not successfully written into the EEPROM or the EEPROM stores erroneous data due to interference with communication timing, which may have serious consequences.
To this end, embodiments of the present invention improve the data storage format of the EEPROM in order to include the reliability of data storage in the EEPROM. Fig. 2 is a schematic diagram illustrating an effect of an EEPROM data storage format according to an embodiment of the present invention, and in a specific example, as shown in fig. 2, one data storage unit of the EEPROM may include 8 bytes. Wherein, the address storage subunit of one data storage unit may include two Byte storage units, such as Byte0 and Byte1, for storing two parts of the contents of the storage address, such as address a part and address b part; the data storage sub-unit may include four Byte storage units, such as Byte2-Byte5, for storing four parts of the data to be stored, such as a valid data a part, a valid data b part, a valid data c part, and a valid data d part; the check code storage sub-unit may include two Byte storage units, e.g., Byte6 and Byte7, for storing two parts of the data check code, e.g., a data check code a part and a data check code b part.
That is, one to-be-stored data needs to store one storage address and one data check code correspondingly. When the data check code is used for reading data from the data memory, the check data serving as a reference is compared with the data check code calculated in real time according to the read data for checking. If the comparison and verification results of the data verification codes are consistent, the data storage is correct, and correct stored data can be returned; otherwise, indicating that the data is stored incorrectly, an error message may be returned, such as a data read failure message.
In an optional embodiment of the present invention, after the storing the data to be stored, the storage address, and the data check code in the data storage, the method may further include: reading target stored data in the data memory; comparing and checking the target stored data and the data to be stored; and under the condition that the target stored data and the to-be-stored data are determined to be inconsistent, returning to execute the operation of storing the to-be-stored data, the storage address and the data check code into a data memory until the target stored data and the to-be-stored data are determined to be consistent.
The target stored data may be stored data corresponding to data to be stored and stored in the data storage.
In order to avoid data storage errors caused by abnormal conditions in the data storage process, after the data to be stored, the storage address and the data check code are stored in the data storage, the target stored data which is just written into the data storage can be read, and the target stored data and the original data to be stored are compared and checked. If the target stored data and the data to be stored are determined to be inconsistent in verification result, which indicates that the data storage fails, the operation of storing the data to be stored, the storage address and the data verification code in the data memory can be returned to be executed again until the target stored data and the data to be stored are determined to be consistent in verification result. And if the verification result of the target stored data and the data to be stored is determined to be consistent, indicating that the data storage is successful, successfully writing the data into the data memory.
According to the embodiment of the invention, after the data to be stored is obtained, the storage address of the data to be stored is determined, and the data check code is calculated according to the data to be stored and the storage address, so that the data to be stored, the storage address and the data check code are stored in the data storage together, the data storage ensures the reliability of data storage by using a data redundancy mode, the problem of low reliability of data storage caused by a single data storage mode of the conventional data storage can be solved, the accuracy of data storage in the data storage is improved, and the reliability of the data storage is improved.
Example two
Fig. 3 is a flowchart of a data processing method according to a second embodiment of the present invention, where this embodiment is applicable to a case where stored data of a data storage is read by using a data check code, and the method may be executed by a data processing apparatus, which may be implemented by software and/or hardware, and may be generally integrated in a computer device and used in cooperation with the data storage for storing data. Accordingly, as shown in fig. 3, the method includes the following operations:
s210, acquiring a data reading address of target reading data.
Wherein the target read data may be stored data that needs to be read from the data storage. The data read address may be an address at which target read data is stored in the data memory.
In the embodiment of the present invention, after the computer device obtains the reading instruction of the target reading data, the data reading address of the target reading data may be obtained according to the reading instruction of the target reading data.
S220, reading the data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code.
The target storage data may be storage data matched with the data reading address, the target storage address may be a storage address of the target storage data, and the target data check code may be a data check code corresponding to the target storage data.
Correspondingly, the computer equipment can read the data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code which are matched with the data reading address. It will be appreciated that the data read address and the target memory address are the same.
In an optional embodiment of the present invention, the data storage may comprise an EEPROM, the data storage stores data using data storage units; the data storage unit may include an address storage subunit, a valid data storage subunit, and a check code storage subunit; wherein: the address storage subunit is used for storing the target storage address; the data storage subunit is used for storing the target storage data; the check code storage subunit is used for storing the target data check code.
Optionally, the address storage subunit may include two byte storage units; the data storage subunit may include four byte storage units; the check code storage subunit may include two byte storage units.
Alternatively, if the data storage is of the EEPROM type, the computer device may read 8 bytes of data in one data storage unit in the EEPROM according to the data read address. In the 8 bytes of data in the data storage unit, the 2 bytes of data corresponding to the address storage subunit form a target storage address, and the target storage address is the same as the data reading address; the data of 4 bytes corresponding to the data storage subunit forms target storage data, and the data of 2 bytes corresponding to the check code storage subunit forms a target data check code.
And S230, calculating a temporary data check code according to the target storage address and the target storage data.
The temporary data check code may be a data check code calculated in real time according to the target storage address and the target storage data.
Accordingly, after obtaining the target storage data, the target storage address and the target data check code, the computer device may calculate the temporary data check code according to the target storage data and the target storage address. Optionally, a temporary data check code may be generated according to data formed by splicing the target storage address and the target storage data by using a check code generation algorithm. The check code generation algorithm may include, but is not limited to, a CRC or LRC algorithm, for example, as long as the temporary data check code can be generated according to the target storage address and the target storage data, and the specific algorithm type of the check code generation algorithm is not limited in the embodiment of the present invention. However, it should be noted that the check code generation algorithm adopted by the computer device when writing the data to be stored into the data storage needs to be consistent with the check code generation algorithm adopted for calculating the temporary data check code. Meanwhile, the generation rule of the check code adopted by the computer device when writing the data to be stored into the data memory also needs to be consistent with the generation rule of the check code adopted by calculating the temporary data check code.
S240, under the condition that the temporary data check code is consistent with the target data check code, returning the target storage data as the target reading data.
Specifically, after the computer device calculates the temporary data check code, consistency comparison and verification can be performed on the temporary data check code and the target data check code. If the temporary data check code is consistent with the target data check code and indicates that the target storage data is correct, the target storage data can be used as target reading data to be returned. If the temporary data check code is determined to be inconsistent with the target data check code, indicating that the target stored data is wrong, an error message may be returned, such as a data read failure message.
According to the embodiment of the invention, after the reading instruction of the target reading data is obtained, the data reading address of the target reading data is obtained, the data memory is read according to the data reading address, the target storage data, the target storage address and the target data check code are obtained, meanwhile, the temporary data check code is calculated according to the target storage address and the target storage data, and then the temporary data check code and the target data check code are compared and checked. And if the temporary data check code is consistent with the target data check code, determining that the target storage data is correct, and returning the target storage data as target reading data. The technical scheme can solve the problem of low reliability of data storage caused by single data storage mode of the existing data storage, thereby improving the accuracy of data storage in the data storage and further improving the reliability of the data storage.
It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.
EXAMPLE III
Fig. 4 is a schematic diagram of a data processing apparatus according to a third embodiment of the present invention, and as shown in fig. 4, the apparatus includes: a to-be-stored data obtaining module 310, a storage address determining module 320, a data check code calculating module 330, and a data storage module 340, wherein:
a to-be-stored data obtaining module 310, configured to obtain to-be-stored data;
a storage address determining module 320, configured to determine a storage address of the data to be stored;
the data check code calculation module 330 is configured to calculate a data check code according to the data to be stored and the storage address;
the data storage module 340 is configured to store the data to be stored, the storage address, and the data check code in a data storage.
According to the embodiment of the invention, after the data to be stored is obtained, the storage address of the data to be stored is determined, and the data check code is calculated according to the data to be stored and the storage address, so that the data to be stored, the storage address and the data check code are stored in the data storage together, the data storage ensures the reliability of data storage by using a data redundancy mode, the problem of low reliability of data storage caused by a single data storage mode of the conventional data storage can be solved, the accuracy of data storage in the data storage is improved, and the reliability of the data storage is improved.
Optionally, the data memory stores data by using a data storage unit; the data storage unit comprises an address storage subunit, an effective data storage subunit and a check code storage subunit;
optionally, the data storage module 340 is specifically configured to: storing the storage address to the address storage subunit; storing the data to be stored to the effective data storage subunit; and storing the data check code to the check code storage subunit.
Optionally, the data memory includes an EEPROM, and the address storage subunit includes two byte storage units; the data storage subunit comprises four byte storage units; the check code storage subunit comprises two byte storage units.
Optionally, the apparatus further comprises: a target stored data module for reading target stored data in the data storage; the target stored data comparison and verification module is used for comparing and verifying the target stored data and the data to be stored; and the return execution module is used for returning and executing the operation of storing the data to be stored, the storage address and the data check code into a data memory under the condition that the target stored data and the data to be stored check result are determined to be inconsistent until the target stored data and the data to be stored check result are determined to be consistent.
The data processing device can execute the data processing method provided by the first embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the data processing method provided in the first embodiment of the present invention, reference may be made to the following description.
Since the data processing apparatus described above is an apparatus capable of executing the data processing method in the first embodiment of the present invention, based on the data processing method described in the first embodiment of the present invention, a person skilled in the art can understand the specific implementation manner of the data processing apparatus in the present embodiment and various modifications thereof, and therefore, how to implement the data processing method in the first embodiment of the present invention by the data processing apparatus is not described in detail herein. As long as a person skilled in the art implements the apparatus used in the data processing method according to the first embodiment of the present invention, the apparatus is within the scope of the present application.
Example four
Fig. 5 is a schematic diagram of a data processing apparatus according to a fourth embodiment of the present invention, and as shown in fig. 5, the apparatus includes: a data read address obtaining module 410, a data memory read module 420, a temporary data check code calculating module 430, and a target read data returning module 440, wherein:
a data reading address obtaining module 410, configured to obtain a data reading address of target reading data;
a data memory reading module 420, configured to read a data memory according to the data reading address to obtain target storage data, a target storage address, and a target data check code;
a temporary data check code calculation module 430, configured to calculate a temporary data check code according to the target storage address and the target storage data;
and a target read data returning module 440, configured to return the target storage data as the target read data when it is determined that the temporary data check code is consistent with the target data check code.
According to the embodiment of the invention, after the reading instruction of the target reading data is obtained, the data reading address of the target reading data is obtained, the data memory is read according to the data reading address, the target storage data, the target storage address and the target data check code are obtained, meanwhile, the temporary data check code is calculated according to the target storage address and the target storage data, and then the temporary data check code and the target data check code are compared and checked. And if the temporary data check code is consistent with the target data check code, determining that the target storage data is correct, and returning the target storage data as target reading data. The technical scheme can solve the problem of low reliability of data storage caused by single data storage mode of the existing data storage, thereby improving the accuracy of data storage in the data storage and further improving the reliability of the data storage.
Optionally, the data storage includes an EEPROM, and the data storage stores data using a data storage unit; the data storage unit comprises an address storage subunit, an effective data storage subunit and a check code storage subunit; wherein: the address storage subunit is used for storing the target storage address; the data storage subunit is used for storing the target storage data; the check code storage subunit is used for storing the target data check code.
Optionally, the address storage subunit includes two byte storage units; the data storage subunit comprises four byte storage units; the check code storage subunit comprises two byte storage units.
The data processing device can execute the data processing method provided by the second embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the data processing method provided in the second embodiment of the present invention, reference may be made to the following description.
Since the data processing apparatus described above is an apparatus capable of executing the data processing method in the second embodiment of the present invention, based on the data processing method described in the second embodiment of the present invention, a person skilled in the art can understand the specific implementation of the data processing apparatus in the present embodiment and various modifications thereof, and therefore, how to implement the data processing method in the second embodiment of the present invention by the data processing apparatus is not described in detail herein. As long as the device used by those skilled in the art to implement the data processing method in the second embodiment of the present invention falls within the scope of the present application.
EXAMPLE five
Fig. 6 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 6 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 6, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects the various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN)) and/or a public Network (e.g., the Internet) via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, thereby implementing the data processing method provided by the embodiment of the present invention: acquiring data to be stored; determining a storage address of the data to be stored; calculating a data check code according to the data to be stored and the storage address; and storing the data to be stored, the storage address and the data check code into a data memory.
Alternatively, the processor 16 executes various functional applications and data processing by running the program stored in the memory 28, thereby implementing the data processing method provided by the embodiment of the present invention: acquiring a data reading address of target reading data; reading a data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code; calculating a temporary data check code according to the target storage address and the target storage data; and returning the target storage data as the target reading data under the condition that the temporary data check code is determined to be consistent with the target data check code.
EXAMPLE six
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute the data processing method according to any one of the above embodiments of the present invention when executed by a computer processor: acquiring data to be stored; determining a storage address of the data to be stored; calculating a data check code according to the data to be stored and the storage address; and storing the data to be stored, the storage address and the data check code into a data memory.
Alternatively, the computer program is configured to perform the data processing method according to any of the above embodiments of the present invention when executed by a computer processor: acquiring a data reading address of target reading data; reading a data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code; calculating a temporary data check code according to the target storage address and the target storage data; and returning the target storage data as the target reading data under the condition that the temporary data check code is determined to be consistent with the target data check code.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data processing method, comprising:
acquiring data to be stored;
determining a storage address of the data to be stored;
calculating a data check code according to the data to be stored and the storage address;
and storing the data to be stored, the storage address and the data check code into a data memory.
2. The method of claim 1, wherein the data storage device stores data using data storage units; the data storage unit comprises an address storage subunit, an effective data storage subunit and a check code storage subunit;
the storing the data to be stored, the storage address and the data check code to a data storage includes:
storing the storage address to the address storage subunit;
storing the data to be stored to the effective data storage subunit;
and storing the data check code to the check code storage subunit.
3. The method of claim 2, wherein the data memory comprises a charge erasable programmable read only memory (EEPROM), and the address storage subunit comprises two byte storage units; the data storage subunit comprises four byte storage units; the check code storage subunit comprises two byte storage units.
4. The method of claim 1, further comprising, after the storing the data to be stored, the storage address, and the data check code into a data storage:
reading target stored data in the data memory;
comparing and checking the target stored data and the data to be stored;
and under the condition that the target stored data and the to-be-stored data are determined to be inconsistent, returning to execute the operation of storing the to-be-stored data, the storage address and the data check code into a data memory until the target stored data and the to-be-stored data are determined to be consistent.
5. A data processing method, comprising:
acquiring a data reading address of target reading data;
reading a data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code;
calculating a temporary data check code according to the target storage address and the target storage data;
and returning the target storage data as the target reading data under the condition that the temporary data check code is determined to be consistent with the target data check code.
6. The method of claim 5, wherein the data memory comprises an EEPROM, the data memory employing data storage units to store data; the data storage unit comprises an address storage subunit, an effective data storage subunit and a check code storage subunit; wherein:
the address storage subunit is used for storing the target storage address;
the data storage subunit is used for storing the target storage data;
the check code storage subunit is used for storing the target data check code.
7. A data processing apparatus, comprising:
the data to be stored acquisition module is used for acquiring data to be stored;
the storage address determining module is used for determining the storage address of the data to be stored;
the data check code calculation module is used for calculating a data check code according to the data to be stored and the storage address;
and the data storage module is used for storing the data to be stored, the storage address and the data check code into a data memory.
8. A data processing apparatus, comprising:
the data reading address acquisition module is used for acquiring a data reading address of target reading data;
the data memory reading module is used for reading the data memory according to the data reading address to obtain target storage data, a target storage address and a target data check code;
the temporary data check code calculation module is used for calculating a temporary data check code according to the target storage address and the target storage data;
and the target read data returning module is used for returning the target storage data as the target read data under the condition that the temporary data check code is determined to be consistent with the target data check code.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data processing method as claimed in any one of claims 1-4, or to implement a data processing method as claimed in any one of claims 5-6.
10. A computer storage medium on which a computer program is stored, which program, when being executed by a processor, carries out the data processing method of any one of claims 1 to 4, or carries out the data processing method of any one of claims 5 to 6.
CN202110297670.4A 2021-03-19 2021-03-19 Data processing method and device, computer equipment and storage medium Pending CN113010114A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110297670.4A CN113010114A (en) 2021-03-19 2021-03-19 Data processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110297670.4A CN113010114A (en) 2021-03-19 2021-03-19 Data processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113010114A true CN113010114A (en) 2021-06-22

Family

ID=76403572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110297670.4A Pending CN113010114A (en) 2021-03-19 2021-03-19 Data processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113010114A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641530A (en) * 2021-06-23 2021-11-12 地平线(上海)人工智能技术有限公司 Data processing method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246542A1 (en) * 2011-03-22 2012-09-27 Freescale Semiconductor, Inc. Selective checkbit modification for error correction
US20140181615A1 (en) * 2012-12-21 2014-06-26 Intel Corporation Method, system and apparatus for providing access to error correction information
EP3171273A1 (en) * 2015-11-20 2017-05-24 Sagemcom Energy & Telecom Sas Method for verifying the integrity of a data set deployed on a plurality of electronical devices
CN111145826A (en) * 2018-11-05 2020-05-12 珠海格力电器股份有限公司 Memory built-in self-test method, circuit and computer storage medium
JP2020112972A (en) * 2019-01-10 2020-07-27 富士通株式会社 Storage control device and storage control program
CN111666046A (en) * 2020-05-20 2020-09-15 西安奥卡云数据科技有限公司 Data storage method, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120246542A1 (en) * 2011-03-22 2012-09-27 Freescale Semiconductor, Inc. Selective checkbit modification for error correction
US20140181615A1 (en) * 2012-12-21 2014-06-26 Intel Corporation Method, system and apparatus for providing access to error correction information
EP3171273A1 (en) * 2015-11-20 2017-05-24 Sagemcom Energy & Telecom Sas Method for verifying the integrity of a data set deployed on a plurality of electronical devices
CN111145826A (en) * 2018-11-05 2020-05-12 珠海格力电器股份有限公司 Memory built-in self-test method, circuit and computer storage medium
JP2020112972A (en) * 2019-01-10 2020-07-27 富士通株式会社 Storage control device and storage control program
CN111666046A (en) * 2020-05-20 2020-09-15 西安奥卡云数据科技有限公司 Data storage method, device and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641530A (en) * 2021-06-23 2021-11-12 地平线(上海)人工智能技术有限公司 Data processing method and device
CN113641530B (en) * 2021-06-23 2023-07-18 地平线(上海)人工智能技术有限公司 Data processing method and device

Similar Documents

Publication Publication Date Title
CN110928559B (en) Data burning method and device, electronic equipment and storage medium
CN112380046B (en) Calculation result verification method, system, device, equipment and storage medium
CN113384896B (en) Resource packaging method, device, equipment and medium based on Unity
CN112363753A (en) Data verification method and device, electronic equipment and storage medium
CN110554929B (en) Data verification method, device, computer equipment and storage medium
CN115587055A (en) Bus transmission method, system, device and storage medium
CN115408730A (en) Data processing method, chip, electronic device and storage medium
CN117687664A (en) Online upgrade configuration method and device for DSP
CN113010114A (en) Data processing method and device, computer equipment and storage medium
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN112713964B (en) Data verification acceleration method and device, computer equipment and storage medium
CN112395129A (en) Storage verification method and device, computing chip, computer equipment and storage medium
CN111124455B (en) Battery management system upgrading method, device, server and storage medium
CN115904230A (en) Data verification method, system and device
CN115658404A (en) Test method and system
CN109918231B (en) Data reforming abnormity repairing method, device, equipment and storage medium
CN113656301A (en) Interface testing method, device, equipment and storage medium
CN111679932B (en) Error code data generation method and device, computer equipment and storage medium
CN110365763B (en) Data synchronization method, device, equipment and storage medium
CN110908818B (en) Verification method, device, equipment and storage medium
CN109150414B (en) Method, device, equipment and storage medium for enhancing Bluetooth communication stability between equipment
CN111857664B (en) Application development method, device, equipment and storage medium
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN116820946B (en) Method and device for automatically testing compatibility of target software
CN116467131B (en) ECC function verification method, device, medium and equipment of processor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination