CN1988493B - Buffer reset system and method thereof - Google Patents
Buffer reset system and method thereof Download PDFInfo
- Publication number
- CN1988493B CN1988493B CN200710000034.0A CN200710000034A CN1988493B CN 1988493 B CN1988493 B CN 1988493B CN 200710000034 A CN200710000034 A CN 200710000034A CN 1988493 B CN1988493 B CN 1988493B
- Authority
- CN
- China
- Prior art keywords
- buffer
- data
- processing unit
- reset
- flag
- 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
- 239000000872 buffer Substances 0.000 title claims abstract description 249
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000010586 diagram Methods 0.000 description 11
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Landscapes
- Communication Control (AREA)
Abstract
Description
技术领域 technical field
本发明是有关于一种缓冲器,其尤指缓冲器的重置系统及其方法。The present invention relates to a buffer, in particular to a buffer reset system and method thereof.
背景技术 Background technique
按,现今串流系统多用于网际网路,让民众可于网路上收听广播、音乐或收看影片。一般基本的串流系统,其包含有复数个处理单元与复数个缓冲器,其中相邻该处理单元间都设置有一缓冲器而用于暂存资料。请参阅图1,其为习用的串流系统的方块图。此串流系统用于网际网路,如图所示,串流系统包含有一第一处理单元20’、一第二处理单元22’、一第三处理单元24’、一第四处理单元26’、一第一缓冲器30’及一第二缓冲器32’。第一处理单元20’用于从网际网路下载资料并储存至第一缓冲器30’。Press, today's streaming system is mostly used on the Internet, allowing people to listen to radio, music or watch videos on the Internet. A general basic streaming system includes a plurality of processing units and a plurality of buffers, wherein a buffer is arranged between adjacent processing units for temporarily storing data. Please refer to FIG. 1, which is a block diagram of a conventional streaming system. This streaming system is used in the Internet. As shown in the figure, the streaming system includes a first processing unit 20', a second processing unit 22', a third processing unit 24', and a fourth processing unit 26' , a first buffer 30' and a second buffer 32'. The first processing unit 20' is used to download data from the Internet and store it in the first buffer 30'.
第二处理单元22’与第三处理单元24’用于依据第一缓冲器30’的资料型态而分别处理该第一缓冲器30’的资料,例如MP 3、WMA或WMV。第二处理单元22’从第一缓冲器30’将资料读取后并进行处理且将处理后的资料储存于第二缓冲器32’,若第二处理单元22’无法处理第一缓冲器30’的资料时,系统将会重置第一缓冲器30’并由第三处理单元24’重新读取第一缓冲器30’的资料而进行处理,之后将处理后的资料储存于第二缓冲器32’。接着,由第四处理单元26’从第二缓冲器32’读取处理后的资料而进行播放。其中缓冲器30’、32’为先进先出(First In First Out,FIFO)且为环型缓冲器(Ring Buffer)。The second processing unit 22' and the third processing unit 24' are used to respectively process the data of the first buffer 30' according to the data type of the first buffer 30', such as MP3, WMA or WMV. The second processing unit 22' reads and processes the data from the first buffer 30' and stores the processed data in the second buffer 32', if the second processing unit 22' cannot process the first buffer 30 ', the system will reset the first buffer 30' and re-read the data in the first buffer 30' by the third processing unit 24' for processing, and then store the processed data in the second buffer device 32'. Next, the processed data is read from the second buffer 32' by the fourth processing unit 26' and played. Wherein the buffers 30', 32' are first in first out (First In First Out, FIFO) and are ring buffers (Ring Buffer).
请参阅图2A,其为习用的环型缓冲器储存资料的状态示意图。如图所示,缓冲器1’具有一开始指标5’与一结束指标7’,缓冲器1’利用开始指标5’与结束指标7’指示缓冲器1’所储存资料10’的起始位址与结束位址。当资料10’被读取时,开始指标5’即向前移动指向资料被读取的最后位址。Please refer to FIG. 2A , which is a schematic diagram of a state of storing data in a conventional ring buffer. As shown in the figure, the buffer 1' has a start pointer 5' and an end pointer 7', and the buffer 1' uses the start pointer 5' and the end pointer 7' to indicate the start bit of the data 10' stored in the buffer 1' address and end address. When the data 10' is read, the start pointer 5' moves forward to point to the last address where the data is read.
再者,请参阅图2B,其为覆写资料至习用环型缓冲器的状态示意图。如图所示,当缓冲器1’的资料10’被读取后,开始指标5’会向前移动至资料10’最后被读取后的位址,也就是说若资料10’被读取完后,开始指标5’会与结束指标7’指向相同的位址。之后,若有一资料12’储存至缓冲器1’时,此资料12’会从结束指标7’所指的位址开始写入,且结束指标7’会向前移动直至完成写入资料12’至缓冲器1’为止。若写入资料12’至缓冲器1’的最后位址,而资料12’仍未完全写入时,则会从缓冲器1’的起始位址接续写入资料12’,此时即会覆盖已被读取的资料10’。所以,此种缓冲器1’称为环型缓冲器。Furthermore, please refer to FIG. 2B , which is a schematic diagram of a state of overwriting data into a conventional ring buffer. As shown in the figure, when the data 10' of the buffer 1' is read, the start pointer 5' will move forward to the address after the data 10' was last read, that is, if the data 10' is read After completion, the start pointer 5' and the end pointer 7' point to the same address. Afterwards, if a data 12' is stored in the buffer 1', the data 12' will be written from the address indicated by the end pointer 7', and the end pointer 7' will move forward until the writing of the data 12' is completed until buffer 1'. If the data 12' is written to the last address of the buffer 1', and the data 12' has not been completely written, the data 12' will be written continuously from the initial address of the buffer 1', and the Overwrite the read material 10'. Therefore, this buffer 1' is called a ring buffer.
请复参阅图1,若当第二处理单元22’无法处理第一缓冲器30’的资料,而交换由第三处理单元24’试着去读取并处理第一缓冲器30’的资料时,由于第二处理单元22’已读取一部分的资料,所以开始旗标5’向前指向第二处理单元22’读取资料后的位址,故此时第三处理单元24’已无法重新读取第一缓冲器30’的原有资料,因此我们需要重置系统,使第一处理单元20’交换为第三处理单元24’处理资料。Please refer to FIG. 1 again, if the second processing unit 22' cannot process the data of the first buffer 30', and the third processing unit 24' tries to read and process the data of the first buffer 30' instead , because the second processing unit 22' has read a part of the data, so the start flag 5' points forward to the address after the second processing unit 22' has read the data, so the third processing unit 24' cannot re-read at this time. The original data of the first buffer 30' is retrieved, so we need to reset the system so that the first processing unit 20' is exchanged for the third processing unit 24' to process data.
因此,如何针对上述问题而提出一种新颖缓冲器的重置系统及其方法,不仅可改善交换处理单元后,交换后的处理单元无法读取缓冲器的原有资料的缺点,亦可避免缓冲器的原有资料被覆写,可解决上述的问题。Therefore, how to propose a novel buffer reset system and its method in view of the above problems can not only improve the defect that the exchanged processing unit cannot read the original data of the buffer, but also avoid buffering. The original data of the device is overwritten, which can solve the above problems.
发明内容 Contents of the invention
本发明的主要目的,在于藉由在缓冲器设置一重置旗标与一重置功能,使在交换处理单元时,可允许重置旗标以重置缓冲器,让交换后的处理单元可重新读取缓冲器的原有资料。The main purpose of the present invention is to set a reset flag and a reset function in the buffer, so that when the processing unit is exchanged, the reset flag can be allowed to reset the buffer, so that the exchanged processing unit can Re-read the original data of the buffer.
本发明的另一目的,在于藉由在缓冲器设置一覆写旗标,当未确定随后的处理单元是否可处理缓冲器的资料时,可设定覆写旗标,让后续资料无法覆写至缓冲器,以避免覆盖缓冲器内的原有资料,而避免缓冲器内的原有资料遗失。Another object of the present invention is to set an overwrite flag in the buffer, when it is not determined whether the subsequent processing unit can process the data in the buffer, the overwrite flag can be set so that the subsequent data cannot be overwritten to the buffer to avoid overwriting the original data in the buffer and avoid losing the original data in the buffer.
为达上述的目的,本发明的缓冲器的重置系统包含有一重置功能、一重置旗标、一覆写旗标与一控制单元,重置旗标与覆写旗标设于缓冲器,控制单元用于呼叫重置功能与设定覆写旗标,藉由控制器呼叫重置功能可重置缓冲器,以让处理单元交换后可重新读取缓冲器的资料,而设定覆写旗标可保留缓冲器的资料,以避免资料遗失。In order to achieve the above-mentioned purpose, the buffer reset system of the present invention includes a reset function, a reset flag, an overwrite flag and a control unit, the reset flag and the overwrite flag are set in the buffer , the control unit is used to call the reset function and set the overwrite flag, the buffer can be reset by the controller calling the reset function, so that the processing unit can re-read the data of the buffer after the exchange, and set the overwrite flag Write flags can preserve the data in the buffer to avoid data loss.
本发明的重置方法是依据处理单元处理缓冲器的资料的状态呼叫重置功能并确认重置旗标。当一第一处理单元读取缓冲器的资料而无法处理时,控制单元则确认重置旗标并呼叫重置功能,以交换一第二处理单元与第一处理单元,让第二处理单元取代第一处理单元,而重新读取缓冲器的资料并进行处理。当资料写入缓冲器时,重置旗标将会设定为假(False),另外,当不确定处理单元是否可处理缓冲器的资料时,可藉由控制单元设定覆写旗标为一非覆写参数值,让后续资料无法覆写至缓冲器,即是无法将资料覆写于旧资料,直至确认处理单元可处理缓冲器的资料时,才设定覆写旗标为一覆写参数值,让后续资料可覆写至缓冲器。The reset method of the present invention is to call the reset function and confirm the reset flag according to the status of the processing unit processing the data in the buffer. When a first processing unit reads the data in the buffer and cannot process it, the control unit confirms the reset flag and calls the reset function to exchange a second processing unit with the first processing unit, allowing the second processing unit to replace The first processing unit re-reads the data in the buffer and processes it. When data is written into the buffer, the reset flag will be set to false (False). In addition, when it is uncertain whether the processing unit can process the data in the buffer, the overwrite flag can be set by the control unit to be A non-overwrite parameter value, so that the subsequent data cannot be overwritten to the buffer, that is, the data cannot be overwritten on the old data, and the overwrite flag is set to an overwrite until it is confirmed that the processing unit can process the data in the buffer Write the parameter value so that subsequent data can be overwritten to the buffer.
本发明的有益效果是:可以在缓冲器设置一重置旗标与一重置功能,使在交换处理单元时,可允许重置旗标以重置缓冲器,让交换后的处理单元可重新读取缓冲器的原有资料。还可以在缓冲器设置一覆写旗标,当未确定随后的处理单元是否可处理缓冲器的资料时,可设定覆写旗标,让后续资料无法覆写至缓冲器,以避免覆盖缓冲器内的原有资料,而避免缓冲器内的原有资料遗失。The beneficial effects of the present invention are: a reset flag and a reset function can be set in the buffer, so that when the processing unit is exchanged, the reset flag can be allowed to reset the buffer, so that the exchanged processing unit can be reset Read the original data of the buffer. An overwrite flag can also be set in the buffer. When it is not determined whether the subsequent processing unit can process the data in the buffer, the overwrite flag can be set so that the subsequent data cannot be overwritten to the buffer to avoid overwriting the buffer. The original data in the buffer can be used to prevent the original data in the buffer from being lost.
附图说明 Description of drawings
图1为习用串流系统的方块图;Figure 1 is a block diagram of a conventional streaming system;
图2A为习用环型缓冲器储存资料的状态示意图;FIG. 2A is a schematic diagram of a state of storing data in a conventional ring buffer;
图2B为覆写资料至习用环型缓冲器的状态示意图;FIG. 2B is a schematic diagram of a state of overwriting data to a conventional ring buffer;
图3为本发明的一较佳实施例的方块图;Fig. 3 is a block diagram of a preferred embodiment of the present invention;
图4为缓型缓冲器设定为非覆写参数的状态示意图;FIG. 4 is a schematic diagram of a state in which the buffer is set to a non-overwriting parameter;
图5为本发明的另一较佳实施例的方块图;Fig. 5 is the block diagram of another preferred embodiment of the present invention;
图6为本发明的一较佳实施例的流程图;Fig. 6 is a flow chart of a preferred embodiment of the present invention;
图7为本发明的另一较佳实施例的流程图。Fig. 7 is a flowchart of another preferred embodiment of the present invention.
图号说明:Description of figure number:
1’缓冲器 5’开始指标1'buffer 5'start indicator
7’结束指标 10’资料7'End indicator 10'Information
12’资料 20’第一处理单元12'data 20'first processing unit
22’第二处理单元 24’第三处理单元22'second processing unit 24'third processing unit
26’第四处理单元 30’第一缓冲器26' fourth processing unit 30' first buffer
32’第二缓冲器 2开始指标32' second buffer 2 start indicators
4结束指标 6旧资料4 End indicator 6 Old information
8新资料 10缓冲器8
13重置旗标 16覆写旗标13 reset
20第一处理单元 22第二处理单元20 The
24第三处理单元 30控制单元24 The
40下载单元 50第一缓冲器40 download units 50 first buffer
53重置旗标 56覆写旗标53 reset flag 56 override flag
60解码模组 62第一解码单元60 decoding module 62 first decoding unit
64第二解码单元 66第三解码单元64 second decoding unit 66 third decoding unit
70第二缓冲器 80播放单元70 second buffer 80 playback unit
具体实施方式 Detailed ways
为使审查委员对本发明的结构特征及所达成的功效有更进一步的了解与认识,谨佐以较佳的实施例及配合详细的说明,说明如后:In order to enable the examiners to have a further understanding and understanding of the structural features and the achieved effects of the present invention, a preferred embodiment and a detailed description are provided, as follows:
请参阅图3,其为本发明的一较佳实施例的方块图。如图所示,本发明的缓冲器的重置系统包含有一控制单元30、一重置旗标13与一覆写旗标16,重置旗标13与覆写旗标16皆设于一缓冲器10。控制单元30用于确认重置旗标(resettable flag)13的状态与确认并改变覆写旗标(overwriteable flag)16,以控制缓冲器10的资料读取与写入。控制单元30确认重置旗标13被设定,之后控制单元30允许呼叫重置功能以重置缓冲器10,也就是重置缓冲器10的开始指标回复至缓冲器10的起始位址,如此第三处理单元24即可在第二处理单元22读取缓冲器10的资料而无法处理时,可重新读取缓冲器10原有的资料而进行处理。若重置旗标13被设定成一非重置参数,之后控制单元30便无法重置缓冲器10,最初将重置旗标13设定为重置参数,当有任何资料覆写于缓冲器10的资料时,重置旗标13将会自动设定为非重置旗标。Please refer to FIG. 3 , which is a block diagram of a preferred embodiment of the present invention. As shown in the figure, the reset system of the buffer of the present invention includes a
控制单元30设定覆写旗标16为一非覆写参数值时,即为逻辑中的”假”(False),是无法将资料覆盖缓冲器10的原有资料,请一并参阅图4所示,当覆写旗标16设定为一非覆写参数值时,资料将写入缓冲器10,直到结束指标到达缓冲器10的最后位址时,无法将资料覆写至缓冲器10,也就是说缓冲器10已储存旧资料6,当覆写旗标16设定为一非覆写参数值时,新资料可由开始旗标2之后写入缓冲器10,直到写满缓冲器10的容量,即是结束旗标4移至缓冲器10的尾端,如此可避免第一处理单元20后续写入资料于缓冲器10,而覆盖缓冲器10内原有的资料,使第二处理单元22或第三处理单元24读取缓冲器10的资料,仍可保留缓冲器10原有的资料。控制单元30设定覆写旗标16为一覆写参数值时,即为逻辑中的”真”(Ture),缓冲器10可被覆写资料。When the
以下是举一实施例,而对本发明进行说明。当第一处理单元20储存一第一资料至缓冲器10后,第二处理单元22会读取缓冲器10的第一资料以进行处理。第二处理单元22于处理第一资料时,是会发送一回应讯息至控制单元30,通知控制单元30可处理第一资料。若第二处理单元22可处理第一资料时,控制单元30即依据表示可处理资料的回应讯息设定覆写旗标为覆写参数值,让第一处理单元20可覆写资料至缓冲器10。若第二处理单元22无法处理第一资料时,控制单元30将会确认缓冲器10的覆写旗标16,若重置旗标设定为逻辑中的”真”,即会重置缓冲器10,并即依据表示无法处理资料的回应讯息发送一交换讯息至第三处理单元24,也就是说当第二处理单元22无法处理第一资料时,控制单元30会交换第二处理单元22与第三处理单元24,让第三处理单元24取代第二处理单元22。The following is an example to illustrate the present invention. After the
此外,控制单元30于发送驱动讯息的同时亦会重置缓冲器10并设定重置旗标13为重置参数值,以重置缓冲器10,使开始指标回复指向缓冲器10的第一资料的起始位置,让第三处理单元24可以从缓冲器10储存第一资料的起始位置开始读取第一资料,如此即可解决第三处理单元24在第二处理单元22无法处理缓冲器10的资料时,无法重新读取缓冲器10原有资料的问题,以提高缓冲器10的使用效能。上述,第三处理单元24于处理第一资料时,亦会发送回应讯息至控制单元30,使控制单元30设定覆写旗标13为覆写参数值,让第一处理单元20可接续覆写资料至缓冲器10。上述,若覆写旗标被设定为覆写参数值且第一处理单元20写入足够资料至缓冲器10以覆写一些资料,之后重置旗标13为非重置参数值。In addition, the
另外,若之后第一处理单元20无法处理缓冲器10的资料,第三处理单元24亦无法处理缓冲器10的资料时,其会发送表示无法处理资料的回应讯息至控制单元30,之后若有任何其他处理单元时,此时控制单元30即会发送交换讯息至其他处理单元,以交换第三处理单元24,让其他处理单元取代第三处理单元24,同时控制单元30会重置缓冲器10并设定重置旗标13为重置参数。In addition, if the
请参阅图5,其为本发明的另一较佳实施例的方块图。如图所示,本发明的缓冲器的重置系统可应用于网路的串流系统。此串流系统包含有一下载单元40、第一缓冲器50、一解码模组60、一第二缓冲器70与一播放单元80。下载单元40藉由网际网路下载一网路资料并写入第一缓冲器50。网路资料可为WMA、WMV或MP3的资料格式或任何其他格式,。由于起初不确定解码模组60的一第一解码单元62、一第二解码单元64与一第三解码单元66是否可解码第一缓冲器50内的网路资料。第一缓冲器50的覆写旗标56初始设定为非覆写参数,所以可确保切换解码单元。Please refer to FIG. 5 , which is a block diagram of another preferred embodiment of the present invention. As shown in the figure, the buffer reset system of the present invention can be applied to a network streaming system. The streaming system includes a
解码模组60,用于解码第一缓冲器50的网路资料,解码模组60的第一解码单元62、第二解码单元64与第三解码单元66,分别用于针对WMA、WMV以及MP3的资料格式进行解码。当第一缓冲器50储存有网路资料时,第一解码单元62将先读取第一缓冲器50的网路资料,若第一缓冲器50的网路资料为WMA格式时,第一解码单元62即可进行解码,并发送表示可以处理的回应讯息至控制单元30,以让控制单元30得知第一解码单元62可解码网路资料,此时控制单元30会设定第一缓冲器的覆写旗标56为覆写参数值,让下载单元40可持续储存网路资料至第一缓冲器50。The decoding module 60 is used to decode the network data of the first buffer 50. The first decoding unit 62, the second decoding unit 64 and the third decoding unit 66 of the decoding module 60 are respectively used for WMA, WMV and MP3 The data format is decoded. When the first buffer 50 stores network data, the first decoding unit 62 will first read the network data of the first buffer 50, if the network data of the first buffer 50 is in WMA format, the first decoding The unit 62 is ready to decode, and sends a response message indicating that it can be processed to the
若,下载单元40所下载的网路资料为MP3格式时,第一解码单元62将无法进行解码,此时第一解码单元62会发送表示无法处理的回应讯息至控制单元30,让控制单元30得知第一解码单元62无法解码第一缓冲器50的网路资料。控制单元30随即会发送交换讯息至第二解码单元64,而交换第一解码单元62与第二解码单元64,使第二解码单元64取代第一解码单元62,同时会重置第一缓冲器50,让第二解码单元64可重新读取第一缓冲器50原有的网路资料,即读取第一解码单元62所读取而无法解码的网路资料。If, when the network data downloaded by the
由于,第二解码单元64是针对WMV格式的网路资料进行解码,所以第二解码单元64亦无法对MP3格式的网路资料进行解码。此时,第二解码单元64亦会发送表示无法处理的回应讯息至控制单元30,以让控制单元30发送驱动讯息至第三解码单元66,而交换第二解码单元64与第三解码单元66,让第三解码单元66取代第二解码单元64,并再重置第一缓冲器50。让第三解码单元66可重新读取第一缓冲器50的网路资料。Since the second decoding unit 64 decodes the network data in the WMV format, the second decoding unit 64 cannot decode the network data in the MP3 format. At this time, the second decoding unit 64 will also send a response message indicating that it cannot be processed to the
由于第一缓冲器50所储存的网路资料的格式符合第三解码单元66可解码的资料格式,所以第三解码单元66将发送表示可处理的回应讯息至控制单元30,控制单元30将会依据回应讯息设定覆写旗标56为覆写参数值,使下载单元40可允许储存网路资料至第一缓冲器50,而覆盖原有的网路资料,让第三解码单元66可持续读取第一缓冲器50的网路资料而进行解码。Since the format of the network data stored in the first buffer 50 conforms to the decodable data format of the third decoding unit 66, the third decoding unit 66 will send a response message indicating that it can be processed to the
若,下载单元40所下载的网路资料的格式并非为WMA、WMV以及MP3时,由于解码模组60的解码单元62、64、66皆无法解码第一缓冲器50所储存的网路资料,加上控制单元30于此网路串流系统亦无法侦测到有其它解码单元存在,也就是代表此网路串流系统有误,而无法解码第一缓冲器50所储存的网路资料。If the format of the network data downloaded by the
上述,第一解码单元62、第二解码单元64或第三解码单元66解码网路资料后,所产生的解码资料会储存至第二缓冲器70。之后,播放单元80会读取第二缓冲器70内的解码资料以进行播放。在此实施例中,由于解码模组60所产生的解码资料的格式,是符合播放单元80可播放资料的格式,所以第二缓冲器70不需设置重置旗标与覆写旗标。在这实施例中,覆写旗标初始设定为”真”,并且第二缓冲器70相当于传统的环形缓冲器,然而第二缓冲器70亦可应用于不同的资料格式。As mentioned above, after the first decoding unit 62 , the second decoding unit 64 or the third decoding unit 66 decodes the network data, the generated decoded data will be stored in the second buffer 70 . Afterwards, the playing unit 80 reads the decoded data in the second buffer 70 for playing. In this embodiment, since the format of the decoded data generated by the decoding module 60 conforms to the format of the data playable by the playback unit 80, the second buffer 70 does not need to set the reset flag and the overwrite flag. In this embodiment, the overwrite flag is initially set to "true", and the second buffer 70 is equivalent to a conventional ring buffer, however, the second buffer 70 can also be applied to different data formats.
请参阅图6,其为本发明的一较佳实施例的流程图。为了便于说明,此实施例是配合图3进行说明。当不确定系统的处理单元22、24是否可处理缓冲器10所储存的资料时,可先设定缓冲器10的覆写旗标16为非覆写参数值,让第一处理单元20无法储存资料至缓冲器10,以避免系统的处理单元22、24皆无法处理缓冲器10的资料时,第一处理单元20尚接续储存资料至缓冲器10而覆盖缓冲器10原有的资料而遗失。如步骤S10所示,当第一处理单元20写入资料至缓冲器10时,控制单元30即会设定缓冲器10的覆写旗标16为非覆写参数值,让缓冲器10无法覆写资料。Please refer to FIG. 6 , which is a flowchart of a preferred embodiment of the present invention. For ease of description, this embodiment is described in conjunction with FIG. 3 . When it is uncertain whether the
第二处理单元22即会读取缓冲器10的资料并进行处理,且依据处理资料的状态对应发送回应讯息至控制单元30。控制单元30如步骤S12所示,接收到回应讯息后,即会进一步执行步骤S14,依据回应讯息确认第二处理单元22是否可以处理缓冲器10的资料,若第二处理单元22可以处理缓冲器的资料,控制单元30即会执行步骤S16,设定覆写旗标16为覆写参数值,以让缓冲器10可覆写资料,使得第二处理单元22可持续读取缓冲器10的资料并进行处理。The
假若,第二处理单元22所发送的回应讯息表示无法处理资料,控制单元30在执行步骤S14时将会依据回应讯息而得知,并且执行步骤S18,侦测是否存在有其他处理单元,以图3为例,控制单元30将会侦测到有第三处理单元24。此时,控制单元30执行步骤S19,重置缓冲器10,并且发送交换讯息至第三处理单元24,以交换第三处理单元24与第二处理单元22,让第三处理单元24读取缓冲器10原有的资料而进行处理。随后,即重复执行步骤S12与步骤S14,若第三处理单元24可处理缓冲器10的资料,即进行步骤S16,并接续进行步骤S17,若第三处理单元24亦无法处理时,则又进行步骤S18,此时由于控制单元30已侦测不到有其他处理单元存在,所以如步骤S20所示,代表此系统错误而无法处理缓冲器10的资料。If the response message sent by the
控制单元30于上述步骤S12,若未接收到回应讯息时,控制单元30会进行步骤S22,侦测缓冲器10是否被填满,因为覆写旗标设定为”假”,所以缓冲器将会填满,且缓冲器10储存资料并无关于资料被处理单元所读取,缓冲器10若未被填满资料时,则更多资料被写入(如步骤S10),并再一次确认及传送回应讯息(如步骤S12)。若缓冲器10已被填满资料时,控制单元30则执行步骤S24,持续等待回应讯息。之后,控制单元30于接收到回应讯息后,则执行步骤S26,此步骤同于上述步骤S14。若回应讯息表示可处理缓冲器10的资料,则执行步骤S16,若回应讯息表示无法处理缓冲器10的资料,则执行同于步骤S18的步骤S28。若控制单元30侦测没有存在其他处理单元时,是如步骤S20所示,表示系统错误,若有处理单元存在则进行步骤S29,此步骤同于步骤S19。随后重复执行步骤S24。In the above-mentioned step S12, if the
请参阅图7,其为本发明的另一较佳实施例的流程图。此实施例为控制单元设定缓冲器的覆写旗标为覆写参数值后的处理流程。此实施例同样配合图3进行说明。由于缓冲器10的覆写旗标16设定为覆写参数值,所以如步骤S30所示,第一处理单元20可写入资料至缓冲器10。之后,第二处理单元22会先读取缓冲器10的资料并进行处理,且依据处理资料的状态发送回应讯息。如步骤S32所示,当控制单元30接收到回应讯息后会执行步骤S34,若回应讯息表示第二处理单元22可处理缓冲器10的资料时,即如步骤S36所示,表示系统正常,第二处理单元22将接续读取缓冲器10的资料并进行处理。Please refer to FIG. 7 , which is a flowchart of another preferred embodiment of the present invention. This embodiment is the processing flow after the control unit sets the overwrite flag of the buffer to overwrite the parameter value. This embodiment is also described in conjunction with FIG. 3 . Since the
若,回应讯息表示第二处理单元22无法处理资料时,控制单元30则进行步骤S38,侦测是否有其他处理单元存在,于此实施例系侦测尚有第三处理单元24存在,所以进行步骤S39,重置缓冲器10并交换第三处理单元24与第二处理单元22,让第三处理单元24取代第二处理单元22,交换完成后则重复执行步骤S32。之后,若第三处理单元24亦无法处理缓冲器10的资料时,由于系统已没有其他处理单元存在可以进行交换,所以如步骤S40所示,表示此系统错误。If, when the response message indicates that the
于上述步骤S32,若控制单元30持续未接收到回应讯息时,控制单元30会如步骤S42所示,侦测缓冲器10是否被填满,缓冲器10若未被填满资料时,则更多资料被写入(如步骤S10),并再一次确认及传送回应讯息(如步骤S12),若缓冲器10已被填满资料时,则直接认定此系统正常。其是因为起初会设定覆写旗标16为覆写参数值即表示此系统的其中的一处理单元可处理缓冲器10的资料,所以直接认定此系统正常。本发明设定覆写旗标为覆写参数值不一定需经过第五图的流程,若确定系统的处理单元可处理缓冲器的资料时,亦可直接设定覆写旗标为覆写参数值。In the above step S32, if the
综上所述,本发明的缓冲器的重置系统及其方法是藉由设置重置旗标于缓冲器,让两处理单元于交换时,重置缓冲器,如此交换后的处理单元即可重新读取前一处理器所读取而无法处理的资料。又,重置旗标将可自动设定而允许控制单元得知系统是否需要重置。另外,本发明更设置覆写旗标于缓冲器,若在不确定系统的处理器是否可处理缓冲器的资料时,为了避免缓冲器的资料被后续写入的资料覆盖而遗失,可藉由设定覆写旗标为非覆写参数值,让缓冲器无法覆写资料直至确定有处理单元可处理缓冲器的资料,覆写旗标将会设定为覆写参数,使缓冲器像一般环形缓冲器一样,如此即可确保缓冲器的资料不会遗失,而提高缓冲器的使用效能。若覆写旗标的初始状态设定为覆写参数时,缓冲器就相当于环形缓冲器,将资料读进缓冲器前时,允许重置并切换处理单元。In summary, the buffer reset system and method of the present invention set a reset flag on the buffer so that the two processing units can reset the buffer when they are swapped, so that the swapped processing units can be Reread data that was read by the previous processor and could not be processed. Also, the reset flag will be automatically set allowing the control unit to know if the system needs to be reset. In addition, the present invention sets an overwrite flag on the buffer. If it is uncertain whether the processor of the system can process the data in the buffer, in order to prevent the data in the buffer from being overwritten by the data written later and being lost, you can use the Set the overwrite flag to the non-overwrite parameter value, so that the buffer cannot overwrite the data until it is determined that there is a processing unit that can process the data in the buffer, and the overwrite flag will be set to the overwrite parameter, so that the buffer will behave like a normal Like a ring buffer, it can ensure that the data in the buffer will not be lost, thereby improving the performance of the buffer. If the initial state of the overwrite flag is set as an overwrite parameter, the buffer is equivalent to a circular buffer, allowing resetting and switching processing units before reading data into the buffer.
以上所述,仅为本发明的一较佳实施例而已,并非用来限定本发明实施的范围,举凡依本发明权利要求范围所述的形状、构造、特征及精神所为的均等变化与修饰,均应包括于本发明的权利要求范围内。The above description is only a preferred embodiment of the present invention, and is not intended to limit the implementation scope of the present invention. For example, all equal changes and modifications are made according to the shape, structure, characteristics and spirit described in the scope of the claims of the present invention. , should be included in the scope of the claims of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200710000034.0A CN1988493B (en) | 2007-01-05 | 2007-01-05 | Buffer reset system and method thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN200710000034.0A CN1988493B (en) | 2007-01-05 | 2007-01-05 | Buffer reset system and method thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1988493A CN1988493A (en) | 2007-06-27 |
| CN1988493B true CN1988493B (en) | 2012-01-11 |
Family
ID=38185136
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN200710000034.0A Expired - Fee Related CN1988493B (en) | 2007-01-05 | 2007-01-05 | Buffer reset system and method thereof |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1988493B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1625107A (en) * | 2003-12-02 | 2005-06-08 | 明基电通股份有限公司 | Method for transmitting data in audio-visual playing system |
| US7028149B2 (en) * | 2002-03-29 | 2006-04-11 | Intel Corporation | System and method for resetting a platform configuration register |
| CN1874295A (en) * | 2005-05-30 | 2006-12-06 | 林正泰 | Wireless digital content streaming download method and device |
-
2007
- 2007-01-05 CN CN200710000034.0A patent/CN1988493B/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7028149B2 (en) * | 2002-03-29 | 2006-04-11 | Intel Corporation | System and method for resetting a platform configuration register |
| CN1625107A (en) * | 2003-12-02 | 2005-06-08 | 明基电通股份有限公司 | Method for transmitting data in audio-visual playing system |
| CN1874295A (en) * | 2005-05-30 | 2006-12-06 | 林正泰 | Wireless digital content streaming download method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1988493A (en) | 2007-06-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI547954B (en) | Electronic device and audio playing method | |
| US20110302365A1 (en) | Storage system using a rapid storage device as a cache | |
| US7849259B1 (en) | Disk controller response handler for write commands | |
| RU2009130109A (en) | SUPPORT OF MULTIPLE OPERATING SYSTEMS IN MULTIMEDIA DEVICES | |
| JP2010537358A (en) | Method and system for repairing a damaged hard disk file system | |
| CN103974013B (en) | Carry out the method and video record equipment of video record playback | |
| CN111984198B (en) | Message queue implementation method and device and electronic equipment | |
| EP2469858B1 (en) | Apparatus and method for sequentially parsing bitstreams based on removal of emulation prevention byte | |
| CN1988493B (en) | Buffer reset system and method thereof | |
| CN100405340C (en) | stream data processing device | |
| US7613867B2 (en) | Information recording apparatus, information recording method and recording medium recording program | |
| US7568066B2 (en) | Reset system for buffer and method thereof | |
| US20060129898A1 (en) | Method for accessing a data sector and processing a bad sector in a hard disk drive of a mobile communication terminal | |
| TW200401271A (en) | DVD-ROM controller and MPEG decoder with shared memory controller | |
| CN111399781B (en) | Storage method for improving reliability of real-time image recording system | |
| TW200814010A (en) | Optical storage device and data storage method thereof | |
| JP5118855B2 (en) | Buffer device reset system and method | |
| CN104103304B (en) | A kind of video and audio filing storage and call method based on LTFS | |
| CN100411044C (en) | Data management method for processing decoding error of read back data of optical disk and optical disk drive | |
| CN100405328C (en) | Methods to Improve Data Transfer Efficiency | |
| JP4305262B2 (en) | Ring buffer control method, ring buffer device, and data recording / reproducing device | |
| CN102929801A (en) | Disk addressing method and device | |
| JP2011193120A (en) | Apparatus and method for playback and recording of content, and program | |
| TWI277868B (en) | Method of improving transferred-data efficiency | |
| CN114969429A (en) | A high frame rate video recording method, device, computer equipment and storage medium |
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 | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120111 Termination date: 20170105 |