CN106338931A - Central control information scheduling algorithm - Google Patents
Central control information scheduling algorithm Download PDFInfo
- Publication number
- CN106338931A CN106338931A CN201510390876.6A CN201510390876A CN106338931A CN 106338931 A CN106338931 A CN 106338931A CN 201510390876 A CN201510390876 A CN 201510390876A CN 106338931 A CN106338931 A CN 106338931A
- Authority
- CN
- China
- Prior art keywords
- message
- scheduling algorithm
- message queue
- region
- middle control
- 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
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Multi Processors (AREA)
Abstract
The invention discloses a central control information scheduling algorithm, and belongs to the field of central control application programs. The characteristics lie in that the scheduling algorithm is the combination of a shared memory and a message queue, wherein the shared memory is a communication method among multiple processes under Unix and mainly applied to communication among multiple processes of a program, and multiple programs can also transmit information through the shared memory; the message queue is a linked list of messages, a process with write permission for the message queue can add a new message to the message queue according to a certain rule; and a program with read permission for the message queue can read messages from the message queue. The central control information scheduling algorithm can occupy minimum hardware resources, processes in central control are associated together in an orderly manner, a destination address to which a message is transmitted is found quickly, and the message is transmitted timely.
Description
Technical field
The present invention relates to middle control application domain, specifically, it is middle control message scheduling algorithm.
Background technology
Middle control application program is mainly responsible for interacting between upper high in the clouds and end application and various smart machines, will
Upper and each equipment is together in series, and realizes unified management to smart machine, by equipment and upper software carry out logic every
From upper software is how to be linked into central control system without interested devices, can be carried out unified monitoring, management.
Because hardware resource is limited, and the process requirement of real-time of data is higher, so, scheduling message must do
To the occupancy reducing resource as far as possible, and message destination address to be transmitted can be quickly found, by message and
When pass.
Content of the invention
The invention discloses middle control message scheduling algorithm is it is characterised in that described dispatching algorithm is shared drive and message
The combination of queue, described shared drive is the communication means between the multi-process under unix, is mainly used in a journey
Communicate between the multi-process of sequence, can also be by shared drive come transmission information between multiple programs;Described message queue is one
The chained list of individual message, has the process of write permission can add according to certain rule in message queue new to message queue
Message;The process having read right to message queue then can read message from message queue.
Further, described shared drive include process number, process lock region, mass-sending region, log-on message region,
Send results area.
Further, described process number represents that how many process current needs to receive the message of process.
Further, described process lock region includes locking initialization flag, lock and lock attribute.
Further, deposit the message queue handle of each process in described mass-sending region, in system, have some message to need
When to be mass-sended, can obtain each process is sent with the handle of message by this region, thus by message cluster transmition to institute
There is process.
Further, deposit the information of each process registers in described log-on message region, these information adopt event number
Group mode stores.
Further, the described results area that sends deposits the result that each process is sent with message, if process number is
N, then zone bit size is n byte, is represented with -1 and does not send, 0 sends unsuccessfully to represent, 1 expression sends into
Work(.
Further, described message queue adopts posix message queue.
Compared with prior art, the positive effect of the present invention is:
1. the present invention can take minimum hardware resource, by middle control, each process is ruly connects, soon
Fast finds message destination address to be transmitted, and message is timely passed.
Brief description
Fig. 1 is the call flow chart needing to send the process of message;
Fig. 2 is the call flow chart of the process receiving event message;
Fig. 3 is the flow chart of initialization step in Fig. 1, Fig. 2;
Fig. 4 is the flow chart of logging-out step in Fig. 1, Fig. 2.
Specific embodiment
The present invention provide in control message scheduling algorithm, for make the purpose of the present invention, technical scheme and better clear,
Clearly, the present invention is described in more detail below.It should be appreciated that specific embodiment described herein is only in order to solve
Release the present invention, and without with limit the present invention.
The invention discloses middle control message scheduling algorithm is it is characterised in that described dispatching algorithm is shared drive and message
The combination of queue, described shared drive is the communication means between the multi-process under unix, is mainly used in a journey
Communicate between the multi-process of sequence, can also be by shared drive come transmission information between multiple programs;Described message queue is one
The chained list of individual message, has the process of write permission can add according to certain rule in message queue new to message queue
Message;The process having read right to message queue then can read message from message queue.
Further, described shared drive include process number, process lock region, mass-sending region, log-on message region,
Send results area.
Further, described process number represents that how many process current needs to receive the message of process.
Further, described process lock region includes locking initialization flag, lock and lock attribute.Because message center will be
Carry out message transmission, this has related to the information resources share between multi-process, contention for resources to be solved in multiple processes
Problem, it is necessary to use the mechanism of Read-Write Locks, carries out the problem of resource further it is necessary to adopt between multi-process to be solved
This mode, lock is placed into shared drive region, and has the process that first registration uses to carry out the initial of resource lock
Change, when process needs to use shared resource it is necessary to the corresponding read lock of first to file or write lock, lock resource, work as fortune
After terminating, should unconditional release lock.This just brings certain risk, and such as one process provides to a certain event
Source use time is long, or lock, after resource use terminates, for various reasons, is not discharged by a process,
Other processes just cannot be processed to this resource.At this moment locking timeout mechanism will be added, take in other processes
Resource time is long, during beyond setting time-out time, lock being reset, and carries out later stage process according to given strategy,
Other processes are made to can continue to normally using resource.
Further, deposit the message queue handle of each process in described mass-sending region, in system, have some message to need
When to be mass-sended, can obtain each process is sent with the handle of message by this region, thus by message cluster transmition to institute
There is process.
Further, deposit the information of each process registers in described log-on message region, these information adopt event number
Group mode stores.Assume that previously defined process number is n, then each message has n parking space, if there are
The corresponding message of which process registers, then place message in corresponding position and send handle.When message center obtains one
It becomes possible to directly find the message transmission handle list registering this message, directly by these handles during individual message
Process, be delivered to in individual process.
It is assumed that the number of passes that enters of definition is 3, the total number of type of message is 10, that corresponding shared drive message registration region
Initial situation such as table 1:
Table 1
Hypothesis process 1 have registered type of message 1,2, and process 2 have registered type of message 2,5, and process 3 have registered message
Type 2 and 10, and assume that process 1 message handle is 100, process 2 message handle is 200, process 3 message
Handle position 300, then situation such as table 2 in shared drive registration area:
Table 2
Further, the described results area that sends deposits the result that each process is sent with message, if process number is
N, then zone bit size is n byte, is represented with -1 and does not send, 0 sends unsuccessfully to represent, 1 expression sends into
Work(.
Further, described message queue adopts posix message queue.
As Figure 1-4, after tested, sent using this dispatching algorithm, receive the time, message sends and receives permissible
Reach 10000 times per second.
It is obvious to a person skilled in the art that the invention is not restricted to the details of above-mentioned exemplary embodiment, and
Without departing from the spirit or essential characteristics of the present invention, the present invention can be realized in other specific forms.Cause
This, no matter from the point of view of which point, all should regard embodiment as exemplary, and be nonrestrictive, the present invention
Scope limited by claims rather than described above, it is intended that the equivalency that will fall in claim
All changes in implication and scope are included in the present invention, should not be considered as limiting by any reference in claim
The involved claim of system.
Claims (8)
1. control message scheduling algorithm in it is characterised in that described dispatching algorithm is combining of shared drive and message queue,
Described shared drive is the communication means between the multi-process under unix, is mainly used between the multi-process of a program
Communication, can also be by shared drive come transmission information between multiple programs;Described message queue is the chained list of a message,
The process having write permission to message queue can add new information according to certain rule in message queue;To message team
The process showing read right then can read message from message queue.
2. middle control message scheduling algorithm according to claim 1 is it is characterised in that described shared drive includes process
Number, process lock region, mass-sending region, log-on message region, transmission results area.
3. middle control message scheduling algorithm according to claim 2 is it is characterised in that described process number represents current
How many process needs to receive the message of process.
4. middle control message scheduling algorithm according to claim 2 is it is characterised in that described process lock region includes locking
Initialization flag, lock and lock attribute.
5. middle control message scheduling algorithm according to claim 2 is it is characterised in that deposit each in described mass-sending region
The message queue handle of individual process, when having some message to need mass-sending in system, can be obtained to each by this region
Individual process sends the handle of message, thus by message cluster transmition to all processes.
6. middle control message scheduling algorithm according to claim 2 is it is characterised in that deposit in described log-on message region
Put the information of each process registers, these information are stored using event number group mode.
7. middle control message scheduling algorithm according to claim 2 is it is characterised in that described transmission results area is deposited
Each process is sent with the result of message, if process number is n, zone bit size is n byte, uses -1
Represent and do not send, 0 sends unsuccessfully to represent, 1 expression sends successfully.
8. middle control message scheduling algorithm according to claim 1 is it is characterised in that described message queue adopts posix
Message queue.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510390876.6A CN106338931A (en) | 2015-07-06 | 2015-07-06 | Central control information scheduling algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510390876.6A CN106338931A (en) | 2015-07-06 | 2015-07-06 | Central control information scheduling algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106338931A true CN106338931A (en) | 2017-01-18 |
Family
ID=57825911
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510390876.6A Pending CN106338931A (en) | 2015-07-06 | 2015-07-06 | Central control information scheduling algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106338931A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108984317A (en) * | 2018-06-21 | 2018-12-11 | 北京奇虎科技有限公司 | The implementation method and device of interprocess communication IPC |
CN109656730A (en) * | 2018-12-20 | 2019-04-19 | 东软集团股份有限公司 | A kind of method and apparatus of access cache |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1859325A (en) * | 2006-02-14 | 2006-11-08 | 华为技术有限公司 | News transfer method based on chained list process |
CN103645942A (en) * | 2013-12-12 | 2014-03-19 | 北京奇虎科技有限公司 | Message queue based write and read method and system of shared memory |
CN104346229A (en) * | 2014-11-14 | 2015-02-11 | 国家电网公司 | Processing method for optimization of inter-process communication of embedded operating system |
CN104503854A (en) * | 2014-12-29 | 2015-04-08 | 成都科来软件有限公司 | Inter-process communication method and device |
-
2015
- 2015-07-06 CN CN201510390876.6A patent/CN106338931A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1859325A (en) * | 2006-02-14 | 2006-11-08 | 华为技术有限公司 | News transfer method based on chained list process |
CN103645942A (en) * | 2013-12-12 | 2014-03-19 | 北京奇虎科技有限公司 | Message queue based write and read method and system of shared memory |
CN104346229A (en) * | 2014-11-14 | 2015-02-11 | 国家电网公司 | Processing method for optimization of inter-process communication of embedded operating system |
CN104503854A (en) * | 2014-12-29 | 2015-04-08 | 成都科来软件有限公司 | Inter-process communication method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108984317A (en) * | 2018-06-21 | 2018-12-11 | 北京奇虎科技有限公司 | The implementation method and device of interprocess communication IPC |
CN108984317B (en) * | 2018-06-21 | 2021-07-13 | 北京奇虎科技有限公司 | Method and device for realizing IPC (inter-process communication) |
CN109656730A (en) * | 2018-12-20 | 2019-04-19 | 东软集团股份有限公司 | A kind of method and apparatus of access cache |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105511954B (en) | Message processing method and device | |
TWI675339B (en) | Virtual item allocation method, system and server | |
US9888048B1 (en) | Supporting millions of parallel light weight data streams in a distributed system | |
US20140280988A1 (en) | System and method for parallel multiplexing between servers in a cluster | |
CN105577801B (en) | A kind of business accelerating method and device | |
CN106209353A (en) | Key management method and system thereof | |
CN105630731A (en) | Network card data processing method and device in multi-CPU (Central Processing Unit) environment | |
CN102546424B (en) | Message order-preserving method and device adopting same | |
CN102469033A (en) | Message subscription system and message sending method | |
CN101951411A (en) | Cloud scheduling system and method and multistage cloud scheduling system | |
DE112007000733T5 (en) | Scaling of outgoing network traffic | |
DE102008030587A1 (en) | Method and apparatus for increasing the efficiency of interrupt delivery at runtime in a network system | |
WO2017054650A1 (en) | Task distribution method, device and system | |
WO2016061935A1 (en) | Resource scheduling method, device and computer storage medium | |
CN105471700B (en) | A kind of methods, devices and systems of Message Processing | |
CN110457128B (en) | Task allocation method, device and system | |
CN110430180A (en) | A kind of platform of internet of things and implementation method based on hot plug | |
US20050169309A1 (en) | System and method for vertical perimeter protection | |
CN107623731A (en) | A kind of method for scheduling task, client, service cluster and system | |
CN102891809A (en) | Interface order-preserving method and system of messages of multi-core network device | |
CN106338931A (en) | Central control information scheduling algorithm | |
CN103166845A (en) | Data processing method and device | |
US8156289B2 (en) | Hardware support for work queue management | |
CN109800094A (en) | A method of realizing individually application and the communication of multiple common applications | |
CN105335362B (en) | The processing method and system of real time data, instant disposal system for treating |
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 |
Application publication date: 20170118 |
|
RJ01 | Rejection of invention patent application after publication |