CN109117268A - A kind of implementation method and device of mill control system communication middleware - Google Patents

A kind of implementation method and device of mill control system communication middleware Download PDF

Info

Publication number
CN109117268A
CN109117268A CN201810805096.7A CN201810805096A CN109117268A CN 109117268 A CN109117268 A CN 109117268A CN 201810805096 A CN201810805096 A CN 201810805096A CN 109117268 A CN109117268 A CN 109117268A
Authority
CN
China
Prior art keywords
message data
data
shared
message
section key
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
CN201810805096.7A
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.)
Shougang Group Co Ltd
Original Assignee
Shougang Group 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 Shougang Group Co Ltd filed Critical Shougang Group Co Ltd
Priority to CN201810805096.7A priority Critical patent/CN109117268A/en
Publication of CN109117268A publication Critical patent/CN109117268A/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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • 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/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses the implementation methods and device of a kind of mill control system communication middleware, it is related to the communication scheme technical field of control system in intermetallic composite coating, which comprises the first shared section key, the second shared section key, third shared section key are obtained according to function or purposes;First shared drive is divided into and sends shared section key and reception shared section key;According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends child partition, the reception shared drive divides into N number of first shared drive and receives child partition;The M the first shared drives are sent into child partitions, N number of first shared drive receive child partition using message data round-robin queue data structure mode to the message data join the team and team is managed out, realize the deposit, reading and data protection of the message data.Shared drive classification can be carried out by different function by having reached, and improve treatment effeciency, technical effect easy to use.

Description

A kind of implementation method and device of mill control system communication middleware
Technical field
The present invention relates to the communication scheme technical fields of control system in intermetallic composite coating, in particular to a kind of milling train control system The implementation method and device of system communication middleware.
Background technique
Currently, metal rolled production line belongs to increasingly automated production line, wherein Secondary process control system is rolling work The key link that skill automatically controls, it is necessary to have the communication between different hosts, field instrument.In the exploitation of Process Control System Cheng Zhong improves system for the interaction difficulty for reducing different user task process and underlying operating system in Process Control System It is portable, it is necessary to develop reusable communication middleware module.Current variant mill control system be based on different purposes and Rolling line device configuration develops targeted communication system, is responsible for user task process and provides Base communication service.Mesh Before have several common methods.First method sends connection for the message of current hosts and receives the message data of connection Individual memory field is respectively set in storage management.User task process submits message to send request, and it is pending to send memory field label After sending state, message to send, sends memory field and mark new message status to be received;It receives memory field and receives external system message Afterwards, deposit receives memory field, labeled as reading state is waited, the message of memory field is extracted and submits to user task process Afterwards, memory field is labeled as wait-to-put status;Second method has carried out list to different connections on the basis of first method Only memory partitioning management, improves processing speed and efficiency to a certain extent.
But present inventor during technical solution, has found the above-mentioned prior art extremely in realizing the embodiment of the present application It has the following technical problems less:
Communication means in the prior art cannot carry out partition management by function, affect efficiency to a certain extent, influence The requirement of real-time control of system, and message data size is handled using fixed length maximum byte, causes the technology of system resource waste Problem.
Summary of the invention
The present invention provides the implementation methods and device of a kind of mill control system communication middleware, to solve existing skill Communication means in art cannot carry out partition management by function, influence the requirement of real-time control of efficiency and system, and message data The technical issues of size is handled using fixed length maximum byte, causes system resource waste, having reached can be total to by different function Memory classification is enjoyed, treatment effeciency, technical effect easy to use are improved.
The present invention provides a kind of implementation methods of mill control system communication middleware, which comprises according to function Energy or purposes obtain the first shared section key, the second shared section key, third shared section key, wherein described first is shared interior Deposit area, the second shared section key, third shared section key are respectively provided with specific function or purposes;By first shared drive It divides into and sends shared section key and reception shared section key, wherein the transmission shared section key is that host sends message number According to first send storage management area, it is described receive shared section key be host receive message data first receive storage management Area;According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends son point Area, the reception shared drive divide into N number of first shared drive and receive child partition;The M the first shared drives are sent Child partition, N number of first shared drive receive child partition using the data structure mode of message data round-robin queue to the message Data join the team and team is managed out, realize the deposit, reading and data protection of the message data.
Preferably, the method also includes: according to queue team head and the position indicator pointer of tail of the queue and the data length pair of queue Queuing data is managed.
Preferably, the method also includes: when tail of the queue increases message data newly, when enqueue operations memory headroom deficiency, Memory fragmentation label is carried out to the tail of the queue memory headroom, the newly-increased message data is wound up into initial position in memory headroom Stored.
On the other hand, the present invention provides a kind of realization device of mill control system communication middleware, described device packets Include: configuration module, the configuration module configure the interface data of user task process, and, the configuration module according to Communication function purposes divides shared section key, and the first message data is registered;Message data sending module, the message Data transmission blocks receive the transmission instruction for sending first message data, the message data sending module and the configuration Module communication connection;Message data processing module, the message data processing module according to message numbering and main body of the packet data, Working process forms the heading data and main body of the packet data, and the second message data, the message data are formed after merging Processing module and the message data sending module communicate to connect;Message data storage management module, the message data storage Management module stores second message data, and the message data storage management module and the message data are handled Module communication connection.
Preferably, described device further include: message data receiving module, the message data receiving module receives and processing The third message data that distance host is sent, and the third message data is stored in corresponding shared drive subregion, institute It states message data receiving module and the message data processing module communicates to connect.
Preferably, the message data processing module handles the third message data.
Preferably, second data are sent to distance host by the message data sending module.
Preferably, described device further include: message data communicates shared section key, and the message data communicates shared drive Area's stored messages data, and, the message data communication shared section key and the message data storage management module communication link It connects.
Preferably, when message queue tail portion free memory insufficient space, the message data storage management module will be described Free memory free token is tail portion debris plume, by second message data by round-robin queue in queue head starting position Stored.
Said one or multiple technical solutions in the embodiment of the present invention at least have following one or more technology effects Fruit:
1, in a kind of implementation method of mill control system communication middleware provided in an embodiment of the present invention, by according to function Energy or purposes obtain the first shared section key, the second shared section key, third shared section key, wherein described first is shared interior Deposit area, the second shared section key, third shared section key are respectively provided with specific function or purposes;By first shared drive It divides into and sends shared section key and reception shared section key, wherein the transmission shared section key is that host sends message number According to first send storage management area, it is described receive shared section key be host receive message data first receive storage management Area;According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends son point Area, the reception shared drive divide into N number of first shared drive and receive child partition;The M the first shared drives are sent Child partition, N number of first shared drive receive child partition using the data structure mode of message data round-robin queue to the message Data join the team and team is managed out, realize the deposit, reading and data protection of the message data.Solves the prior art In communication means cannot by function carry out partition management, influence the requirement of real-time control of efficiency and system, and message data is big The technical issues of small use fixed length maximum byte handles, causes system resource waste, having reached can be shared by different function Memory classification, improves treatment effeciency, technical effect easy to use.
2, in a kind of realization device of mill control system communication middleware provided in an embodiment of the present invention, by configuring mould Block, the configuration module configure the interface data of user task process, and, the configuration module is used according to communication function Way divides shared section key, and the first message data is registered;Message data sending module, the message data send mould Block receives the transmission instruction for sending first message data, the message data sending module and the configuration module communication link It connects;Message data processing module, the message data processing module is according to message numbering and main body of the packet data, working process shape At the heading data and main body of the packet data, form the second message data after merging, the message data processing module with The message data sending module communication connection;Message data storage management module, the message data storage management module will Second message data is stored, the message data storage management module and the message data processing module communication link It connects.Solve mill control system host, data center, instrument, other control system hosts and level-one in the prior art Data communication problem between PLC has reached the difficulty for reducing the exploitation of milling train Process Control System, easy to operate, easy to use, The technical effect of convenient and efficient.
3, the embodiment of the present invention communicates shared section key by message data, and the message data communication shared section key is deposited Message data is stored up, and, the message data communication shared section key and the message data storage management module communicate to connect, and reach The technical effect realized to message data storage and data protection is arrived.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the implementation method of mill control system communication middleware in the embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of the realization device of mill control system communication middleware in the embodiment of the present invention;
Fig. 3 is a kind of another structural representation of the realization device of mill control system communication middleware in the embodiment of the present invention Figure.
Description of symbols: 11- configuration module, 12- message data sending module, 13- message data processing module, 14- Message data storage management module, 16- message data receiving module, 15- message data communicate shared section key.
Specific embodiment
The embodiment of the invention provides the implementation methods and device of a kind of mill control system communication middleware, to solve Communication means in the prior art cannot carry out partition management by function, influence the requirement of real-time control of efficiency and system, and report The technical issues of literary size of data is handled using fixed length maximum byte, causes system resource waste.
Technical solution in the embodiment of the present invention, overall structure are as follows:
The present invention provides the implementation method and device of a kind of mill control system communication middleware, by according to function or Purposes obtains the first shared section key, the second shared section key, third shared section key, wherein first shared section key, Second shared section key, third shared section key are respectively provided with specific function or purposes;First shared drive is distinguished To send shared section key and receiving shared section key, wherein the shared section key that sends is that host sends message data First sends storage management area, and the shared section key that receives is the first reception storage management area that host receives message data; According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends child partition, The reception shared drive divides into N number of first shared drive and receives child partition;The M the first shared drives are sent into son point Area, N number of first shared drive receive child partition using the data structure mode of message data round-robin queue to the message data Join the team and team is managed out, realize the deposit, reading and data protection of the message data.It is simple to have reached structure, it is right Vibration signal is sensitive, high sensitivity, and demodulates simply, demodulates technical effect at low cost.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Embodiment one
The embodiment of the invention provides a kind of implementation methods of mill control system communication middleware, referring to FIG. 1, described Method includes:
Step 110: the first shared section key, the second shared section key, third shared drive are obtained according to function or purposes Area, wherein first shared section key, the second shared section key, third shared section key be respectively provided with specific function or Purposes;
Specifically, be supplied to the transmission of user task process according to function or purposes and receive the interface of message data, And the partition management of shared drive is carried out by the functional category of handled message data, that is to say, that will according to function or purposes Shared drive is divided into the first shared section key, the second shared section key, third shared section key, the 4th shared section key etc., obtains To the division in different function area.
Step 120: first shared drive being divided into and sends shared section key and reception shared section key, wherein The shared section key that sends is the first transmission storage management area that host sends message data, and the reception shared section key is Host receives the first reception storage management area of message data;
Specifically, further the shared drive subregion of each function is continued point after shared drive is carried out subregion To send and receive shared section key, that is, continue the shared section key of each functional areas to be divided into message transmission area and message Reception area, to realize the classification storage and management of message data.In turn, again according to function or each memory field of purposes division It is divided into transmission shared section key, shared section key is received and is connect as the storage management area of current hosts message data to be sent The storage management area of the message data received, wherein the shared section key that sends is the first hair that host sends message data Storage management area is sent, the shared section key that receives is the first reception storage management area that host receives message data, that is, It says, first shared section key, the second shared section key, the third shared drive of subregion division will be carried out according to functional requirement Area, the 4th shared section key etc. are divided into respectively to be sent shared section key and receives shared section key, that is, is exactly by each Shared section key is all divided into shared section key and receives shared section key.
Step 130: according to P connection for sending message data, the transmission shared drive being divided into M first and is shared Memory sends child partition, and the reception shared drive divides into N number of first shared drive and receives child partition;
Specifically, according to P of message data connection is sent, that is, according to the connections of all transmission message datas, For the corresponding shared drive subregion of each link division, for storing the message data belonged within the scope of the connection management, that is, The transmission shared drive is divided into M the first shared drives and sends child partitions, the reception shared drive divides into N number of the One shared drive receives child partition.In other words, it each sends or receives shared section key and respective number is divided according to connection number Shared drive subregion.The message number that the shared drive subregion of each connection is stored by the data structure managing of message data queue According to.That is, connecting for each transmission shared section key and reception shared section key all in accordance with described P, it is every to mark off management The shared section key of a connection, that is, the transmission shared drive is divided into M the first shared drives and sends child partition, it is described It receives shared drive and divides into the individual message data management of N number of first shared drive reception child partition progress.
Step 140: the M the first shared drives being sent into child partition, N number of first shared drive receives child partition and uses The data structure mode of message data round-robin queue to the message data join the team and team is managed out, realize the message Deposit, reading and the data protection of data.
Further, the method also includes: according to queue team head and the position indicator pointer of tail of the queue and the data length of queue Queuing data is managed.
Further, the method also includes: when tail of the queue increases message data newly, when enqueue operations memory headrooms is insufficient When, memory fragmentation label is carried out to the tail of the queue memory headroom, the newly-increased message data is wound up into starting in memory headroom Stored position.
Specifically, sending child partition and N number of first shared drive for M described in each the first shared drives Receive child partition for, using message data round-robin queue data structure mode to message data join the team and team carries out pipe out Reason, that is, position indicator pointer and the data length of queue manage the data manipulation of queue end to end using queue.Further, when When tail of the queue increases message data newly, when such as enqueue operations memory headroom deficiency, memory fragmentation label is carried out to tail portion memory headroom, Newly-increased message data is wound up into initial position in memory headroom and starts to store, i.e., round-robin queue manages.For each link division Shared section key takes the data structure of queue to manage message data, and queue position indicator pointer end to end is arranged, and caching message is total Number, memory lock etc., realizes the functions such as the deposit, reading and data protection of message data;For the message number for realizing each connection According to management, realizes the message data deposit of shared section key and read, the message data structure is by following design: the message Data are collectively formed by regular length heading data and message body data, and the composition of the heading data includes at least Message number, heading byte number, message body data byte length information, also alternative includes other information, such as send With recipient's IP address, port, transmission and receiving time date, functional label serial number etc..The heading data can be by fixed length Or elongated byte number design, the whether given fixed number of heading byte number is depended on, heading includes at least message numbering, message Head byte number and main body of the packet data word joint number.For convenient for user task process interface calling, message numbering and body data Size is provided by middleware configuration tool.
Embodiment two
The embodiment of the invention provides a kind of realization devices of mill control system communication middleware, referring to FIG. 2, described Device includes:
Configuration module 11, the configuration module 11 configure the interface data of user task process, and, the configuration Module 11 divides shared section key according to communication function purposes, and the first message data is registered;
Specifically, the configuration module 11 is realized by communication function purposes, receives transmission, all connections, and carry out Corresponding shared drive Division, for the configuration module 11 according to the parameter of input, which can be with representation function purposes, reception The features such as transmission, connection number, shared drive partition size, including but not limited to the above parameter.It can by the configuration module 11 The interface data of user task process is configured, specifically includes and shared drive subregion is carried out according to function and usage, further according to Message send, message receive to function division carry out further division, further in each function division, message send area or The connection number of reception area carries out the subdivision of shared section key.The configuration module 11 is by each company of all mill control systems simultaneously The each message data connect, message number and message body size of data etc. in the communications between registered in part, it is described to match Setting the function that module 11 is finally completed includes, and carries out subregion automatically according to classification and connection number, shared drive size, and by message Number and size etc. registered.
Message data sending module 12, the message data sending module 12 receive the hair for sending first message data Instruction is sent, the message data sending module 12 is communicated to connect with the configuration module;
Specifically, the message data sending module 12 receives the transmission instruction for sending first message data, it is real Current family task process submits message data to send the services after request.Specifically, the message data sending module 12 It obtains the message that user submits and sends request data, and then it is raw to call the message data processing module 13 to carry out message data At calling the message data storage management module 14 to carry out the storage of message data, while the message data being called to store 14 equity of management module message data to be sent is read out, and call operation system respective service sends out the message data of reading Give destination host.The message data sending module 12 is supplied to user task process message transmission interface, and realizes and will report In shared drive in literary data deposit respective partition and connection.The message datas to be sent such as reading, call operation system phase Service is closed by the message data to be sent, is sent to distance host.
Message data processing module 13, the message data processing module 13 according to message numbering and main body of the packet data, Working process forms the heading data and main body of the packet data, and the second message data, the message data are formed after merging Processing module 13 and the message data sending module 12 communicate to connect
Further, described device further include: second data are sent to far by the message data sending module 12 Journey host.
Specifically, the message data processing module 13 realizes synthesis and the decomposition function of message data, the message Data processing module 13 generates the heading data and message body data that user task process is submitted, and the two is merged and is generated Message data, and then be sent to the message data storage management module 14 and carry out storage management;Further, the message number Can also operation splitting be carried out to the message data that the message data storage management module 14 is read according to processing module 13, generate only Vertical heading data and message body data are extracted heading characteristic and are mentioned such as message number and message body data The message data receiving module 16 is given, for notifying user task process to carry out respective handling.Communication middleware message number According to processing module, the assembling of the heading data and message body data when message data storage is completed, and is read out of memory After taking message data, the parsing of heading data and message body data and extraction data function.
Message data storage management module 14, the message data storage management module 14 deposit the message data Storage, the message data storage management module and the message data processing module communicate to connect.
Specifically, the message data storage management module 14 realizes the depositing in each connection subregion of message data Storage, and read the function of message data in each connection subregion.To meet communication middleware message data sending module, lead to Believe the storage and reading of middleware message data receiving module and communication middleware message data processing module to message data Requirement.The message data storage management module of communication middleware, is responsible for message data team in the shared section key of each connection The management of column when there is newly-increased message data to store into round-robin queue (write-in enqueue operations), or is read in round-robin queue When message data (the reading dequeue operation) of storage, it is responsible for updating pointer end to end and message data queue length of queue etc. The work such as the processing of data and tail of the queue memory fragmentation.
Message data receiving module 16, the third that the message data receiving module 16 receives and processing distance host is sent Message data, and the third message data is stored in corresponding shared drive subregion, the message data receiving module 16 communicate to connect with the message data processing module 13.
Further, described device further include: the message data processing module 13 carries out the third message data Processing.
Specifically, the message data receiving module 16 realizes the reception for the message data that external host system is sent And the services of processing.The 16 call operation system respective service of message data receiving module receives external host system hair The message data sent, and the message data processing module 13 is called to handle received message data, call the message data The storage of the progress message data of storage management module 14;Call the message data storage management module 14 to received simultaneously Etc. message data to be processed be read out, 13 pairs of reading message datas of the message data processing module parse, will Data are submitted to corresponding user task process by interface and are handled after parsing.The message data of communication middleware receives mould Block is responsible for receiving the message data that distance host is sent, and the message data is stored in corresponding function subregion, corresponding In shared drive in connection.The outstanding message data stored are read in turn, which is notified to corresponding User task process
Further, described device further include: message data communicates shared section key 15, and the message data communication is shared 15 stored messages data of memory field, and, the message data communication shared section key 15 and the message data storage management mould Block 14 communicates to connect.
Specifically, the message data communication shared section key 15 is used for stored messages data, that is, each connection connects Shared section key is received, when receiving the message data of external host system, which stores corresponding total into the connection It enjoys in memory field.
Further, described device further include: when message queue tail portion free memory insufficient space, the message data is deposited The free memory free token be second message data to be pressed round-robin queue and is existed for tail portion debris plume by storage management module Stored queue head starting position.
Specifically, marking the free memory space is tail portion debris plume if queue tail free memory insufficient space, Message data is stored by round-robin queue in queue head starting position.Further, if entirely connection memory headroom is not Foot, then the message data storage management module 14 will carry out having waited until enough memory headrooms, in a manner described will continue Message data stores in the shared drive of the connection, that is to say, that when newly-increased message data is at queue end, if queue End free memory is insufficient, then marking end is debris plume, does not store valid data;It is shared interior that it is wound up into queue head at this time It deposits, judges whether there is enough newly-increased message datas of memory headroom storage and newly-increased message data exists if memory headroom is sufficiently large The memory headroom beginning of queue head is stored, the similar annular queue data structure of the storage mode;If queue head memory Insufficient space, then system carries out after waiting until that message data is read in queue, has sufficient space to carry out again when being stored The storage of newly-increased message data.Meanwhile the message data of queuing memory storage is needed when submitting operating system to carry out message transmission Queue head data are subjected to out team's read operation, that is, follow the first-in first-out rule of queuing data;Each message data is read When, next message data pending, while the message data size stored are directed toward in the shift position of the pointer on mark queue head Need to subtract the message data size read.
Embodiment three
A kind of application method of the realization device for mill control system communication middleware that inventive embodiments are provided below It is described in detail, specific as follows:
In present example, feature is communicated according to milling train Process Control System, i.e. peripheral communications system mainly there are data Function is arranged in the configuration module in the several types such as central server, other general hosts and instrument, primary PLC controller Energy subregion is data center, general host, primary PLC a total of three function division, and independent size is arranged for each function division Shared section key.According to communication in need external system host and connection number, be respectively configured by the configuration module Transmission area and reception area in three function divisions, and the host connection number in each memory partitioning is specified, configure each connection The size of required shared drive, the shared drive thus completed in system host divide management.Meanwhile the configuration module needs Further the first all message data of all systems is registered, communication middleware knows the message of each message data Number and main body of the packet data the information such as byte count sizes, to complete the management of all message datas.
Firstly, mentioning as shown in figure 3, user task process submits message data to be sent by interface function Content is handed over to include at least message number, main body of the packet data, to realize the transmission process of message;
Further, after the message data sending module 12 is connected to the task requests of message transmission, the message is notified The working process of the progress message data of data processing module 13.For the message data processing module 13 according to message number, obtaining should Connection belonging to message, and the byte length of the main body of the packet data is obtained, heading data are generated, heading data are at least wrapped The byte length of message number He main body of the packet data is contained.Further, heading data and message body data are formed finally Message data;
Then, the message data sending module 12 obtains being correspondingly connected with for registration according to the message number, by final message Data-storing enters in the shared drive of the corresponding connection, which is related to joining the team and going out for message data queue in shared drive Team's operation, the storage and reading of corresponding message data, is safeguarded by the message data storage management module 14.The message Data transmission blocks 12 are sent the data to be sent being correspondingly connected in shared drive in area are sent, and message data is deposited first It stores management module and the head of the queue message data of the queue in the connection shared drive is subjected to out team's read operation, while updating head of the queue Position indicator pointer and queue messages data length;The message data of team out is submitted to operating system to distance host by sending module Carry out data transmission, after sending successfully, return task status data give user task process, sending module completion user task into The task that journey is submitted.
The message data storage management module 14 stores message data in the tail portion of message data queue, simultaneously Update the data length of queue tail pointer and message queue.If queue tail free memory insufficient space, mark this surplus Remaining memory headroom is tail portion debris plume, and message data is stored by round-robin queue in queue head starting position.Further, If entirely connection memory headroom is insufficient, message data storage management module will carry out having waited until enough memory headrooms, Continuation in a manner described stores message data in the shared drive of the connection, that is to say, that when newly-increased message data is in team When arranging end, if queue end free memory is insufficient, marking end is debris plume, does not store valid data;It winds at this time To queue head shared drive, judges whether there is enough memory headrooms and store newly-increased message data, if memory headroom is sufficiently large, Newly-increased message data is stored at the memory headroom beginning of queue head, the similar annular queue data structure of the storage mode; If queue head memory headroom is insufficient, system is carried out after waiting until that message data is read in queue, there is sufficient space The storage of newly-increased message data is carried out when being stored again.Meanwhile queuing memory storage message data submit operating system into When row message is sent, needs to carry out queue head data into out team's read operation, that is, follow the first-in first-out rule of queuing data; When each message data is read, the shift position of the pointer on mark queue head is directed toward next message data pending, is deposited simultaneously The message data size needs of storage subtract the message data size read
16 receiving module of message data receiving module is responsible for implementing the reception and treatment process of message data.The report Effective message that the worker thread of each connection of literary data reception module 16 waits always the distance host in the connection to send Data.After receiving effective message data, message data is stored in the corresponding connection by the message data receiving module 16 In shared drive.Identical as the message data sending module 12, which is related to entering for message data queue in shared drive Team and dequeue operation, the storage and reading of corresponding message data, are safeguarded by message data storage management module.The message Data-storing management module 14 operates storage of the message data in the shared drive of the connection, sends out in the message data It send the message data of module 12 to be elaborated when storing, is not repeated herein.
The message data receiving module 16 goes out team's message data for what the message data storage management module 14 was read It is decomposed, the message data processing module 13 obtains the message number and main body of the packet data of the message, passes through interface letter Message number and main body of the packet data notification at least are gone to handle by number to corresponding user task process.
Send that message data is identical, and the message data storage management module 14 is in the connection pair with the sending module 1 In the shared drive answered, the message data received is increased newly queue end, while updating the queue tail pointer and having stored And wait message amount to be read;
It is identical that message data is increased newly with the message data sending module 12, and the message data receiving module 16 is in queue End increases message data newly, if queue end free memory off-capacity, marking end free memory is debris plume, does not deposit Store valid data;According to circle queue data structure mode, judge whether queue head memory size stores newly-increased message enough Data, if memory size is sufficiently large, newly-increased message data is stored at queue head memory headroom beginning;If team Arrange that head memory size is insufficient, then system carries out after waiting until that message data is read in queue, have enough memory sizes into When row storage, then newly-increased message data is stored.
The message data of the reception shared section key of each connection, described device go out the head message data of queue Team's read operation, it then follows the first in first out of queuing data.Heading data are read first, according to the report in heading data Body of text data word joint number size, then message body data are read out, meanwhile, queue head position indicator pointer is updated, is directed toward next The message data to be read such as a, while the message data size to be read such as update, complete dequeue operation.Communication middleware will The message data of extraction notifies to carry out relevant processing to corresponding user task process.To solve milling train in the prior art Data communication problem between control system host, data center, instrument, other control system hosts and primary PLC, reaches The difficulty for reducing the exploitation of milling train Process Control System, easy to operate, easy to use, the technical effect of convenient and efficient are arrived.
Said one or multiple technical solutions in the embodiment of the present invention at least have following one or more technology effects Fruit:
1, in a kind of implementation method of mill control system communication middleware provided in an embodiment of the present invention, by according to function Energy or purposes obtain the first shared section key, the second shared section key, third shared section key, wherein described first is shared interior Deposit area, the second shared section key, third shared section key are respectively provided with specific function or purposes;By first shared drive It divides into and sends shared section key and reception shared section key, wherein the transmission shared section key is that host sends message number According to first send storage management area, it is described receive shared section key be host receive message data first receive storage management Area;According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends son point Area, the reception shared drive divide into N number of first shared drive and receive child partition;The M the first shared drives are sent Child partition, N number of first shared drive receive child partition using the data structure mode of message data round-robin queue to the message Data join the team and team is managed out, realize the deposit, reading and data protection of the message data.Solves the prior art In communication means cannot by function carry out partition management, influence the requirement of real-time control of efficiency and system, and message data is big The technical issues of small use fixed length maximum byte handles, causes system resource waste, having reached can be shared by different function Memory classification, improves treatment effeciency, technical effect easy to use.
2, in a kind of realization device of mill control system communication middleware provided in an embodiment of the present invention, by configuring mould Block, the configuration module configure the interface data of user task process, and, the configuration module is used according to communication function Way divides shared section key, and the first message data is registered;Message data sending module, the message data send mould Block receives the transmission instruction for sending first message data, the message data sending module and the configuration module communication link It connects;Message data processing module, the message data processing module is according to message numbering and main body of the packet data, working process shape At the heading data and main body of the packet data, form the second message data after merging, the message data processing module with The message data sending module communication connection;Message data storage management module, the message data storage management module will Second message data is stored, the message data storage management module and the message data processing module communication link It connects.Solve mill control system host, data center, instrument, other control system hosts and level-one in the prior art Data communication problem between PLC has reached the difficulty for reducing the exploitation of milling train Process Control System, easy to operate, easy to use, The technical effect of convenient and efficient.
3, the embodiment of the present invention communicates shared section key by message data, and the message data communication shared section key is deposited Message data is stored up, and, the message data communication shared section key and the message data storage management module communicate to connect, and reach The technical effect realized to message data storage and data protection is arrived.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, those skilled in the art can carry out various modification and variations without departing from this hair to the embodiment of the present invention The spirit and scope of bright embodiment.In this way, if these modifications and variations of the embodiment of the present invention belong to the claims in the present invention And its within the scope of equivalent technologies, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of implementation method of mill control system communication middleware, which is characterized in that the described method includes:
The first shared section key, the second shared section key, third shared section key are obtained according to function or purposes, wherein described First shared section key, the second shared section key, third shared section key are respectively provided with specific function or purposes;
First shared drive is divided into and sends shared section key and reception shared section key, wherein described send is shared Memory field is the first transmission storage management area that host sends message data, and the reception shared section key is that host receives message The first of data receives storage management area;
According to P connection for sending message data, the transmission shared drive is divided into M the first shared drives and sends son point Area, the reception shared drive divide into N number of first shared drive and receive child partition;
The M the first shared drives are sent into child partition, N number of first shared drive is received child partition and recycled using message data The data structure mode of queue to the message data join the team and team is managed out, realize the message data deposit, Reading and data protection.
2. the method as described in claim 1, which is characterized in that the method also includes:
Queuing data is managed according to queue team head and the position indicator pointer of tail of the queue and the data length of queue.
3. method according to claim 2, which is characterized in that the method also includes:
When tail of the queue increases message data newly, when enqueue operations memory headroom deficiency, memory is carried out to the tail of the queue memory headroom Fragment label, is wound up into initial position in memory headroom for the newly-increased message data and stores.
4. the method as described in claim 1, which is characterized in that the method also includes:
The message data includes regular length heading data and message body data.
5. a kind of realization device of mill control system communication middleware, which is characterized in that described device includes:
Configuration module, the configuration module configure the interface data of user task process, and, the configuration module according to Communication function purposes divides shared section key, and the first message data is registered;
Message data sending module, the message data sending module receive the transmission instruction for sending first message data, The message data sending module and the configuration module communicate to connect;
Message data processing module, the message data processing module is according to message numbering and main body of the packet data, working process The heading data and main body of the packet data are formed, form the second message data, the message data processing module after merging It is communicated to connect with the message data sending module;
Message data storage management module, the message data storage management module store second message data, The message data storage management module and the message data processing module communicate to connect.
6. device as claimed in claim 5, which is characterized in that described device further include:
Message data receiving module, the third message number that the message data receiving module receives and processing distance host is sent According to, and the third message data is stored in corresponding shared drive subregion, the message data receiving module with it is described The communication connection of message data processing module.
7. device as claimed in claim 6, which is characterized in that the message data processing module is to the third message data It is handled.
8. device as claimed in claim 5, which is characterized in that the message data sending module sends second data To distance host.
9. device as claimed in claim 5, which is characterized in that described device further include:
Message data communicates shared section key, and the message data communicates shared section key stored messages data, and, the message Data communication shared section key and the message data storage management module communicate to connect.
10. device as claimed in claim 5, which is characterized in that when message queue tail portion free memory insufficient space, the report The free memory free token is for tail portion debris plume, by second message data by following by literary data-storing management module Ring queue is stored in queue head starting position.
CN201810805096.7A 2018-07-20 2018-07-20 A kind of implementation method and device of mill control system communication middleware Pending CN109117268A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810805096.7A CN109117268A (en) 2018-07-20 2018-07-20 A kind of implementation method and device of mill control system communication middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810805096.7A CN109117268A (en) 2018-07-20 2018-07-20 A kind of implementation method and device of mill control system communication middleware

Publications (1)

Publication Number Publication Date
CN109117268A true CN109117268A (en) 2019-01-01

Family

ID=64863090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810805096.7A Pending CN109117268A (en) 2018-07-20 2018-07-20 A kind of implementation method and device of mill control system communication middleware

Country Status (1)

Country Link
CN (1) CN109117268A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7552306B2 (en) * 2005-11-14 2009-06-23 Kabushiki Kaisha Toshiba System and method for the sub-allocation of shared memory
CN101662551A (en) * 2008-08-29 2010-03-03 深圳市东进通讯技术股份有限公司 Enterprise converged communication system
CN102023961A (en) * 2009-09-10 2011-04-20 中兴通讯股份有限公司 Communication method based on shared memory and apparatus thereof
CN103514261A (en) * 2013-08-13 2014-01-15 江苏华大天益电力科技有限公司 Data asynchronization storage and access mechanism applied to industrial control system
CN104133445A (en) * 2014-07-25 2014-11-05 中国科学院等离子体物理研究所 Real-time state monitoring and data sharing method for neutral beam injector
CN104462008A (en) * 2014-12-05 2015-03-25 三星半导体(中国)研究开发有限公司 Physical-memory-shared multi-processor communication system and communication method thereof
CN106126359A (en) * 2016-08-25 2016-11-16 成都交大光芒科技股份有限公司 The rapid transmission method of process data sharing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7552306B2 (en) * 2005-11-14 2009-06-23 Kabushiki Kaisha Toshiba System and method for the sub-allocation of shared memory
CN101662551A (en) * 2008-08-29 2010-03-03 深圳市东进通讯技术股份有限公司 Enterprise converged communication system
CN102023961A (en) * 2009-09-10 2011-04-20 中兴通讯股份有限公司 Communication method based on shared memory and apparatus thereof
CN103514261A (en) * 2013-08-13 2014-01-15 江苏华大天益电力科技有限公司 Data asynchronization storage and access mechanism applied to industrial control system
CN104133445A (en) * 2014-07-25 2014-11-05 中国科学院等离子体物理研究所 Real-time state monitoring and data sharing method for neutral beam injector
CN104462008A (en) * 2014-12-05 2015-03-25 三星半导体(中国)研究开发有限公司 Physical-memory-shared multi-processor communication system and communication method thereof
CN106126359A (en) * 2016-08-25 2016-11-16 成都交大光芒科技股份有限公司 The rapid transmission method of process data sharing

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ZHAO YUANZHE等: "Design of Timing Synchronization Software on EAST-NBT", 《PLASMA SCIENCE AND TECHNOLOGY》 *
王升广等: "宁波钢铁1780精轧过程控制系统", 《冶金自动化》 *
谢永刚等: "基于共享内存的进程间通信在嵌入式软件测试中的应用", 《计算机应用与软件》 *

Similar Documents

Publication Publication Date Title
CN103634364B (en) A kind of system for realizing remote desktop, method, client and service centre
CN104809601B (en) The mutual auxiliary system of express delivery based on electronic map
CN105511954A (en) Method and device for message processing
CN104079599A (en) Real-time message synchronizing method and container wharf operation system
CN1514977A (en) Arrangement for creating multiple virtual queue pairs from compressed queue pairs based on shared attributed
CN102648455A (en) Server and flow control program
CN109196837A (en) The method and system of interprocess communication is carried out in user's space between OS grades of containers
CN104615684B (en) A kind of mass data communication concurrent processing method and system
CN101840328A (en) Data processing method, system and related equipment
CN103929377A (en) Wired network and wireless network combined dispatching method and system and related devices
CN109446204A (en) A kind of date storage method of instant messaging, device, electronic equipment and medium
WO2016180083A1 (en) Airport operation command system
CN103617021A (en) Communication system and method of hardware abstraction layer of universal processor in software communication system structure
JP2004213533A (en) Screen reception device, screen delivery device, screen information transmission/reception system, screen reception method, screen delivery method and program therefor
US7133913B2 (en) Information routing
CN109818977A (en) A kind of access server communication optimization method, access server and communication system
CN105376155B (en) A kind of Intelligent routing system and method based on distributed type assemblies framework
CN109117268A (en) A kind of implementation method and device of mill control system communication middleware
CN102081845B (en) Preprocessing method and device of traffic information
CN107819697A (en) Data transmission method, interchanger and data center
CN101155370A (en) Business serial processing method and system in multi-stream application of mobile communication system
CN104240049A (en) Comprehensive order handling platform
CN102769495A (en) Optical access network equipment communication method, device and system
CN104240048A (en) Comprehensive order handling platform
CN109587063A (en) A kind of drainage method and device of data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for 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: 20190101