CN111726395B - Automatic communication mechanism of numerical control system - Google Patents

Automatic communication mechanism of numerical control system Download PDF

Info

Publication number
CN111726395B
CN111726395B CN202010472809.XA CN202010472809A CN111726395B CN 111726395 B CN111726395 B CN 111726395B CN 202010472809 A CN202010472809 A CN 202010472809A CN 111726395 B CN111726395 B CN 111726395B
Authority
CN
China
Prior art keywords
session
communication
control
control system
library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010472809.XA
Other languages
Chinese (zh)
Other versions
CN111726395A (en
Inventor
叶昌煜
万军杨
甘玉轩
张锦源
邱民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Coresing Robot Technology Co ltd
Original Assignee
Guangzhou Coresing Robot Technology 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 Guangzhou Coresing Robot Technology Co ltd filed Critical Guangzhou Coresing Robot Technology Co ltd
Priority to CN202010472809.XA priority Critical patent/CN111726395B/en
Publication of CN111726395A publication Critical patent/CN111726395A/en
Application granted granted Critical
Publication of CN111726395B publication Critical patent/CN111726395B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to an automatic communication mechanism of a numerical control system, which comprises an upper computer and the numerical control system communicated with the upper computer, wherein the upper computer is provided with a control library, the control library is internally provided with a plurality of types of registrable controls and a communication library for maintaining communication between the registrable controls and the numerical control system, the registrable controls complete initialization of the registrable controls and establishment and registration of sessions by registering in the communication library, and a session ID is generated during session registration and is stored in the session; the registered control realizes full-automatic communication between the control and the numerical control system and self-updating of the control through a communication library and the numerical control system by a session interaction mechanism. The invention can eliminate the communication process of human intervention, and establish a set of full-automatic communication mechanism, thereby not only reducing the complexity of constructing the upper computer software, but also improving the reliability of the system.

Description

Automatic communication mechanism of numerical control system
Technical Field
The invention relates to the technical field of numerical control system communication, in particular to an automatic communication mechanism of a numerical control system.
Background
The prior art requires developers to manually add a large amount of program code to intervene in the communication process, such as encapsulating sessions, sending sessions, receiving responses, parsing sessions, updating controls, and the like. If hundreds or thousands of data items are provided, since the meaning of each data item may be different, the same number of control codes will need to be written, which is an extremely tedious process and is easy to generate data errors and behavior anomalies.
Disclosure of Invention
The present invention aims to provide an automatic communication mechanism for a numerical control system to solve the problems of the background art.
In order to achieve the purpose, the invention provides the following technical scheme: an automatic communication mechanism of a numerical control system comprises an upper computer and the numerical control system which is communicated with the upper computer, wherein the upper computer is provided with a control library, the control library is internally provided with a plurality of registrable controls and a communication library which is used for maintaining communication between the registrable controls and the numerical control system, the registrable controls complete initialization, creation and registration conversation of the registrable controls by registering in the communication library, and a conversation ID is generated during conversation registration and is stored in the conversation itself; the registered control realizes full-automatic communication between the control and the numerical control system and self-updating of the control through a communication library and the numerical control system by a session interaction mechanism.
Preferably, the communication library is provided with a control and a session registry, and the control and the session registry records the mapping relationship between the control and the session and the mapping relationship between the session ID and the session.
Preferably, the session interaction mechanism is implemented as follows:
s11, the control generates an interactive request (acquiring data or submitting data) during the operation of a user;
s12, the control searches own conversation, finds the conversation corresponding to the interaction and sends the conversation to a communication library;
s13, the communication library receives the conversation of the control, packages the data of the conversation into a TCP data packet and forwards the TCP data packet to the numerical control system;
s14, waiting for the response of the numerical control system;
s15, the communication library transfers the received response to a distribution mechanism of the communication library for processing;
s16, the distribution mechanism of the communication library searches the controls and the session registry according to the session ID, finds one or a group of equivalent controls and returns responses to the controls in sequence;
and S17, the control analyzes the response data, updates the display of the control and finishes the process.
The equivalent control is a group of controls of the session containing the same ID as the response session when a response session is returned. The "equivalence" belongs to the instant state, for example, the control a contains a session with IDs a and B, the control B contains a session with IDs a and c, and when the ID of the response session is a, the control a and the control B are equivalent controls; when the response session ID is b or c, they do not belong to the equivalent control.
Preferably, the communication library further comprises a timeout management mechanism. The timeout management mechanism is as follows: when the communication library sends the TCP data packet to the numerical control system end, the response of the numerical control system end is not received within the set overtime time, namely the overtime time is up. At this moment, the communication library timeout management mechanism can select whether to retransmit according to the retransmission flag of the session; if not, then the control is handed over to the timeout mechanism for processing.
Compared with the prior art, the invention has the beneficial effects that:
1) Automated communication: the whole communication process is managed and maintained by the cooperation of the control, the session and the communication library, and a user does not need to write any control codes in communication, so that the communication can be called automatic communication.
2) Better communication quality: all the sessions are managed by the communication library, and centralized optimization can be carried out on the communication of the sessions, such as merging repeated sessions, an efficient distribution mechanism and a timeout management mechanism.
3) Simple and easy to use: the control library can be used as a plug-in of a visual interface design tool, namely, the interface can be created and laid out through simple dragging, then some attributes of the controls are specified, and non-programming professionals can also realize the construction of upper computer software and the layout of the controls.
4) The reliability of the system is improved: the invention can eliminate the communication process of human intervention, establish a set of full-automatic communication mechanism, not only reduce the complexity of constructing the upper computer software, but also improve the reliability of the system.
Drawings
FIG. 1 is a diagram of a communication system framework;
FIG. 2 is a flow diagram of registrable control registration and de-registration;
fig. 3 is an automatic communication flow chart.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art without creative efforts based on the technical solutions of the present invention belong to the protection scope of the present invention.
Referring to fig. 1 to 3, the present invention provides a technical solution: an automatic communication mechanism of a numerical control system comprises an upper computer and the numerical control system which is communicated with the upper computer, wherein the upper computer is provided with a control library, the control library is internally provided with a plurality of registrable controls and a communication library for maintaining communication between the registrable controls and the numerical control system, and the registrable controls complete initialization, creation and registration conversation of the registrable controls by registering in the communication library; the registered control realizes full-automatic communication between the control and the numerical control system and self-updating of the control through a communication library and the numerical control system by a session interaction mechanism.
The data comparison table of the upper computer and the nc system in fig. 1 is used for classifying, encoding (i.e., address code) and specifying data types of the nc system data used by the upper computer (or may be used in the future), and is summarized into a table. When a user creates a control, the user searches the table to obtain the address code of the data of the end of the required numerical control system, and then fills the obtained address code into the address code attribute of the control, and at the moment, the control starts an automatic communication mechanism.
The control library predefines several types of registrable controls, such as edit boxes, status buttons, drop-down boxes, tabs, and various compound controls. Each kind of control realizes an interaction mechanism, a response mechanism and a timeout mechanism, and realizes an updating mechanism of the control according to the specificity of the control. Each control object has one or more sessions, the specific number of which is determined by the control type.
The communication library is used for maintaining communication between the registrable control and the numerical control system, managing sessions of all registrable controls of the upper computer, receiving a response of the numerical control system end and distributing the response session to the registrable control.
Before the registrable control is communicated with the numerical control system, the registrable control needs to be registered with the communication library, and when the registrable control is destroyed, the registrable control is unregistered with the communication library. The registration and the counterregistration processes are as follows:
s1, initializing a control and creating a session: the control initializes the display style of the control and creates a plurality of sessions (the specific number is determined by the control type) according to the attributes of the address code, the data type and the like;
s2, registering conversation: the control registers the session owned by the control to the communication library and records the session in a control and session registry; at the same time, a session ID is generated and stored in the session itself;
s3, user interaction: mainly refers to the interaction on data, namely, a user acquires data or submits data, and each user interaction is accompanied with an automatic communication process;
s4, control destruction: when the display interface is closed or the operation such as the software of the upper computer is quitted, the control is destroyed; the destroying process is accompanied with the counterregistration session, the control informs the communication library to counterregister the session owned by the control, and the communication library searches the control and the session registry according to the ID of the session and removes the corresponding record.
The session is a basic unit for communication between the registrable control and the communication library, and comprises the following information:
the session type is as follows: data is acquired, data is submitted, bit data is acquired, and bit data is submitted.
Address code: and indicating which data the session acquires/submits can be obtained by searching the data comparison table of the upper computer and the numerical control system.
Internal offset: the address of the internal offset on the basis of the data indicated by the address code, address code + internal offset, ultimately determines the specific data to be operated on by the session.
Data type: shaping, floating point type and the like can be obtained by searching a data comparison table of an upper computer and a numerical control system.
Data length: byte length of data fetched/committed.
An operation position: the fetch bit data/commit bit data is used to indicate which data bit is to be fetched/committed.
Caching: the (bit) data is acquired for saving the acquired data, and the (bit) data is submitted for saving the submitted data.
Retransmission flag: and indicating whether to retransmit in time-out of communication.
The control comprises the following components: indicating to which control the session belongs.
Session ID: the registration is automatically calculated by the system, and a 64-bit integer value is calculated according to the information of the session type, the address code, the internal offset, the data length and the operation bit. If the IDs of the two sessions are the same, it means that they are the same, otherwise they are different. The calculation formula is as follows, where "<" is a left shift operator:
ID = (conversational class < < 60) + (operation bit < < 48) + (data length data < < 32) + (internal offset < < 16) + (address code)
The "control and session registry" includes two sub-tables, which respectively record the mapping relationship between the control and the session and the mapping relationship between the session ID and the session, that is:
control and session mapping table: one control corresponds to a group of sessions,
session ID and session mapping table: one session ID corresponds to a group of sessions.
After the registrable control is successfully registered in the communication library, the registrable control can continuously and automatically communicate with the numerical control system by a session interaction mechanism, and each automatic communication process comprises the following steps:
s21, the control generates an interactive request (acquiring data or submitting data) during the operation of a user;
s22, the control searches own conversation, finds the conversation corresponding to the interaction and sends the conversation to a communication library;
s23, the communication library receives the conversation of the control, packages the data of the conversation into a TCP data packet and forwards the TCP data packet to the numerical control system;
s24, waiting for the response of the numerical control system;
s25, the communication library transfers the received response to a distribution mechanism of the communication library for processing;
and S26, the distribution mechanism of the communication library searches the controls and the session registry according to the session ID, finds one or a group of equivalent controls and returns responses to the controls in sequence. Wherein, the process of searching the control and the session registry is as follows: firstly, according to a session ID, finding a group of equivalent sessions in a session ID and session mapping table, and then obtaining a group of equivalent controls according to the respective 'belonged controls' of the equivalent sessions;
and S27, the control analyzes the response data, updates the display of the control and finishes the communication process.
In addition, the communication library also comprises a timeout management mechanism. When the communication library sends the TCP data packet to the numerical control system end, the response of the numerical control system end is not received within the set overtime time, namely the overtime is achieved. At this moment, the communication library timeout management mechanism can select whether to retransmit according to the retransmission mark of the session; if not, then the control is handed over to the timeout mechanism for processing. The timeout mechanism of the control presets different processing modes, such as an edit box, according to different control types, and because new data cannot be successfully submitted, the current display of the control is updated by using old data to update.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (2)

1. The utility model provides a numerical control system automatic communication mechanism, automatic communication mechanism include the host computer and with the numerical control system that the host computer carries out the communication which characterized in that: the upper computer is provided with a control library, the control library is provided with a plurality of types of registrable controls and a communication library for maintaining communication between the registrable controls and the numerical control system, the registrable controls complete initialization of the registrable controls and establishment and registration of sessions by registering in the communication library, and a session ID is generated during session registration and is stored in the session; the registered control realizes full-automatic communication between the control and the numerical control system and self-updating of the control through a communication library and the numerical control system by a session interaction mechanism; the communication library is provided with a control and a session registry, and the control and the session registry records the mapping relation between the control and the session and the mapping relation between the session ID and the session; the session interaction mechanism is realized by the following steps:
s11, the control generates an interactive request during the operation of the user;
s12, the control searches own session, finds the session corresponding to the interaction and sends the session to a communication library;
s13, the communication library receives the conversation of the control, encapsulates the data of the conversation into a TCP data packet and forwards the TCP data packet to the numerical control system;
s14, waiting for the response of the numerical control system;
s15, the communication library transfers the received response to a distribution mechanism of the communication library for processing;
s16, the distribution mechanism of the communication library searches for 'controls and a session registry' according to the session ID, finds one or a group of equivalent controls and returns responses to the controls in sequence;
and S17, the control analyzes the response data, updates the display of the control and finishes the process.
2. The automatic communication mechanism of claim 1, wherein: the communication library also comprises a timeout management mechanism; the timeout management mechanism is as follows: when the communication library sends the TCP data packet to the numerical control system end, if the response of the numerical control system is not received within the set overtime time, the response is overtime; at this moment, the communication library timeout management mechanism can select whether to retransmit according to the retransmission flag of the session; if not, then the control is handed over to the timeout mechanism for processing.
CN202010472809.XA 2020-05-29 2020-05-29 Automatic communication mechanism of numerical control system Active CN111726395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010472809.XA CN111726395B (en) 2020-05-29 2020-05-29 Automatic communication mechanism of numerical control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010472809.XA CN111726395B (en) 2020-05-29 2020-05-29 Automatic communication mechanism of numerical control system

Publications (2)

Publication Number Publication Date
CN111726395A CN111726395A (en) 2020-09-29
CN111726395B true CN111726395B (en) 2023-01-31

Family

ID=72565235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010472809.XA Active CN111726395B (en) 2020-05-29 2020-05-29 Automatic communication mechanism of numerical control system

Country Status (1)

Country Link
CN (1) CN111726395B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6490624B1 (en) * 1998-07-10 2002-12-03 Entrust, Inc. Session management in a stateless network system
CN102214090A (en) * 2010-04-09 2011-10-12 腾讯科技(深圳)有限公司 Method and device for creating session window

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7600024B2 (en) * 2006-03-31 2009-10-06 Microsoft Corporation Restricting device access per session
US9742843B2 (en) * 2013-03-14 2017-08-22 Thoughtwire Holdings Corp. Method and system for enabling data sharing between software systems

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6490624B1 (en) * 1998-07-10 2002-12-03 Entrust, Inc. Session management in a stateless network system
CN102214090A (en) * 2010-04-09 2011-10-12 腾讯科技(深圳)有限公司 Method and device for creating session window

Also Published As

Publication number Publication date
CN111726395A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
KR100795929B1 (en) Method and system for transmitting defined-query to database
US7779404B2 (en) Managing network device configuration using versioning and partitioning
CN102236705B (en) The fine granularity that data base resets synchronizes
JP4774372B2 (en) Complex computing across heterogeneous computer systems
US6453321B1 (en) Structured cache for persistent objects
CN101957832B (en) Unified window support for event stream data management
US20100185645A1 (en) Structured query language syntax rewriting
CN109144994A (en) Index updating method, system and relevant apparatus
KR100671506B1 (en) A mobile middleware and a method for processing business logic using it
US20140229504A1 (en) System and method for managing database in data distribution service
WO2009012696A1 (en) A communication device batch configuration managing method and the apparatus thereof
US11151098B2 (en) Enabling multi-tenant access to respective isolated data sets organized using different application schemas
US7020659B2 (en) System and method for managing bi-directional relationships between objects
US11210277B2 (en) Distributing and processing streams over one or more networks for on-the-fly schema evolution
CN102355499B (en) Cloud computing system
CN104731943A (en) Server and data processing method
US7958154B2 (en) Apparatus, system, and method for command manager support for pluggable data formats
US20070214113A1 (en) Method to support multiple data sources connecting to a persistent object
CN111726395B (en) Automatic communication mechanism of numerical control system
CN100423492C (en) Management information base processing method
US6493710B1 (en) Method and apparatus for reducing costs associated with manipulating data
CN110737506A (en) virtual machine image version management method
CN103458121A (en) System and method capable of realizing Android version compatibility and third-party function compatibility
EP1548588A2 (en) Method of translating computer program code, communications system and network management entity therefor
CN102033871B (en) Method and system for sharing public resource data by multiple information systems

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
GR01 Patent grant
GR01 Patent grant