CN101901193A - Data buffer method and service end - Google Patents

Data buffer method and service end Download PDF

Info

Publication number
CN101901193A
CN101901193A CN2009100850289A CN200910085028A CN101901193A CN 101901193 A CN101901193 A CN 101901193A CN 2009100850289 A CN2009100850289 A CN 2009100850289A CN 200910085028 A CN200910085028 A CN 200910085028A CN 101901193 A CN101901193 A CN 101901193A
Authority
CN
China
Prior art keywords
data
data block
buffer
read
read operation
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.)
Granted
Application number
CN2009100850289A
Other languages
Chinese (zh)
Other versions
CN101901193B (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.)
Beijing Venus Information Security Technology Co Ltd
Beijing Venus Information Technology Co Ltd
Original Assignee
Beijing Venus Information Security Technology Co Ltd
Beijing Venus Information 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 Beijing Venus Information Security Technology Co Ltd, Beijing Venus Information Technology Co Ltd filed Critical Beijing Venus Information Security Technology Co Ltd
Priority to CN2009100850289A priority Critical patent/CN101901193B/en
Publication of CN101901193A publication Critical patent/CN101901193A/en
Application granted granted Critical
Publication of CN101901193B publication Critical patent/CN101901193B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data buffer method and a service end, and the method comprises the following steps: arranging all buffer storage regions according to a certain sequence for forming a storage queue; writing a data block into one buffer storage region every time; writing all the data blocks into all the buffer storage regions which are started from one buffer storage region and are continuous in the storage queue according to the writing time sequence of the data blocks when writing the data blocks, and generating and recording marks for respectively indicating the writing time sequence of each data block; sequentially reading the data blocks in the all the continuous buffer storage regions in the storage queue in one-time reading operation, and obtaining the marks which respectively indicate the writing time sequence of each data block; and finishing the reading operation if the mark which indicates the writing time sequence of a certain data block is different from the due mark. The data buffer method and the service end can meet the requirement on continuity of data obtainment.

Description

A kind of way to play for time of data and service end
Technical field
The present invention relates to data Caching Mechanism, particularly a kind of way to play for time of data and service end.
Background technology
The equipment with special purpose that safety equipment are made up of hardware, software and networking technology, it mainly provides one or multinomial security function.With matching used common its management control end that also has of safety equipment, on management control end, all can provide the function of the security incident of display security device real-time report usually.
Use based on the management control end Yin Qiyi of Web, easily dispose, advantage such as easy care and being widely used.But because the singularity that Web uses realizes that at browser end there is certain technical difficulty in the actual time safety incident that display device reports.
In typical Web was used, communication process must be initiated by browser end, and Web service end (to call service end in the following text) is accepted the communication request of browser end, reply data then, and close link subsequently.Though in the HTTP1.1 version, can reduce the load of service end by setting up the mode that long-chain connects, but still have problems such as overtime maintenance.
Under this applied environment, browser end is for obtaining up-to-date security incident, need send request to server end again and again, and the security incident that service end need report safety equipment cushions, when treating the browser end request, reply the data to browser through end (as shown in Figure 1) of the security incident of buffering.Under the situation that single browser is browsed, security incident in the data that the buffering assurance browser of server is replied at every turn is continuous, if the request of browser is enough timely, and replying of server is enough rapid, the actual time safety incident that enough, continuous nothings that browser end can obtain are lost, otherwise the actual time safety incident may be the front and back divergence in the data that browser is replied for twice.Under the situation of the concurrent request msg of many browsers, above-mentioned requirements when the buffering of service end not only will satisfy single browser, also to consider to be in the interactive problem of browser under the heterogeneous networks bandwidth environment, as in some buffering, may produce because reply the data of low bandwidth browser, and cause the blocked situation of replying of other browsers.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of way to play for time and service end of data, can satisfy the continuity requirement of obtaining data.
In order to address the above problem, the invention provides a kind of way to play for time of data, comprising:
Each buffer-stored zone is arranged in certain sequence, form storage queue;
In a buffer-stored zone, write a data block at every turn; During writing data blocks, the time sequencing that writes according to described data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generates and write down the sign of the writing time sequence of indicating each data block respectively;
In read operation, read block in continuous each buffer-stored zone from storage queue successively, and obtain the sign of this data block writing time sequence of indication; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish this read operation; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, the sign of the writing time sequence of the data block that should read for indication then.
Further, do not allow to write simultaneously, or simultaneously a certain block buffering storage area is write and reads; Allow to read simultaneously.
Further, be physical deflection X with every block buffering storage area residing position in annular storage queue; The total block data in the buffer-stored zone in the storage queue is C; With the sign of Data Position as the writing time sequence of designation data piece;
Concrete steps when each writing data blocks comprise:
31, pw is increased progressively 1; The initial value of pw is 0;
32, described data block is written in the buffer-stored zone that physical deflection is the X place, and current pw is deducted 1 Data Position that is recorded as this data block; X is that pw deducts 1 the difference result to the C delivery.
Further, with the sign of Data Position as the writing time sequence of designation data piece; The concrete steps of a read operation comprise:
41, determine the maximum data piece number N of this read operation and the initial data position Pi that reads; If carry out read operation for the first time, Pi gets 0;
42, read the data block that physical deflection is the X place, and obtain the Data Position p of this data block; X is that described Pi is to the C delivery;
43, whether more above-mentioned p equates with Pi, if equate the data block that then output is read, execution in step 44; Otherwise abandon data block herein, make that Pi is pw, return step 41;
44, read the data block that physical deflection is the X place, and obtain the Data Position of this data block, X be p add 1 and to the result of C delivery; If the value of the Data Position of this place's data block is not equal to p+1, execution in step 45; Otherwise, execution in step 46;
45, abandon reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
46, export this place's data block, and with this place data block Data Position as p;
47, if the data block number of having exported in this read operation more than or equal to N, then execution in step 48; Otherwise, return execution in step 44;
48, finish this read operation, return the p+1 conduct Pi of read operation next time.
Further, described storage queue is a circle queue;
In writing/read described storage queue behind last buffer-stored zone, again from described storage queue first buffer-stored zone begin to write/read.
The present invention also provides a kind of service end, is used for the management control end based on Web, comprising:
Receiving element is used to receive the data that safety equipment report;
Storage unit is used to preserve the data of security incident;
Writing unit is used for the data write storage unit that will receive;
Reading unit is used for after the request of receiving browser end from storage unit reading of data and output;
Described storage unit comprises several buffer-stored zones; Arrange in certain sequence in described several buffer-stored zones, forms storage queue;
The said write unit writes a data block to a buffer-stored zone at every turn; Write the fashionable time sequencing that writes according to data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generate and write down the sign of the writing time sequence of indicating each data block respectively;
Described reading unit in read operation, read block from each buffer-stored zone of storage queue, and the sign of indicating this data block writing time sequence successively; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish to read; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, then be the sign of the writing time sequence of the data block that reads the first time in this read operation of indication.
Further, the said write unit can not write two or more data blocks simultaneously;
Described storage unit does not allow said write unit and described reading unit simultaneously a block buffering storage area to be operated;
Described reading unit can read two or more data blocks simultaneously.
Further, be physical deflection X with every block buffering storage area residing position in annular storage queue; The total block data in the buffer-stored zone in the storage queue is C; With the sign of Data Position as the writing time sequence of designation data piece;
During said write unit each writing data blocks, pw is increased progressively 1, the initial value of pw is 0; Described data block is written in the buffer-stored zone that physical deflection is the X place then, and current pw is deducted 1 Data Position that is recorded as this data block; X is that pw deducts 1 the difference result to the C delivery.
When further, reading unit carries out read operation at every turn:
Determine the maximum data piece number N of this read operation earlier, and the initial data position Pi that reads, read the data block that X=(Pi mod C) locates then, and obtain the real Data Position p of this data block; Abandon reading if p and Pi are unequal, make Pi equal to read the data block that X=(Pi mod C) locates again behind the pw, relatively whether the Data Position of this data block equates with Pi again; If equate then data block that output is read, repeat data block number that following operation exported then more than or equal to N in this read operation:
Read X=[(p+1) mod C] data block located, and obtain the Data Position of this data block; If the value of the Data Position of this data block equals p+1, then export this place's data block, replace p with this value of locating the Data Position of data block;
When the value of the Data Position of a data block is not equal to p+1, abandon reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
The data block number of having exported in this read operation finishes this read operation during more than or equal to N, returns p+1 as the Pi of read operation next time.
Further, described storage queue is a circle queue;
Behind last buffer-stored zone, first buffer-stored zone begins to write from described storage queue again in being written to described storage queue in the said write unit;
Behind last buffer-stored zone, first buffer-stored zone begins to read described reading unit from described storage queue again in reading described storage queue.
Compared with prior art, technical scheme of the present invention has satisfied the continuity requirement that browser obtains data; Prioritization scheme of the present invention can drop to interacting between many browsers minimum under the situation of the concurrent request msg of many browsers.
Description of drawings
Fig. 1 is the synoptic diagram of transmission security incident between service end and browser end in the prior art;
Fig. 2 is the memory model synoptic diagram in the embodiment of the invention one;
Fig. 3 goes into process flow diagram for the buffer write in the embodiment of the invention one;
Fig. 4 reads process flow diagram for the buffering in the embodiment of the invention one.
Embodiment
Below in conjunction with drawings and Examples technical scheme of the present invention is described in detail.
Embodiment one, a kind of way to play for time of data; Each buffer-stored zone is arranged in certain sequence, form storage queue; The data of preserving in the described buffer-stored zone are called a data block; As shown in Figure 2, adopt the memory model of annular storage queue in the present embodiment as security incident.Every block buffering storage area residing position in annular storage queue is called physical deflection, represents with X; In Fig. 2, label 1~18 is X.The size of storage queue (the just total block data in the buffer-stored zone in the storage queue, the i.e. maximal value of X) is called buffer sizes, represents that with C regulation C can not change during program run.Present embodiment is the buffering at security event data, also goes for other data during practical application.
In the present embodiment, all write the data block of the security incident in buffer-stored zone, priority according to its write time, adopt unique Digital ID corresponding with it, this sign is referred to as Data Position, represent with P, write at every turn fashionable, the P of the data block that is write than before the P of data block of write-once increase progressively 1.P is the sign that is used to indicate the writing time sequence of each described data block correspondence, when practical application, can adopt the sign of other indication writing time sequence to indicate,, and can show that the adjacent data block that writes of each data block gets final product as long as can show the order that each data block writes.During such as priority writing data blocks D1, D2, D3, D4, D5......, the sign of described indication writing time sequence is not only wanted to show that data block D3 writes behind D1, D2, before D4, D5, write, also want to show that writing of D3 is to follow at D2, rather than after the D1, that then write after the D3 is D4, rather than D5.Present embodiment has provided the implementation that adopts P, but can be out of shape during practical application, write such as hypothesis at every turn and fashionablely to increase progressively 3, so to differ be that 3 data block is exactly the adjacent data block that writes to Dui Ying P, and can learn writing time sequence according to the size of P.
In the present embodiment, simultaneously to a certain block buffering storage area write and be read as mutually exclusive operation, write and be written as mutually exclusive operation, be unallowed; And read and read non-exclusive operation, allow.
After the data that receive the security incident that safety equipment report, it be write in the buffer-stored zone; Write a data block to a buffer-stored zone at every turn.
When writing the data block of security incident, the time sequencing that writes according to described data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generates and write down the sign of the writing time sequence of indicating each data block respectively.Such as described buffer-stored zone is the buffer-stored zone of X=6, earlier data block is write this buffer-stored zone; The data block that will write after this data block writes the buffer-stored zone of X=7, the data block that next writes is write the buffer-stored zone of X=8 ... by that analogy; Behind last buffer-stored zone, first buffer-stored zone begins to write from described storage queue again in being written to described storage queue.In the present embodiment, be first buffer-stored zone from described storage queue, promptly the buffer-stored zone of X=0 begins to write.
As shown in Figure 3, the idiographic flow that writes for the buffering in the embodiment of the invention is with the sign of Data Position as the writing time sequence of designation data piece; When writing the data block of security incident, may further comprise the steps at every turn:
Step 300 generates new Data Position pw; In the practical application, this step also can generate the sign of other indication writing time sequence.
Wherein, the initial value of described pw is 0, when each writing data blocks, pw is increased progressively 1.
Generate the atomic operation that is operating as of new Data Position.
Step 301 is written to physical deflection X=[(pw-1 with described data block) mod C] in the buffer-stored zone located, and with the Data Position of current pw-1 as this data block, record in this data block, write described buffer-stored zone.
Wherein, mod represents modulo operation.
If adopt the sign of other indication writing time sequence, the calculating formula of the physical deflection in the then above-mentioned buffer-stored zone that is written to also can correspondingly change, and guarantees to be written in the buffer-stored zone continuous in the storage queue to get final product.
When receiving browser end to the request of security event data, from the buffering storage area, read several data blocks and output, receive described request once more after, from the buffering storage area, read several data blocks and output again.In this article, the process that will " read a data block " is called " once reading ", and the process that will " read several data blocks after receiving request " is called " read operation ".
In read operation, read block in continuous each buffer-stored zone from storage queue successively, and obtain the sign of this data block writing time sequence of indication; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish this read operation; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, the sign of the writing time sequence of the data block that should read for indication then.
Such as priority writing data blocks D1, D2, D3, D4, D5......, if the last data block that reads is D3, it is exactly the sign of representing the writing time sequence of D4 that sign should be arranged so, can certainly be the sign of the writing time sequence of expression D2.
Behind last buffer-stored zone, first buffer-stored zone begins to read from described storage queue again in reading described storage queue.
In addition,, then read the back at every turn and judge whether the data block number that is read is equal to or greater than N, read if then finish if determined the maximum data piece number N that reads before the read operation.
As shown in Figure 4, for the buffering in the embodiment of the invention reads process flow diagram, with the sign of Data Position as the writing time sequence of designation data piece; Carry out following steps during each read operation:
Step 400 is determined the maximum data piece number N of this read operation and the initial data position Pi that reads; Pi promptly indicates the sign (in the present embodiment, if carry out read operation for the first time, the Pi input gets 0) of the writing time sequence of the data block that should read;
Step 401 reads the data block that X=(Pi mod C) locates, and obtains real Data Position p in this data block;
Step 402, whether more above-mentioned p equates with Pi, if equate the data block that then output is read, execution in step 403; Otherwise abandon the data block that (Pi mod C) locates, revise Pi=pw, return step 400.
Step 403 reads X=[(p+1) mod C] data block located, and obtain the Data Position of this data block; If the value of the Data Position of this place's data block is not equal to p+1, execution in step 404; Otherwise, execution in step 405;
Step 404 abandons reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
Step 405 is exported this place's data block, and replaces p with the value (being exactly p+1) of the Data Position of this place's data block;
Step 406, if the data block number of having exported in this read operation more than or equal to N, then execution in step 407; Otherwise, return execution in step 403;
Step 407 finishes this read operation, returns the p+1 conduct Pi of read operation next time.
Also be to carry out above-mentioned steps when beginning read operation again, but the Data Position that the initial data position Pi that reads in the step 400 returns when being a preceding read operation.
If adopt the sign of other indication writing time sequence, the calculating formula of the physical deflection in then above-mentioned buffer-stored zone of reading also can correspondingly change, and assurance is to read in the buffer-stored zone continuous from storage queue to get final product.
Therefore the speed that reads is during more than or equal to writing speed, and output is the continuous data of P; Satisfied the continuity requirement that browser obtains data; Reading speed is during less than writing speed, and the head and the tail P that read for twice front and back is a divergence, but the data of each output are P the longest continuous output.
In the present invention, writing and reading of buffering can be carried out simultaneously, so long as not writing or write simultaneously and read same block buffering storage area simultaneously just without any influencing each other.Reading of same block buffering storage area can be carried out simultaneously, mutually without any influencing each other.
Embodiment two, and a kind of service end is used for the management control end based on Web in the present embodiment, and present embodiment is the buffering at security event data, also go for other data during practical application.As shown in Figure 2, comprising:
Receiving element is used to receive the data of the security incident that safety equipment report.
Storage unit is used to preserve the data of security incident; Comprise several buffer-stored zones; Arrange in certain sequence in described several buffer-stored zones, forms storage queue, adopts circle queue in the present embodiment; The data of preserving in the described buffer-stored zone are called a data block.
Writing unit is used for the data write storage unit that will receive, and writes a data block to a buffer-stored zone at every turn; Write the fashionable time sequencing that writes according to data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generate and write down the sign of the writing time sequence of indicating each data block respectively.Behind last buffer-stored zone, first buffer-stored zone begins to write from described storage queue again in being written to described storage queue.In the present embodiment, be first buffer-stored zone from described storage queue, promptly the buffer-stored zone of X=0 begins to write.
Reading unit is used for after the request of receiving browser end from storage unit reading of data and output; In read operation, read block from each buffer-stored zone of storage queue, and the sign of indicating this data block writing time sequence successively; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish to read; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, then be the sign of the writing time sequence of the data block that reads the first time in this read operation of indication.Behind last buffer-stored zone, first buffer-stored zone begins to read from described storage queue again in reading described storage queue.
In the present embodiment, writing unit can not write two or more data blocks simultaneously, and storage unit does not allow writing unit and reading unit simultaneously to block buffering storage area operation (writing/read); Reading unit can read two or more data blocks simultaneously.
In the present embodiment, with the sign of Data Position as the writing time sequence of designation data piece; During the each writing data blocks of writing unit, pw is increased progressively 1, the initial value of pw is 0; Then described data block is written to physical deflection X=[(pw-1) mod C] in the buffer-stored zone located, and with the Data Position of current pw-1 as this data block, record in this data block.Can but be not limited to preserve pw with a register.
In the present embodiment, with the sign of Data Position as the writing time sequence of designation data piece; When reading unit carries out read operation at every turn, determine the maximum data piece number N of this read operation earlier, and the initial data position Pi that reads is (in the present embodiment, if carry out read operation for the first time, the Pi input gets 0), read the data block that X=(Pi mod C) locates then, and obtain the real Data Position p of this data block; Abandon reading if p and Pi are unequal, read the data block that X=(Pi mod C) locates again after making Pi=pw, relatively whether the Data Position of this data block equates with Pi again; If equate then data block that output is read, repeat data block number that following operation exported then more than or equal to N in this read operation:
Read X=[(p+1) mod C] data block located, and obtain the Data Position of this data block; If the value of the Data Position of this data block equals p+1, then export this place's data block, replace p with this value of locating the Data Position of data block;
When the value of the Data Position of a data block is not equal to p+1, abandon reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
The data block number of having exported in this read operation finishes this read operation during more than or equal to N, returns p+1 as the Pi of read operation next time.
Certainly; the present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.

Claims (10)

1. the way to play for time of data comprises:
Each buffer-stored zone is arranged in certain sequence, form storage queue;
In a buffer-stored zone, write a data block at every turn; During writing data blocks, the time sequencing that writes according to described data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generates and write down the sign of the writing time sequence of indicating each data block respectively;
In read operation, read block in continuous each buffer-stored zone from storage queue successively, and obtain the sign of this data block writing time sequence of indication; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish this read operation; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, the sign of the writing time sequence of the data block that should read for indication then.
2. way to play for time as claimed in claim 1 is characterized in that:
Do not allow to write simultaneously, or simultaneously a certain block buffering storage area is write and reads; Allow to read simultaneously.
3. way to play for time as claimed in claim 1 is characterized in that:
With every block buffering storage area residing position in annular storage queue is physical deflection X; The total block data in the buffer-stored zone in the storage queue is C; With the sign of Data Position as the writing time sequence of designation data piece;
Concrete steps when each writing data blocks comprise:
31, pw is increased progressively 1; The initial value of pw is 0;
32, described data block is written in the buffer-stored zone that physical deflection is the X place, and current pw is deducted 1 Data Position that is recorded as this data block; X is that pw deducts 1 the difference result to the C delivery.
4. way to play for time as claimed in claim 3 is characterized in that, with the sign of Data Position as the writing time sequence of designation data piece; The concrete steps of a read operation comprise:
41, determine the maximum data piece number N of this read operation and the initial data position Pi that reads; If carry out read operation for the first time, Pi gets 0;
42, read the data block that physical deflection is the X place, and obtain the Data Position p of this data block; X is that described Pi is to the C delivery;
43, whether more above-mentioned p equates with Pi, if equate the data block that then output is read, execution in step 44; Otherwise abandon data block herein, make that Pi is pw, return step 41;
44, read the data block that physical deflection is the X place, and obtain the Data Position of this data block, X be p add 1 and to the result of C delivery; If the value of the Data Position of this place's data block is not equal to p+1, execution in step 45; Otherwise, execution in step 46;
45, abandon reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
46, export this place's data block, and with this place data block Data Position as p;
47, if the data block number of having exported in this read operation more than or equal to N, then execution in step 48; Otherwise, return execution in step 44;
48, finish this read operation, return the p+1 conduct Pi of read operation next time.
5. way to play for time according to any one of claims 1 to 4 is characterized in that:
Described storage queue is a circle queue;
In writing/read described storage queue behind last buffer-stored zone, again from described storage queue first buffer-stored zone begin to write/read.
6. a service end is used for the management control end based on Web, comprising:
Receiving element is used to receive the data that safety equipment report;
Storage unit is used to preserve the data of security incident;
Writing unit is used for the data write storage unit that will receive;
Reading unit is used for after the request of receiving browser end from storage unit reading of data and output;
It is characterized in that:
Described storage unit comprises several buffer-stored zones; Arrange in certain sequence in described several buffer-stored zones, forms storage queue;
The said write unit writes a data block to a buffer-stored zone at every turn; Write the fashionable time sequencing that writes according to data block, each described data block is written in the storage queue since a buffer-stored each the buffer-stored zone zone, continuous, generate and write down the sign of the writing time sequence of indicating each data block respectively;
Described reading unit in read operation, read block from each buffer-stored zone of storage queue, and the sign of indicating this data block writing time sequence successively; If indicate the sign of a certain data block writing time sequence to be different from sign should be arranged, then finish to read; Described should have be designated: the sign of indication and the writing time sequence of the last adjacent data block that writes of data block that reads; If read the first time in read operation, then be the sign of the writing time sequence of the data block that reads the first time in this read operation of indication.
7. service end as claimed in claim 6 is characterized in that:
The said write unit can not write two or more data blocks simultaneously;
Described storage unit does not allow said write unit and described reading unit simultaneously a block buffering storage area to be operated;
Described reading unit can read two or more data blocks simultaneously.
8. service end as claimed in claim 6 is characterized in that:
With every block buffering storage area residing position in annular storage queue is physical deflection X; The total block data in the buffer-stored zone in the storage queue is C; With the sign of Data Position as the writing time sequence of designation data piece;
During said write unit each writing data blocks, pw is increased progressively 1, the initial value of pw is 0; Described data block is written in the buffer-stored zone that physical deflection is the X place then, and current pw is deducted 1 Data Position that is recorded as this data block; X is that pw deducts 1 the difference result to the C delivery.
9. service end as claimed in claim 8 is characterized in that, when reading unit carries out read operation at every turn:
Determine the maximum data piece number N of this read operation earlier, and the initial data position Pi that reads, read the data block that X=(Pi mod C) locates then, and obtain the real Data Position p of this data block; Abandon reading if p and Pi are unequal, make Pi equal to read the data block that X=(Pi mod C) locates again behind the pw, relatively whether the Data Position of this data block equates with Pi again; If equate then data block that output is read, repeat data block number that following operation exported then more than or equal to N in this read operation:
Read X=[(p+1) mod C] data block located, and obtain the Data Position of this data block; If the value of the Data Position of this data block equals p+1, then export this place's data block, replace p with this value of locating the Data Position of data block;
When the value of the Data Position of a data block is not equal to p+1, abandon reading this place's data block, and the Data Position that returns this place's data block finishes this read operation as the Pi of read operation next time;
The data block number of having exported in this read operation finishes this read operation during more than or equal to N, returns p+1 as the Pi of read operation next time.
10. as each described service end in the claim 6 to 9, it is characterized in that:
Described storage queue is a circle queue;
Behind last buffer-stored zone, first buffer-stored zone begins to write from described storage queue again in being written to described storage queue in the said write unit;
Behind last buffer-stored zone, first buffer-stored zone begins to read described reading unit from described storage queue again in reading described storage queue.
CN2009100850289A 2009-05-27 2009-05-27 Data buffer method and device Expired - Fee Related CN101901193B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100850289A CN101901193B (en) 2009-05-27 2009-05-27 Data buffer method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100850289A CN101901193B (en) 2009-05-27 2009-05-27 Data buffer method and device

Publications (2)

Publication Number Publication Date
CN101901193A true CN101901193A (en) 2010-12-01
CN101901193B CN101901193B (en) 2012-07-18

Family

ID=43226740

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100850289A Expired - Fee Related CN101901193B (en) 2009-05-27 2009-05-27 Data buffer method and device

Country Status (1)

Country Link
CN (1) CN101901193B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544116A (en) * 2012-07-09 2014-01-29 安凯(广州)微电子技术有限公司 Data processing method and device
CN105516548A (en) * 2015-11-27 2016-04-20 中央电视台 File pre-reading method and device
CN109492016A (en) * 2018-11-19 2019-03-19 中国银联股份有限公司 A kind of exchange settlement method and device
CN110019509A (en) * 2017-09-29 2019-07-16 北京京东尚科信息技术有限公司 A kind of wiring method and device of data
CN110045918A (en) * 2018-12-03 2019-07-23 阿里巴巴集团控股有限公司 A kind of efficient data cell method for reusing and system
CN110620816A (en) * 2019-09-16 2019-12-27 杭州比孚科技有限公司 Inter-group communication method for ships
CN111913807A (en) * 2020-08-13 2020-11-10 支付宝(杭州)信息技术有限公司 Event processing method, system and device based on multiple storage areas
CN113641304A (en) * 2021-07-05 2021-11-12 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100359887C (en) * 2003-05-09 2008-01-02 华为技术有限公司 Method for ordering to eliminate its jitter time delay by time stamp of RTP data pocket
CN1286314C (en) * 2004-08-05 2006-11-22 联合信源数字音视频技术(北京)有限公司 Method and its device for keeping display synchronization in video frequency decoding system
US7877543B2 (en) * 2004-12-03 2011-01-25 Hewlett-Packard Development Company, L.P. System and method for writing data and a time value to an addressable unit of a removable storage medium
CN100517294C (en) * 2006-07-14 2009-07-22 中兴通讯股份有限公司 Double CPU communication method based on shared memory

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103544116B (en) * 2012-07-09 2016-08-10 安凯(广州)微电子技术有限公司 A kind of data processing method and device
CN103544116A (en) * 2012-07-09 2014-01-29 安凯(广州)微电子技术有限公司 Data processing method and device
CN105516548A (en) * 2015-11-27 2016-04-20 中央电视台 File pre-reading method and device
CN105516548B (en) * 2015-11-27 2019-01-11 中央电视台 A kind of pre-reading method of files and device
CN110019509A (en) * 2017-09-29 2019-07-16 北京京东尚科信息技术有限公司 A kind of wiring method and device of data
US11887068B2 (en) 2018-11-19 2024-01-30 China Unionpay Co., Ltd. Transaction settlement method and apparatus
CN109492016A (en) * 2018-11-19 2019-03-19 中国银联股份有限公司 A kind of exchange settlement method and device
CN110045918A (en) * 2018-12-03 2019-07-23 阿里巴巴集团控股有限公司 A kind of efficient data cell method for reusing and system
CN110045918B (en) * 2018-12-03 2021-09-03 蚂蚁金服(杭州)网络技术有限公司 Efficient data unit reusing method and system
CN110620816B (en) * 2019-09-16 2021-11-05 杭州比孚科技有限公司 Inter-group communication method for ships
CN110620816A (en) * 2019-09-16 2019-12-27 杭州比孚科技有限公司 Inter-group communication method for ships
CN111913807A (en) * 2020-08-13 2020-11-10 支付宝(杭州)信息技术有限公司 Event processing method, system and device based on multiple storage areas
CN111913807B (en) * 2020-08-13 2024-02-06 支付宝(杭州)信息技术有限公司 Event processing method, system and device based on multiple storage areas
CN113641304A (en) * 2021-07-05 2021-11-12 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks
CN113641304B (en) * 2021-07-05 2023-10-20 深圳市宏旺微电子有限公司 Method, device, terminal equipment and storage medium for managing data blocks

Also Published As

Publication number Publication date
CN101901193B (en) 2012-07-18

Similar Documents

Publication Publication Date Title
CN101901193B (en) Data buffer method and device
CN104360967B (en) The control method of accumulator system, console controller and DMA
CN101079154B (en) Role animation realization method and system
CN102122271B (en) NAND flash memory controller and control method thereof
CN104702474A (en) FPGA (Field Programmable Gate Array)-based EtherCAT (Ethernet Control Automation Technology) main station device
CN112231148B (en) Distributed cache data offline transmission method and device and readable storage medium
CN101714391A (en) Data storage method and device
CN101430663B (en) Caching management unit and caching management method
CN111291022B (en) Data storage system based on block chain
CN106325759A (en) DDR (Double Data Rate) method and device capable of dynamically configuring port bandwidths
CN204733178U (en) A kind of EtherCAT master station device based on FPGA
CN100472493C (en) An asynchronism first in first out method, system and sending apparatus
CN102082577A (en) High-speed cyclic redundancy check (CRC) device and implementation method thereof
CN104102552A (en) Message processing method and device
CN104252420A (en) Data writing method and memory system
CN106372002A (en) Data storage method and data reading and restoring method
CN109857969A (en) Data form view processing method, system and computer readable storage medium
CN106469172B (en) The data-updating method and device of distributed file system
CN102081597A (en) Failure analysis report generation system and method
JP5251586B2 (en) Verification support program, verification support apparatus, and verification support method
CN105683961B (en) Method and system for managing data for write back of hypothesis analysis
CN107704329A (en) A kind of information persistence method, server and computer-readable recording medium
CN100536020C (en) First-in first-out memory and regulating method of read/write address
CN104077127B (en) Execute the method that the security software being interlaced with one another is applied and non-secure software is applied
CN104639456A (en) Data transmission control method and network card

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: 20120718

Termination date: 20180527