[go: up one dir, main page]

CN115167767B - Dirty data prevention method and system based on BBC exclusive OR check - Google Patents

Dirty data prevention method and system based on BBC exclusive OR check Download PDF

Info

Publication number
CN115167767B
CN115167767B CN202210751662.7A CN202210751662A CN115167767B CN 115167767 B CN115167767 B CN 115167767B CN 202210751662 A CN202210751662 A CN 202210751662A CN 115167767 B CN115167767 B CN 115167767B
Authority
CN
China
Prior art keywords
data
check
server
received
dirty
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210751662.7A
Other languages
Chinese (zh)
Other versions
CN115167767A (en
Inventor
余丹
刘一凡
兰雨晴
邢智涣
王丹星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Standard Intelligent Security Technology Co Ltd
Original Assignee
China Standard Intelligent Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Intelligent Security Technology Co Ltd filed Critical China Standard Intelligent Security Technology Co Ltd
Priority to CN202210751662.7A priority Critical patent/CN115167767B/en
Publication of CN115167767A publication Critical patent/CN115167767A/en
Application granted granted Critical
Publication of CN115167767B publication Critical patent/CN115167767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Detection And Correction Of Errors (AREA)

Abstract

The invention provides a dirty data prevention method and a dirty data prevention system based on BBC exclusive OR check, wherein the method comprises the following steps: step 1: receiving data sent by a server side; step 2: detecting whether dirty data exist in the data by utilizing a BBC exclusive OR checking algorithm; if dirty data exists in the data, stopping the transmission of the dirty data; and if the dirty data does not exist in the data, continuing to transmit the data. The dirty data can be quickly and effectively detected.

Description

一种基于BBC异或校验的脏数据预防方法及系统Method and system for preventing dirty data based on BBC XOR check

技术领域technical field

本发明涉及数据校验技术领域,特别涉及一种基于BBC异或校验的脏数据预防方法及系统。The invention relates to the technical field of data verification, in particular to a method and system for preventing dirty data based on BBC XOR verification.

背景技术Background technique

两个服务个体之间的数据交互是系统的核心业务之一,怎样维持系统高效、快速运转一直是通信领域的一个研究热点。脏数据是指系统中的数据超出范围、失去意义或者格式非法,以及在源系统中存在不规范的编码和含糊的业务逻辑。究其脏数据存在的主要原因是因为源系统的设计不够严密,脏数据的主要表现形式有:数据格式错误、业务逻辑不合理和违反业务规则等。The data interaction between two service individuals is one of the core services of the system. How to maintain the efficient and fast operation of the system has always been a research hotspot in the field of communication. Dirty data refers to data in the system that is out of range, meaningless, or in an illegal format, as well as irregular coding and ambiguous business logic in the source system. The main reason for the existence of dirty data is that the design of the source system is not rigorous enough. The main manifestations of dirty data are: wrong data format, unreasonable business logic, and violation of business rules.

目前,传统处理脏数据的软方法是采用COBOL语言、C语言或者是SQL语句来检测存储系统中是否存在有脏数据,但是这些方法需要程序员大量的编程工作,而且这些语言的界面处理功能不是很强,执行效率低下,对于脏数据的查询速度缓慢,极大地影响了用户的工作效率。因此,如何准确快速地检测脏数据是亟待解决的一个问题。At present, the traditional soft method of processing dirty data is to use COBOL language, C language or SQL statement to detect whether there is dirty data in the storage system, but these methods require a lot of programming work for programmers, and the interface processing functions of these languages are not Very strong, low execution efficiency, and slow query speed for dirty data, which greatly affects the user's work efficiency. Therefore, how to detect dirty data accurately and quickly is an urgent problem to be solved.

因此,本发明提出一种基于BBC异或校验的脏数据预防方法及系统。Therefore, the present invention proposes a method and system for preventing dirty data based on BBC XOR check.

发明内容Contents of the invention

本发明提供一种基于BBC异或校验的脏数据预防方法及系统,用以通过采用BBC异或校验算法,对数据进行脏数据是否存在的校验,可以快速且有效的实现对脏数据的检测。The present invention provides a method and system for preventing dirty data based on BBC XOR check, which is used to check whether dirty data exists on data by using BBC XOR check algorithm, and can quickly and effectively realize dirty data detection.

本发明提供一种基于BBC异或校验的脏数据预防方法,包括:The present invention provides a dirty data prevention method based on BBC XOR check, comprising:

步骤1:接收服务器端发送的数据;Step 1: Receive the data sent by the server;

步骤2:利用BBC异或校验算法检测所述数据中是否存在脏数据;Step 2: Use the BBC XOR check algorithm to detect whether there is dirty data in the data;

若所述数据中存在脏数据,则停止对脏数据的传输;If there is dirty data in the data, stop the transmission of the dirty data;

若所述数据中不存在脏数据,则继续对所述数据进行传输。If there is no dirty data in the data, continue to transmit the data.

优选的,继续对所述数据进行传输的过程中,还包括:Preferably, the process of continuing to transmit the data also includes:

若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘。If the data is damaged when being written into the storage hard disk, it is prohibited to write the data into the storage hard disk.

优选的,接收的服务器端所发送的数据为16进制形式,且16进制下的最后两位数据为校验数据。Preferably, the received data sent by the server is in hexadecimal form, and the last two bits of data in the hexadecimal system are check data.

优选的,利用BBC异或校验算法检测所述数据中是否存在脏数据,包括:Preferably, whether there is dirty data in the data detected by using the BBC XOR check algorithm, including:

步骤A1:利用公式(1)判断接收到的服务器端发送的数据是否为整数个字节的数据,并根据判断结果控制所述数据传输的启停:Step A1: Use formula (1) to determine whether the received data sent by the server is an integer number of bytes of data, and control the start and stop of the data transmission according to the result of the determination:

Figure BDA0003718541240000021
Figure BDA0003718541240000021

其中,F表示判断值;D表示接收到的服务器端发送的数据,此时数据形式为二进制形式;(D)16表示将数据D转换为十六进制形式的数据;%表示取余;len[(D)16]表示求取十六进制数据(D)16的数据总位数;Among them, F represents the judgment value; D represents the received data sent by the server, and the data form is in binary form at this time; (D) 16 represents the data that converts the data D into hexadecimal form; % represents the remainder; len [(D) 16 ] means to obtain the total number of digits of the hexadecimal data (D) 16 ;

若F=1,表示所述接收到的服务器端发送的数据为整数个字节的数据,则控制所述数据继续传输,并进行后续步骤A2和A3的判断和控制;If F=1, it means that the received data sent by the server end is data of an integer number of bytes, then control the data to continue transmission, and carry out the judgment and control of subsequent steps A2 and A3;

若F=0,表示所述接收到的服务器端发送的数据不是整数个字节的数据,则控制所述数据传输停止;If F=0, it means that the received data sent by the server is not an integer number of bytes of data, then control the data transmission to stop;

步骤A2:若所述数据为整数个字节的数据,则根据接收到的服务器端发送的数据,并利用公式(2)的BBC异或校验算法得到所述接收到的服务器端发送的数据的算法校验值:Step A2: If the data is data of an integer number of bytes, then according to the received data sent by the server end, and utilize the BBC XOR check algorithm of formula (2) to obtain the data sent by the received server end Algorithm check value of :

Figure BDA0003718541240000022
Figure BDA0003718541240000022

其中,J16表示所述接收到的服务器端发送的数据的算法校验值;S16(i)表示利用BBC异或校验算法得到的所述接收到的服务器端发送的数据十六进制形式中计算到第i个字节的校验值;[D]16(i)表示所述接收到的服务器端发送的数据十六进制形式中第i个字节的数据;[D]16(1)表示所述接收到的服务器端发送的数据十六进制形式中第1个字节的数据;xor表示异或;S16{len[(D)16]/2-1}Wherein, J 16 represents the algorithm check value of the data sent by the server end received; S 16 (i) represents the hexadecimal value of the data sent by the server end received using the BBC XOR check algorithm The check value calculated to the i-th byte in the form; [D] 16 (i) indicates the data of the i-th byte in the hexadecimal form of the received data sent by the server; [D] 16 (1) Indicates the data of the first byte in the hexadecimal format of the received data sent by the server; xor means exclusive OR; S 16 {len[(D) 16 ]/2-1}

表示将i=len[(D)16]/2-1代入S16(i)的公式中得到的数据;Indicates the data obtained by substituting i=len[(D) 16 ]/2-1 into the formula of S 16 (i);

步骤A3:在步骤A2计算出所述接收到的服务器端发送的数据的算法校验值后,利用公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停:Step A3: After calculating the algorithm check value of the received data sent by the server in step A2, use formula (3) according to the received algorithm check value of the data sent by the server and the received The verification data of the last two digits of the data sent by the server end controls the start and stop of the data transmission:

Figure BDA0003718541240000031
Figure BDA0003718541240000031

其中,E表示在所述数据为整数个字节的数据的条件下,所述数据传输的启停控制值;>>2表示右移2位;<<2表示左移2位;Wherein, E represents the start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >>2 represents a right shift of 2 bits; <<2 represents a left shift of 2 bits;

若E=1,表示数据中不存在脏数据,则控制所述数据继续传输;If E=1, it means that there is no dirty data in the data, then control the data to continue to be transmitted;

若E=0,表示数据中存在脏数据,则控制停止对所述数据的传输。If E=0, it means that there is dirty data in the data, and the control stops the transmission of the data.

优选的,若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘之前,包括:Preferably, if the data is damaged when writing to the storage hard disk, before prohibiting the data from being written to the storage hard disk, it includes:

实时检测所述存储硬盘,得到检测日志;Detecting the storage hard disk in real time to obtain a detection log;

对所述检测日志进行多维指标分析,并按照指标权重大小,依次获取每维度指标的指标向量;Perform multi-dimensional index analysis on the detection log, and sequentially obtain the index vector of each dimension index according to the weight of the index;

按照对应维度指标的向量分析标准,得到对应指标向量进行分析值;According to the vector analysis standard of the corresponding dimension index, the analysis value of the corresponding index vector is obtained;

将所述分析值与预设值进行比较,得到差值;Comparing the analyzed value with a preset value to obtain a difference;

基于所有差值以及对应维度指标的指标权重,获取所述存储硬盘的写入不合格性;Based on all the difference values and the index weights of the corresponding dimension indexes, obtain the writing disqualification of the storage hard disk;

当所述写入不合格性大于预设阈值时,判定所述存储硬盘存在损坏。When the writing disqualification is greater than a preset threshold, it is determined that the storage hard disk is damaged.

本发明提供一种基于BBC异或校验的脏数据预防系统,包括:The present invention provides a dirty data prevention system based on BBC XOR check, including:

接收模块,用于接收服务器端发送的数据;The receiving module is used to receive the data sent by the server;

检测模块,用于利用BBC异或校验算法检测所述数据中是否存在脏数据;A detection module, configured to utilize a BBC XOR check algorithm to detect whether there is dirty data in the data;

若所述数据中存在脏数据,则停止对脏数据的传输;If there is dirty data in the data, stop the transmission of the dirty data;

若所述数据中不存在脏数据,则继续对所述数据进行传输。If there is no dirty data in the data, continue to transmit the data.

优选的,还包括:Preferably, it also includes:

禁止写入模块,用于若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘。The write-inhibiting module is configured to prohibit writing the data into the storage hard disk if the data is damaged when being written into the storage hard disk.

优选的,接收的服务器端所发送的数据为16进制形式,且16进制下的最后两位数据为校验数据。Preferably, the received data sent by the server is in hexadecimal form, and the last two bits of data in the hexadecimal system are check data.

优选的,所述检测模块,包括:Preferably, the detection module includes:

第一计算单元,用于利用公式(1)判断接收到的服务器端发送的数据是否为整数个字节的数据,并根据判断结果控制所述数据传输的启停:The first calculation unit is used to judge whether the received data sent by the server end is data of an integer number of bytes by using the formula (1), and control the start and stop of the data transmission according to the judgment result:

Figure BDA0003718541240000041
Figure BDA0003718541240000041

其中,F表示判断值;D表示接收到的服务器端发送的数据,此时数据形式为二进制形式;(D)16表示将数据D转换为十六进制形式的数据;%表示取余;len[(D)16]表示求取十六进制数据(D)16的数据总位数;Among them, F represents the judgment value; D represents the received data sent by the server, and the data form is in binary form at this time; (D) 16 represents the data that converts the data D into hexadecimal form; % represents the remainder; len [(D) 16 ] means to obtain the total number of digits of the hexadecimal data (D) 16 ;

若F=1,表示所述接收到的服务器端发送的数据为整数个字节的数据,则控制所述数据继续传输,并进行后续步骤A2和A3的判断和控制;If F=1, it means that the received data sent by the server end is data of an integer number of bytes, then control the data to continue transmission, and carry out the judgment and control of subsequent steps A2 and A3;

若F=0,表示所述接收到的服务器端发送的数据不是整数个字节的数据,则控制所述数据传输停止;If F=0, it means that the received data sent by the server is not an integer number of bytes of data, then control the data transmission to stop;

第二计算单元,用于若所述数据为整数个字节的数据,则根据接收到的服务器端发送的数据,并利用公式(2)的BBC异或校验算法得到所述接收到的服务器端发送的数据的算法校验值:The second calculating unit is used for if the data is data of an integer number of bytes, then according to the data sent by the received server end, and using the BBC exclusive OR check algorithm of formula (2) to obtain the received server The algorithm check value of the data sent by the end:

Figure BDA0003718541240000042
Figure BDA0003718541240000042

其中,J16表示所述接收到的服务器端发送的数据的算法校验值;S16(i)表示利用BBC异或校验算法得到的所述接收到的服务器端发送的数据十六进制形式中计算到第i个字节的校验值;[D]16(i)表示所述接收到的服务器端发送的数据十六进制形式中第i个字节的数据;[D]16(1)表示所述接收到的服务器端发送的数据十六进制形式中第1个字节的数据;xor表示异或;S16{len[(D)16]/2-1}Wherein, J 16 represents the algorithm check value of the data sent by the server-side received; S 16 (i) represents the hexadecimal value of the data sent by the server-side received using the BBC XOR check algorithm The check value calculated to the i-th byte in the form; [D] 16 (i) indicates the data of the i-th byte in the hexadecimal form of the received data sent by the server; [D] 16 (1) Indicates the data of the first byte in the hexadecimal format of the received data sent by the server; xor means exclusive OR; S 16 {len[(D) 16 ]/2-1}

表示将i=len[(D)16]/2-1代入S16(i)的公式中得到的数据;Indicates the data obtained by substituting i=len[(D) 16 ]/2-1 into the formula of S 16 (i);

第三计算单元,用于在计算出所述接收到的服务器端发送的数据的算法校验值后,利用公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停:The third computing unit is configured to use formula (3) to calculate the received algorithm check value of the data sent by the server and the received algorithm check value of the data sent by the server. The verification data of the last two digits of the received data sent by the server end controls the start and stop of the data transmission:

Figure BDA0003718541240000051
Figure BDA0003718541240000051

其中,E表示在所述数据为整数个字节的数据的条件下,所述数据传输的启停控制值;>>2表示右移2位;<<2表示左移2位;Wherein, E represents the start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >>2 represents a right shift of 2 bits; <<2 represents a left shift of 2 bits;

若E=1,表示数据中不存在脏数据,则控制所述数据继续传输;If E=1, it means that there is no dirty data in the data, then control the data to continue to be transmitted;

若E=0,表示数据中存在脏数据,则控制停止对所述数据的传输。If E=0, it means that there is dirty data in the data, and the control stops the transmission of the data.

优选的,还包括:Preferably, it also includes:

日志获取模块,用于实时检测所述存储硬盘,得到检测日志;A log acquisition module, configured to detect the storage hard disk in real time and obtain a detection log;

多维分析模块,用于对所述检测日志进行多维指标分析,并按照指标权重大小,依次获取每维度指标的指标向量;A multi-dimensional analysis module, configured to perform multi-dimensional index analysis on the detection log, and sequentially obtain the index vector of each dimension index according to the weight of the index;

按照对应维度指标的向量分析标准,得到对应指标向量进行分析值;According to the vector analysis standard of the corresponding dimension index, the analysis value of the corresponding index vector is obtained;

比较模块,用于将所述分析值与预设值进行比较,得到差值;A comparison module, configured to compare the analysis value with a preset value to obtain a difference;

基于所有差值以及对应维度指标的指标权重,获取所述存储硬盘的写入不合格性;Based on all the difference values and the index weights of the corresponding dimension indexes, obtain the writing disqualification of the storage hard disk;

当所述写入不合格性大于预设阈值时,判定所述存储硬盘存在损坏。When the writing disqualification is greater than a preset threshold, it is determined that the storage hard disk is damaged.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

附图说明Description of drawings

附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the description, and are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention. In the attached picture:

图1为本发明实施例中一种基于BBC异或校验的脏数据预防方法的流程图;Fig. 1 is a kind of flow chart of the dirty data prevention method based on BBC XOR check in the embodiment of the present invention;

图2为本发明实施例中一种基于BBC异或校验的脏数据预防系统的结构图;Fig. 2 is the structural diagram of a kind of dirty data prevention system based on BBC XOR check in the embodiment of the present invention;

图3为本发明实施例中检测模块的结构图。Fig. 3 is a structural diagram of a detection module in an embodiment of the present invention.

具体实施方式Detailed ways

以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The preferred embodiments of the present invention will be described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described here are only used to illustrate and explain the present invention, and are not intended to limit the present invention.

本发明提供一种基于BBC异或校验的脏数据预防方法,如图1所示,包括:The present invention provides a dirty data prevention method based on BBC XOR check, as shown in Figure 1, comprising:

步骤1:接收服务器端发送的数据;Step 1: Receive the data sent by the server;

步骤2:利用BBC异或校验算法检测所述数据中是否存在脏数据;Step 2: Use the BBC XOR check algorithm to detect whether there is dirty data in the data;

若所述数据中存在脏数据,则停止对脏数据的传输;If there is dirty data in the data, stop the transmission of the dirty data;

若所述数据中不存在脏数据,则继续对所述数据进行传输。If there is no dirty data in the data, continue to transmit the data.

优选的,接收的服务器端所发送的数据为16进制形式,且16进制下的最后两位数据为校验数据。Preferably, the received data sent by the server is in hexadecimal form, and the last two bits of data in the hexadecimal system are check data.

该实施例中,脏数据可以是数据格式错误、业务逻辑不合理、违反业务规则等的数据。In this embodiment, dirty data may be data with wrong data format, unreasonable business logic, or data that violates business rules.

上述技术方案的有益效果是:通过采用BBC异或校验算法,对数据进行脏数据是否存在的校验,可以快速且有效的实现对脏数据的检测。The beneficial effect of the above technical solution is that by using the BBC XOR check algorithm to check whether the dirty data exists on the data, the dirty data can be quickly and effectively detected.

本发明提供一种基于BBC异或校验的脏数据预防方法,继续对所述数据进行传输的过程中,还包括:The present invention provides a method for preventing dirty data based on BBC XOR check. In the process of continuing to transmit the data, it also includes:

若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘。If the data is damaged when being written into the storage hard disk, it is prohibited to write the data into the storage hard disk.

上述技术方案的有益效果是:可以有效地防止将脏数据写入存储硬盘上,从而提高存储硬盘的存储效率及其稳定性。The beneficial effect of the above technical solution is that dirty data can be effectively prevented from being written into the storage hard disk, thereby improving the storage efficiency and stability of the storage hard disk.

本发明提供一种基于BBC异或校验的脏数据预防方法,利用BBC异或校验算法检测所述数据中是否存在脏数据,包括:The present invention provides a method for preventing dirty data based on BBC XOR check, which uses the BBC XOR check algorithm to detect whether there is dirty data in the data, including:

步骤A1:利用公式(1)判断接收到的服务器端发送的数据是否为整数个字节的数据,并根据判断结果控制所述数据传输的启停:Step A1: Use formula (1) to determine whether the received data sent by the server is an integer number of bytes of data, and control the start and stop of the data transmission according to the result of the determination:

Figure BDA0003718541240000071
Figure BDA0003718541240000071

其中,F表示判断值;D表示接收到的服务器端发送的数据,此时数据形式为二进制形式;(D)16表示将数据D转换为十六进制形式的数据;%表示取余;len[(D)16]表示求取十六进制数据(D)16的数据总位数;Among them, F represents the judgment value; D represents the received data sent by the server, and the data form is in binary form at this time; (D) 16 represents the data that converts the data D into hexadecimal form; % represents the remainder; len [(D) 16 ] means to obtain the total number of digits of the hexadecimal data (D) 16 ;

若F=1,表示所述接收到的服务器端发送的数据为整数个字节的数据,则控制所述数据继续传输,并进行后续步骤A2和A3的判断和控制;If F=1, it means that the received data sent by the server end is data of an integer number of bytes, then control the data to continue transmission, and carry out the judgment and control of subsequent steps A2 and A3;

若F=0,表示所述接收到的服务器端发送的数据不是整数个字节的数据,则控制所述数据传输停止;If F=0, it means that the received data sent by the server is not an integer number of bytes of data, then control the data transmission to stop;

步骤A2:若所述数据为整数个字节的数据,则根据接收到的服务器端发送的数据,并利用公式(2)的BBC异或校验算法得到所述接收到的服务器端发送的数据的算法校验值:Step A2: If the data is data of an integer number of bytes, then according to the received data sent by the server end, and utilize the BBC XOR check algorithm of formula (2) to obtain the data sent by the received server end Algorithm check value of :

Figure BDA0003718541240000072
Figure BDA0003718541240000072

其中,J16表示所述接收到的服务器端发送的数据的算法校验值;S16(i)表示利用BBC异或校验算法得到的所述接收到的服务器端发送的数据十六进制形式中计算到第i个字节的校验值;[D]16(i)表示所述接收到的服务器端发送的数据十六进制形式中第i个字节的数据;[D]16(1)表示所述接收到的服务器端发送的数据十六进制形式中第1个字节的数据;xor表示异或;S16{len[(D)16]/2-1}Wherein, J 16 represents the algorithm check value of the data sent by the server end received; S 16 (i) represents the hexadecimal value of the data sent by the server end received using the BBC XOR check algorithm The check value calculated to the i-th byte in the form; [D] 16 (i) indicates the data of the i-th byte in the hexadecimal form of the received data sent by the server; [D] 16 (1) Indicates the data of the first byte in the hexadecimal format of the received data sent by the server; xor means exclusive OR; S 16 {len[(D) 16 ]/2-1}

表示将i=len[(D)16]/2-1代入S16(i)的公式中得到的数据;Indicates the data obtained by substituting i=len[(D) 16 ]/2-1 into the formula of S 16 (i);

步骤A3:在步骤A2计算出所述接收到的服务器端发送的数据的算法校验值后,利用公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停:Step A3: After calculating the algorithm check value of the received data sent by the server in step A2, use formula (3) according to the received algorithm check value of the data sent by the server and the received The verification data of the last two digits of the data sent by the server end controls the start and stop of the data transmission:

Figure BDA0003718541240000081
Figure BDA0003718541240000081

其中,E表示在所述数据为整数个字节的数据的条件下,所述数据传输的启停控制值;>>2表示右移2位;<<2表示左移2位;Wherein, E represents the start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >>2 represents a right shift of 2 bits; <<2 represents a left shift of 2 bits;

若E=1,表示数据中不存在脏数据,则控制所述数据继续传输;If E=1, it means that there is no dirty data in the data, then control the data to continue to be transmitted;

若E=0,表示数据中存在脏数据,则控制停止对所述数据的传输。If E=0, it means that there is dirty data in the data, and the control stops the transmission of the data.

该实施例中,比如数据(D)16为10FE 25 39 1C;In this embodiment, such as data (D) 16 is 10FE 25 39 1C;

则(D)16>>2为10 FE 25 39Then (D) 16 >>2 is 10 FE 25 39

[(D)16>>2]<<2为10FE 25 39 00[(D) 16 >>2]<<2 is 10FE 25 39 00

(D)16-{[(D)16>>2]<<2}为1C(D) 16 -{[(D) 16 >>2]<<2} is 1C

该实施例中,计算第i个字节的校验值,比如:16进制数据:01A0 7C FF02,计算:01xor A0 xor 7C xor FF xor 02=20,得到的校验值是:20。In this embodiment, the check value of the i-th byte is calculated, for example: hexadecimal data: 01A0 7C FF02, calculation: 01xor A0 xor 7C xor FF xor 02=20, the obtained check value is: 20.

上述技术方案的有益效果是:利用步骤A1的公式(1)根据接收到的服务器端发送的数据判断所述数据是否为整数个字节的数据并控制所述数据传输的启停,进而进行快速检测数据从而提高检测时间;然后利用步骤A2的公式(2)利用BBC异或校验检测算法得到所述接收到的服务器端发送的数据的算法校验值,进而利用公式自动进行BBC异或校验检测算法得到算法校验值,体现了系统的智能化和自动化的特点;最后利用步骤A3的公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停,从而通过这样的方法来检测脏数据,可以有效地防止将脏数据写入存储硬盘上,从而提高存储硬盘的存储效率及其稳定性。The beneficial effect of the above technical solution is: use the formula (1) of step A1 to judge whether the data is data of an integer number of bytes according to the received data sent by the server end and control the start and stop of the data transmission, and then perform fast Detect data thereby improving detection time; Then utilize the formula (2) of step A2 to utilize the BBC XOR check detection algorithm to obtain the algorithmic check value of the data that the server end that receives described receives sends, and then utilize formula to carry out BBC XOR check automatically The verification detection algorithm obtains the algorithm verification value, which embodies the characteristics of intelligence and automation of the system; finally utilizes the formula (3) of step A3 according to the algorithm verification value of the data sent by the server end received and the received The verification data of the last two digits of the data sent by the server side controls the start and stop of the data transmission, so that dirty data can be detected by this method, which can effectively prevent dirty data from being written to the storage hard disk, thereby improving storage capacity. Hard disk storage efficiency and its stability.

本发明提供一种基于BBC异或校验的脏数据预防方法,若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘之前,包括:The present invention provides a method for preventing dirty data based on BBC XOR check. If the data is damaged when it is written into the storage hard disk, it is forbidden to write the data into the storage hard disk before, including:

实时检测所述存储硬盘,得到检测日志;Detecting the storage hard disk in real time to obtain a detection log;

对所述检测日志进行多维指标分析,并按照指标权重大小,依次获取每维度指标的指标向量;Perform multi-dimensional index analysis on the detection log, and sequentially obtain the index vector of each dimension index according to the weight of the index;

按照对应维度指标的向量分析标准,得到对应指标向量进行分析值;According to the vector analysis standard of the corresponding dimension index, the analysis value of the corresponding index vector is obtained;

将所述分析值与预设值进行比较,得到差值;Comparing the analyzed value with a preset value to obtain a difference;

基于所有差值以及对应维度指标的指标权重,获取所述存储硬盘的写入不合格性;Based on all the difference values and the index weights of the corresponding dimension indexes, obtain the writing disqualification of the storage hard disk;

当所述写入不合格性大于预设阈值时,判定所述存储硬盘存在损坏。When the writing disqualification is greater than a preset threshold, it is determined that the storage hard disk is damaged.

该实施例中,检测日志指的是存储硬盘的内部存储的一个当下检测结果。In this embodiment, the detection log refers to a current detection result stored inside the hard disk.

该实施例中,多维度指标分析,比如是从容量、存储效率、在存储过程中对数据的更改可能性等多维度来分析。In this embodiment, the multi-dimensional index analysis is, for example, analyzed from multiple dimensions such as capacity, storage efficiency, and possibility of changing data during the storage process.

该实施例中,指标权重都是预先设置好的,且指标权重的累加和为1。In this embodiment, the indicator weights are preset, and the cumulative sum of the indicator weights is 1.

该实施例中,当每个差值与对应权重相乘的所有指标累加和结果大于0.3时,就判断存储硬盘存在损坏。In this embodiment, when the cumulative sum of all indicators multiplied by each difference value and the corresponding weight is greater than 0.3, it is determined that the storage hard disk is damaged.

上述技术方案的有益效果是:通过检测存储硬盘,并进行多维指标分析,获取不同维度指标的分析值,来确定存储硬盘本身是否存在问题,可以有效的避免在数据校验成功的情况下,可以将数据有效的存储在硬盘中。The beneficial effect of the above technical solution is: by detecting the storage hard disk and performing multi-dimensional index analysis to obtain the analysis values of different dimension indexes, it is possible to determine whether there is a problem with the storage hard disk itself, which can effectively avoid the failure of the storage hard disk when the data verification is successful. Store data effectively in the hard disk.

本发明提供一种基于BBC异或校验的脏数据预防系统,如图2所示,包括:The present invention provides a dirty data prevention system based on BBC XOR check, as shown in Figure 2, comprising:

接收模块,用于接收服务器端发送的数据;The receiving module is used to receive the data sent by the server;

检测模块,用于利用BBC异或校验算法检测所述数据中是否存在脏数据;A detection module, configured to utilize a BBC XOR check algorithm to detect whether there is dirty data in the data;

若所述数据中存在脏数据,则停止对脏数据的传输;If there is dirty data in the data, stop the transmission of the dirty data;

若所述数据中不存在脏数据,则继续对所述数据进行传输。If there is no dirty data in the data, continue to transmit the data.

优选的,接收的服务器端所发送的数据为16进制形式,且16进制下的最后两位数据为校验数据。Preferably, the received data sent by the server is in hexadecimal form, and the last two bits of data in the hexadecimal system are check data.

上述技术方案的有益效果是:通过采用BBC异或校验算法,对数据进行脏数据是否存在的校验,可以快速且有效的实现对脏数据的检测。The beneficial effect of the above technical solution is that by using the BBC XOR check algorithm to check whether the dirty data exists on the data, the dirty data can be quickly and effectively detected.

本发明提供一种基于BBC异或校验的脏数据预防系统,还包括:The present invention provides a kind of dirty data prevention system based on BBC XOR check, also comprises:

禁止写入模块,用于若所述数据在写入存储硬盘时发生损坏,则禁止将所述数据写入所述存储硬盘。The write-inhibiting module is configured to prohibit writing the data into the storage hard disk if the data is damaged when being written into the storage hard disk.

上述技术方案的有益效果是:可以有效地防止将脏数据写入存储硬盘上,从而提高存储硬盘的存储效率及其稳定性。The beneficial effect of the above technical solution is that dirty data can be effectively prevented from being written into the storage hard disk, thereby improving the storage efficiency and stability of the storage hard disk.

本发明提供一种基于BBC异或校验的脏数据预防系统,所述检测模块,如图3所示,包括:The present invention provides a dirty data prevention system based on BBC XOR verification, and the detection module, as shown in Figure 3, includes:

第一计算单元,用于利用公式(1)判断接收到的服务器端发送的数据是否为整数个字节的数据,并根据判断结果控制所述数据传输的启停:The first calculation unit is used to judge whether the received data sent by the server end is data of an integer number of bytes by using the formula (1), and control the start and stop of the data transmission according to the judgment result:

Figure BDA0003718541240000101
Figure BDA0003718541240000101

其中,F表示判断值;D表示接收到的服务器端发送的数据,此时数据形式为二进制形式;(D)16表示将数据D转换为十六进制形式的数据;%表示取余;len[(D)16]表示求取十六进制数据(D)16的数据总位数;Among them, F represents the judgment value; D represents the received data sent by the server, and the data form is in binary form at this time; (D) 16 represents the data that converts the data D into hexadecimal form; % represents the remainder; len [(D) 16 ] means to obtain the total number of digits of the hexadecimal data (D) 16 ;

若F=1,表示所述接收到的服务器端发送的数据为整数个字节的数据,则控制所述数据继续传输,并进行后续步骤A2和A3的判断和控制;If F=1, it means that the received data sent by the server end is data of an integer number of bytes, then control the data to continue transmission, and carry out the judgment and control of subsequent steps A2 and A3;

若F=0,表示所述接收到的服务器端发送的数据不是整数个字节的数据,则控制所述数据传输停止;If F=0, it means that the received data sent by the server is not an integer number of bytes of data, then control the data transmission to stop;

第二计算单元,用于若所述数据为整数个字节的数据,则根据接收到的服务器端发送的数据,并利用公式(2)的BBC异或校验算法得到所述接收到的服务器端发送的数据的算法校验值:The second calculating unit is used for if the data is data of an integer number of bytes, then according to the data sent by the received server end, and using the BBC exclusive OR check algorithm of formula (2) to obtain the received server The algorithm check value of the data sent by the end:

Figure BDA0003718541240000111
Figure BDA0003718541240000111

其中,J16表示所述接收到的服务器端发送的数据的算法校验值;S16(i)表示利用BBC异或校验算法得到的所述接收到的服务器端发送的数据十六进制形式中计算到第i个字节的校验值;[D]16(i)表示所述接收到的服务器端发送的数据十六进制形式中第i个字节的数据;[D]16(1)表示所述接收到的服务器端发送的数据十六进制形式中第1个字节的数据;xor表示异或;S16{len[(D)16]/2-1}Wherein, J 16 represents the algorithm check value of the data sent by the server end received; S 16 (i) represents the hexadecimal value of the data sent by the server end received using the BBC XOR check algorithm The check value calculated to the i-th byte in the form; [D] 16 (i) indicates the data of the i-th byte in the hexadecimal form of the received data sent by the server; [D] 16 (1) Indicates the data of the first byte in the hexadecimal format of the received data sent by the server; xor means XOR; S 16 {len[(D) 16 ]/2-1}

表示将i=len[(D)16]/2-1代入S16(i)的公式中得到的数据;Indicates the data obtained by substituting i=len[(D) 16 ]/2-1 into the formula of S 16 (i);

第三计算单元,用于在计算出所述接收到的服务器端发送的数据的算法校验值后,利用公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停:The third computing unit is configured to use formula (3) to calculate the received algorithm check value of the data sent by the server and the received algorithm check value of the data sent by the server. The verification data of the last two digits of the received data sent by the server end controls the start and stop of the data transmission:

Figure BDA0003718541240000112
Figure BDA0003718541240000112

其中,E表示在所述数据为整数个字节的数据的条件下,所述数据传输的启停控制值;>>2表示右移2位;<<2表示左移2位;Wherein, E represents the start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >>2 represents a right shift of 2 bits; <<2 represents a left shift of 2 bits;

若E=1,表示数据中不存在脏数据,则控制所述数据继续传输;If E=1, it means that there is no dirty data in the data, then control the data to continue to be transmitted;

若E=0,表示数据中存在脏数据,则控制停止对所述数据的传输。If E=0, it means that there is dirty data in the data, and the control stops the transmission of the data.

上述技术方案的有益效果是:利用步骤A1的公式(1)根据接收到的服务器端发送的数据判断所述数据是否为整数个字节的数据并控制所述数据传输的启停,进而进行快速检测数据从而提高检测时间;然后利用步骤A2的公式(2)利用BBC异或校验检测算法得到所述接收到的服务器端发送的数据的算法校验值,进而利用公式自动进行BBC异或校验检测算法得到算法校验值,体现了系统的智能化和自动化的特点;最后利用步骤A3的公式(3)根据所述接收到的服务器端发送的数据的算法校验值以及所述接收到的服务器端发送的数据本身最后两位数据的校验数据控制所述数据传输的启停,从而通过这样的方法来检测脏数据,可以有效地防止将脏数据写入存储硬盘上,从而提高存储硬盘的存储效率及其稳定性。The beneficial effect of the above technical solution is: use the formula (1) of step A1 to judge whether the data is data of an integer number of bytes according to the received data sent by the server end and control the start and stop of the data transmission, and then perform fast Detect data thereby improving detection time; Then utilize the formula (2) of step A2 to utilize the BBC XOR check detection algorithm to obtain the algorithmic check value of the data that the server end that receives described receives sends, and then utilize formula to carry out BBC XOR check automatically The verification detection algorithm obtains the algorithm verification value, which embodies the characteristics of intelligence and automation of the system; finally utilizes the formula (3) of step A3 according to the algorithm verification value of the data sent by the server end received and the received The verification data of the last two digits of the data sent by the server side controls the start and stop of the data transmission, so that dirty data can be detected by this method, which can effectively prevent dirty data from being written to the storage hard disk, thereby improving storage capacity. Hard disk storage efficiency and its stability.

本发明提供一种基于BBC异或校验的脏数据预防系统,还包括:The present invention provides a kind of dirty data prevention system based on BBC XOR check, also comprises:

日志获取模块,用于实时检测所述存储硬盘,得到检测日志;A log acquisition module, configured to detect the storage hard disk in real time and obtain a detection log;

多维分析模块,用于对所述检测日志进行多维指标分析,并按照指标权重大小,依次获取每维度指标的指标向量;A multi-dimensional analysis module, configured to perform multi-dimensional index analysis on the detection log, and sequentially obtain the index vector of each dimension index according to the weight of the index;

按照对应维度指标的向量分析标准,得到对应指标向量进行分析值;According to the vector analysis standard of the corresponding dimension index, the analysis value of the corresponding index vector is obtained;

比较模块,用于将所述分析值与预设值进行比较,得到差值;A comparison module, configured to compare the analysis value with a preset value to obtain a difference;

基于所有差值以及对应维度指标的指标权重,获取所述存储硬盘的写入不合格性;Based on all the difference values and the index weights of the corresponding dimension indexes, obtain the writing disqualification of the storage hard disk;

当所述写入不合格性大于预设阈值时,判定所述存储硬盘存在损坏。When the writing disqualification is greater than a preset threshold, it is determined that the storage hard disk is damaged.

上述技术方案的有益效果是:通过检测存储硬盘,并进行多维指标分析,获取不同维度指标的分析值,来确定存储硬盘本身是否存在问题,可以有效的避免在数据校验成功的情况下,可以将数据有效的存储在硬盘中。The beneficial effect of the above technical solution is: by detecting the storage hard disk and performing multi-dimensional index analysis to obtain the analysis values of different dimension indexes, it is possible to determine whether there is a problem with the storage hard disk itself, which can effectively avoid the failure of the storage hard disk when the data verification is successful. Store data effectively in the hard disk.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (8)

1. A dirty data prevention method based on BBC exclusive OR check is characterized by comprising the following steps:
step 1: receiving data sent by a server side;
step 2: detecting whether dirty data exist in the data by utilizing a BBC exclusive OR checking algorithm;
if dirty data exists in the data, stopping transmission of the dirty data;
if the data does not contain dirty data, continuing to transmit the data;
detecting whether dirty data exist in the data by utilizing a BBC exclusive OR checking algorithm comprises the following steps:
step A1: judging whether the received data sent by the server side is data of an integer number of bytes or not by using a formula (1), and controlling start and stop of data transmission according to a judging result:
Figure FDA0004045327450000011
wherein F represents a judgment value; d represents the received data sent by the server, and the data form is a binary form at the moment; (D) 16 Representing data D converted into hexadecimal form; % represents remainder; len [ (D) 16 ]Representing the determination of hexadecimal data (D) 16 Is a data total bit number of (2);
if f=1, the received data sent by the server end is data with an integer number of bytes, the data is controlled to continue to be transmitted, and the judgment and control of the subsequent steps A2 and A3 are performed;
if f=0, the received data sent by the server end is not data of an integer number of bytes, and the data transmission is controlled to stop;
step A2: if the data is data with an integer number of bytes, obtaining an algorithm check value of the data sent by the received server according to the received data sent by the server and by utilizing a BBC exclusive OR check algorithm of the formula (2):
Figure FDA0004045327450000012
wherein J is 16 An algorithm check value representing the received data sent by the server side; s is S 16 (i) Representing a check value calculated to an ith byte in a hexadecimal form of data transmitted by the received server terminal, which is obtained by utilizing a BBC exclusive OR check algorithm; [ D] 16 (i) Representing the data of the ith byte in the hexadecimal form of the received data sent by the server side; [ D] 16 (1) Representing the 1 st byte in hexadecimal form of the data transmitted by the received serverData of (2); xor represents exclusive or; s is S 16 {len[(D) 16 ]2-1 represents that i=len [ (D) 16 ]Substitution of/2-1 into S 16 (i) Data obtained in the formula (i);
step A3: after the algorithm check value of the data sent by the received server is calculated in the step A2, the start and stop of the data transmission are controlled according to the algorithm check value of the data sent by the received server and the check data of the last two bits of data sent by the received server by using a formula (3):
Figure FDA0004045327450000021
wherein E represents a start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >2 represents a right shift by 2 bits; <2 represents a left shift by 2 bits;
if e=1, indicating that there is no dirty data in the data, controlling the data to continue to be transmitted;
if e=0, indicating that dirty data exists in the data, control stops transmitting the data.
2. The method for preventing dirty data based on BBC exclusive or check as claimed in claim 1, further comprising, during the process of continuing to transmit the data:
and if the data is damaged when being written into the storage hard disk, the data is forbidden to be written into the storage hard disk.
3. The method for preventing dirty data based on BBC exclusive or check as claimed in claim 1, wherein the data sent by the server side is 16-ary, and the last two bits of data under 16-ary are check data.
4. The method for preventing dirty data based on BBC exclusive or check according to claim 1, wherein if the data is damaged when being written into a storage hard disk, prohibiting the data from being written into the storage hard disk, comprising:
detecting the storage hard disk in real time to obtain a detection log;
performing multidimensional index analysis on the detection log, and sequentially acquiring index vectors of each dimension index according to the weight of the index;
according to vector analysis standards of the corresponding dimension indexes, obtaining corresponding index vectors for analysis values;
comparing the analysis value with a preset value to obtain a difference value;
acquiring the writing disqualification of the storage hard disk based on all the difference values and the index weights of the corresponding dimension indexes;
and when the writing disqualification is larger than a preset threshold value, judging that the storage hard disk is damaged.
5. A dirty data prevention system based on BBC exclusive or checking, comprising:
the receiving module is used for receiving the data sent by the server side;
the detection module is used for detecting whether dirty data exist in the data by utilizing a BBC exclusive-OR check algorithm;
if dirty data exists in the data, stopping transmission of the dirty data;
if the data does not contain dirty data, continuing to transmit the data;
wherein, detection module includes:
the first calculating unit is used for judging whether the received data sent by the server side is data with an integer number of bytes or not by using the formula (1), and controlling the start and stop of data transmission according to a judging result:
Figure FDA0004045327450000031
wherein F represents a judgment value; d represents the received data sent by the server, and the data form is twoA binary form; (D) 16 Representing data D converted into hexadecimal form; % represents remainder; len [ (D) 16 ]Representing the determination of hexadecimal data (D) 16 Is a data total bit number of (2);
if f=1, the received data sent by the server end is data with an integer number of bytes, the data is controlled to continue to be transmitted, and the judgment and control of the subsequent steps A2 and A3 are performed;
if f=0, the received data sent by the server end is not data of an integer number of bytes, and the data transmission is controlled to stop;
the second calculating unit is configured to obtain, according to the received data sent by the server, an algorithm check value of the received data sent by the server by using a BBC exclusive-or check algorithm of the formula (2), if the data is data of an integer number of bytes:
Figure FDA0004045327450000032
wherein J is 16 An algorithm check value representing the received data sent by the server side; s is S 16 (i) Representing a check value calculated to an ith byte in a hexadecimal form of data transmitted by the received server terminal, which is obtained by utilizing a BBC exclusive OR check algorithm; [ D] 16 (i) Representing the data of the ith byte in the hexadecimal form of the received data sent by the server side; [ D] 16 (1) Representing the 1 st byte of data in hexadecimal form of the received data sent by the server side; xor represents exclusive or;
S 16 {len[(D) 16 ]2-1 represents that i=len [ (D) 16 ]Substitution of/2-1 into S 16 (i) Data obtained in the formula (i);
the third calculation unit is configured to control start and stop of the data transmission according to the algorithm check value of the received data sent by the server and the check data of the last two bits of data sent by the server by using formula (3) after calculating the algorithm check value of the received data sent by the server:
Figure FDA0004045327450000041
wherein E represents a start-stop control value of the data transmission under the condition that the data is an integer number of bytes of data; >2 represents a right shift by 2 bits; <2 represents a left shift by 2 bits;
if e=1, indicating that there is no dirty data in the data, controlling the data to continue to be transmitted;
if e=0, indicating that dirty data exists in the data, control stops transmitting the data.
6. The BBC exclusive or check based dirty data prevention system according to claim 5, further comprising:
and the write-inhibition module is used for inhibiting the data from being written into the storage hard disk if the data is damaged during the writing of the data into the storage hard disk.
7. The system for preventing dirty data based on BBC exclusive or checking as claimed in claim 5, wherein the data transmitted from the server side is 16-ary, and the last two bits of data under 16-ary are check data.
8. The BBC exclusive or check based dirty data prevention system according to claim 5, further comprising:
the log acquisition module is used for detecting the storage hard disk in real time to obtain a detection log;
the multidimensional analysis module is used for carrying out multidimensional index analysis on the detection log and sequentially acquiring index vectors of each dimension index according to the weight of the index;
according to vector analysis standards of the corresponding dimension indexes, obtaining corresponding index vectors for analysis values;
the comparison module is used for comparing the analysis value with a preset value to obtain a difference value;
acquiring the writing disqualification of the storage hard disk based on all the difference values and the index weights of the corresponding dimension indexes;
and when the writing disqualification is larger than a preset threshold value, judging that the storage hard disk is damaged.
CN202210751662.7A 2022-06-28 2022-06-28 Dirty data prevention method and system based on BBC exclusive OR check Active CN115167767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210751662.7A CN115167767B (en) 2022-06-28 2022-06-28 Dirty data prevention method and system based on BBC exclusive OR check

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210751662.7A CN115167767B (en) 2022-06-28 2022-06-28 Dirty data prevention method and system based on BBC exclusive OR check

Publications (2)

Publication Number Publication Date
CN115167767A CN115167767A (en) 2022-10-11
CN115167767B true CN115167767B (en) 2023-04-25

Family

ID=83489155

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210751662.7A Active CN115167767B (en) 2022-06-28 2022-06-28 Dirty data prevention method and system based on BBC exclusive OR check

Country Status (1)

Country Link
CN (1) CN115167767B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8307271B1 (en) * 2009-09-17 2012-11-06 Emc Corporation Fast verification of data block cycle redundancy checks
CN107368438A (en) * 2017-09-13 2017-11-21 郑州云海信息技术有限公司 A kind of dirty data detection method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385354A (en) * 2020-03-02 2020-07-07 拉扎斯网络科技(上海)有限公司 File transmission method and device, electronic equipment and nonvolatile storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8307271B1 (en) * 2009-09-17 2012-11-06 Emc Corporation Fast verification of data block cycle redundancy checks
CN107368438A (en) * 2017-09-13 2017-11-21 郑州云海信息技术有限公司 A kind of dirty data detection method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Tian Jianzhong.Study and design on high reliability mass capacity memory.IEEE.2010,全文. *
朱旭锋.一种弹载信息处理器NAND Flash高可靠数据管理方法.航天控制.2022,第40卷(第40期),全文. *
朱智林,左天军,牛淑龄.基于日志的脏数据检测与恢复.电子科技.2004,(第05期),全文. *

Also Published As

Publication number Publication date
CN115167767A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
US9264740B2 (en) Methods and apparatus for error rate estimation
CN103001734B (en) Method for automatically detecting asynchronous serial port communication protocol on basis of level sampling
CN101882096A (en) Method for detecting and correcting damaged control character transmitted between SATA main control device and SATA peripheral device
CN115167767B (en) Dirty data prevention method and system based on BBC exclusive OR check
CN112685128A (en) Method for detecting pornography and filtering pictures of live broadcast
CN109743362B (en) Data storage method applied to full-format data structure
CN107368438A (en) A kind of dirty data detection method and system
CN114598544A (en) A method and device for judging the security status baseline of an intelligent IoT terminal
CN112288077B (en) Diagnosis and adjustment method, system, device and medium of convolutional neural network
CN112637139A (en) Voice transmission processing method and device based on Internet of things and computer equipment
CN111652723A (en) Data processing method, device, equipment and computer readable storage medium
CN118018153B (en) Method and device for processing transmission data and electronic equipment
CN120358050A (en) Rapid DDoS attack detection method based on multi-mode data characteristic enhancement and combination
CN114268480B (en) Picture transmission monitoring method and device, storage medium and terminal
CN118449788B (en) Network security information protection method and system based on AI learning
CN117349407B (en) An automated detection method and system for content security
CN114363176B (en) A network identification method, device, terminal and medium based on federated learning
CN113722351B (en) Parameter restoration method and device in Oracle database access flow
CN110690991B (en) Non-blocking network reduction computing device and method based on logic tree
CN120567464A (en) Constraint-aware industrial control protocol fuzzy test method and device
CN120336309A (en) Data quality detection and judgment method for industry field
CN116089273A (en) Software data identification and model training method thereof
CN115269187A (en) Industrial control safety stroke distribution test method and device
CN118467219A (en) A method and device for detecting white screen of a Web front-end page
CN116418742A (en) Method, device and storage medium for solving IPFIX hash collision

Legal Events

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