CN101354883B - Method for protecting Midi audio data - Google Patents
Method for protecting Midi audio data Download PDFInfo
- Publication number
- CN101354883B CN101354883B CN2008101196945A CN200810119694A CN101354883B CN 101354883 B CN101354883 B CN 101354883B CN 2008101196945 A CN2008101196945 A CN 2008101196945A CN 200810119694 A CN200810119694 A CN 200810119694A CN 101354883 B CN101354883 B CN 101354883B
- Authority
- CN
- China
- Prior art keywords
- instruction
- distorted
- track block
- string
- midi
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Electrophonic Musical Instruments (AREA)
Abstract
The invention provides a method for protecting Midi audio data, which belongs to the field of audio data. In the prior audio data protecting method, the audio data is extracted into one-dimensional signals for processing, which is not suitable for storing the Midi audio data of performance instructions. In the method, all note on instructions and note off instructions are found out from each locus block in a midi file, and are arrayed into an instruction string according to the sequence in the prior locus block; the instruction string undergoes compression, encryption and correction to form anew 0-1 character string called validation string; the validation string is placed in a reset instruction at the end of the locus block as a parameter of the instruction and stored in a storage medium; when differentiating, the parameter, namely the validation string, of the reset instruction at the end of the locus block is read, and undergoes compression, encryption and correction to obtain a decoded instruction string; and whether the midi file is falsified or not is judged, where and how the midi file is falsified are determined, and then the falsified information is restored.
Description
Technical field
The present invention relates to a kind of guard method of voice data, particularly a kind of guard method at the midi voice data.
Background technology
The protection of multi-medium data has become under the digital network environment, the important technology of protection digital content and related right people economic interests.Especially along with the rise of online music, cell phone entertainment etc., the protection of voice data seems even more important.
In various voice datas, the Midi voice data has occupied critical positions, main cause has two: the one, and the storage space that the midi file takies is very little, same one section music, may need hundreds of K byte with WAV form coding, and only need two or three hundred bytes with midi form coding, and differing from 1000 times, this just is highly suitable under memory capacity such as mobile phone, mobile network or the band-limited environment; The 2nd, the midi data storage be not audio volume control, but play instruction, change the parameter of instruction, can simulate the sound of hundreds of kind musical instruments such as piano, violin, flute, drum, and can control when every kind " musical instrument " is played, the length of sounding, power etc., this very similar symphony, during broadcast by player synthetic " symphony " and sounding, because this unique characteristics of midi make it become the strong instrument that the musician carries out the electronic music creation.
Yet what form contrast with the extensive employing of midi data is also not have good guard method at the midi voice data at present.Existing voice data guard method is mostly at audio volume control, and soon voice data will be abstract handles for one-dimensional signal, and these methods all are not suitable for the midi audio frequency that instruction is played in storage.Therefore must be at the characteristics of midi self, the guard method of research midi voice data.
Summary of the invention
The objective of the invention is characteristics, the guard method of a kind of midi voice data is provided at midi self.Whether this method can be judged data and be distorted, and determines what which place was distorted, how to be distorted, and then the information that will be distorted is recovered.
Technical scheme of the present invention is:
1). read a midi file from storage medium;
2). to each track block in the midi file, all notes of finding out in the track block are opened instruction and the instruction of note pass, and these instructions are become a strings of commands according to the series arrangement in former track block;
3). to the above-mentioned strings of commands compress successively, encryption, three encoding operations of error correction, form a new 0-1 character string, be called the checking string; The checking string is placed in the reset instruction of track block ending,, and is saved in storage medium as the parameter of this instruction;
4). during discriminating, read the parameter of the reset instruction of track block ending, promptly the checking string carries out error correction, deciphering, three decode operations of decompression successively, obtains a decoded strings of commands;
5) judge according to the decoded strings of commands whether the midi file was distorted, and determine what which place was distorted, how to be distorted, and then the information that will be distorted is recovered: if the type of distorting is to have inserted new performance instruction, the then instruction that is inserted in the deletion locus piece; If the type of distorting is to have deleted original instruction, then from the checking string, obtain deleted performance instruction, position deleted in the track block is inserted in this instruction; If the type of distorting is to have revised original instruction, the performance that then obtains to be modified from the checking string that reads is instructed, and covers the instruction that is modified in track block with this instruction;
Perhaps only judge according to the decoded strings of commands whether the midi file was distorted, and determine what which place was distorted, how to be distorted.
The present invention compares with other voice data guard methods has following characteristics:
Play the characteristics of instruction and design at the midi audio storage.
Directly operate, voice data is not carried out any modification, have the transparency completely playing instruction.
Can resist instruction sequences adjustment, voice data revise (filtering, add make an uproar, resampling etc.), insertions/delete instruction, intercept multiple attack such as snatch of music, have robustness.
It is anti-tamper with hash function or Message Authentication Code to be different from general communication system, and the cryptographic operation among the present invention has anti-tamper function, does not know that the user of key can't correctly encrypt, and has guaranteed the security of system.In addition, encryption/decryption can also be recovered message, so whether the present invention not only can judge data and distorted, and can also determine what which place was distorted, how to be distorted, and the information that will be distorted is recovered.
Error Correction of Coding can be revised to a certain extent to distorting that checking is gone here and there, and has prevented the mistake owing to checking string itself, and with the generation that legitimate files is judged this situation of file of being distorted for quilt by accident, has improved availability.
Description of drawings
Fig. 1 protects process.
Fig. 2 generates the strings of commands.
Fig. 3 revises track block.
Fig. 4 discrimination process.
Fig. 5 reads the additional information of last instruction ff.
Fig. 6 deterministic process.
Fig. 7 recovers track block.
Embodiment
What Fig. 1 represented is the protection process of midi voice data.Read a midi file 100 from storage medium.The midi file is made up of several track blocks, to each track block, carries out same operation.At first the content according to track block generates a strings of commands 300, and this strings of commands is carried out compressed encoding 400, encryption 500, Error Correction of Coding 600 successively, forms a 0-1 character string, is called the checking string, will verify that string writes back track block, promptly revises track block 700.After all track blocks dispose, newly-generated midi file is saved in storage medium 800.
Compressed encoding 400 wherein, encryption 500, Error Correction of Coding 600 can be selected a kind of lossless compression-encoding algorithm, symmetric encipherment algorithm and Error Correction of Coding algorithm respectively arbitrarily for use.
What Fig. 2 represented is the process that generates the strings of commands.
In order more clearly to represent this process 300, simply introduce the midi instruction first.So-called midi instruction is one 8 a binary number, takies 1 byte, and before and after the instruction parameter, the length of parameter being arranged may be 1 byte, also may be a plurality of bytes, the back content of sexadecimal form presentation directives and parameter.
What among the midi musical performance is played a major role is that note is opened instruction 9x and note and closed instruction 8x, low 4 all values that can get between " 0 " ~ " F " in " x " presentation directives wherein, and in fact these low 4 bit representations is the used passage of note sounding.The form of 8x/9x instruction is " instruction start time "+" 8x/9x "+" note numbering "+" note velocity ", and front and back have three parameters.Wherein " instruct the start time " and take 1-4 byte, " note numbering " and " note velocity " respectively take 1 byte, and whole instruction takies 4-7 byte.For example " 00904864 " instruction, " 00 " shows just carry out this instruction when music is play at the beginning, " 90 " show that the effect of this instruction is to play a note by passage 0, and " 48 " show that this note is a piccolo, and " 64 " show that the sounding dynamics of piccolo is 64.
Following mask body introduction generates the process 300 of the strings of commands.
The strings of commands is recorded among the variable c, and it is an empty string 310 at the beginning.Scan whole track block from front to back, in case find a 8x or 9x instruction, just with whole 8x/9x instruction, promptly " instruction start time "+" 8x/9x "+" note numbering "+" note velocity " is connected the end 330 of variable c, all disposes up to whole track block.
What Fig. 3 represented is the process of revising track block.
In order more clearly to represent this process 700, simply introduce the head and tail of track block first.The head of track block is made up of 8 bytes " 4d 54 72 6b nn nn nn nn ", and wherein " nn nn nn nn " represents the byte number that this track block also comprises except the head of these 8 bytes.The end of track block is a reset instruction ff, and the form of this ff instruction is " 00 ff 2f 00 ", and last byte " 00 " represents that there is the additional information of 0 byte the back of this instruction, and this is the 2nd parameter after the ff instruction.The process 700 of track block is revised in following mask body introduction.
Find 710 of track block earlier, revise nn nn nn nn=nn nn nn nn+ " byte number of checking string " 720 wherein, promptly increase the length of track block, the length of increase is the byte number of checking string.Find last instruction ff730 of track block again, with the 2nd parameter " 00 " modification thereafter " byte number of checking string " 740, promptly increase the length of instruction ff, will verify that at last string copies the end 750 of track block to, the 3rd parameter, i.e. additional information as the ff instruction.
What Fig. 4 represented is discrimination process.Read a midi file 100 from storage medium.Each track block is carried out same operation.At first read the additional information 900 of last instruction ff, this additional information is carried out error correction decoding 1000, deciphering 1100 successively, decompressed 1200, be verified string again.Content according to track block generates the strings of commands 300 then.The contrast verification string and the strings of commands are made and are judged 1300.When all track blocks all dispose, the midi file that then will recover back original state is saved in storage medium 800, and generates and distort report 1400, points out whether data are distorted, is where distorted, how to distort.
Error correction decoding 1000 wherein, deciphering 1100, decompress 1200 to select for use respectively, encrypt 500 with Error Correction of Coding 600, compressed encoding 400 corresponding algorithm.
What Fig. 5 represented is the process that reads the additional information of last instruction ff.Find last instruction ff910 of track block, read the value of the 2nd byte behind the ff and this value is composed to variables L 920, this value is exactly the byte number of additional information.The 3rd byte behind the ff reads the content 930 of L byte, i.e. additional information.
What Fig. 6 represented is deterministic process.The contrast verification string and the strings of commands, if both are identical, can draw a conclusion " this track block was not distorted ".If both difference, can draw a conclusion " this track block would have been distorted ".Find out differences 1310 all in two character strings, comprise various situations such as insertion, deletion, modification, can draw a conclusion " all different places are exactly the place of being distorted ".Can also recover initial trace piece 1320 according to the checking string.
Wherein finding out differences 1310 all in two character strings and recovering initial trace piece 1320 according to the checking string is optionally, can be according to the needs of practical application, and whether decision carries out this two operations, also can only select one of them to carry out.
What Fig. 7 represented is the process of recovering track block.If the type of distorting is to have inserted new performance instruction, the then instruction 1321 that is inserted in the deletion locus piece.If the type of distorting is to have deleted original instruction, then from the checking string that reads, obtain deleted 8x/9x instruction, three parameters of this instruction and front and back thereof are inserted position deleted in the track block 1322.If the type of distorting is to have revised original instruction, the 8x/9x that then obtains to be modified from the checking string that reads instructs, and covers the instruction 1323 that is modified in the track block with three parameters of this instruction and front and back thereof.
The midi file that recovers back original state is saved in storage medium, and generates and to distort report, point out whether data are distorted, where distorted, how to distort.
Claims (1)
1. Midi voice data guard method is characterized in that, may further comprise the steps:
1). read a midi file from storage medium;
2). to each track block in the midi file, all notes of finding out in the track block are opened instruction and the instruction of note pass, and these instructions are become a strings of commands according to the series arrangement in former track block;
3). to the above-mentioned strings of commands compress successively, encryption, three encoding operations of error correction, form a new 0-1 character string, be called the checking string; The checking string is placed in the reset instruction of track block ending,, and is saved in storage medium as the parameter of this instruction;
4). during discriminating, read the parameter of the reset instruction of track block ending, promptly the checking string carries out error correction, deciphering, three decode operations of decompression successively, obtains a decoded strings of commands;
5) judge according to the decoded strings of commands whether the midi file was distorted, and determine what which place was distorted, how to be distorted, and then the information that will be distorted is recovered: if the type of distorting is to have inserted new performance instruction, the then instruction that is inserted in the deletion locus piece; If the type of distorting is to have deleted original instruction, then from the checking string, obtain deleted performance instruction, position deleted in the track block is inserted in this instruction; If the type of distorting is to have revised original instruction, the performance that then obtains not to be modified from the checking string that reads is instructed, and covers the instruction that is modified in track block with this instruction;
Perhaps only judge according to the decoded strings of commands whether the midi file was distorted, and determine what which place was distorted, how to be distorted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101196945A CN101354883B (en) | 2008-09-05 | 2008-09-05 | Method for protecting Midi audio data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101196945A CN101354883B (en) | 2008-09-05 | 2008-09-05 | Method for protecting Midi audio data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101354883A CN101354883A (en) | 2009-01-28 |
CN101354883B true CN101354883B (en) | 2011-06-08 |
Family
ID=40307666
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008101196945A Expired - Fee Related CN101354883B (en) | 2008-09-05 | 2008-09-05 | Method for protecting Midi audio data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101354883B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105023594B (en) * | 2015-08-04 | 2018-05-15 | 珠海市杰理科技股份有限公司 | MIDI file decoding method and systems |
CN113112971B (en) * | 2021-03-30 | 2022-08-05 | 上海锣钹信息科技有限公司 | Midi defective sound playing method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002116757A (en) * | 2000-10-11 | 2002-04-19 | Matsushita Electric Ind Co Ltd | Data recording method and recording device as well as recording medium |
JP2003044057A (en) * | 2001-07-27 | 2003-02-14 | Matsushita Electric Ind Co Ltd | Musical score distribution system and musical score distribution method |
-
2008
- 2008-09-05 CN CN2008101196945A patent/CN101354883B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002116757A (en) * | 2000-10-11 | 2002-04-19 | Matsushita Electric Ind Co Ltd | Data recording method and recording device as well as recording medium |
JP2003044057A (en) * | 2001-07-27 | 2003-02-14 | Matsushita Electric Ind Co Ltd | Musical score distribution system and musical score distribution method |
Non-Patent Citations (2)
Title |
---|
姜楠,王健,杨义先,钮心忻.Midi数字水印算法.《计算机应用研究》.2005,(第6期),36-37. * |
徐常凯,郑金忠.基于数字水印和加密技术的Internet音乐保护.《计算机工程》.2005,第31卷(第15期),137-139. * |
Also Published As
Publication number | Publication date |
---|---|
CN101354883A (en) | 2009-01-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100653802B1 (en) | Data processing apparatus, data processing method, and contents data generation method | |
KR100843813B1 (en) | Data processing apparatus, data processing method, and recording medium | |
US6792539B1 (en) | Processing method and apparatus for encrypted data transfer | |
US7957535B2 (en) | Data storing method, data playback method, data recording device, data playback device, and recording medium | |
KR20010109323A (en) | Data recording/reproducing device and saved data processing method, and program providing medium | |
KR20010108397A (en) | Storage device authentication system | |
US20070074037A1 (en) | Method for signing a data package and signing apparatus | |
KR20010006805A (en) | Data processing system and method for mutual identification between apparatuses | |
KR100934108B1 (en) | Data processing method, apparatus and system for encrypted data transmission | |
US6564322B1 (en) | Method and apparatus for watermarking with no perceptible trace | |
KR20060033447A (en) | Method and apparatus for sharing and generating system key in drm | |
Gomez et al. | Mixed watermarking-fingerprinting approach for integrity verification of audio recordings | |
CN101354883B (en) | Method for protecting Midi audio data | |
US7385131B2 (en) | Method and apparatus of music obfuscation to limit unauthorized playback | |
WO2021035978A1 (en) | Information steganography method, apparatus and device, and storage medium | |
US20070282924A1 (en) | Devices and methods for checking and determining control values | |
JP4172131B2 (en) | Data processing apparatus, data processing system and method thereof | |
KR100498264B1 (en) | Encryption and Decryption method for files | |
JP2000224045A (en) | Vector quantizing device and vector quantizing method | |
Chenna et al. | Storage and Authentication of Audio Footage for IoAuT Devices Using Distributed Ledger Technology | |
CN116910792A (en) | Artificial intelligence generated content processing method, system, equipment and storage medium | |
JPH11249670A (en) | Karaoke device and karaoke terminal device | |
JP2005301366A (en) | Data protecting device and method, data reproducing device, and data restoring device | |
KR20090071411A (en) | Audio data reproduction system, audio data reproduction method, and electronic device used in the system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20110608 Termination date: 20110905 |