Information processing device and data reception error detection method
The information processing device addresses high CPU occupation and communication frequency in MCUs by using a bus controller and inspection data calculator to perform error detection directly on the bus, facilitating faster data transfer with reduced CPU load.
Patent Information
- Application Number
- JP2023051417
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2024-10-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In small-scale devices like microcontroller units (MCUs), the bus communication frequency is high, leading to high CPU occupation rates, which delays processing and reduces system processing speed due to the complexity and time required for data reception error detection.
An information processing device with a receiving unit, storage unit, bus controller, and inspection data calculator that performs error detection by generating and comparing test data directly on the bus, reducing CPU involvement and communication frequency.
Enables quick data transfer with error detection by minimizing CPU occupation and communication frequency, thereby enhancing processing speed.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an information processing device and a method for detecting errors in data reception. [Background technology]
[0002] In data transfer performed by the information processing device, error detection is performed using inspection data composed of parity bits, etc. (for example, Patent Document 1).
[0003] In such error detection, for example, the transmitting side creates and transmits transmission data by adding test data generated by a predetermined calculation to the target data to be transmitted, and the receiving side generates test data by the same calculation using the received target data, and compares and collates the respective test data to detect errors or corruption in the received data. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Application Publication No. 10-173546 Summary of the Invention [Problem to be solved by the invention]
[0005] In the receiving device that receives the data transfer, a receiving device such as a register first receives the data, and a control unit such as a CPU reads the target data from the register and stores it in RAM. When the final target data has been stored in RAM, the test data is read from the register and stored in RAM. After storing the received data, the CPU reads the target data from RAM and writes it to the test data calculator. The test data calculator generates test data based on the written target data. The control unit reads the test data from RAM and compares the read test data with the test data generated by the test data calculator to determine whether there is an error in the data reception.
[0006] However, with such an error detection method, when the receiving device is a small device such as a microcomputer (MCU: Micro Controller Unit), communication between the CPU and the register, the test data calculator, and the RAM via the bus is frequent, and the CPU occupancy rate is high, causing delays in processing other than data reception, resulting in a decrease in the processing speed of the system as a whole.
[0007] Furthermore, there is a problem that there is a large number of processing steps from data reception to comparison and verification results, and the data transfer speed is slower.
[0008] The present invention has been made in consideration of the above problems, and has an object to provide an information processing device that is capable of quickly performing data transfer accompanied by error detection. [Means for solving the problem]
[0009] The information processing device of the present invention includes a receiving unit that receives data including a data main body portion and first test data generated by performing a predetermined operation on the data main body portion, a memory unit connected to the receiving unit via a bus, a control unit connected to the receiving unit and the memory unit via the bus and reading out the data main body portion and the first test data from the receiving unit and storing them in the memory unit, a first bus controller connected to the bus and acquiring the data main body portion from the bus in association with the control unit storing the data main body portion in the memory unit based on address information of the address at which the data main body portion of the memory unit is stored, and a test data calculator that generates second test data by performing the predetermined operation on the data main body portion acquired by the first bus controller, and is characterized in that the control unit determines whether or not the receiving unit has successfully received the data based on a comparison result between the first test data and the second test data.
[0010] Further, an error detection method according to the present invention is a data reception error detection method executed by an information processing device including: a receiving unit that receives data including a data main body portion and first test data generated by performing a predetermined operation on the data main body portion; a memory unit connected to the receiving unit via a bus; a control unit that acquires the data from the receiving unit and stores it in the memory unit; a first bus controller that acquires the data main body portion from the bus in association with the storage of the data main body portion in the memory unit by the control unit; and a test data calculator that generates second test data by performing a predetermined operation on the data main body portion, the method including a step in which the control unit sets an address of the memory unit for storing the data main body portion in the first bus controller; The method includes the steps of: receiving a data main body portion; the control unit reading the data main body portion from the receiving unit via the bus and storing it in the memory unit; the first bus controller acquiring the data main body portion from the bus as the control unit stores the data main body portion in the memory unit; the first bus controller supplying the acquired data main body portion to the test data calculator; the test data calculator generating the second test data by performing the specified calculation on the data main body portion; and the control unit determining whether or not there is an error in the reception of the data by the receiving unit based on a comparison result between the first test data and the second test data. Effect of the Invention
[0011] According to the information processing device according to the present invention, data transfer accompanied by error detection can be performed quickly. [Brief description of the drawings]
[0012] [Figure 1] 1 is a block diagram showing the structure of an information processing device according to the first embodiment of the present invention. [Diagram 2] 14 is a diagram showing an example of the data structure of data received by the information processing device according to the first embodiment. [Diagram 3]10 is a flow chart showing a processing routine for error detection processing of received data by the information processing device according to the first embodiment. [Figure 4] 10 is a flow chart showing a processing routine for error detection processing of received data by the information processing device according to the first embodiment. [Diagram 5] 1 is a block diagram showing the structure of an information processing device according to a second embodiment of the present invention. [Figure 6] 10 is a flow chart showing a processing routine for error detection processing of received data by the information processing device according to the second embodiment. [Figure 7] 10 is a flow chart showing a processing routine for error detection processing of received data by the information processing device according to the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description of each embodiment and the accompanying drawings, substantially the same or equivalent parts are designated by the same reference numerals. EXAMPLES
[0014] 1 is a block diagram showing a configuration of an information processing device 100 according to a first embodiment of the present invention. The information processing device 100 includes a CPU 11, registers 12A and 12B, a RAM 13, a test data calculator 14, and a bus controller 15. The information processing device 100 has a function of receiving data transferred from a source device 20, which is an external device, and detecting whether or not there is an error in the data reception.
[0015] 2 is a diagram showing an example of the data structure of received data RD received by the information processing device 100 from the transmission source device 20 in this embodiment. The received data RD includes a data body portion consisting of consecutive target data TD1, TD2, ... TDn, and check data ED added thereto. The check data ED is data generated by performing an operation on the data body portion in accordance with a predetermined rule (hereinafter referred to as a predetermined operation), and is composed of, for example, a CRC (Cyclic Redundancy Code) code.
[0016] 1 again, the CPU 11 is a processing control unit that controls the processing operations of each unit of the information processing device 100. In this embodiment, the CPU 11 reads and stores data via the bus B1. Specifically, the CPU 11 reads the received data RD (target data TD1 to TDn and inspection data ED) stored in the register 12A, and stores it in the RAM 13.
[0017] Furthermore, the CPU 11 detects whether or not there is an error in the data reception by comparing and collating the test data ED read from the RAM 13 with the test data ED generated by the test data calculator 14. That is, the test data ED received by the register 12A and stored in the RAM 13 and the test data ED generated by the test data calculator 14 are both data generated by performing calculations on the same data body (target data TD1 to TDn) according to the same rules. Therefore, by comparing these and determining whether they match, it is possible to determine whether or not there is an error or damage in the received data RD and to determine whether or not the data reception was successful.
[0018] The registers 12A and 12B are receiving devices that receive data transferred from the transmission source device 20 as received data RD. The registers 12A and 12B first receive the target data TD1, TD2, ... TDn, and after receiving the final target data (TDn), receive the inspection data ED.
[0019] The RAM 13 is a storage unit that stores the reception data RD (target data and test data) received by the registers 12A and 12B. The CPU 11 stores data in the RAM 13 and reads data from the RAM 13 via the bus B1.
[0020] The test data calculator 14 is a calculation unit that generates test data ED by performing a predetermined calculation (i.e., a calculation according to the same rule as the above-mentioned predetermined rule) on the data main body (target data TD1 to TDn). In this embodiment, the test data calculator 14 receives the target data TD1 to TDn from the bus controller 15, and performs a predetermined calculation on the supplied target data TD1 to TDn to generate new test data ED in addition to the test data ED received by the register 12A. In the following description, the test data ED generated by the test data calculator 14 is referred to as test data EDX to distinguish it from the test data ED received by the register 12A.
[0021] The bus controller 15 is provided between the test data calculator 14 and the bus B1, acquires data via the bus B1, and supplies the acquired data to the test data calculator 14. In this embodiment, the address of the RAM 13 for storing the target data TD1 to TDn is set in the bus controller 15. Based on the set address information of the RAM 13, the bus controller 15 acquires the target data TD1 to TDn from the bus B1 as the CPU 11 stores the target data TD1 to TDn in the RAM 13. The bus controller 15 supplies the acquired target data TD1 to TDn to the test data calculator 14.
[0022] Next, the processing operation of the error detection processing of received data executed by the information processing device 100 of this embodiment will be described.
[0023] 3 and 4 are flowcharts showing a processing routine of the error detection process executed by the information processing device 100 of the embodiment 1. Note that, here, the following steps are processed in a state where data is transferred from the transmission source device 20 and the register 12A starts receiving the reception data RD (i.e., receiving the target data TD1 to TDn and the check data ED).
[0024] First, the CPU 11 sets an address of the RAM 13 for storing the target data TD1 to TDn in the bus control unit 15 (STEP 101). Note that the address may be set in advance before the register 12A starts receiving the reception data RD.
[0025] The CPU 11 reads out the target data TD1 to TDn from the register 12A (STEP 102). The CPU 11 sequentially reads out the target data TD1, TD2, TD3, ... in this order. In the following description, of the target data TD1 to TDn, the target data that is currently being processed, such as read or stored, is also simply referred to as TD.
[0026] The CPU 11 stores the read target data TD in the RAM 13 (STEP 103).
[0027] The bus controller 15 acquires the target data TD from the bus B1 when the CPU 11 stores the target data TD in the RAM 13 based on the address information of the RAM 13 set in STEP 101 (STEP 104).
[0028] The bus controller 15 supplies (writes) the target data TD obtained from the bus B1 to the inspection data computing machine 14 (STEP 105).
[0029] The CPU 11 determines whether or not the register 12A has received and stored in the RAM 13 up to the final target data TDn, that is, whether or not all of the target data TD1 to TDn have been stored in the RAM 13 (STEP 106).
[0030] If it is determined that all of the target data TD1 to TDn are not stored in RAM 13 (STEP 106: NO), the processing of STEP 102 to 105 is repeated.
[0031] On the other hand, if it is determined that all of the target data TD1 to TDn have been stored in RAM 13 (STEP 106: YES), the CPU 11 reads out the check data ED from the register 12A (STEP 107).
[0032] The CPU 11 stores the read-out inspection data ED in the RAM 13 (STEP 108).
[0033] The inspection data computing machine 14 performs predetermined calculations on the target data TD1 to RDn supplied from the bus controller 15 to generate inspection data EDX (STEP 109).
[0034] The CPU 11 acquires the inspection data EDX from the inspection data computing unit 14 (STEP 110).
[0035] The CPU 11 reads out the inspection data ED from the RAM 13 (STEP 111).
[0036] The CPU 11 compares and collates the inspection data ED (first inspection data) read from the RAM 13 with the inspection data EDX (second inspection data) acquired from the inspection data calculator 14 (STEP 112).
[0037] As a result of the comparison, the CPU 11 determines whether the first test data ED read from the RAM 13 (i.e., the test data ED received by the register 12A) matches the second test data EDX obtained from the test data calculator 14 (i.e., the test data EDX newly generated based on TD1 to TDn received by the register 12A) (STEP 113).
[0038] If it is determined that the data is the same (STEP 113: YES), the CPU 11 determines that no error or corruption has occurred in the received data RD, and that the data reception has been successful.
[0039] On the other hand, if it is determined that the data does not match (STEP 113: NO), the CPU 11 determines that an error or corruption has occurred in the received data RD, and that data reception has failed.
[0040] As described above, the information processing device 100 of this embodiment is provided with the bus controller 15, and the addresses of the RAM 13 for storing the target data TD1 to TDn are preset in the bus controller 15. When the CPU 11 stores the target data TD read from the register 12A in the RAM 13, the bus controller 15 acquires the target data TD via the bus B1 and supplies it to the test data calculator 14. The CPU 11 compares the test data ED stored in the RAM 13 with the test data EDX generated by the test data calculator 14 to determine whether data reception has been successful or not.
[0041] If the bus controller 15 as in this embodiment is not provided, the CPU 11 must access the RAM 13 to read the target data TD1 to TDn and write the read target data TD1 to TDn to the test data calculator 14 in order to supply the target data TD1 to TDn to the test data calculator 14. For this reason, the CPU 11 frequently communicates via the bus B1, and the occupancy rate of the CPU 11 is high.
[0042] In contrast, in the information processing device 100 of this embodiment, as described above, the address of the RAM 13 is set in advance in the bus controller 15, and the bus controller 15 acquires the target data TD from the bus B1 as the CPU 11 stores the target data TD in the RAM 13. Therefore, compared to a case where the bus controller 15 is not provided, the frequency of communication by the CPU 11 via the bus B1 is lower, and the occupation rate of the CPU 11 is reduced.
[0043] Therefore, the information processing device 100 of this embodiment allows for quick data transfer with error detection. EXAMPLES
[0044] Next, a description will be given of a second embodiment of the present invention. The information processing device of this embodiment differs from the information processing device 100 of the first embodiment in that the comparison and collation of the inspection data ED is performed by an inspection data comparator instead of the CPU 11.
[0045] 5 is a block diagram showing a configuration of an information processing device 200 according to Example 2. The information processing device 200 includes a CPU 11, registers 12A and 12B, a RAM 13, a test data calculator 14, a bus controller 15, a test data comparator 16, and a bus controller 17.
[0046] The test data comparator 16 receives (writes) the test data ED from the bus controller 17, and detects whether there is an error in the data reception by comparing the supplied test data ED (first test data) with the test data EDX (second test data) generated by the test data calculator 14.
[0047] The bus controller 17 is provided between the test data comparator 16 and the bus B2, acquires data via the bus B2, and supplies the acquired data to the test data comparator 16. In this embodiment, an address of the RAM 13 for storing the test data ED is set in the bus controller 17. The bus controller 17 acquires the test data ED from the bus B2 based on the set address information of the RAM 13 when the CPU 11 stores the test data ED in the RAM 13. The bus controller 17 supplies the acquired test data ED to the test data comparator 16.
[0048] Next, the processing operation of the error detection processing of received data executed by the information processing device 100 of this embodiment will be described.
[0049] 6 and 7 are flowcharts showing a processing routine of the error detection process executed by the information processing device 200 of the embodiment 2. Note that, in this case, data is transferred from the transmission source device 20, and the register 12A starts receiving the reception data RD, and the following steps are processed.
[0050] First, the CPU 11 sets the address of the RAM 13 for storing the target data TD1 to TDn to the bus controller 15 (STEP 201).
[0051] Furthermore, the CPU 11 sets the address of the RAM 13 for storing the inspection data ED in the bus controller 17 (STEP 202). Note that the order of these address settings may be reversed, and may be performed before the register 12A starts receiving the reception data RD.
[0052] The CPU 11 reads out the target data TD1 to TDn from the register 12A (STEP 203). At this time, the CPU 11 reads out the target data TD in the order of TD1, TD2, TD3, . . .
[0053] The CPU 11 stores the read target data TD in the RAM 13 (STEP 204).
[0054] The bus controller 15 acquires the target data TD from the bus B2 when the CPU 11 stores the target data TD in the RAM 13 based on the address information of the RAM 13 set in STEP 201 (STEP 205).
[0055] The bus controller 15 supplies (writes) the target data TD obtained from the bus B2 to the inspection data computing machine 14 (STEP 206).
[0056] The CPU 11 determines whether or not the register 12A has received and stored in the RAM 13 up to the final target data TDn, that is, whether or not all of the target data TD1 to TDn have been stored in the RAM 13 (STEP 207).
[0057] If it is determined that all of the target data TD1 to TDn are not stored in RAM 13 (STEP 207: NO), the processing of STEP 203 to 206 is repeated.
[0058] On the other hand, if it is determined that all of the target data TD1 to TDn have been stored in RAM 13 (STEP 207: YES), the CPU 11 reads out the check data ED from the register 12A (STEP 208).
[0059] The CPU 11 stores the read-out inspection data ED in the RAM 13 (STEP 209).
[0060] The bus controller 17 acquires the test data ED from the bus B2 as the CPU 11 stores the test data ED in the RAM 13 based on the address information of the RAM 13 set in STEP 202 (STEP 210).
[0061] The bus controller 17 supplies (writes) the inspection data ED obtained from the bus B2 to the inspection data comparator 16 (STEP 211).
[0062] The inspection data computing machine 14 performs predetermined calculations on the target data TD1 to RDn supplied from the bus controller 15 to generate inspection data EDX (STEP 212).
[0063] The bus controller 17 acquires the test data EDX, which is the result of the calculation by the test data calculator 14, via the bus B2, and supplies (writes) the acquired test data EDX to the test data comparator 16 (STEP 213).
[0064] The inspection data comparator 16 compares the inspection data ED (first inspection data) supplied in STEP 211 with the inspection data EDX (second inspection data) supplied in STEP 213 (STEP 214).
[0065] The CPU 11 acquires the comparison and comparison results from the inspection data comparator 16 (STEP 215).
[0066] Based on the obtained comparison result, the CPU 11 determines whether or not the test data ED received by the register 12A, which is the first test data, matches the test data EDX generated by the test data calculator 14, which is the second test data (STEP 216).
[0067] If it is determined that the data is the same (STEP 216: YES), the CPU 11 determines that no error or corruption has occurred in the received data RD, and that the data reception has been successful.
[0068] On the other hand, if it is determined that the data does not match (STEP 216: NO), the CPU 11 determines that an error or corruption has occurred in the received data RD, and that data reception has failed.
[0069] As described above, the information processing device 200 of this embodiment is provided with a test data comparator 16 and a bus controller 17, and the test data comparator 16 performs a comparison and collation between the test data ED received by the register 12A and the test data EDX generated by the test data calculator 14.
[0070] According to this configuration, unlike the case where the CPU 11 compares the inspection data ED with the inspection data EDX, the CPU 11 does not need to read the inspection data ED from the RAM 13 when comparing and matching. Therefore, the frequency of communication by the CPU 11 via the bus B1 can be further reduced compared to the first embodiment, and the occupation rate of the CPU 11 can be further reduced.
[0071] Therefore, the information processing device 200 of this embodiment allows for faster data transfer with error detection.
[0072] The present invention is not limited to the above-mentioned embodiment. For example, in each of the above-mentioned embodiments, the information processing device 100 (200) has the registers 12A and 12B as a receiving device, and receives data transferred from the transmission source device 20. However, the type of the receiving device provided in the information processing device 100 (200) is not limited to this, and may be other devices having a function of receiving and storing data, such as a buffer or an optical drive. Also, it may be a receiving device that receives data via a communication network, such as a NIC (Network Interface Card).
[0073] In addition, in each of the above embodiments, the check data ED is configured with a CRC code. However, the type of the check data ED is not limited to this, and may be other types of error detection codes. The check data ED may be data generated according to a predetermined rule (calculation) based on the data (target data TD) that configures the data body.
[0074] Furthermore, the components constituting the information processing devices (100 and 200) of the above embodiments do not necessarily have to be provided on the same chip. In other words, they may be configured as an information processing system made up of functional units provided on different chips. [Explanation of symbols]
[0075] 100,200 Information processing equipment 11 CPU 12A, 12B Register 13 RAM 14 Inspection data calculator 15 Bus controller 16 Inspection data comparator 17 Bus Controller 20 Source Device
Claims
1. a receiving unit that receives data including a data body and first test data generated by performing a predetermined operation on the data body; A storage unit connected to the receiving unit via a bus; a control unit connected to the receiving unit and the storage unit via the bus, reading the data body and the first test data from the receiving unit, and storing the data in the storage unit; a first bus controller connected to the bus, which acquires the data body from the bus when the control unit stores the data body in the storage unit based on address information of an address at which the data body is stored in the storage unit; a test data calculator that generates second test data by performing the predetermined calculation on the data body portion acquired by the first bus controller; Including, The information processing device, characterized in that the control unit determines whether or not the receiving unit has successfully received the data based on a comparison result between the first test data and the second test data.
2. The information processing device according to claim 1, characterized in that the control unit reads out the first test data from the memory unit, acquires the second test data from the test data calculator, compares the first test data with the second test data to determine whether they match, and if they match, determines that the receiving unit has successfully received the data.
3. a second bus controller connected to the bus and configured to acquire the first test data from the bus when the control unit stores the first test data in the memory unit based on address information of an address at which the first test data is stored in the memory unit; a test data comparator for comparing the first test data acquired by the second bus controller with the second test data generated by the test data calculator; Including, 2 . The information processing apparatus according to claim 1 , wherein the control unit acquires the comparison result from the test data comparator and determines whether or not the receiving unit has successfully received the data.
4. 2. The information processing apparatus according to claim 1, wherein the receiving unit is a register that receives the data transferred from an external device provided outside the information processing apparatus.
5. A data reception error detection method executed by an information processing device including: a receiving unit that receives data including a data body portion and first test data generated by performing a predetermined operation on the data body portion; a storage unit that is connected to the receiving unit via a bus; a control unit that acquires the data from the receiving unit and stores it in the storage unit; a first bus controller that acquires the data body portion from the bus in association with the storage of the data body portion in the storage unit by the control unit; and a test data calculator that generates second test data by performing a predetermined operation on the data body portion, a step of the control unit setting an address of the storage unit for storing the data body portion in the first bus controller; a step of the receiving unit receiving the data body portion; a step in which the control unit reads the data body portion from the receiving unit via the bus and stores the data body portion in the storage unit; the first bus controller acquiring the data body portion from the bus in association with the control unit storing the data body portion in the memory unit; a step of the first bus controller supplying the acquired data body portion to the test data calculator; a step in which the test data calculator performs the predetermined calculation on the data body to generate the second test data; a step of determining, by the control unit, whether or not there is an error in receiving the data by the receiving unit based on a comparison result obtained by comparing the first test data with the second test data; 13. An error detection method comprising:
6. the information processing device includes a second bus controller that acquires the first test data from the bus when the control unit stores the first test data in the memory unit, and a test data comparator that compares the first test data with the second test data; the control unit sets an address of the memory unit for storing the first test data in the second bus controller; the control unit reading the first test data from the receiving unit via the bus and storing the first test data in the storage unit; the second bus controller acquiring the first test data from the bus in association with the control unit storing the first test data in the memory unit; the second bus controller supplying the acquired first test data to the test data comparator; said test data comparator comparing said first test data with said second test data; 6. The method of claim 5, further comprising:
Citation Information
Patent Citations
Error correction circuit, disk reproduction device using the circuit and cd-rom drive
JP1998173546A
