Data detection method and device, electronic equipment and storage medium
By performing ECC encoding and processing on the data at both the sending and receiving ends, a companion checksum is generated and combined with the detection mode to determine abnormal bits and abnormal conditions, which significantly improves the security and reliability of data transmission and solves the problem of hardware failures in data transmission.
Patent Information
- Application Number
- CN202511423637.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-12-05
AI Technical Summary
During data transmission, errors may occur due to hardware problems or issues in the encoding process, potentially leading to hardware failures. Existing technologies struggle to effectively detect and correct these errors.
The target data is ECC encoded at both the sending and receiving ends to obtain the first and second encoding results. An XOR operation is then used to generate a companion checksum, which is combined with the detection mode to determine abnormal bits and abnormal situations in the data, thereby improving the detection strength.
By combining the accompanying checksum and the detection mode, the security and reliability of data transmission are significantly improved. It can effectively detect and correct multi-bit information anomalies and reduce the risk of hardware failure.
Smart Images

Figure CN121077620A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular, the present application relates to a kind of data detection method, device, electronic equipment and storage medium. BACKGROUND
[0002] Data transmission refers to the data from data sending end is transmitted to data receiving end by one or more data links, its main function is to realize the information transmission and exchange between points.A good data transmission mode can improve the real-time performance and reliability of data transmission.
[0003] And in the process of data transmission, often because of some uncontrollable factors (such as the problem of hardware itself, coding process problem) etc. And lead to data transmission error, and these errors may further cause hardware to appear more serious failure, therefore need to propose a scheme to realize the enhancement of the detection intensity of the data after transmission. SUMMARY
[0004] The present application aims to at least one of the above technical defects, the technical scheme provided by the present application embodiment is as follows: In a first aspect, the present application embodiment provides a kind of data detection method, applied to receiving end, comprising: Receiving target data and the first encoding result of target data sent by sending end, target data is binary sequence, and the first encoding result is obtained by sending end ECC encoding to target data; ECC encoding is carried out on target data at decoding, and second encoding result is obtained; The first encoding result and the second encoding result are exclusive or, and first companion formula check sub is obtained, and first companion formula check sub is used to determine the bit of information anomaly and abnormal situation in target data; Determine the current detection mode, obtain the detection result for target data based on detection mode and first companion formula check sub;Different detection mode is different to the detection intensity of target data, and detection intensity is used to represent the probability of detecting that target data exists multiple bit information anomaly.
[0005] In a second aspect, the present application embodiment provides a kind of data detection method, applied to sending end, comprising: Obtain target data, and ECC encoding is carried out on target data, and first encoding result is obtained;Target data is binary sequence; The target data and the first encoding result are sent to a receiving end, so that the receiving end performs ECC encoding on the target data at a decoding end to obtain a second encoding result, and performs XOR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome is used to determine a bit position of information abnormality and an abnormality in the target data, and a detection result of the target data is obtained based on a current detection mode of the receiving end and the first syndrome; different detection modes have different detection intensities on the target data, and the detection intensity is used to represent a probability of detecting that the target data has multiple-bit information abnormality.
[0006] In a third aspect, an embodiment of the present application provides a data detection device, including: A data receiving module is configured to receive target data and a first encoding result of the target data sent by a sending end, the target data being a binary sequence, and the first encoding result being obtained by performing error correction code (ECC) encoding on the target data by the sending end; A first encoding module is configured to perform ECC encoding on the target data at a decoding end to obtain a second encoding result; A checking module is configured to perform XOR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome being used to determine a bit position of information abnormality in the target data; A detection module is configured to determine a current detection mode, and obtain a detection result of the target data based on the detection mode and the first syndrome; different detection modes have different detection intensities on the target data, and the detection intensity is used to represent a probability of detecting that the target data has multiple-bit information abnormality.
[0007] In a fourth aspect, an embodiment of the present application provides a data detection device, including: A second encoding module is configured to obtain target data, and perform ECC encoding on the target data to obtain a first encoding result; the target data is a binary sequence; An encoding output module is configured to send the target data and the first encoding result to a receiving end, so that the receiving end performs ECC encoding on the target data at a decoding end to obtain a second encoding result, and performs XOR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome being used to determine a bit position of information abnormality in the target data, and a detection result of the target data is obtained based on a current detection mode of the receiving end and the first syndrome; different detection modes have different detection intensities on the target data, and the detection intensity is used to represent a probability of detecting that the target data has multiple-bit information abnormality.
[0008] In a fifth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the method provided in the first aspect embodiment or any optional embodiment of the first aspect.
[0009] In a sixth aspect, the embodiments of the present application provide a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the method provided in the first aspect embodiment or any optional embodiment of the first aspect.
[0010] The technical scheme provided by the embodiments of the present application has the following beneficial effects: First, in the embodiments of the present application, after receiving the target data and the first encoding result sent by the sending end, the target data is encoded again to obtain a second encoding result which can be used for comparison with the first encoding result. Then, in the embodiments of the present application, the first encoding result and the second encoding result can be compared by means of exclusive or operation to obtain the first syndrome. Finally, the detection result of the target data is determined according to the current detection mode and the first syndrome.
[0011] The scheme provided by the embodiments of the present application can effectively improve the security and reliability in the data transmission process by encoding the target data at the sending end and the receiving end respectively, comparing the two encoding results to obtain the first syndrome, and finally improving the detection strength of the target data through the first syndrome and the detection mode. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical scheme in the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced.
[0013] Figure 1 A flowchart of a data detection method provided by the embodiments of the present application; Figure 2 An encoding process diagram of an SRAM memory in an example of the embodiments of the present application; Figure 3 A flowchart of an analysis process of a syndrome in an example of the embodiments of the present application; Figure 4 An example diagram of a first preset comparison table in an example of the embodiments of the present application; Figure 5 A logic judgment code example diagram of abnormal information in an example of the embodiments of the present application; Figure 6 A flowchart of a data detection method provided by the embodiments of the present application; Figure 7A structural block diagram of a data detection device provided by an embodiment of the present application is shown in FIG. 1. Figure 8 A structural block diagram of a data detection device provided by an embodiment of the present application is shown in FIG. 1. Figure 9 A structural block diagram of a data detection device provided by an embodiment of the present application is shown in FIG. 1. DETAILED DESCRIPTION
[0014] Embodiments of the present application will be described below in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions of the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0015] Those skilled in the art can understand that the singular forms "a", "an" and "the" used herein include plural forms unless specifically stated otherwise. It should be further understood that the terms "comprise" and "include" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the present technology. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can mean that the element and the other element are connected through an intermediate element. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The term "and / or" used herein means that at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".
[0016] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below in conjunction with the accompanying drawings.
[0017] The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be described below through the description of several exemplary embodiments. It should be pointed out that the following embodiments can be mutually referenced, borrowed or combined, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0018] Figure 1 A flowchart of a data detection method provided by an embodiment of the present application is shown in FIG. 2. The execution subject of the method can be a receiving end (such as a computer, a mobile phone, a storage device, etc.), as shown in FIG. 2, the method can include: Figure 1 Step S101, receiving target data and a first encoding result of the target data sent by a sending end, the target data being a binary sequence, and the first encoding result being obtained by the sending end performing error correction code (ECC) encoding on the target data.
[0019] In the embodiments of the present application, the sending end or the receiving end can be a CPU (Central Processing Unit), a DMA (Direct Memory Access), or the like, which is not limited in the embodiments of the present application. The target data can be a binary sequence, which contains a plurality of bits, and each bit has a value of "0" or "1". The target data in the embodiments of the present application can include only data having actual calculation significance, or can include both the data having actual calculation significance and address information of the data, which is not limited in the embodiments of the present application. The ECC (Error Correction Code) encoding is used to convert the target data into an encoded data block with redundant information (check information). The bit width of the encoding result after encoding is the same as that used in the ECC encoding, that is, the encoding result contains a number of bits of values corresponding to the bit width used in the ECC encoding. For the sending end, the ECC encoding can enable the receiving end to detect whether the target data is erroneous in the transmission or storage process, and can automatically correct the errors to a certain extent.
[0020] Specifically, as shown in FIG. 1, Figure 2 when the sending end needs to send the target data to the receiving end, the target data needs to be encoded first to obtain a first encoding result corresponding to the target data. Figure 2 The first encoding result stored in the SRAM contains check information of the target data. Optionally, the target data and the first encoding result in the embodiments of the present application can be sent to the receiving end at the same time, or can be sent to the receiving end in sequence, which is not limited in the embodiments of the present application.
[0021] As shown in FIG. 2, Figure 2 Figure 2 is an encoding process diagram when there is an SRAM (Static Random-Access Memory) memory in the transmission path. In the encoding process, the address part (i.e., "waddr" in the figure) and the data part (i.e., "wdata" in the figure) of the data are encoded together as the target data.
[0022] Step S102, performing ECC encoding on the target data at the decoding end to obtain a second encoding result.
[0023] Specifically, after the receiving end receives the target data, it can encode the target data again (i.e., the first step of decoding is also encoding) to obtain a second encoded result. The sending end and the receiving end use the same bit width when performing ECC encoding on the target data.
[0024] Step S103: Perform an XOR operation on the first encoding result and the second encoding result to obtain the first comorbid checksum. The first comorbid checksum is used to determine the bits and abnormal situations in the target data where information is abnormal.
[0025] In the embodiments of this application, the syndrome is also a binary sequence, which can be used to check whether there are any anomalies in the target data during transmission or storage. Generally, when there are no anomalies in the transmission or storage process, the value of each bit in the syndrome is "0". When one or more bits in the syndrome are "1", it indicates that an anomaly has occurred in the target data during transmission or storage. Different syndromes can represent different types of anomalies, which will be discussed in detail later. The detection strength can be measured by the probability of detecting multi-bit information anomalies. Generally, the higher the probability of detecting multi-bit information anomalies, the stronger the detection strength of the corresponding detection mode.
[0026] Specifically, after the receiving end obtains the second encoding result, it can perform an XOR operation on the first encoding result and the second encoding result. The XOR operation process is to compare the data at corresponding bits in the first encoding result and the second encoding result. If they are the same, the value of the first synod checksum at the corresponding bit is "0"; if they are different, the value of the first synod checksum at the corresponding bit is "1".
[0027] like Figure 3 As shown, Figure 3 In this context, "ecc" represents the first encoding result. The rdata (data part) and raddr (address part) are ECC encoded by the receiving end to obtain the second encoding result. Then, the first encoding result and the second encoding result are passed through the "XOR" module (i.e., the XOR operation module) to obtain the corresponding output of the first synod checksum.
[0028] Step S104: Determine the current detection mode, and obtain the detection result for the target data based on the detection mode and the first accompanying checksum; different detection modes have different detection intensities for the target data, and the detection intensity is used to characterize the probability of detecting multi-bit information anomalies in the target data.
[0029] In the embodiments of the present application, the receiving end can set multiple detection modes, and the purpose of setting different detection modes is to select a more suitable detection mode, so there are differences in detection strength between different detection modes. The detection mode can be adjusted according to actual needs.
[0030] Specifically, as shown in Figure 3 After obtaining the first syndrome, the receiving end analyzes the first syndrome in combination with the current detection mode, and then outputs the detection result of the target data according to the analysis result, and can also determine whether to report an error (such as the report module in Figure 3 ) or perform self-correction according to the detection result. If the output information exception is a single-bit information exception and the information exception does not occur in the address part of the target data, the information exception can be self-corrected. For a multi-bit information exception or a single-bit information exception occurring in the address part of the target data, the report module can be used to report an error.
[0031] It should be noted that the detection result in the embodiments of the present application can include information exceptions occurring in the target data, and the information exceptions can include single-bit information exceptions and multi-bit information exceptions. The single-bit information exceptions occurring in the ECC encoding process or the data part of the target data can be regarded as information exceptions that can be self-corrected by hardware, and the single-bit information exceptions occurring in the address part of the target data or any multi-bit information exceptions can be regarded as information exceptions that cannot be self-corrected by hardware.
[0032] First, in the embodiments of the present application, after receiving the target data and the first encoding result sent by the sending end, the target data is encoded again to obtain a second encoding result that can be used for comparison with the first encoding result. Then, in the embodiments of the present application, the first encoding result and the second encoding result can be compared by means of exclusive OR operation to obtain the first syndrome. Finally, the detection result of the target data is determined according to the current detection mode and the first syndrome.
[0033] The scheme provided by the embodiments of the present application can effectively improve the security and reliability of the data transmission process by encoding the target data in the sending end and the receiving end, comparing the two encoding results to obtain the first syndrome, and finally improving the detection strength of the target data through the first syndrome and the detection mode.
[0034] In the above various embodiments, as an optional embodiment, the value of each bit in the accompanying syndrome is the first value or the second value, if there is a bit with the first value in the accompanying syndrome, it indicates that the target data has abnormal information, if all the bits are the second value, it indicates that the target data has no abnormal information. In the case that the current detection mode is the first mode, the detection result of the target data is obtained based on the detection mode and the first accompanying syndrome, specifically including: A first preset reference table is obtained, the first preset reference table contains a plurality of accompanying syndromes and target bits corresponding to each accompanying syndrome; the target bit is used to represent that in the case of obtaining the corresponding accompanying syndrome, the bit of the target data with single-bit information abnormality appears; The target number of second accompanying syndromes and target bits of each second accompanying syndrome are obtained from the first preset reference table; If there is a second accompanying syndrome identical to the first accompanying syndrome, it is determined that the detection result is that the target data has information abnormality at the target bit corresponding to the second accompanying syndrome; If there is no second accompanying syndrome identical to the first accompanying syndrome and each bit in the first accompanying syndrome is not all the second value, it is determined that the detection result is that the target data has information abnormality at a plurality of bits.
[0035] In the embodiments of the present application, the first preset reference table records the bit with data abnormality corresponding to part of the accompanying syndromes, generally, each accompanying syndrome corresponds to one bit (i.e. target bit) of the target data with abnormality (i.e. single-bit abnormality).
[0036] Figure 4 A first preset reference table example provided by the embodiments of the present application is shown in the figure as Figure 4 The figure contains a plurality of accompanying syndromes (i.e. syndrome in the figure, the number in the box after syndrome represents the bit with information abnormality in the target data, such as syndrome[0] represents the 0th bit of the target data), hit_ood1 represents the corresponding bit detected, for example, hit_ood1_syndrome[0] represents the 0th bit detected, compare_bitarray_hex represents that the bit detected has information abnormality, (syndrome_0) represents the returned accompanying syndrome, for example, when the 0th bit of the target data is detected to have information abnormality, the accompanying syndrome of 0x31 is returned.
[0037] Specifically, after obtaining the first syndrome, a certain number of second syndromes can be obtained from the first preset correspondence table, and then it is checked whether the first syndrome exists in the second syndromes. If the first syndrome is found, it is considered that the information abnormality type of the target data is single-bit abnormality (i.e., only one bit of the target data is abnormal), and the target bit corresponding to the first syndrome in the first preset correspondence table is determined as the bit of the target data in which the information abnormality exists. For example, when the first syndrome is "0x54" (expressed in hexadecimal number, which can be converted into binary number), and the second syndrome also exists in the first preset correspondence table, and the target bit corresponding to the first syndrome in the first preset correspondence table is "2", it is considered that the second bit of the target data is abnormal. It can be understood that in the embodiments of the present application, the bit of the target data is counted from the first "0" bit, that is, if the target data has 27 bits, the last bit of the target data corresponds to the 26th bit.
[0038] If the first syndrome is not all 0 and the first syndrome is not found in the second syndrome, it is considered that the information abnormality type of the target data is multi-bit abnormality (i.e., the target data has information abnormality in multiple bits). Through the above method, the multi-bit information abnormality that is mistakenly considered as single-bit information abnormality can be successfully detected based on the prior art, and the detection capability of the multi-bit information abnormality can be improved.
[0039] Based on the above embodiments, as an optional embodiment, the target number of second syndromes and the target bits of the second syndromes are obtained from the first preset correspondence table, and the method comprises the following steps: The total number of bits of each syndrome in which the bit is the first value is obtained from the first preset correspondence table; wherein the total number of bits of each syndrome in which the bit is the first value in the first preset correspondence table is an odd number; The syndromes are sorted in ascending order of the total number of bits, and the target number of syndromes in the front of the sorting result is determined as the second syndrome, and the target bits of the second syndrome are obtained from the first preset correspondence table.
[0040] Specifically, the first value in the embodiment of the present application can refer to "1" in binary, and the second value can refer to "0" in binary. In the embodiment of the present application, a part of the second syndrome can be selected from the first preset correspondence table as the object of reference. Specifically, the target number can be determined according to the target data and the bit width used when the target data is encoded, and then the target number of the second syndrome can be selected from the first preset correspondence table.
[0041] First of all, it needs to be pointed out that for the syndrome, if the number of bits with "1" in the syndrome is odd, the target data can have single-bit abnormality or multi-bit abnormality, and if the number of bits with "1" is 1, it means that an abnormality occurs in the ECC encoding process (if the number of bits is not 1, it means that an information abnormality occurs in the target data). If the number of bits with "1" in the syndrome is even, it means that the target data has a multi-bit abnormality (i.e., a multi-bit information abnormality occurs in the target data).
[0042] It needs to be pointed out that since the number of bits with "1" being even can determine that the target data has a multi-bit abnormality, the first preset correspondence table does not contain the case that the syndrome contains an even number of bits with "1", and for the syndrome with the number of bits with "1" being 1, the information abnormality occurs in the ECC encoding process and is irrelevant to the target data itself, so the first preset correspondence table does not contain the case that the syndrome contains one bit with "1". In order to reduce the fan-out and improve the frequency of the hardware, when selecting from the first preset correspondence table, the second syndrome with fewer bits with "1" can be selected preferentially, and the target bits corresponding to these second syndromes can be obtained.
[0043] On the basis of the above embodiments, as an optional embodiment, the target number is the value of the bit length of the target data.
[0044] Specifically, since the first preset correspondence table in the embodiment of the present application records the case of single-bit information abnormality of the data, it can be understood that for the target data, how many bits it contains, how many types of single-bit abnormality can occur (for example, for a target data containing 20 bits, bit information abnormality (such as bit value error, etc.) can occur on all 20 bits, so there are 20 types of single-bit abnormality), therefore the number of the second syndrome selected in the embodiment of the present application (i.e., the target number) is equal to the bit length of the target data.
[0045] On the basis of the various embodiments described above, as an optional embodiment, when the detection result is that the target data has information abnormality on the target bit corresponding to the second syndrome check sub, the method further comprises: if the target data is the first value on the target bit, the first value is adjusted to the second value; or if the target data is the second value on the target bit, the second value is adjusted to the first value.
[0046] Specifically, in the embodiment of the present application, if each second syndrome check sub exists in the same syndrome check sub as the first syndrome check sub, it can be considered that the target data only has single-bit information abnormality. The target data in the embodiment of the present application is a binary sequence, which only contains two values of "0" and "1", so the value on the corresponding target bit can be directly adjusted to another value to realize the automatic error correction process of the target data.
[0047] On the basis of the various embodiments described above, as an optional embodiment, when the detection result is that the target data has information abnormality on multiple bits, the method further comprises: adjusting the receiving end to a safe state; the safe state is used to indicate that the data transmission and storage path of the target data has a fault; displaying prompt information of the storage information abnormality of the target data on multiple bits.
[0048] Specifically, if each second syndrome check sub does not exist in the same syndrome check sub as the first syndrome check sub, it can be considered that the target data has multi-bit information abnormality. This part of information abnormality is self-correctable by the hardware itself, and if the use state is continued, it may cause more serious abnormality, so the hardware will enter a "safe state" (or "safe mode"). When the receiving end enters the safe state, it indicates that the data transmission and storage path has a fault, which needs to be further repaired and handled, and related abnormal prompt information is displayed.
[0049] On the basis of the various embodiments described above, as an optional embodiment, in the case that the current detection mode is the second mode, the detection result for the target data is determined based on the detection mode and the syndrome check sub, specifically comprising: if each bit in the first syndrome check sub is the second value, it is determined that the detection result is that the target data has no information abnormality on the bit; if there is a bit in the first syndrome check sub that is not the second value, it is determined that the detection result is that the target data has information abnormality on the bit.
[0050] Specifically, the embodiment of the present application also provides another mode (i.e., the second mode) of detection, and the focus of the determination logic in the first mode is to determine the type of information abnormality of the hardware, while in the second mode, the focus of the determination logic is to determine whether the hardware is abnormal, i.e., as long as each bit of the first accompanying check sub is not "0", it is determined that the hardware is abnormal, and the hardware directly enters the "safe mode". This way has stronger detection capability and can avoid more risks, but this mode is too strong in detection capability, so that in the case of "low risk" information abnormality or "no actual risk" information abnormality, the hardware will also enter the "safe mode", which will sacrifice the availability of the hardware to some extent.
[0051] It should be noted that although the scheme provided by the embodiment of the present application cannot correct the multi-bit information abnormality, it can significantly improve the detection capability of the multi-bit abnormal information. In the existing application scenario, each accompanying check sub containing an odd number of bits of "1" is directly determined as single-bit information abnormality, and each accompanying check sub containing an even number of bits of "1" is determined as multi-bit information abnormality. However, in fact, this detection method still has a large error, because when some multi-bit information abnormality occurs, the same accompanying check sub as some single-bit information abnormality will also be generated. The scheme provided by the embodiment of the present application can detect some multi-bit abnormal information corresponding to the accompanying check sub not belonging to the second accompanying check sub in the first preset reference table, and further improve the detection capability of the multi-bit abnormal information.
[0052] For example, Table 1 is the detection capability of the hardware for bit information abnormality in the second mode of the prior art. As shown in Table 1, when ew (i.e., the bit width used in ECC encoding, hereinafter abbreviated as ew) is 8, the detection capability of the hardware is 99.61% (i.e., 1-1 / 2^ew), and when ew is 7, the detection capability of the hardware is 99.22%.
[0053]
[0054] Table 1 Next, refer to Table 2 and Table 3. Table 2 is the detection capability of the hardware for bit information abnormality when the target data only contains the data part in the first mode of the prior art, and Table 3 is the detection capability of the hardware for bit information abnormality when the target data contains both the data part and the address part corresponding to the data in the first mode of the prior art. In the first mode, for the information abnormality that the hardware can "self-correct", it will no longer report an error after completing "self-correction";
[0055] Table 2
[0056] Table 3 wherein, aw in Table 2 and Table 3 represents the bit number of the address part in the target data, daw_max represents the maximum bit number that the data part in the target data can include when the target data is encoded under the corresponding ew, DCodd_mbe represents the detection ability for information anomaly when the syndrome contains an odd number of "1" bits (usually expressed by probability), DCeven_mbe represents the detection ability for information anomaly when the syndrome contains an even number of "1" bits, and DCmbe represents the total detection ability, it should be noted that in the actual operation of multi-bit error detection, the probability of an odd number of "1" bits appearing in the syndrome (i.e., sending an odd bit anomaly) and the probability of an even number of "1" bits appearing in the syndrome (i.e., sending an even bit anomaly) can be considered the same, so each is weighted by 50%, and since the information anomaly in the address part of the target data is "uncorrected error", for the case where the syndrome contains an odd number of "1" bits, the detection probability is the address bit width (i.e., the number of bits contained in the corresponding syndrome) divided by the effective space corresponding to the syndrome:
[0057] And for the case where the syndrome contains an even number of "1" bits, since it is a case of no information anomaly when "syndrome = 0", the detection probability is:
[0058] And the total detection ability is the sum of the probabilities of the above two detection abilities: DCmbe=DCodd_mbe+DCeven_mbe From the above comparison, it is not difficult to find that compared with the target data containing only the data part, if the address part corresponding to the data part is also involved in the ECC encoding, the detection ability for information anomaly can be improved to some extent.
[0059] Then, referring to Table 4 and Table 5, Table 4 is the detection ability of the hardware for multi-bit information anomaly when the target data contains both the data part and the address part corresponding to the data part in the first mode in the embodiments of the present application, and Table 5 is the detection ability of the hardware for bit information anomaly when the target data contains only the data part in the first mode in the embodiments of the present application;
[0060] Table 4
[0061] Table 5 In the table 4 and table 5, dw represents the bit included in the data part of the target data. Compared with the prior art, the judgment logic of the prior art that the first syndrome with an odd number of 1 bits is regarded as a single-bit information anomaly is modified to the judgment logic of the embodiment of the present application that the first syndrome with an odd number of 1 bits and the same syndrome in each second syndrome are regarded as a single-bit information anomaly. Under the new judgment logic, the detection capability also changes:
[0062] By comparing table 2 with table 4 and table 3 with table 5, it can be found that the judgment logic provided by the embodiment of the present application can significantly improve the overall detection capability of the hardware. The core is that for the syndrome with an odd number of 1 bits, it is no longer directly determined as a single-bit information anomaly. It will only be determined as a single-bit information anomaly and self-corrected when a certain condition is met (i.e. the same syndrome exists in each second syndrome). Otherwise, it is still determined as a multi-bit information anomaly and an error is reported. This way can greatly improve the detection capability for multi-bit information anomaly. In the above scheme, whether the target data contains the address part of the data or not, the detection capability can remain consistent.
[0063] The detection judgment logic of the embodiment of the present application can be implemented as shown in the following code: Figure 5 In the prior art judgment logic, as long as an odd number of 1 bits appears in the first syndrome, it is considered that the target data has a single-bit information anomaly. In the detection judgment logic of the present application, a new judgment logic (i.e. hit judgment logic) is added. That is, not only an odd number of 1 bits appears in the first syndrome, but also the corresponding first syndrome in the obtained multiple second syndromes is determined as a single-bit information anomaly. Otherwise, it is still determined as a multi-bit information anomaly. Compared with the prior art judgment logic, this way can significantly improve the detection capability of multi-bit information anomaly.
[0064] Figure 6 A flowchart of a data detection method is provided for the embodiment of the present application. The execution subject of the method can be a sending end (such as a computer, a mobile phone, a storage device, a CPU, etc.). As shown in the following figure, the method can include: Figure 6 In step S601, target data is obtained, and the target data is ECC encoded to obtain a first encoding result; the target data is a binary sequence.
[0065] In an embodiment of the present application, the target data can be a binary sequence, and the target data includes a plurality of bits, and each bit has a value of "0" or "1". The target data in the embodiment of the present application can include only data having actual calculation significance, or can include both data having actual calculation significance and address information of the data, which is not limited in the embodiment of the present application. ECC (Error Correction Code) encoding is used to convert the target data into an encoded data block with redundant information (check information). The bit width of the encoding result after encoding is the same as that used in the ECC encoding, that is, the encoding result includes a number of bits of values corresponding to the bit width used in the encoding. For the sending end, the ECC encoding can enable the receiving end to detect whether the target data is erroneous in the transmission or storage process, and can automatically correct the errors within a certain range of abnormality.
[0066] Specifically, when the sending end needs to send the target data to the receiving end, the target data needs to be ECC encoded first to obtain a first encoding result corresponding to the target data. Optionally, the target data and the first encoding result in the embodiment of the present application can be sent to the receiving end simultaneously, or can be sent to the receiving end in sequence, which is not limited in the embodiment of the present application.
[0067] In step S602, the target data and the first encoding result are sent to the receiving end, so that the receiving end performs ECC encoding on the target data in decoding to obtain a second encoding result, and performs XOR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome is used to determine the bit position of the abnormal information in the target data and the abnormal situation, and a detection result of the target data is obtained based on the current detection mode of the receiving end and the first syndrome; different detection modes have different detection strengths for the target data, and the detection strength is used to represent the probability of detecting that the target data has a plurality of bit abnormal information.
[0068] In the embodiments of the present application, the accompanying syndrome is also a binary sequence, which can be used to check whether the target data has an abnormality in the process of transmission or storage. Generally, when the process of transmission or storage is normal, the value of each bit in the accompanying syndrome is "0", and when one or more bits in the accompanying syndrome are "1", it indicates that the target data has an abnormality in the process of transmission or storage, and different accompanying syndromes can represent different types of abnormalities. The receiving end can set multiple detection modes, and the purpose of setting different detection modes is to select a more suitable detection mode, so there is a difference in detection strength between different detection modes. The detection strength can be measured by the detection probability of multi-bit information abnormality. Generally, the higher the probability of detecting multi-bit information abnormality, the stronger the detection strength of the corresponding detection mode.
[0069] Specifically, after the receiving end receives the target data, the target data can be encoded again to obtain a second encoding result. The bit width used by the sending end and the receiving end when encoding the target data is the same, and then the first encoding result and the second encoding result can be subjected to an exclusive or operation. The exclusive or operation process is to compare the data on the corresponding bit positions in the first encoding result and the second encoding result. If they are the same, the value of the first accompanying syndrome on the corresponding bit position is "0", and if they are different, the value of the first accompanying syndrome on the corresponding bit position is "1". After obtaining the first accompanying syndrome, the receiving end will analyze the first accompanying syndrome in combination with the current detection mode, and then output the detection result of the target data according to the analysis result.
[0070] First, in the embodiments of the present application, after receiving the target data and the first encoding result sent by the sending end, the target data is encoded again to obtain a second encoding result that can be used for comparison with the first encoding result; Then, in the embodiments of the present application, the first encoding result and the second encoding result can be compared by means of exclusive or operation to obtain the first accompanying syndrome; Finally, the detection result of the target data is determined according to the current detection mode and the first accompanying syndrome.
[0071] The scheme provided by the embodiments of the present application can effectively improve the security and reliability in the process of data transmission by encoding the target data in the sending end and the receiving end respectively, comparing the two encoding results to obtain the first accompanying syndrome, and finally improving the detection strength of the target data through the first accompanying syndrome and the detection mode.
[0072] On the basis of each of the above embodiments, as an optional embodiment, the target data is ECC encoded to obtain a first encoding result, specifically including: obtaining a data length of the target data, and determining a bit width used for ECC encoding of the target data based on the data length; ECC encoding the target data based on the bit width to obtain a first encoding result; the bit width of the first encoding result is the same as the bit width used for ECC encoding of the target data.
[0073] In the embodiments of the present application, the data length can be the number of bit positions contained by the target data. When the target data only contains a data part, the data length is the number of bit positions of the data part. When the target data contains a data part and an address part corresponding to the data, the data length is the sum of the number of bit positions of the data part and the address part.
[0074] Specifically, the bit width used for ECC encoding in the embodiments of the present application has a corresponding maximum encodable data length. Generally, before ECC encoding of the target data, it is necessary to ensure that the maximum encoding data length corresponding to the bit width used for encoding is not less than the data length of the target data. The corresponding relationship between the bit width and the maximum encodable data length can be: daw_max=2 ew-1 -ew wherein daw_max represents the maximum encodable data length, and ew represents the ECC bit width.
[0075] After the bit width is determined, the target data can be ECC encoded according to the bit width to obtain a first encoding result. The number of bit positions (i.e. the bit width) contained in the obtained first encoding result is the same as the bit width used for ECC encoding.
[0076] On the basis of each of the above embodiments, as an optional embodiment, the bit width used for ECC encoding of the target data is determined based on the data length, specifically including: obtaining a second preset reference table, the second preset reference table including a plurality of optional bit widths and a first upper limit of each optional bit width; wherein the first upper limit represents the maximum encoding data length corresponding to the optional bit width; determining at least one second upper limit not less than the data length from the first upper limits, and determining the optional bit width corresponding to the minimum value in the second upper limits as the bit width used for ECC encoding of the target data.
[0077] In the embodiments of the present application, the first upper limit is the maximum encodable data length mentioned in the foregoing.
[0078] Specifically, to avoid wasting resources, when selecting the bit width for ECC encoding of target data, a lower bit width will be preferred. For example, for target data including 20 bits, a bit width of 6 or more can be selected for encoding. In this case, a bit width of 6 can be selected as the bit width used for ECC encoding.
[0079] Optionally, the second preset lookup table in this application embodiment may also include a lower limit of the coded data length corresponding to each bit width. The lower limit of the coded data length of each bit width can be a first upper limit of the bit width that is 1 smaller than it plus 1. For example, when the bit width is 6, its first upper limit is 26, then the lower limit of the coded data length when the bit width is 7 is 27.
[0080] Figure 7 A structural block diagram of a data detection device provided in an embodiment of this application is shown below. Figure 7 As shown, the data detection device 700 may include: a data receiving module 701, a first encoding module 702, a verification module 703, and a first detection module 704, wherein... The data receiving module 701 is used to receive the target data and the first encoding result of the target data sent by the sending end. The target data is a binary sequence, and the first encoding result is obtained by the sending end performing error correction code (ECC) encoding on the target data. The first encoding module 702 is used to perform ECC encoding on the target data at the decoding point to obtain the second encoding result; The verification module 703 is used to perform an XOR operation on the first encoding result and the second encoding result to obtain a first comorbid checksum. The first comorbid checksum is used to determine the bits and abnormal situations in the target data where information is abnormal. The detection module 704 is used to determine the current detection mode and obtain the detection result for the target data based on the detection mode and the first accompanying checksum. Different detection modes have different detection intensities for the target data, and the detection intensity is used to characterize the probability of detecting multi-bit information anomalies in the target data.
[0081] First, in the embodiment of this application, after receiving the target data and the first encoding result sent by the sending end, the target data will be encoded again to obtain a second encoding result that can be compared with the first encoding result; Then, in the embodiments of this application, the first encoding result and the second encoding result can be compared by XOR operation to obtain the first comorbid checksum; Finally, the detection result for the target data is determined based on the current detection mode and the first associated checksum.
[0082] The scheme provided by the embodiments of the present application can improve the security and reliability in the data transmission process by encoding the target data at the sending end and the receiving end respectively, comparing the two encoding results to obtain a first accompanying syndrome, and finally improving the detection strength of the target data through the first accompanying syndrome and the detection mode.
[0083] On the basis of the above various embodiments, as an optional embodiment, the value of each bit in the accompanying syndrome is the first value or the second value, if there is a bit of the first value in the accompanying syndrome, it indicates that the target data has abnormal information, if all the bits in the accompanying syndrome are the second value, it indicates that the target data has no abnormal information. In the case that the current detection mode is the first mode, the first detection module is specifically configured to: obtain a first preset reference table, the first preset reference table contains a plurality of accompanying syndromes and target bits corresponding to each accompanying syndrome; the target bit is used to represent that in the case of obtaining the corresponding accompanying syndrome, the bit position of the single-bit information abnormality in the target data appears; obtain a target number of second accompanying syndromes and target bits of each second accompanying syndrome from the first preset reference table; if there is a second accompanying syndrome same as the first accompanying syndrome, it is determined that the detection result is that the target data has information abnormality at the target bit position corresponding to the second accompanying syndrome; if there is no second accompanying syndrome same as the first accompanying syndrome and each bit in the first accompanying syndrome is not all the second value, it is determined that the detection result is that the target data has information abnormality at a plurality of bit positions.
[0084] On the basis of the above various embodiments, as an optional embodiment, the first detection module is further configured to: obtain the total number of bits of the first value in each accompanying syndrome in the first preset reference table; wherein the total number of bits of the first value in each accompanying syndrome in the first preset reference table is odd; sort the accompanying syndromes in the order from small to large according to the total number of bits, determine the target number of accompanying syndromes in the front of the sorting result as the second accompanying syndrome, and obtain the target bits of each second accompanying syndrome from the first preset reference table.
[0085] On the basis of the above various embodiments, as an optional embodiment, the target number is the value of the bit length of the target data.
[0086] On the basis of each of the above embodiments, as an optional embodiment, the apparatus further comprises an exception handling module, when the detection result is that the target data has information exception on the target bit corresponding to the second syndrome, the exception handling module is specifically used for: if the target data is the first value on the target bit, the first value is adjusted to the second value; or if the target data is the second value on the target bit, the second value is adjusted to the first value.
[0087] On the basis of each of the above embodiments, as an optional embodiment, when the detection result is that the target data has information exception on multiple bits, the exception handling module is further used for: adjusting the receiving end to a safe state; the safe state is used to indicate that the data transmission and storage path of the target data has a fault; displaying prompt information that the target data has storage information exception on multiple bits.
[0088] On the basis of each of the above embodiments, as an optional embodiment, in the case that the current detection mode is the first mode, the first detection module is specifically used for: if each bit in the first syndrome is the second value, it is determined that the detection result is that the target data has no information exception bit; if there is a bit in the first syndrome that is not the second value, it is determined that the detection result is that the target data has information exception bit.
[0089] Figure 8 A structural block diagram of a data detection apparatus provided by the embodiments of the present application is shown in Figure 8 The data detection apparatus 800 can include a second encoding module 801 and a second detection module 802, wherein, The second encoding module 801 is used to obtain target data, perform ECC encoding on the target data, and obtain a first encoding result; the target data is a binary sequence; The encoding output module 802 is used to send the target data and the first encoding result to a receiving end, so that the receiving end performs ECC encoding on the target data at decoding, obtains a second encoding result, and performs XOR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome is used to determine the bit and exception of the target data that has information exception, and the detection result of the target data is obtained based on the current detection mode of the receiving end and the first syndrome; different detection modes have different detection strengths for the target data, and the detection strength is used to represent the probability of detecting that the target data has multiple bit information exceptions.
[0090] Firstly, in the embodiment of the application, after receiving the target data and the first encoding result sent by the sending end, the target data is encoded again to obtain a second encoding result which can be used for comparison with the first encoding result; Then, in the embodiment of the application, the first encoding result and the second encoding result can be compared by means of XOR operation to obtain the first coset check subcode; Finally, the detection result of the target data is determined according to the current detection mode and the first coset check subcode.
[0091] The scheme provided by the embodiment of the application can effectively improve the security and reliability in the data transmission process by encoding the target data in the sending end and the receiving end respectively, comparing the two encoding results to obtain the first coset check subcode, and finally improving the detection strength of the target data through the first coset check subcode and the detection mode.
[0092] On the basis of each of the above embodiments, as an optional embodiment, the second encoding module is specifically configured to: obtain the data length of the target data, and determine the bit width used for ECC encoding of the target data based on the data length; perform ECC encoding on the target data based on the bit width to obtain the first encoding result; the bit width of the first encoding result is the same as the bit width used for ECC encoding of the target data.
[0093] On the basis of each of the above embodiments, as an optional embodiment, the second encoding module is further configured to: obtain a second preset reference table, the second preset reference table including a plurality of optional bit widths and a first upper limit of each optional bit width; wherein the first upper limit represents the maximum encoding data length corresponding to the optional bit width; determine at least one second upper limit from the first upper limits which is not less than the data length, and determine the optional bit width corresponding to the minimum value in the second upper limits as the bit width used for ECC encoding of the target data.
[0094] Reference will now be made to the following description Figure 9 which shows a structural schematic diagram of an electronic device (for example, a terminal device or a server) 900 adapted to implement the method shown in Figure 1 or Figure 6 embodiments of the application. The electronic device in the embodiments of the application can include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (for example, vehicle-mounted navigation terminals), wearable devices, and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 7The electronic device shown is merely an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
[0095] The electronic device includes a memory for storing a program for executing the methods described in the above various method embodiments, and a processor configured to execute the program stored in the memory. Here, the processor can be referred to as the processing device 901 described below, and the memory can include at least one of a read-only memory (ROM) 902, a random access memory (RAM) 903, and a storage device 908, as described below: As shown, the electronic device 900 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901 that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904. Figure 9
[0096] Generally, the following devices can be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication devices 909 can allow the electronic device 900 to communicate wirelessly or wired with other devices to exchange data. Although Figure 9 An electronic device having various devices is shown, but it is understood that all of the devices shown are not required to be implemented or possessed. More or less devices can be alternatively implemented or possessed.
[0097] In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 909, or installed from the storage devices 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-described functions defined in the methods of the embodiments of the present application are performed.
[0098] It should be noted that the computer-readable storage medium in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, an RF (radio frequency) or the like, or any suitable combination of the above.
[0099] In some embodiments, the client, server, can communicate using any current known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0100] The above computer-readable medium can be contained in the above electronic device; or can exist separately without being assembled into the electronic device.
[0101] The above computer-readable medium carries one or more programs, when the above one or more programs are executed by the electronic device, the electronic device: The target data and the first encoding result of the target data sent by the sending end are received, wherein the target data is a binary sequence, and the first encoding result is obtained by the sending end performing error correction code (ECC) encoding on the target data; the target data is ECC encoded at a decoding place to obtain a second encoding result; the first encoding result and the second encoding result are subjected to XOR operation to obtain a first syndrome check subcode, and the first syndrome check subcode is used to determine a bit position and an abnormal situation of the target data in which information abnormality occurs; a current detection mode is determined, and a detection result for the target data is obtained based on the detection mode and the first syndrome check subcode; different detection modes have different detection strengths on the target data; and the detection strength is used to represent a probability of detecting that the target data has multiple-bit information abnormality.
[0102] Or, The target data is obtained, and the target data is ECC encoded to obtain a first encoding result; the target data is a binary sequence; the target data and the first encoding result are sent to a receiving end, so that the receiving end performs ECC encoding on the target data at a decoding place to obtain a second encoding result, and the first encoding result and the second encoding result are subjected to XOR operation to obtain a first syndrome check subcode, and the first syndrome check subcode is used to determine a bit position and an abnormal situation of the target data in which information abnormality occurs; a detection result for the target data is obtained based on a current detection mode of the receiving end and the first syndrome check subcode; different detection modes have different detection strengths on the target data; and the detection strength is used to represent a probability of detecting that the target data has multiple-bit information abnormality.
[0103] Computer program code for carrying out operations of the present application can 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 can 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 latter scenario, the remote computer can 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 can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0104] The computer program product of the first aspect of the present application can include a computer readable storage medium. The computer readable storage medium can be a tangible medium that can contain or store the program for use by or in connection with the instruction execution system, apparatus, or device. The computer readable storage medium can be a machine-readable signal medium or a machine-readable storage medium.
[0105] The modules or units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. In some cases, the names of the modules or units do not limit the functions of the modules or units themselves. For example, the first constraint obtaining module can also be referred to as a module that obtains a first constraint.
[0106] The functions described in the above description can be performed by one or more hardware logic components. For example, non-limiting examples of hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0107] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store the program for use by or in connection with the instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the above. More specific examples of the machine-readable storage medium will include one or more of an electrical connection based on one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0108] It should be understood that although the steps in the flowcharts of the drawings are shown in sequence according to the indication of the arrows, the steps are not necessarily executed in sequence according to the indication of the arrows. Unless explicitly stated herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least part of the steps in the flowcharts of the drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0109] The above only describes some embodiments of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A data detection method applied to a receiving end, characterized in that, The method comprises the following steps: receiving target data and a first encoding result of the target data sent by a sending end, the target data being a binary sequence, and the first encoding result being obtained by performing error correction code (ECC) encoding on the target data by the sending end; performing ECC encoding on the target data at a decoding end to obtain a second encoding result; performing exclusive OR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome being used to determine a bit position of abnormal information and an abnormal condition in the target data; determining a current detection mode, and obtaining a detection result of the target data based on the detection mode and the first syndrome, different detection modes having different detection intensities for the target data, the detection intensity being used to represent a probability of detecting a plurality of bit positions of abnormal information in the target data.
2. The method of claim 1, wherein, Each bit position in the syndrome has a first value or a second value, and if there is a bit position with the first value in the syndrome, it indicates that the target data has abnormal information, and if all bit positions in the syndrome have the second value, it indicates that the target data has no abnormal information. In a case where the current detection mode is a first mode, the method of obtaining the detection result of the target data based on the detection mode and the first syndrome comprises the following steps: obtaining a first preset reference table, the first preset reference table containing a plurality of syndromes and target bit positions corresponding to each syndrome, the target bit position being used to represent a bit position of single-bit abnormal information in the target data in a case where the corresponding syndrome is obtained; obtaining a target number of second syndromes and target bit positions of each second syndrome from the first preset reference table; if there is a second syndrome identical to the first syndrome, determining that the detection result is that the target data has abnormal information at a target bit position corresponding to the second syndrome; if there is no second syndrome identical to the first syndrome and each bit position in the first syndrome is not all the second value, determining that the detection result is that the target data has abnormal information at a plurality of bit positions.
3. The method of claim 2, wherein, The method of obtaining a target number of second syndromes and target bit positions of each second syndrome from the first preset reference table comprises the following steps: obtaining a total number of bit positions with the first value in each syndrome in the first preset reference table, wherein the total number of bit positions with the first value in each syndrome in the first preset reference table is an odd number; sorting the syndromes in a descending order of the total number of bit positions with the first value, and determining a target number of syndromes at the front of the sorting result as the second syndromes, and obtaining target bit positions of each second syndrome from the first preset reference table.
4. The method of claim 2, wherein, The target number is a value of a bit length of the target data.
5. The method of claim 2, wherein, When the detection result is that the target data has abnormal information at a target bit position corresponding to the second syndrome, the method further comprises the following steps: if the target data is of a first value at the target bit, the first value is adjusted to a second value; or if the target data is of a second value at the target bit, the second value is adjusted to the first value.
6. The method of claim 2, wherein, When the detection result is that the target data has information abnormality at multiple bits, the method further comprises: adjusting the receiving end to a security state; the security state is used to indicate that the data transmission and storage path of the target data has a fault; displaying prompt information that the target data has storage information abnormality at multiple bits.
7. The method of claim 1, wherein, In a case where the current detection mode is a second mode, the determination of the detection result for the target data based on the detection mode and the syndrome comprises: if each bit in the first syndrome is of a second value, it is determined that the detection result is that the target data has no information abnormality at the bit; if there is a bit in the first syndrome that is not of the second value, it is determined that the detection result is that the target data has information abnormality at the bit.
8. A data detection method applied to a transmitting end, characterized in that, comprising: obtaining target data, ECC encoding the target data to obtain a first encoding result; the target data is a binary sequence; sending the target data and the first encoding result to a receiving end, so that the receiving end ECC encodes the target data at a decoding end to obtain a second encoding result, and XORs the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome is used to determine the bit and abnormality of the target data that has information abnormality, and the detection result for the target data is obtained based on the current detection mode of the receiving end and the first syndrome; different detection modes have different detection strengths for the target data, and the detection strength is used to represent the probability of detecting that the target data has multiple bit information abnormality.
9. The method of claim 8, wherein, the ECC encoding of the target data to obtain a first encoding result comprises: obtaining the data length of the target data, and determining the bit width used for ECC encoding of the target data based on the data length; ECC encoding the target data based on the bit width to obtain the first encoding result; the bit width of the first encoding result is the same as the bit width used for ECC encoding of the target data.
10. The method of claim 9, wherein, the determination of the bit width used for ECC encoding of the target data based on the data length comprises: obtaining a second preset reference table, the second preset reference table comprising a plurality of selectable bit widths and a first upper limit of each selectable bit width; wherein the first upper limit represents the maximum encoding data length of the corresponding selectable bit width; determining at least one second upper limit from the first upper limits that is not less than the data length, and determining the selectable bit width corresponding to the minimum value in the second upper limits as the bit width used for ECC encoding of the target data.
11. A data detection device, characterized by comprising: comprising: The data receiving module is configured to receive target data and a first encoding result of the target data sent by a sending end, the target data being a binary sequence, and the first encoding result being obtained by performing error correction code (ECC) encoding on the target data by the sending end. The first encoding module is configured to perform ECC encoding on the target data at a decoding end to obtain a second encoding result. The checking module is configured to perform exclusive OR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome being used to determine a bit position at which information abnormality occurs in the target data. The detecting module is configured to determine a current detection mode, and obtain a detection result for the target data based on the detection mode and the first syndrome, different detection modes having different detection intensities for the target data, the detection intensity being used to represent a probability of detecting that the target data has multiple-bit information abnormality.
12. A data detection device, characterized by comprising: The second encoding module is configured to obtain target data, and perform ECC encoding on the target data to obtain a first encoding result. The target data is a binary sequence. The encoding output module is configured to send the target data and the first encoding result to a receiving end, so that the receiving end performs ECC encoding on the target data at a decoding end to obtain a second encoding result, and performs exclusive OR operation on the first encoding result and the second encoding result to obtain a first syndrome, the first syndrome being used to determine a bit position at which information abnormality occurs in the target data, and a detection result for the target data is obtained based on a current detection mode of the receiving end and the first syndrome, different detection modes having different detection intensities for the target data, the detection intensity being used to represent a probability of detecting that the target data has multiple-bit information abnormality. The processor executes the computer program to implement the method of any one of claims 1-10.
13. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, is arranged to perform the method of any one of claims 1 to 12. The computer program is executed by the processor to implement the method of any one of claims 1-10.
14. A computer readable storage medium having stored thereon a computer program, characterized in that,