A kind of slave computer control method, system, storage medium and industrial personal computer

文档序号:1755360 发布日期:2019-11-29 浏览:31次 中文

阅读说明:本技术 一种下位机控制方法、系统、存储介质和工控机 (A kind of slave computer control method, system, storage medium and industrial personal computer ) 是由 苏晓良 张凡力 杨晓红 沈浩锋 于 2019-09-05 设计创作,主要内容包括:本申请提供一种下位机控制方法,包括:接收服务器发送的控制指令;所述控制指令包括读取数据和写入数据,所述写入数据包括操作内容和下位机通讯协议;根据所述下位机通讯协议和所述操作内容向各下位机写入数据,并生成写入结果;根据所述写入结果生成操作记录。通过在服务器发送至工控机的控制指令中添加下位机通讯协议,使得工控机通过一条信息就可以知晓服务器需要操作的数据和内容,工控机可以只根据一条控制指令操控下位机,同时不必使用各自的通讯协议,节约了通讯时间,提高了可靠性。本申请还提供一种下位机控制系统、存储介质和工控机,具有上述有益效果。(The application provides a kind of slave computer control method, comprising: receives the control instruction that server is sent;The control instruction includes reading data and write-in data, and said write data include operation content and slave computer communications protocol;Data are written to each slave computer according to the slave computer communications protocol and the operation content, and generate write-in result;Operation note is generated according to said write result.By adding slave computer communications protocol in the control instruction that server is sent to industrial personal computer, so that industrial personal computer can the awareness server data and content that needs to operate by information, industrial personal computer only can manipulate slave computer according to a control instruction, respective communications protocol need not be used simultaneously, communication time has been saved, reliability is improved.The application also provides a kind of lower computer control system, storage medium and industrial personal computer, has above-mentioned beneficial effect.)

1. a kind of slave computer control method characterized by comprising

Receive the control instruction that server is sent;The control instruction includes reading data and write-in data, said write data Including operation content and slave computer communications protocol;

Data are written to each slave computer according to the slave computer communications protocol and the operation content, and generate write-in result;

Operation note is generated according to said write result.

2. slave computer control method according to claim 1, which is characterized in that further include:

The operation note is back to the server.

3. slave computer control method according to claim 1, which is characterized in that the execution priority of said write data is high In the execution priority for reading data.

4. slave computer control method according to claim 3, which is characterized in that when detecting write-in subtask, also wrap It includes:

Judgement is currently carrying out with the presence or absence of reading subtask;

If so, executing said write subtask after completing the reading subtask;

If it is not, then directly executing said write subtask.

5. slave computer control method according to claim 1, which is characterized in that further include:

The read requests of slave computer described in timing receipt;

It whether there is control instruction according to read requests retrieval;

Data are written to each slave computer according to the slave computer communications protocol and the operation content if so, executing, and generates and writes The step of entering result.

6. slave computer control method according to claim 1, which is characterized in that the read data packet include simplify data and Total data.

7. a kind of lower computer control system characterized by comprising

Receiving module, for receiving the control instruction of server transmission;The control instruction includes reading data and write-in data, Said write data include operation content and slave computer communications protocol;

Writing module, for data to be written to each slave computer according to the slave computer communications protocol and the operation content, and it is raw At write-in result;

Generation module is recorded, for generating operation note according to said write result.

8. lower computer control system according to claim 7, which is characterized in that further include:

Feedback module, for the operation note to be back to the server.

9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt The step of processor realizes slave computer control method as claimed in any one of claims 1 to 6 when executing.

10. a kind of industrial personal computer, which is characterized in that including memory and processor, have computer program, institute in the memory It states and realizes slave computer control as claimed in any one of claims 1 to 6 when processor calls the computer program in the memory The step of method.

Technical field

This application involves industrial equipment field, in particular to a kind of slave computer control method, system, storage medium and industry control Machine.

Background technique

When server is interacted with industrial personal computer, there are reading, write operation, reading has reading to simplify data and total data, writes Enter to need to inform when operating industrial personal computer concrete operations content, industrial personal computer records operation performed by server, and slave computer uses oneself Communication modes with industrial computer communication, the operation of server is passed to slave computer through industrial personal computer.In other words, existing communication side Formula is exactly that each stage communication operation is separately carried out, i.e., one operation, one instruction or even content-data and operation data all need Separately send is wanted, if server needs slave computer at least to need two instructions when executing a certain operation, needs repeatedly to be communicated. When data are written to slave computer in server, error can be easy long by needing repeatedly to communicate holding time, occupy Internet resources etc..

Summary of the invention

The purpose of the application is to provide a kind of slave computer control method, system, storage medium and industrial personal computer, is capable of providing clothes The communication efficiency being engaged between device, industrial personal computer and slave computer.

In order to solve the above technical problems, the application provides a kind of slave computer control method, specific technical solution is as follows:

Receive the control instruction that server is sent;The control instruction includes reading data and write-in data, said write Data include operation content and slave computer communications protocol;

Data are written to each slave computer according to the slave computer communications protocol and the operation content, and generate write-in knot Fruit;

Operation note is generated according to said write result.

Wherein, further includes:

The operation note is back to the server.

Wherein, the execution priority of said write data is higher than the execution priority for reading data.

Wherein, when detecting write-in subtask, further includes:

Judgement is currently carrying out with the presence or absence of reading subtask;

If so, executing said write subtask after completing the reading subtask;

If it is not, then directly executing said write subtask.

Wherein, further includes:

The read requests of slave computer described in timing receipt;

It whether there is control instruction according to read requests retrieval;

Data are written to each slave computer according to the slave computer communications protocol and the operation content if so, executing, and raw The step of at write-in result.

Wherein, the read data packet, which includes, simplifies data and total data.

The application also provides a kind of lower computer control system, comprising:

Receiving module, for receiving the control instruction of server transmission;The control instruction includes reading data and write-in Data, said write data include operation content and slave computer communications protocol;

Writing module, for data to be written to each slave computer according to the slave computer communications protocol and the operation content, And generate write-in result;

Generation module is recorded, for generating operation note according to said write result.

Wherein, further includes:

Feedback module, for the operation note to be back to the server

The application also provides a kind of computer readable storage medium, is stored thereon with computer program, the computer journey The step of slave computer control method as described above is realized when sequence is executed by processor.

The application also provides a kind of industrial personal computer, including memory and processor, has computer program in the memory, The processor realizes the step of slave computer control method as described above when calling the computer program in the memory.

The application provides a kind of slave computer control method, comprising: receives the control instruction that server is sent;The control refers to Enabling includes reading data and write-in data, and said write data include operation content and slave computer communications protocol;Under described Position machine communications protocol and the operation content generate write-in result to each slave computer write-in data;According to said write result Generate operation note.

The application in the control instruction that server is sent to industrial personal computer by adding slave computer communications protocol, so that industry control Machine by information can the awareness server data and content that needs to operate, industrial personal computer can only refer to according to a control Manipulation slave computer is enabled, while respective communications protocol need not be used, communication time has been saved, has improved reliability.The application is also A kind of lower computer control system, storage medium and industrial personal computer are provided, there is above-mentioned beneficial effect, details are not described herein again.

Detailed description of the invention

In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.

Fig. 1 is a kind of flow chart of slave computer control method provided by the embodiment of the present application;

Fig. 2 is a kind of server provided by the embodiment of the present application to the communication process schematic diagram of industrial personal computer;

Fig. 3 is a kind of industrial personal computer provided by the embodiment of the present application to the communication process schematic diagram of server;

Fig. 4 is a kind of industrial personal computer provided by the embodiment of the present application to the communication succession schematic diagram of slave computer;

Fig. 5 is communication process schematic diagram of the another kind industrial personal computer provided by the embodiment of the present application to slave computer;

Fig. 6 is a kind of server provided by the embodiment of the present application to the communication process schematic diagram of industrial personal computer;

Fig. 7 is the communication process schematic diagram of a kind of server provided by the embodiment of the present application, industrial personal computer and slave computer;

Fig. 8 is a kind of lower computer control system structural schematic diagram provided by the embodiment of the present application.

Specific embodiment

To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall in the protection scope of this application.

Referring to FIG. 1, Fig. 1 is a kind of flow chart of slave computer control method provided by the embodiment of the present application, the bottom Machine control method includes:

S101: the control instruction that server is sent is received;

It should be noted that control instruction includes operation content under including reading data and write-in data, write-in data Position machine communications protocol.It mainly include server and situ machine in existing centralized control scheme, server refers mainly to Central Control Room Computer, can monitor and operate all live industrial personal computers, data, alarm or the prompt of every other industrial personal computer can all reach clothes Business device.Situ machine is made of industrial personal computer and several slave computers, and industrial personal computer is human-computer interaction device, machine operation data, state It will show and record, slave computer is specific execution unit.

In this step, industrial personal computer receive server send control instruction, the control instruction mainly include read data and Data are written.Be written data be used for " informings " industrial personal computer or slave computer concrete operations content, specifically include operation content with Slave computer communications protocol.

Byte number etc. of each section content in control instruction is not construed as limiting at this.Referring to figs. 2 and 3, it respectively takes Business device to the communication process schematic diagram of server, can be seen the communication process schematic diagram and industrial personal computer of industrial personal computer by Fig. 2 and Fig. 3 Out, read data packet, which includes, simplifies data and total data, in the write-in data of server to industrial personal computer include operation content and Slave computer communications protocol writes data into industrial personal computer directly to corresponding slave computer according to slave computer communications protocol. Word content is the write-in data content that server is sent to industrial personal computer in addition to bracket on the left of four-headed arrow in Fig. 2, in bracket Content be " generate operation note " be industrial computer communication be written after data be written result after executed by industrial personal computer, and two-way arrow Head represents the process of data write-in front and back.Similarly, in Fig. 3, in the data that industrial personal computer is returned to server, industrial personal computer to After data are written in slave computer, operation note is generated, which at least should include that slave computer communicates result.It should be noted that It is that the byte number of each section data is only a kind of preferred scheme provided by the present application in Fig. 2 and Fig. 3, does not limit specifically herein It is fixed.

It should be noted that operation data and operation content are separately sends, and the application in the prior art In, which includes reading data and write-in data simultaneously, so that server is by one information of operation data and content It sends, has saved the communication time and communication cost of server and industrial personal computer.

S102: data are written to each slave computer according to the slave computer communications protocol and the operation content, and generates and writes Enter result;

This step is intended to that data are written to slave computer according to slave computer communications protocol and operation content.In general, same Each slave computer communications protocol in centralized control scheme is not completely the same, and server can store note as control core Communications protocol used by each slave computer is recorded, and when needing to be implemented operation that operation content and slave computer communications protocol one is concurrent It send to industrial personal computer, can data directly be written to slave computer according to operation content and slave computer communications protocol in industrial personal computer at this time.

It should be noted that in the prior art, server directly sends control instruction to industrial personal computer, service in the prior art The control instruction that device is sent to industrial personal computer only meets the operational order between server and industrial personal computer, is not used to industrial personal computer under Operation between the machine of position.And in the embodiment of the present application, slave computer communications protocol is contained in the write-in data of the control instruction, is made Can data directly be written to slave computer according to control instruction in industrial personal computer, need to only parse operation content in control instruction i.e. It can.For industrial personal computer, server only can be specified by an information and need the data and content that operates, while can also be with Data are written to slave computer using this message, communication time is greatly saved.Simultaneously as reduce the instruction number of communication, The complexity of communication is directly reduced, has ensured the communication degree of reliability.

S103: operation note is generated according to said write result.

After industrial personal computer completes write-in data to slave computer, operation note is generated according to result is actually written into.The operation note It usually also needs to be back to server, which is saved by server.Operation record content is not construed as limiting herein, example It such as may include instruction sender's title, sending time, action name, operation content, operating result.

The embodiment of the present application is made by adding slave computer communications protocol in the control instruction that server is sent to industrial personal computer Industrial personal computer by information can the awareness server data and content that needs to operate, industrial personal computer can be only according to one Control instruction manipulates slave computer, while need not use respective communications protocol, has saved communication time, has improved reliability.

Based on the above embodiment, as preferred embodiment, the execution priority of said write data is higher than the reading The execution priority of data.

In simple terms, for server or industrial personal computer, the priority of write operation is higher than the excellent of read operation First grade executes the premise of operation to industrial personal computer or industrial personal computer because write operation is substantially server to slave computer, surface this When server there is task to need to be implemented, and read operation is usually read operation completion status, natural write operation priority compared with It is higher.

Current reading task is interrupted when write-in task immediately specifically, not having, in server or industrial personal computer two The execution sequence of kind task specifically can be such that

When detecting write-in subtask, judgement is currently carrying out with the presence or absence of reading subtask;

If so, completing to execute write-in subtask after reading subtask;

If it is not, then directly executing write-in subtask.

In other words, it has detected write-in data manipulation, has been immediately performed write-in data manipulation, be written after the completion of data manipulation Read operation is executed again.

Based on the above embodiment, as preferred embodiment, can also include:

The read requests of slave computer described in timing receipt;

It whether there is control instruction according to read requests retrieval;

Data are written to each slave computer according to the slave computer communications protocol and the operation content if so, executing, and raw The step of at write-in result.

The communication succession of slave computer is shown for a kind of industrial personal computer provided by the embodiment of the present application to Fig. 7, Fig. 4 referring to fig. 4 It is intended to, Fig. 5 is communication process schematic diagram of the another kind industrial personal computer provided by the embodiment of the present application to slave computer, and Fig. 6 is this Shen Please a kind of server provided by embodiment to the communication process schematic diagram of industrial personal computer, Fig. 7 is provided by the embodiment of the present application A kind of communication process schematic diagram of server, industrial personal computer and slave computer.In a whole centralized control scheme, Fig. 4 to Fig. 7 institute Four kinds of communication successions for including can usually exist simultaneously.And slave computer can generally also be arranged clocked flip and ask to the reading of industrial personal computer It asks.

Referring to fig. 4, between industrial personal computer and slave computer, industrial personal computer can set clocked flip read slave computer data, and under Slave computer data required for industrial personal computer are back to industrial personal computer when receiving industrial personal computer reading data requirements by position machine.And it is somebody's turn to do Data are also typically used as the data basis that industrial personal computer returns to server, but should be noted that the data are not is that industrial personal computer exists It (is instructed to slave computer write-in data according to the control instruction of server transmission to slave computer transmission corresponding operation), but work Control machine or server end pass through industrial personal computer inquiry slave computer data.

Referring to Fig. 5, which, which is industrial personal computer, is written data according to slave computer, while industrial personal computer is returned according to slave computer Data generation operations record and return to server.

Referring to Fig. 6, it is similar to Fig. 4, server reads slave computer data from industrial personal computer, and industrial personal computer is by each slave computer data It is back to server.It should be noted that a server corresponds to multiple industrial personal computers, each industrial personal computer may also correspond to it is multiple under Position machine, therefore, the corresponding slave computer quantity of server is more, and each industrial personal computer returns to the slave computer of their own subordinate to server Data.

Referring to Fig. 7, operating process of the Fig. 7 between server, industrial personal computer and slave computer, server is written to certain slave computer Data refer to that server needs this slave computer to execute corresponding operation, and first control instruction is written to belonging to the slave computer Industrial personal computer, corresponding operation instructs and is written by the industrial personal computer being responsible for by the slave computer.Hereafter, slave computer first returns to write-in result To industrial personal computer, industrial personal computer records according to the data generation operations that slave computer returns and returns to server.

A kind of lower computer control system provided by the embodiments of the present application is introduced below, slave computer control described below System processed can correspond to each other reference with above-described slave computer control method.

Referring to Fig. 8, the application also provides a kind of lower computer control system, comprising:

Receiving module 100, for receiving the control instruction of server transmission;The control instruction includes reading data and writing Enter data, said write data include operation content and slave computer communications protocol;

Writing module 200, for number to be written to each slave computer according to the slave computer communications protocol and the operation content According to, and generate write-in result;

Generation module 300 is recorded, for generating operation note according to said write result.

Based on the above embodiment, as preferred embodiment, further includes:

Feedback module, for the operation note to be back to the server

Present invention also provides a kind of computer readable storage mediums, have computer program thereon, the computer program It is performed and step provided by above-described embodiment may be implemented.The storage medium may include: USB flash disk, mobile hard disk, read-only deposit Reservoir (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or The various media that can store program code such as CD.

Present invention also provides a kind of industrial personal computers, may include memory and processor, have calculating in the memory When the processor calls the computer program in the memory, step provided by above-described embodiment is may be implemented in machine program Suddenly.Certain industrial personal computer can also include various network interfaces, the components such as power supply.

Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For embodiment provide system and Speech, since it is corresponding with the method that embodiment provides, so being described relatively simple, related place is referring to method part illustration .

Specific examples are used herein to illustrate the principle and implementation manner of the present application, and above embodiments are said It is bright to be merely used to help understand the present processes and its core concept.It should be pointed out that for the ordinary skill of the art For personnel, under the premise of not departing from the application principle, can also to the application, some improvement and modification can also be carried out, these improvement It is also fallen into the protection scope of the claim of this application with modification.

It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多个GPU同时工作的独立显卡

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!