CN105760217A - Method for accessing shared memory - Google Patents

Method for accessing shared memory Download PDF

Info

Publication number
CN105760217A
CN105760217A CN201610167111.0A CN201610167111A CN105760217A CN 105760217 A CN105760217 A CN 105760217A CN 201610167111 A CN201610167111 A CN 201610167111A CN 105760217 A CN105760217 A CN 105760217A
Authority
CN
China
Prior art keywords
visitor
access
authority
interface
shared drive
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.)
Pending
Application number
CN201610167111.0A
Other languages
Chinese (zh)
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.)
Shenzhen Sungreat Communication Co Ltd
Original Assignee
Shenzhen Sungreat Communication 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 Shenzhen Sungreat Communication Co Ltd filed Critical Shenzhen Sungreat Communication Co Ltd
Priority to CN201610167111.0A priority Critical patent/CN105760217A/en
Publication of CN105760217A publication Critical patent/CN105760217A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/468Specific access rights for resources, e.g. using capability register
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a method for accessing a shared memory. The method comprises the following steps of: calling an access interface by a visitor; checking an authority registry by an authority checking program to check an interface authority for the visitor; if checking is passed, calling the interface and returning results and ending; if the checking is not passed, returning errors and ending. The patent of the invention ensures the safety and consistency of a shared memory data access by setting the visitor authority.

Description

A kind of method accessing shared drive
Technical field
Shared drive process field of the present invention, particularly to a kind of method accessing shared drive.
Background technology
Shared drive refers to that (sharedmemory) is in the computer system of multiprocessor, it is possible to the Large Copacity internal memory accessed by different central processing units (CPU).Shared drive is the communication means between the multi-process under Unix, and this method is generally used between the multi-process of a program communication, can also transmit information by shared drive between actually multiple programs.Owing to shared drive concurrently can be accessed by multiple cpu or multiple process; but not to visitor's control of authority in addition; this can cause that visitor can have all of access right, thus the access behavior of uncontrollable visitor, is unfavorable for the data in shared drive are protected by.Such as, Data Consistency occurs.
The traditional method solving such problem is to adopt lock mechanism, namely locks as shown in Figure 1 to shared drive: first visitor to obtain the lock of this section of shared drive, then just can carry out data access;When a process has obtained this lock, other visitor must wait in line, until lock is released, other processes could obtain this lock from new, and carries out data access.
But no matter adopt what kind of lock, this lock all can become the efficiency bottle neck that shared drive accesses: in time having a lot of visitor to access simultaneously, a visitor can only be had to obtain lock and conduct interviews, and other visitors must wait in line, thus causing that access efficiency is greatly cut down.As shown in Figure 1.
The method comprises the following steps:
First, visitor calls shared drive access interface.
Then, attempt obtaining the access lock of shared drive, if got, then perform interface interchange and carry out shared drive access and return result.If do not got, wait this lock.
Traditional locks mechanism many visitors are when concurrently accessing shared drive data, the efficiency bottle neck of formation as shown in Figure 2:
Each visitor accesses shared drive simultaneously.
Each visitor competes acquisition shared drive and accesses lock.
Obtain the visitor accessing lock and perform access interface backward reference result.
The visitor not obtaining lock then waits in line this lock, until getting this lock, and performs step C.
Data in shared drive as long as visitor gets corresponding lock, still can be carried out any operation, so the Information Security in internal memory still can not be guaranteed by the access behavior of the same uncontrollable visitor of traditional locks mechanism simultaneously.
So, shared drive accesses and accesses protective measure and there is several big defect, it may be assumed that the authority of visitor is not unrestricted, is easily caused various data safety and Data Consistency;Traditional locks protection mechanism is adopted to easily cause access efficiency bottleneck problem.
Summary of the invention
The present invention is directed to shared drive access and namely access protective measure exists several big defect: the authority of visitor is not unrestricted, is easily caused various data safety and Data Consistency;Traditional locks protection mechanism is adopted to easily cause access efficiency bottleneck problem.Propose to adopt the method giving different rights to the visitor of shared drive, effectively solve and avoid above-mentioned several big problem.
The technical scheme is that a kind of method accessing shared drive, comprise the following steps:
Step 1, visitor call access interface;
Step 2, scope check program checkout visitor's authority registration table, carry out interface authority inspection to visitor;This visitor's registration table mainly comprises three parts: visitor's mark and id, corresponding access rights, and the access interface information of correspondence.
Step 3, inspection are passed through, then visitor performs interface interchange and returns result, terminate;Check and do not pass through, directly return mistake, terminate.
Patent of the present invention puts the person's of asking authority by setting, it is ensured that the safety of shared drive data access and concordance.
So, each visitor is made directly data access at any time according to self chartered authority, without waiting for other visitor, avoids the loss in efficiency that lock mechanism brings, ensure that the access efficiency to shared drive, can ensure that access efficiency is not by any loss in theory.
Owing to Accessor Access's authority has been arranged, make visitor can not access shared drive with unlimited authority, and only can carry out the access having permission, thereby may be ensured that the safety to data access and concordance.
Below with reference to drawings and Examples, the present invention is described in detail.
Accompanying drawing explanation
Fig. 1 is for illustrating to implement the flow process of traditional locks mechanism Accessor Access's shared drive data.
When Fig. 2 is used for illustrating that implementing the traditional locks many visitors of mechanism concurrently accesses shared drive data, the efficiency bottle neck situation of formation.
Fig. 3 is used for the concrete assembly ingredient of the present invention is described.
Fig. 4 is for illustrating the flow process of Accessor Access's shared drive data of the present invention.
Fig. 5 is used for illustrating that the many visitors of the present invention concurrently access shared drive data, can the situation of concurrent access.
Detailed description of the invention
Embodiment 1, the present embodiment is a kind of method that shared drive is conducted interviews, and in the method, initialization program each visitor sets up in shared drive an authority registration table in advance, record the access rights of shared drive, as: definition read right/write permission.
Operation (retrieval/storage etc.) interface of shared drive, as: definition reading interface/write interface.
The authority register list of each visitor, specifies the access rights that each process has in the list.
Visitor's scope check and access control.According to the authority that authority register list gives, control the access behavior of visitor.The access that visitor can only perform to have permission is done and is called and operates interface accordingly;When visitor performs the access interface operating or calling lack of competence of lack of competence, return corresponding mistake.
Implementing of Accessor Access's control of authority can there be is various ways, as: during calling interface, visitor is carried out scope check;Or initialize it according to visitor's permissions list and access operation interface list, and such table is mapped in the memory headroom of visitor, thus limiting visitor can only effectively operate these initialized interfaces etc..
The data safety focusing on solution shared drive access mode existence of the real-time example of the present invention and inconsistence problems, and the efficiency bottle neck problem that traditional locks access protection mechanism is brought.
It is critical only that this invention is implemented gives specific access rights to each visitor of shared drive, and this authority can be registered in initialization procedure by program in authority registration table;Can also provide interface, user choosing the right moment as required carries out concrete configuration.Wherein visitor refers to need all process visitors that specified permission accesses shared drive first to be carried out scope check by scope check program according to authority registration table when accessing, by the access behavior of control of authority visitor, guarantee data access safety and concordance, and may insure that the access efficiency of data is seldom impaired simultaneously.
As, by the program of initialization, or by user by calling certain interface, can only give visitor's write permission, give other visitor's read rights,.For the access of shared drive, owing to being actually, at hardware view, (internal storage access bus simultaneously can only by the cpu/ Process flowchart) that serial performs, so not havinging not only situation that synchronization is read but also write, it may be assumed that read/write is that serial performs;Owing to only one of which process has write permission, so do not have the problem that multiple process writes one section of shared drive simultaneously.Thus ensureing that data will not be write unrest, safety and the concordance of sharing data are protected.
Owing to not adopting lock mechanism, each visitor can directly access data at any time, it is not necessary to waits other visitor, so access efficiency will not be subject to any loss in theory.
The concrete component software ingredient of the embodiment of the present invention is as it is shown on figure 3, specifically include that
Visitor's authority registration table, it is the core of whole software architecture.This table is by process authority registration entries, and wherein each registration entries entry deposits the access rights of a registered access person (namely each accesses process) and correspondence thereof.
Scope check module (scope check program), for queried access person's authority registration table, and according to Query Result, decides whether to perform to visit interface.It is obvious that if it is determined that success then illustrates that visitor has corresponding authority, is carried out interface;Otherwise do not perform.
Authority, represents the access rights of visitor, and it is corresponding with concrete access interface.When a visitor has certain authority, illustrate that this visitor can perform corresponding access interface.Authority and visitor, corresponding access interface corresponding relation record in visitor's authority registration table.
Interface, is access shared drive and return the concrete function of result, corresponding with authority, the function finally called when being Accessor Access's internal memory with corresponding access rights.
Depositing the shared drive memory area of concrete data, it is exactly access the object being required for accessing.
The flow chart of the present embodiment Accessor Access's shared drive data is as shown in Figure 4: comprise the following steps.
Step 1, visitor call access interface;Visitor is exactly the process needing to access shared drive.
Step 2, scope check program checkout visitor's authority registration table, carry out interface authority inspection to visitor;This visitor's registration table mainly comprises three parts: visitor's mark and id, corresponding access rights, and the access interface information of correspondence.
Step 3, inspection are passed through, then visitor performs interface interchange and returns result, terminate;Check and do not pass through, directly return mistake, terminate.Shared drive is conducted interviews, mainly has read and write, if visitor has the authority write, then directly shared drive is carried out write operation, otherwise can not carry out write operation.When practical application, only one of which visitor has the authority write, and other, visitor only has the authority of reading.
It is illustrated in figure 5 many visitors and concurrently accesses shared drive data, can the situation of concurrent access.
Each visitor independently calls shared drive access interface simultaneously.
The access rights of scope check module each visitor of independent check.
The visitor that scope check passes through calls access interface and performs access backward reference result.

Claims (4)

1. the method accessing shared drive, it is characterised in that: comprise the following steps:
Step 1, visitor call access interface;
Step 2, scope check program checkout visitor's authority registration table, carry out interface authority inspection to visitor;
Step 3, inspection are passed through, then visitor performs interface interchange and returns result, terminate;Check and do not pass through, directly return mistake, terminate.
2. the method for access shared drive according to claim 1, it is characterised in that: described authority registration table comprises: visitor's mark and id, corresponding access rights, and the access interface information of correspondence.
3. the method for access shared drive according to claim 1, it is characterized in that: the authority carrying out in interface authority inspection to visitor in step 2 is registered in initialization procedure by program in authority registration table, representing the access rights of visitor, it is corresponding with concrete access interface.
4. the method for access shared drive according to claim 3, it is characterized in that: described interface is to access shared drive and return the concrete function of result, function that is corresponding with authority, that finally call when being Accessor Access's internal memory with corresponding access rights.
CN201610167111.0A 2016-03-23 2016-03-23 Method for accessing shared memory Pending CN105760217A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610167111.0A CN105760217A (en) 2016-03-23 2016-03-23 Method for accessing shared memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610167111.0A CN105760217A (en) 2016-03-23 2016-03-23 Method for accessing shared memory

Publications (1)

Publication Number Publication Date
CN105760217A true CN105760217A (en) 2016-07-13

Family

ID=56346169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610167111.0A Pending CN105760217A (en) 2016-03-23 2016-03-23 Method for accessing shared memory

Country Status (1)

Country Link
CN (1) CN105760217A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368736A (en) * 2017-07-03 2017-11-21 青岛海信电器股份有限公司 Information access method, device and computer-readable recording medium
CN107664978A (en) * 2016-07-27 2018-02-06 发那科株式会社 Programmable controller
CN109413432A (en) * 2018-07-03 2019-03-01 北京中科睿芯智能计算产业研究院有限公司 Multi-process coding method, system and device based on event and shared drive mechanism
CN109472124A (en) * 2018-10-11 2019-03-15 平安科技(深圳)有限公司 Matching process, device, equipment and the medium of interface access right
CN110928701A (en) * 2018-09-20 2020-03-27 北京君正集成电路股份有限公司 Communication registration method and device
CN111638968A (en) * 2019-03-01 2020-09-08 维塔科技(北京)有限公司 Shared memory access permission setting method and device, electronic equipment and storage medium
US11487258B2 (en) 2016-09-09 2022-11-01 Hitachi Industrial Equipment Systems Co., Ltd. Controller and control management system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329657A (en) * 2007-06-19 2008-12-24 瑞达信息安全产业股份有限公司 System and method for safe sharing dynamic memory of multi-application space
US20100095089A1 (en) * 2008-10-14 2010-04-15 Samsung Electronics Co., Ltd. Multiprocessor system with multiport memory
CN102662773A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Structured document communication system between multiple processes
CN102662774A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Inter-process structured document communication method
CN103179126A (en) * 2013-03-26 2013-06-26 山东中创软件商用中间件股份有限公司 Access control method and device
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329657A (en) * 2007-06-19 2008-12-24 瑞达信息安全产业股份有限公司 System and method for safe sharing dynamic memory of multi-application space
US20100095089A1 (en) * 2008-10-14 2010-04-15 Samsung Electronics Co., Ltd. Multiprocessor system with multiport memory
CN102662773A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Structured document communication system between multiple processes
CN102662774A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Inter-process structured document communication method
CN103179126A (en) * 2013-03-26 2013-06-26 山东中创软件商用中间件股份有限公司 Access control method and device
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张效祥主编: "《计算机科学技术百科全书》", 31 August 1998, 清华大学出版社 *
褚瑞,张一鸣著: "《基于虚拟计算环境的内存共享技术》", 31 December 2010 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107664978A (en) * 2016-07-27 2018-02-06 发那科株式会社 Programmable controller
CN107664978B (en) * 2016-07-27 2019-06-07 发那科株式会社 Programmable controller
US11487258B2 (en) 2016-09-09 2022-11-01 Hitachi Industrial Equipment Systems Co., Ltd. Controller and control management system
CN107368736A (en) * 2017-07-03 2017-11-21 青岛海信电器股份有限公司 Information access method, device and computer-readable recording medium
CN107368736B (en) * 2017-07-03 2020-06-09 海信视像科技股份有限公司 Information access method, device and computer readable storage medium
CN109413432A (en) * 2018-07-03 2019-03-01 北京中科睿芯智能计算产业研究院有限公司 Multi-process coding method, system and device based on event and shared drive mechanism
CN109413432B (en) * 2018-07-03 2023-01-13 北京中科睿芯智能计算产业研究院有限公司 Multi-process coding method, system and device based on event and shared memory mechanism
CN110928701A (en) * 2018-09-20 2020-03-27 北京君正集成电路股份有限公司 Communication registration method and device
CN109472124A (en) * 2018-10-11 2019-03-15 平安科技(深圳)有限公司 Matching process, device, equipment and the medium of interface access right
CN109472124B (en) * 2018-10-11 2022-12-30 平安科技(深圳)有限公司 Method, device, equipment and medium for matching interface use permission
CN111638968A (en) * 2019-03-01 2020-09-08 维塔科技(北京)有限公司 Shared memory access permission setting method and device, electronic equipment and storage medium
CN111638968B (en) * 2019-03-01 2024-03-15 维塔科技(北京)有限公司 Shared memory access authority setting method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105760217A (en) Method for accessing shared memory
US6449699B2 (en) Apparatus and method for partitioned memory protection in cache coherent symmetric multiprocessor systems
US6681238B1 (en) Method and system for providing a hardware machine function in a protected virtual machine
CN101351774B (en) Method, device and system for coloring page of memory and page associated pages with programs
CN103080912B (en) Microprocessor system and by Memory Management Unit thereon and management method
US6253224B1 (en) Method and system for providing a hardware machine function in a protected virtual machine
CA1252907A (en) Secure data processing system architecture with format control
CN101952807B (en) Managing use of storage by multiple pageable guests of a computing environment
US6243793B1 (en) Protocol for arbitrating access to a shared memory area using historical state information
CN100428165C (en) Apparatus, system, and method for implementing protected virtual memory subcontexts
WO2020244369A1 (en) Inter-process communication method and apparatus, and computer device
US20080052709A1 (en) Method and system for protecting hard disk data in virtual context
JP2003186746A (en) Hardware execution control method of access to memory in computer using hardware execution semaphore and other similar hardware execution serializing and prioritizing mechanisms
TW200412105A (en) Virtual to physical memory address mapping within a system having a secure domain and a non-secure domain
US8239663B2 (en) System and method for maintaining the security of memory contents and computer architecture employing the same
CN109669724B (en) Multi-command concurrent proxy service method and system based on Linux system
US7823019B2 (en) Debug circuitry
JP4591163B2 (en) Bus access control device
CN112835846A (en) System on chip
CN112835845A (en) Method for managing the debugging of a system-on-chip forming, for example, a microcontroller and corresponding system-on-chip
US5459872A (en) Software control of hardware interruptions
CN102929802B (en) A kind of guard method of storage resources and system
CN105678176A (en) Mandatory access control method under virtual environment
JP2000003302A (en) Method for controlling exclusive access of common memory
GB2483884A (en) Parallel processing system using dual port memories to communicate between each processor and the public memory bus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160713