CN105404599B - A kind of bus access error protection method - Google Patents

A kind of bus access error protection method Download PDF

Info

Publication number
CN105404599B
CN105404599B CN201510718453.2A CN201510718453A CN105404599B CN 105404599 B CN105404599 B CN 105404599B CN 201510718453 A CN201510718453 A CN 201510718453A CN 105404599 B CN105404599 B CN 105404599B
Authority
CN
China
Prior art keywords
access
user
delay
visitor
cycle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510718453.2A
Other languages
Chinese (zh)
Other versions
CN105404599A (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.)
CRRC Zhuzhou Institute Co Ltd
Original Assignee
CSR Zhuzou Institute 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 CSR Zhuzou Institute Co Ltd filed Critical CSR Zhuzou Institute Co Ltd
Priority to CN201510718453.2A priority Critical patent/CN105404599B/en
Publication of CN105404599A publication Critical patent/CN105404599A/en
Application granted granted Critical
Publication of CN105404599B publication Critical patent/CN105404599B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/36Handling requests for interconnection or transfer for access to common bus or bus system

Abstract

The invention discloses a kind of bus access error protection methods, the described method comprises the following steps:Obtain the access cycle of the multiple visitors to access;Access conflict is judged whether in the flag of Accessor Access's data block;When access cycle, there are change one or more visitors during the access conflict to the time point accessed of the flag next time to avoid access generates the access conflict next time described in multiple visitors each other by identical multiple visitors.Compared with prior art, the method according to the invention can effectively reduce the number of bus access error;Meanwhile method of the invention need not increase hardware cost, have higher promotional value.

Description

A kind of bus access error protection method
Technical field
The present invention relates to field of computer technology, in particular relate to a kind of bus access error protection method.
Background technology
The number for accessing error is the key factor for weighing bus communication degree of stability.Currently for the protection of bus error There are two types of methods, and one kind is designed in itself by hardware, to reduce or avoid the probability of error.But this mode is to correlation Hardware device has special requirement, and designs relative complex.It is another a kind of, it is to be gone out by the design of software itself Error protection.
Currently used software mode is logically by the deblocking of access, and corresponding each data block sets a mark Position is known, for the data block is marked to be in the either idle state of reading and writing.Then, which is shared to visit The person of asking accesses access identities position first before data block.If flag is read/write status, wait until flag is idle. If flag is the free time, flag is performed into read/write operation labeled as read/write and further to data block.Finally read/ Flag is reverted into idle state after write operation.
Above-mentioned setting also generates a problem simultaneously.In multiple visitors state of one flag of reading simultaneously, If the flag is the free time, multiple visitors can be caused to change same flag simultaneously and access a data block simultaneously Happen, so as to generate access errors.Further, if the access cycle of multiple visitors is identical, then Duo Gefang The person of asking goes the probability for accessing or operating the flag that can increase simultaneously, increases so as to cause to access the number to malfunction.
Therefore, in order to reduce bus access error number, it is necessary to a kind of bus access error protection method.
The content of the invention
In order to reduce the number for accessing error, the present invention provides a kind of bus access error protection method, the methods Comprise the following steps:
Obtain the access cycle of the multiple visitors to access;
Access conflict is judged whether in the flag of Accessor Access's data block;
When the access cycle identical multiple visitors each other there are change during the access conflict one or Multiple visitors are to the time point accessed of the flag next time to avoid the described next of multiple visitors Secondary access generates the access conflict.
In one embodiment, described in when two or more visitors access the same flag simultaneously There are the access conflicts each other by visitor.
In one embodiment, during the time point accessed described in changing next time it is respectively each visitor Set the delay of different durations so that accessed next time described in being carried out after each corresponding delay of visitor's wait.
In one embodiment, the delay is not equal to the integral multiple of the access cycle.
In one embodiment, the delay is less than the access cycle.
In one embodiment, wait and accessed again afterwards still the time of the access conflict occurs in the visitor Point performs the access operation after the visitor for start time point according to the access cycle.
In one embodiment, the time point for being waited using the visitor and being accessed again is start time point according to the visit Ask that the cycle performs the access operation after the visitor.
In one embodiment, the delay of different durations is set according to the access privileges of the different visitors, The visitor higher to the access privileges sets the delay of smaller duration.
In one embodiment, the visitor includes main side and one or more from side, is visited next time described in change The access cycle that the main side is kept during the time point asked is constant, respectively will be each described different from being just set as waiting It is accessed again after the delay of duration, wherein, the arbitrary delay from side is not equal to the access cycle.
In one embodiment, the arbitrary delay from side is more than the access cycle.
Compared with prior art, the method according to the invention can effectively reduce the number of bus access error;Meanwhile this The method of invention need not increase hardware cost, have higher promotional value.
The other feature or advantage of the present invention will illustrate in the following description.Also, the present invention Partial Feature or Advantage will be become apparent or be appreciated that by implementing the present invention by specification.The purpose of the present invention and part Advantage can be realized or obtained by specifically noted step in specification, claims and attached drawing.
Description of the drawings
Attached drawing is used for providing a further understanding of the present invention, and a part for constitution instruction, the reality with the present invention It applies example to be provided commonly for explaining the present invention, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is execution flow chart according to an embodiment of the invention;
Fig. 2 is that data block identifier position sets schematic diagram in the prior art.
Specific embodiment
Carry out the embodiment that the present invention will be described in detail below with reference to accompanying drawings and embodiments, whereby implementation personnel of the invention Can fully understand how application technology means solve technical problem to the present invention, and reach the realization process of technique effect and according to The present invention is embodied according to above-mentioned realization process.If it should be noted that do not form conflict, each embodiment in the present invention And each feature in each embodiment can be combined with each other, the technical solution formed protection scope of the present invention it It is interior.
In order to reduce the number of bus access error, the present invention proposes a kind of bus access error protection method.It connects down To be described in detail the execution flow of method according to an embodiment of the invention based on attached drawing.The step of being shown in the flow chart of attached drawing It can be performed in the computer system comprising such as a group of computer-executable instructions.Although each step is shown in flow charts Rapid logical order, but in some cases, it can be with the steps shown or described are performed in an order that is different from the one herein.
As shown in Figure 1, in the method for the invention, initially performing step S100, start step, start bus access.With Exemplified by core bus accesses, in core bus communication, mainly to avoid because of mainboard and operate the same area simultaneously from plate causing Access error.Existing scheme is that the region that entire core bus is able to access that is first divided into several pieces, is connected on and distributes several Identification byte corresponds to each piece of data area, which identifies the current state of the data block.
As shown in Fig. 2, 1 flag of data block, 2 flag of data block, 3 flag ... data block N flags of data block Corresponding data block 1, data block 2, data block 3 ... data block N respectively.Whenever mainboard or to go from plate to access a certain data block When (data block 1, data block 2, data block 3 ... or data block N), it is necessary to the state for reading the data block first be gone (to access data 1 flag of block, 2 flag of data block, 3 flag ... of data block or data block N mark), so that it is determined that this time operation whether It has permission.After the side for obtaining permission has operated corresponding data block, the value of set identifier, represents this operation again It has been completed that, so as to discharge operating right.The side for not obtaining permission again accesses to the data block in next cycle.
According to above-mentioned logic flow, in the present embodiment, when bus access starts (step S100), if necessary to access A certain data block first has to perform step S101, and identification marking position step judges whether this visit operation has permission.If Flag is busy state, then illustrates have other users (visitor) accessing the data block at this time.Step is performed at this time S102, waiting step wait access identities position again after an access cycle.
If flag is idle state, illustrate accessing the data block without other users at this time.But at this time again There will be two kinds of situations, and a kind of situation, which is that only there are one users at this time, to access the flag, and such the user was based in the free time Flag further can normally access data block.Another situation is that there are multiple (two or more) at this time User access the flag simultaneously.Since the user that current time each accesses the flag can the free time based on flag State goes further to access data block, this has resulted in multiple users while has accessed a data block, and punching is accessed so as to generate It is prominent.
For the above situation, in the present embodiment, after step slol, when flag is idle state, it is necessary to hold Row step S110 judges whether that access conflict occurs.I.e. whether current time has multiple users access identities position simultaneously.If work as The preceding moment, there are one user's access identities positions (not generating access conflict), then the user can continue to execute step S103 marks flag, and (access rights are obtained, and other users is prevented to obtain access right flag labeled as busy Limit).Then step S104 is further performed, accesses data block, read/write operation is carried out to data block.
When the read/write operation is completed, step S105 is performed, recovers flag, flag is reverted into idle state (release Access rights).Step S106 is finally performed, data access terminates, and terminates this access to data block.
In step s 110, i.e., ought sometime if access conflict currently has occurred, multiple users will in synchronization Operate this data block.Since multiple users go to read flag before operation, it is to have permission that multiple users, which have been found that, at this time The data block is operated, as a result multiple users go to operate the data block, are missed so as to cause data write error.
Generally, when the above-mentioned data write error mistake (access conflict) of generation, it is necessary to when each user's wait one is specific Data block access is carried out after length again.But in the design of many access mechanisms, multiple users are with a fixed cycle A certain data block is operated.Due to being all the access cycle of multiple users fixed, so that this while operation Probability greatly increases, and the probability of error also increases, so as to affect the reliability of communication.
Specifically, such as data write error occurs for data block 1 in moment T1 user A and user B to miss.User A and user B Respectively wait one access cycle T2Access data block 1 again afterwards.Since user A and the access cycle of the wait of user B are T2, at this time data write error by mistake will occur again.
To avoid the occurrence of upper one, in the present embodiment, (step 110 judging result is after access conflict occurs It is), step S111 is first carried out, judges whether the access cycle that each side user of access conflict occurs is consistent.In the event of access The access cycle of each side user of conflict is inconsistent, then can perform step S112, and each side waits a respective access respectively Performing step S101 after cycle again, (since access cycle is inconsistent, each side waits after a respective access cycle again respectively The time point of secondary access will not overlap).
When the access cycle for each side user that access conflict occurs is consistent, then step S113 is performed, respectively delaying step, The delay of different durations is set respectively for each user (access cycle is identical and access conflict occurs).Then step is performed S114 makes each user be waited according to the delay set.It waits and performs step S101 again later.Since each user uses It is different in the duration of the delay of wait, therefore after step S114, each user again identifies that the time point of flag (S101) Also would not overlap.
Summarize the above process, exactly when access cycle identical multiple visitors there are change one during access conflict each other A or multiple visitors generate visit to the time point accessed of flag next time to avoid the access next time of multiple visitors Ask conflict.It is noted herein that the premise of step 111 is to obtain the access cycle of visitor.The access cycle of visitor It can be obtained when accessing (the step S100) at the beginning of operation, that is, obtain the access week of the multiple visitors to access Phase can also obtain after step silo, that is, obtain the access cycle for multiple visitors that access conflict occurs.
Further, in step S113, the premise for setting delay is the access next time in order to enable multiple visitors Time point it is misaligned.Based on above-mentioned premise, a variety of different schemes may be employed in the duration setting of delay.First, in order to drop There is the probability of access conflict after low multiple access, in one embodiment of the invention, delay is whole not equal to access cycle Several times (not equal to the multiple of access cycle or access cycle).Further, in another embodiment of the present invention, it is delayed Less than access cycle.In addition, in order to reduce the setting of delay, for multiple users, the delay of one of user is made to access Cycle (does not do delay process), and other users set the delay not equal to access cycle.
Specifically, in an embodiment of the present invention.A time-delayed sequence is set for each user.Each time-delayed sequence is One array, all numerical value in whole arrays are different (each numerical value represents a duration) each other.Into line delay During setting, duration of the numerical value as delay in respective time-delayed sequence (array) is respectively adopted in each user, can thus protect Demonstrate,prove the difference of the stand-by period of each user.
By taking user A and user B as an example, the time-delayed sequence of user A is (A1、A2、A3、A4), the time-delayed sequence of user B is (B1、 B2、B3、B4), A1、A2、A3、A4、B1、B2、B3、B4It is 8 different numbers, is not mutually equal between them.
It is assumed that T1 moment user A and user B are conflicted, A is respectively adopted in user A and user B1And B2As delay, then User A and user B is respectively in moment T1+A1And T+B2It accesses again.Due to A1Not equal to B2, therefore moment T1+A1And T1+B2No Together.
In order to further reduce the probability of access conflict appearance, in an embodiment of the present invention, can be read when setting and being delayed The last delay used is taken, then (is occurred using the delay for being different from last delay using last delay currently Access conflict, then the probability that access conflicts occur again using other delays is relatively small).
Continue by taking user A and user B as an example, it is assumed that T2 moment (a certain moment after the T1 moment) user A and user B occurs Conflict.The delay that last time (T1 moment) user A is used is A1, the delay that user B is used is B2.The last time is read respectively (during T1 Carve) delay, then according to the order of array carry out this delay setting.Namely according to array order this (T2 moment) User A uses A2, user B use B3
After the completion of step S113 and S114, user is again introduced into browsing process.In order to avoid the confusion of browsing process, It reduces and performs step, in an embodiment of the present invention, still access conflict occurs after being accessed again after visitor is delayed Time point performs the access operation after visitor for start time point according to access cycle.
Continue by taking user A and user B as an example, it is assumed that the access cycle of user A and user B are all T.It is assumed that T2 moment users A and user B are conflicted, and A is respectively adopted in user A and user B2And B3As delay, then user A and user B are respectively at the moment T2+A2And T2+B3It accesses again.After this, user A and user B is still using T as access cycle, in timing node T2+nT (T2 + nT is moment T2+A2And T2+B3Timing node afterwards) it accesses.
In said program, due to performing visit according to access cycle as start time point using the time point that access conflict occurs Access operation after the person of asking, therefore the probability that access conflict occurs again is still higher, in order to further reduce access conflict The probability of generation, in one embodiment of this invention, the time point accessed again after being delayed using visitor are pressed as initial time The access operation after visitor is performed according to access cycle.
Continue by taking user A and user B as an example, it is assumed that T2 moment user A and user B are conflicted, user A and user B A is respectively adopted2And B3As delay, then user A and user B is respectively in moment T2+A2And T2+B3It accesses again.After this, User A and user B is still using T as access cycle, respectively in timing node T2+A2+ nT and T2+B3+ nT accesses.Due to A2Not equal to B3, therefore moment T2+A2+ nT and T2+B3+ nT is misaligned (to also need to A herein2And B3Not for T's access cycle Integral multiple).The access time point that this is allowed for after user A and user B is completely misaligned, thus greatly reduces access conflict The probability of generation.
In a practical situation, each user's is specifically different.In some specific cases, different user may With different access privileges., it is necessary to which the high user of priority preferentially accesses i.e. when there is access conflict.Therefore in this hair In a bright embodiment, different delays, the visit higher to access privileges are set according to the access privileges of different visitors The person of asking sets smaller delay.
Continue by taking user A and user B as an example, it is assumed that T2 moment user A and user B are conflicted, user A and user B A is respectively adopted2And B3As delay, then user A and user B is respectively in moment T2+A2And T2+B3It accesses again.Herein, it is false The access privileges of user A is determined higher than user B, then sets delay A2Less than B3(all numerical value is small in the time-delayed sequence of user A Any value in the time-delayed sequence of user B).So user A can just be accessed prior to user B.
In addition, in some specific cases, different user may have different stability requirements.Such as in some systems In (core bus), user be divided into main side and from side (one master one from or one master and multiple slaves).It in some cases, be as far as possible The accessing time sequence flow of main side is not upset.For this case, in an embodiment of the present invention, when change accesses next time Between put during kept for the access cycle of main side constant, respectively by it is each from side be set as visiting again after waiting different delays It asks, wherein, arbitrarily it is not equal to access cycle from the delay of side.
Continue by taking user A and user B as an example, it is assumed that T2 moment user A and user B are conflicted, user A and user B A is respectively adopted2And B3As delay, then user A and user B is respectively in moment T2+A2And T2+B3It accesses again.Herein, it is false Determine side based on user A, user B is from side.Setting delay A2For T access cycle the accessing time sequence of main side (do not change set), if It is B to determine user B delays3(B3Not equal to T).
Further, in master-slave system, the access privileges of main side is ensured, even being arbitrarily more than from the delay of side described Access cycle.It is B to set user B delays3More than T).The accessing time sequence for so neither changing main side is set, and can guarantee master The preferential access of side.
Explanation is needed exist for, the setting of above-mentioned principal and subordinate is only to facilitate the life of description embodiment of the present invention Name.The user not fully represented in actual conditions names setting.In a practical situation, it is possible that needing as far as possible not Upset from square accessing time sequence flow and/or ensure the situation of the access privileges from side.
To sum up, compared with prior art, the method according to the invention can effectively reduce the number of bus access error;Together When, method of the invention need not increase hardware cost, have higher promotional value.
While it is disclosed that embodiment as above, but the content only to facilitate understand the present invention and adopt Embodiment is not limited to the present invention.Method of the present invention can also have other various embodiments.Without departing substantially from In the case of essence of the present invention, those skilled in the art make various corresponding changes or change in accordance with the present invention Shape, but these corresponding changes or deformation should all belong to the scope of the claims of the present invention.

Claims (8)

1. a kind of bus access error protection method, which is characterized in that the described method comprises the following steps:
Obtain the access cycle of the multiple visitors to access;
Access conflict is judged whether in the flag of Accessor Access's data block;
After access conflict occurs, judge whether the access cycle that each side user of access conflict occurs is consistent;
Inconsistent in the event of the access cycle of each side user of access conflict, then each visitor waits a respective visit respectively Ask the cycle;
When the access cycle for each side user that access conflict occurs is consistent, then different durations are set respectively for each visitor Delay so that accessed next time described in being carried out after each corresponding delay of visitor's wait, the delay is not equal to The integral multiple of the access cycle.
2. according to the method described in claim 1, it is characterized in that, when two or more visitors access simultaneously There are the access conflicts each other by the visitor during the same flag.
3. according to the method described in claim 1, it is characterized in that, the delay is less than the access cycle.
4. according to the method described in claim 1, which is characterized in that the visitor wait and again access afterwards still with The time point that the access conflict occurs is start time point according to the access after the access cycle execution visitor Operation.
5. according to the method described in claim 1, which is characterized in that the time point for being waited with the visitor and being accessed again It is operated for start time point according to the access after the access cycle execution visitor.
6. according to the method described in claim 1, which is characterized in that set according to the access privileges of the different visitors The delay of fixed different durations, the visitor higher to the access privileges set the delay of smaller duration.
7. according to the method described in claim 1, it is characterized in that, the visitor include main side and it is one or more from Side is kept for the access cycle of the main side constant during the time point accessed described in changing next time, respectively will be each It is described to be accessed again after the delay for being just set as waiting different durations, wherein, the arbitrary delay from side is not Equal to the access cycle.
8. the method according to the description of claim 7 is characterized in that the arbitrary delay from side is more than the access week Phase.
CN201510718453.2A 2015-10-29 2015-10-29 A kind of bus access error protection method Active CN105404599B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510718453.2A CN105404599B (en) 2015-10-29 2015-10-29 A kind of bus access error protection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510718453.2A CN105404599B (en) 2015-10-29 2015-10-29 A kind of bus access error protection method

Publications (2)

Publication Number Publication Date
CN105404599A CN105404599A (en) 2016-03-16
CN105404599B true CN105404599B (en) 2018-05-29

Family

ID=55470095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510718453.2A Active CN105404599B (en) 2015-10-29 2015-10-29 A kind of bus access error protection method

Country Status (1)

Country Link
CN (1) CN105404599B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4467418A (en) * 1980-09-12 1984-08-21 Quinquis Jean Paul Data transmission system resolving access conflicts between transmitters-receivers to a common bus
CN101510181A (en) * 2009-03-19 2009-08-19 北京中星微电子有限公司 Bus arbitration method and bus arbitration apparatus
CN101626334A (en) * 2009-08-10 2010-01-13 中兴通讯股份有限公司 Method and device for controlling communication bus
CN103580976A (en) * 2012-07-20 2014-02-12 中兴通讯股份有限公司 Method and device for avoiding carrier sensing conflicts

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4467418A (en) * 1980-09-12 1984-08-21 Quinquis Jean Paul Data transmission system resolving access conflicts between transmitters-receivers to a common bus
CN101510181A (en) * 2009-03-19 2009-08-19 北京中星微电子有限公司 Bus arbitration method and bus arbitration apparatus
CN101626334A (en) * 2009-08-10 2010-01-13 中兴通讯股份有限公司 Method and device for controlling communication bus
CN103580976A (en) * 2012-07-20 2014-02-12 中兴通讯股份有限公司 Method and device for avoiding carrier sensing conflicts

Also Published As

Publication number Publication date
CN105404599A (en) 2016-03-16

Similar Documents

Publication Publication Date Title
EP0438021B1 (en) Synchronization instruction for multiple processor network
US9923967B2 (en) Storage management system for preserving consistency of remote copy data
CN101884071B (en) Bank sharing and refresh in a shared multi-port memory device
CN105700939A (en) Method and system for multi-thread synchronization in distributed system
US20020143512A1 (en) System simulator, simulation method and simulation program
CN103297456A (en) Method for accessing sharing resources in distributed system and distributed system
JP2022013854A (en) Method and device for updating database by using two-phase commit distributed transaction
WO2016082594A1 (en) Data update processing method and apparatus
CN109933632B (en) Data migration method, device and equipment for database
CN110399227B (en) Data access method, device and storage medium
CN103905220B (en) Data synchronizing processing method and system
CN106886450A (en) Method for scheduling task and system
EP4044509A1 (en) Pbft algorithm-based improved method for active recovery of single node from anomaly
CN105760519A (en) Cluster file system and file lock allocation method thereof
JP5754301B2 (en) Transaction concurrency control system, transaction concurrency control method, and program
CN101169774B (en) Multiprocessor system, sharing control device and method for starting slave processor
CN105404599B (en) A kind of bus access error protection method
KR102053849B1 (en) Airplane system and control method thereof
CN109298953B (en) Device and method for reading and writing shared memory data
CN112153114A (en) Method, system, equipment and medium for time-sharing access to shared device
CN115550384A (en) Cluster data synchronization method, device and equipment and computer readable storage medium
JP2013114628A (en) Data management program, data management method and storage device
EP2933739B1 (en) Database management method
CN112433968A (en) Controller sharing synchronization method and device
CN112732295B (en) Boot loader flashing method based on multi-core ECU, electronic 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
GR01 Patent grant
GR01 Patent grant