CN111930080A - Multi-serial port communication control method and device and upper computer - Google Patents
Multi-serial port communication control method and device and upper computer Download PDFInfo
- Publication number
- CN111930080A CN111930080A CN202010667832.4A CN202010667832A CN111930080A CN 111930080 A CN111930080 A CN 111930080A CN 202010667832 A CN202010667832 A CN 202010667832A CN 111930080 A CN111930080 A CN 111930080A
- Authority
- CN
- China
- Prior art keywords
- serial port
- information
- control
- area
- computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004891 communication Methods 0.000 title claims abstract description 127
- 238000000034 method Methods 0.000 title claims abstract description 74
- 230000003993 interaction Effects 0.000 claims abstract description 134
- 238000012544 monitoring process Methods 0.000 claims abstract description 24
- 230000005540 biological transmission Effects 0.000 claims description 95
- 238000012360 testing method Methods 0.000 claims description 14
- 230000006870 function Effects 0.000 claims description 5
- 230000001276 controlling effect Effects 0.000 description 16
- 230000000875 corresponding effect Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 12
- 238000004590 computer program Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 101000746134 Homo sapiens DNA endonuclease RBBP8 Proteins 0.000 description 8
- 101000969031 Homo sapiens Nuclear protein 1 Proteins 0.000 description 8
- 102100021133 Nuclear protein 1 Human genes 0.000 description 8
- 238000012545 processing Methods 0.000 description 6
- 230000004044 response Effects 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000002349 favourable effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
- G05B19/4185—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
- G05B19/4186—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication by protocol, e.g. MAP, TOP
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/30—Nc systems
- G05B2219/33—Director till display
- G05B2219/33139—Design of industrial communication system with expert system
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Manufacturing & Machinery (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Information Transfer Systems (AREA)
Abstract
The embodiment of the invention discloses a multi-serial port communication control method, a device and an upper computer, wherein the method comprises the following steps: monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer to obtain control information input in at least one serial port control area, wherein the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling one serial port; transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information; the communication control of a plurality of serial ports is realized through a single human-computer interaction interface, the purpose of simplifying the operation of the serial ports is achieved, and the accuracy rate of the serial port control is improved.
Description
Technical Field
The invention relates to the technical field of industrial automation, in particular to a multi-serial port communication control method, a multi-serial port communication control system and an upper computer.
Background
With the development of computer technology and communication technology, conventional industrial control is transitioned to automation control. In industrial automation control, an upper computer is connected with industrial equipment through a serial port, and the industrial equipment is controlled to carry out corresponding operations such as information acquisition, program upgrading, equipment debugging and the like. The upper computer can be simultaneously provided with a plurality of serial ports, and serial port parameter configuration and serial port communication control are carried out through upper computer control software.
Wherein, the upper computer control software only supports one serial port control. If a plurality of serial ports are controlled to communicate, two common control modes are respectively as follows: firstly, the current control software is closed to reselect the serial port name, but the operation is complicated, and misoperation is easy to occur during reselection; secondly, a plurality of control software are started, but the interfaces are too many, the operation is complicated, and misoperation is easy to occur between switching. Therefore, the two serial port communication control modes have the problems of complex operation and easy misoperation.
Disclosure of Invention
The embodiment of the invention discloses a multi-serial port communication control method, a multi-serial port communication control system and an upper computer, which are used for solving the problems of complex operation and easy misoperation in serial port communication control in the prior art.
In view of this, a first aspect of the embodiments of the present invention discloses a method for controlling multi-serial port communication, which may include:
monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer, and acquiring control information input in at least one serial port control area, wherein the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling a serial port;
and transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
According to the embodiment of the invention, a single human-computer interaction interface is used for controlling a plurality of serial ports, the serial port control operation is simplified, and the accuracy of serial port control is improved.
Optionally, in some embodiments of the present invention, the serial port control area includes a first serial port option area and an information area, and the monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer to obtain control information input in at least one of the serial port control areas includes:
monitoring all serial port control areas in a human-computer interaction interface of an upper computer to obtain control information input in at least one serial port control area, wherein serial port information included in the control information is obtained according to selection operation of the target serial port in the first serial port option area, and information to be transmitted included in the control information is obtained according to input operation of the information area.
Through the embodiment, the option area and the information area are divided for each serial port control area, so that the observability and the visual angle effect of a human-computer interaction interface can be improved.
Optionally, in some embodiments of the present invention, the serial port control area further includes a serial port initialization key, and the method further includes:
after the serial port information is obtained according to the selection operation of the target serial port in the first serial port option area, if the triggering operation of a user on the serial port initialization key is detected, initializing the target serial port;
and distributing a serial port class and establishing a protocol transmission class for the target serial port.
Through the embodiment, after the target serial port is selected by a user, the target serial port is locked through initialization, and then the same serial port cannot be selected in other serial port control areas, so that control errors caused by simultaneous selection of the same serial port are avoided, and serial port classes are distributed and protocol transmission classes are established for the same serial port, so that serial port communication is realized.
Optionally, in some embodiments of the present invention, after allocating a serial port class and creating a protocol transmission class for the target serial port, the method further includes:
and carrying out communication test on the target serial port by utilizing the created protocol transmission class.
Through the embodiment, the serial port can be ensured to be communicated.
Optionally, in some embodiments of the present invention, before the serial port information included in the control information is a serial port number, and the monitoring monitors a plurality of serial port control areas of a human-computer interaction interface of the upper computer, and obtains the control information input in at least one of the serial port control areas, the method further includes:
traversing each serial port of the upper computer, and detecting the connection state of the serial ports, wherein the connection state comprises connected state and unconnected state;
and counting the number of the serial ports of the connected serial ports and distributing serial port numbers for the connected serial ports.
Through the implementation mode, the connected serial port is accurately detected, and an accurate basis is provided for setting a human-computer interaction interface.
Optionally, in some embodiments of the present invention, after counting the number of serial ports of the connected serial port and allocating serial port numbers to the connected serial port, the method further includes:
setting the human-computer interaction interface according to the number of the serial ports and the serial port number, wherein the human-computer interaction interface comprises serial port control areas with the number equal to that of the serial ports, and one serial port control area is used for controlling one connected serial port of the upper computer;
and outputting and displaying the human-computer interaction interface on the upper computer.
Through the implementation mode, the intuitive human-computer interaction interface capable of controlling the plurality of serial ports individually is provided for the user.
Optionally, in some embodiments of the present invention, after the target serial port indicated by the serial port information transmits the information to be transmitted to the lower computer, the method further includes:
receiving reply information fed back by the lower computer to the information to be transmitted;
and outputting and displaying the reply information in the information area.
Through the embodiment, the reply information is displayed on the human-computer interaction interface, so that a user can visually know the processing result of the lower computer, the next operation of the user or the upper computer is facilitated, and the improvement on the intelligence of serial port communication control is facilitated.
Optionally, in some embodiments of the present invention, the information area includes an information sending area and an information receiving area, and the information to be transmitted included in the control information is obtained according to an input operation of the information sending area;
the outputting and displaying the reply information in the information area comprises:
and outputting and displaying the reply information in the information receiving area.
Through the embodiment, the target serial port can be selected through the first serial port option area, the information to be transmitted is obtained in the monitoring information sending area, the feedback reply information is displayed in the information receiving area, an intuitive communication control interface is provided, and a user can know the result of each step.
Optionally, in some embodiments of the present invention, the human-computer interaction interface further includes an automatic button, and the method further includes:
monitoring the triggering operation of the user on the automatic button;
and responding to the triggering operation of the automatic button, and transmitting preset transmission information through a serial port corresponding to the serial port control area.
Through above-mentioned embodiment, preserve and predetermine transmission information, realize going out predetermineeing transmission information through each serial ports transmission through the automatic button, realize the unified control to all serial ports that have connected.
Optionally, in some embodiments of the present invention, if the information to be transmitted is any sub-series transmission information in series transmission information, after the information receiving area outputs and displays the reply information, the method further includes:
and when the information to be transmitted is not the last piece of sub-series transmission information in the series of transmission information, if the reply information indicates that the next piece of sub-series transmission information can be sent, acquiring the next piece of sub-series transmission information of the information to be transmitted from the series of transmission information, taking the next piece of sub-series transmission information as new information to be transmitted, and executing the step of transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
Through the embodiment, the control intelligence of the upper computer can be improved, and the control operation is simplified.
The second aspect of the embodiments of the present invention discloses a multi-serial port communication control apparatus, which may include:
the system comprises a human-computer interaction module, a serial port control module and a control module, wherein the human-computer interaction module is used for monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer and acquiring control information input in at least one serial port control area, the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling one serial port;
and the control module is used for transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
By implementing the device, a single human-computer interaction interface controls a plurality of serial ports, the serial port control operation is simplified, and the accuracy of serial port control is improved.
Optionally, in some embodiments of the present invention, the apparatus further includes:
the serial port control area comprises a first serial port option area and an information area, the control module is used for monitoring a plurality of serial port control areas of a human-computer interaction interface of the upper computer, and the mode of obtaining control information input in at least one serial port control area specifically comprises the following steps:
the control module is used for monitoring all serial port control areas in a human-computer interaction interface of the upper computer and obtaining control information input in at least one serial port control area, wherein serial port information included in the control information is obtained according to selection operation of the target serial port in the first serial port option area, and information to be transmitted included in the control information is obtained according to input operation of the information area.
By the device in the embodiment, the option area and the information area are divided for each serial port control area, so that the observability and the visual angle effect of a human-computer interaction interface can be improved.
Optionally, in some embodiments of the present invention, the serial port control area further includes a serial port initialization key, and the apparatus further includes:
the communication module is used for initializing the target serial port if the triggering operation of the user on the serial port initialization key is detected after the human-computer interaction module obtains the serial port information according to the selection operation of the target serial port in the first serial port option area; and distributing a serial port class and establishing a protocol transmission class for the target serial port.
Through the device in the embodiment, after a user selects a target serial port, the target serial port is locked through initialization, and then the same serial port cannot be selected in other serial port control areas, so that control errors caused by simultaneous selection of the same serial port are avoided, and serial port classes are distributed and protocol transmission classes are established for the same serial port, so that serial port communication is realized.
Optionally, in some embodiments of the present invention, the control module is further configured to, after the communication module allocates a serial port class to the target serial port and creates a protocol transmission class, perform a communication test on the target serial port by using the created protocol transmission class.
Through the device of the embodiment, the serial port can be ensured to be communicated through a communication test.
Optionally, in some embodiments of the present invention, the serial port information included in the control information is a serial port number;
the communication module is also used for traversing each serial port of the upper computer and detecting the connection state of the serial ports before the human-computer interaction module monitors a plurality of serial port control areas of a human-computer interaction interface of the upper computer and obtains control information input in at least one serial port control area, wherein the connection state comprises connected state and unconnected state; and counting the number of the serial ports of the connected serial ports and distributing serial port numbers to the connected serial ports.
Through the device of the embodiment, the connected serial port is accurately detected, and an accurate basis is provided for setting a human-computer interaction interface.
Optionally, in some embodiments of the present invention, the human-computer interaction module is further configured to set the human-computer interaction interface according to the number of serial ports and serial port numbers after the communication module counts the number of the serial ports of the connected serial ports and allocates the serial port numbers to the connected serial ports, where the human-computer interaction interface includes serial port control areas equal to the number of the serial ports, and one serial port control area is used to control one connected serial port of the upper computer; and outputting and displaying the human-computer interaction interface on the upper computer.
Through the device of the embodiment, an intuitive human-computer interaction interface capable of controlling a plurality of serial ports individually is provided for a user.
Optionally, in some embodiments of the present invention, the control module is further configured to receive reply information fed back by the lower computer to the information to be transmitted after the information to be transmitted is transmitted to the lower computer through the target serial port indicated by the serial port information;
and the human-computer interaction module is also used for outputting and displaying the reply information in the information area.
Through the device of the embodiment, reply information is displayed on the human-computer interaction interface, so that a user can visually know the processing result of the lower computer, the next operation of the user or the upper computer is facilitated, and the improvement of the intelligence of serial port communication control is facilitated.
Optionally, in some embodiments of the present invention, the information area includes an information sending area and an information receiving area, and the information to be transmitted included in the control information is obtained according to an input operation of the information sending area;
the mode that the human-computer interaction module is used for outputting and displaying the reply information in the information area is specifically as follows:
and the human-computer interaction module is used for outputting and displaying the reply information in the information receiving area.
Through the embodiment, the target serial port can be selected through the first serial port option area, the information to be transmitted is obtained in the monitoring information sending area, the feedback reply information is displayed in the information receiving area, an intuitive communication control interface is provided, and a user can know the result of each step.
Optionally, in some embodiments of the present invention, the human-computer interaction interface further includes an automatic button;
the human-computer interaction module is also used for monitoring the triggering operation of the user on the automatic button;
and the control module is also used for responding to the touch operation of the automatic button and transmitting preset transmission information through a serial port corresponding to the serial port control area.
Through above-mentioned embodiment, preserve and predetermine transmission information, realize going out predetermineeing transmission information through each serial ports transmission through the automatic button, realize the unified control to all serial ports that have connected.
Optionally, in some embodiments of the present invention, if the information to be transmitted is any sub-series transmission information in series transmission information;
the control module is further configured to, after the human-computer interaction module outputs and displays the reply information in the information receiving area, when the to-be-transmitted information is not the last piece of sub-series transmission information in the series transmission information, if the reply information indicates that a next piece of sub-series transmission information can be sent, obtain a next piece of sub-series transmission information of the to-be-transmitted information from the series transmission information, use the next piece of sub-series transmission information as new to-be-transmitted information, and execute the step of transmitting the to-be-transmitted information to a lower computer through a target serial port indicated by the serial port information.
Through the embodiment, the control intelligence of the upper computer can be improved, and the control operation is simplified.
The third aspect of the embodiments of the present invention discloses an upper computer, which may include:
the multi-serial port communication control device according to any one of the second aspect of the embodiments of the present invention.
The fourth aspect of the embodiments of the present invention discloses an upper computer, which may include:
a memory storing executable program code;
a processor coupled with the memory;
an input unit and a display unit coupled with the processor;
the processor calls the executable program code stored in the memory to execute the multi-serial port communication control method disclosed by the first aspect of the embodiment of the invention;
the input unit is used for receiving information input by a user or generating key signal input related to user setting and function control of the upper computer;
the display unit is used for displaying information input by a user or information provided for the user and various menu interfaces.
A fifth aspect of the present invention discloses a computer-readable storage medium storing a computer program, where the computer program enables a computer to execute the method for controlling multi-serial communication disclosed in the first aspect of the present invention.
A sixth aspect of the embodiments of the present invention discloses a computer program product, which, when run on a computer, causes the computer to perform some or all of the steps of any one of the methods of the first aspect.
A seventh aspect of the present embodiment discloses an application publishing platform, where the application publishing platform is configured to publish a computer program product, where when the computer program product runs on a computer, the computer is caused to perform part or all of the steps of any one of the methods in the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, control information input in at least one serial port control area is obtained by monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer, the control information at least comprises serial port information and information to be transmitted, one serial port control area is used for controlling one serial port, and then the corresponding information to be transmitted is transmitted to a lower computer through a target serial port indicated by the serial port information; therefore, a single man-machine interaction interface can control a plurality of serial ports, the single man-machine interaction interface can be visually presented in front of a user, unified operation of the user is facilitated, the purpose of simplifying serial port operation is achieved, and the accuracy of serial port control is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of communication between an upper computer and a machine station according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a human-computer interaction interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a human-computer interaction interface according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of a human-computer interaction interface provided by a third embodiment of the present invention;
fig. 5 is a flowchart of a single multi-serial communication control system or multi-serial communication control software controlling a multi-channel process according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a multi-serial port communication control method according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a multi-serial port communication control method according to a second embodiment of the present invention;
fig. 8 is a schematic flowchart of a multi-serial port communication control method according to a third embodiment of the present invention;
fig. 9 is a schematic structural diagram of a multi-serial port communication control apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an upper computer according to an embodiment of the present invention.
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, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first" and "second" in the description and claims of the present invention are used for distinguishing different objects, and are not used for describing a specific order. The terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The Serial port is a short name for a Serial Interface (Serial Interface), also called a Serial communication Interface or a Serial communication Interface (generally referred to as a COM Interface), and is an extended Interface adopting a Serial communication method to sequentially transmit data bit by bit.
Referring to fig. 1 to 5, as shown in fig. 1, fig. 1 is a schematic view of a communication between an upper computer and a machine according to an embodiment of the present invention. In fig. 1, the upper computer may be provided with a plurality of serial ports (2 or more than 2), which are named as serial port a, serial port B, serial port C, serial port D, - - -, and serial port N, respectively, according to serial port class. The machines are also provided with a plurality of machines, namely a machine A, a machine B, a machine C, a machine D, a machine N. The upper computer can control a machine table through a serial port, so that the upper computer can control the machine tables equal to the serial ports of the upper computer, the machine table A and the machine table B are controlled through the serial port A, and the machine table C and the machine table D are controlled through the serial port D, and the machine table N is controlled through the serial port N.
Furthermore, a multi-serial communication control system or multi-serial communication control software is installed on the upper computer, the upper computer controls the communication of a plurality of serial ports through a single multi-serial communication control system or the multi-serial communication control software, the serial communication between the upper computer and the machine is achieved, namely the control of the communication of the plurality of serial ports is integrated through the single multi-serial communication control system or the multi-serial communication control software, and the serial control operation is simplified. Specifically, the multi-serial communication control system or the multi-serial communication control software provides a man-machine interaction interface for a user to intuitively and conveniently control the multi-serial port.
As shown in fig. 2, fig. 2 is a schematic diagram of a human-computer interaction interface according to an embodiment of the present invention, in fig. 2, a human-computer interaction interface 10 includes two serial port control areas 20, and each serial port control area 20 includes a first serial port option area 30, a serial port initialization key (Point Int) of a serial port, a baud rate adjustment slider, an information area, and an information sending button. In fig. 2, according to the serial port class assignment, the serial port to be controlled in the left serial port control area 20 is named as a serial port a, and the serial port to be controlled in the right serial port control area 20 is named as a serial port B.
The first serial port option area 30 provides a pull-down serial port option list, and a user can select a target serial port from the pull-down serial port option list, specifically, the user pops up the pull-down serial port option list by clicking a triangle position, and the pull-down serial port option list includes serial port numbers of a plurality of connected serial ports of an upper computer, and since fig. 2 provides two serial port control areas 20, two connected serial ports of the upper computer, such as COM1 and COM2, are correspondingly controlled.
For a serial port initialization key (Point Int) of a serial port, after a user selects a target serial port through a pull-down serial port option list, initializing the selected target serial port by clicking the serial port initialization key (Point Int); when the target serial port is initialized, a serial port initialization class/serial port initialization function is called to complete target serial port initialization. It should be noted that after the serial port is initialized, the target serial port is locked, so that the target serial port cannot be selected in other serial port control areas of the human-computer interaction interface, that is, the same serial port cannot be selected in a plurality of serial port control areas of the human-computer interaction interface. After target serial port initialization is carried out, serial port classes are distributed and protocol communication classes are established for the target serial ports, if COM2 is selected by a user in the serial port control area 20 on the left side, COM2 is named as a serial port A, the serial port A is the serial port class distributed by COM2, COM1 is selected in the serial port control area 20 on the right side, COM1 is named as a serial port B, and the serial port B is the serial port class distributed by COM 1; otherwise, if the user selects COM1 in the serial control area 20 on the left, the COM1 is named as serial a, where the serial a is a serial class allocated to COM1, then the COM2 is selected in the serial control area 20 on the right, the COM2 is named as serial B, and the serial B is a serial class allocated to COM 2.
The serial port control area 20 provides a baud rate adjusting slide bar, and the baud rate can be adjusted by the baud rate adjusting slide bar, but in the embodiment of the present invention, preferably, the baud rate of the serial port is set at the initial setting, and the human-computer interaction interface 10 presents a set fixed baud rate value, that is, the baud rate adjustment cannot be performed on the human-computer interaction interface 10.
The information area is used for acquiring and displaying information to be transmitted which needs to be transmitted to the lower computer, and meanwhile, the information area is also used for displaying received reply information sent by the upper computer. Further, the user can transmit the information to be transmitted to the lower computer by triggering the information sending button.
Further, the human-computer interaction interface 10 in fig. 2 further includes an automatic button (AUTO), which may be used to implement intelligent control of the serial port. When all the machines need to be controlled in a unified manner, an automatic button (AUTO) can be selected, and the preset transmission information is automatically triggered to be sent to the corresponding lower computer through the serial port controlled by each serial port control area 20, so that unified control is realized, and the intelligence is improved.
The human-machine interface 10 may further include a STOP button (STOP), a ok button, and a cancel button. Wherein a STOP button (STOP) when pressed will force the communication being performed to STOP transmission; the confirming button is used for confirming the operation of the human-computer interaction interface, and if a serial port initialization key of a serial port is pressed down, the confirming button can be further pressed down so as to further confirm the initialization operation on the upper computer and avoid misoperation; the cancel button is used for canceling the operation of the human-computer interaction interface, for example, after the serial port initialization button of the serial port is pressed, if the cancel button is pressed, the upper computer can determine that the user cancels the serial port initialization operation, and at the moment, the serial port initialization operation does not occur.
As shown in fig. 3, fig. 3 is a schematic view of a human-machine interaction interface according to a second embodiment of the present invention, the human-machine interaction interface 10 shown in fig. 3 is obtained by performing optimization on the basis of the human-machine interaction interface 10 shown in fig. 2, and the human-machine interaction interface 10 shown in fig. 3 is different from the human-machine interaction interface shown in fig. 2 in that:
in fig. 3, the information area includes an information sending area 40 and an information receiving area, the information sending button is disposed around the information sending area, the information sending area 40 may be an information input field, and a user may input information to be transmitted through the information input field and send the information to be transmitted through the information sending button; the information receiving area is used for displaying the received reply information.
As shown in fig. 4, fig. 4 is a schematic view of a human-computer interaction interface according to a third embodiment of the present invention, where the human-computer interaction interface 10 shown in fig. 4 is obtained by changing the human-computer interaction interface 10 shown in fig. 2, and as can be understood by referring to fig. 2 and fig. 4, the serial port control regions in fig. 2 are laid out horizontally, and the serial port control regions in fig. 4 are laid out vertically. Of course, it can also be understood that the serial port control areas for horizontal typesetting in fig. 3 may be further changed to obtain serial port control areas for vertical typesetting, and a schematic diagram is not given here. It can be further understood that the embodiment of the present invention only provides three human-computer interaction interfaces shown in fig. 2 to fig. 4, and any human-computer interaction interface which is obtained by performing optimization or transformation on the human-computer interaction interface shown in fig. 2, fig. 3, or fig. 4 and can implement the technical solution of the present invention belongs to the protection scope of the present invention.
With reference to fig. 2 to 4, in fig. 1, the multiple serial port communication control system or the multiple serial port communication control software includes a plurality of functional modules, which are respectively: the system comprises a machine platform identification module, a man-machine interaction module, a communication module and a control module. The specific functional implementation of each functional module will be described later, and will not be described herein again.
In addition, the machine can also comprise a machine control module for controlling the machine to complete communication with the upper computer and complete corresponding action events.
As shown in fig. 5, fig. 5 is a flowchart for controlling a multi-channel process by a single multi-serial communication control system or multi-serial communication control software according to an embodiment of the present invention; fig. 5 shows a process flow obtained on the basis of fig. 1, and the serial ports a to N control the processes 1 to N in a one-to-one correspondence manner, which means that in the embodiment of the present invention, a single upper computer, a single multi-serial port communication control system, or multi-serial port communication control software can control a plurality of serial ports, so that serial port operation can be simplified, and operation convenience can be improved.
With the above introduction, embodiments of the present invention provide a method, a system, and an upper computer for controlling multi-serial port communication, which can simplify serial port control operations, and are beneficial to improving operation convenience and improving control accuracy.
The technical solution of the present invention will be described in detail by the following specific examples.
Referring to fig. 6, fig. 6 is a schematic flow chart of a multi-serial port communication control method according to an embodiment of the present invention; in fig. 6, the multi-serial port communication control method may include:
601. monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer, and obtaining control information input in at least one serial port control area, wherein the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling one serial port.
The serial port information includes a serial port number, and certainly, may also include a serial port identifier; the information to be transmitted is information transmitted to the lower computer by the upper computer through the serial port, and can be data (such as debugging parameters and communication data), control instructions and the like.
The upper computer is provided with a multi-serial port communication control system or multi-serial port communication control software, and after the multi-serial port communication control system or the multi-serial port communication control software is opened, the upper computer outputs a man-machine interaction interface which is provided for a user to realize man-machine interaction between the upper computer and the user. Illustratively, the human-computer interface 10 and the serial control area 20 are shown in fig. 2 to 4.
It should be noted that, the obtaining of the control information input in at least one serial port control area refers to: at least one piece of control information is obtained, and one piece of control information is obtained from one serial port control area.
602. And transmitting the information to be transmitted to a lower computer through the target serial port indicated by the serial port information.
Correspondingly, the lower computer receives the information to be transmitted. The lower computer can be a machine table or other external equipment such as a USB flash disk.
Therefore, the serial port control areas can be correspondingly arranged on the single human-computer interaction interface through the embodiment, and one serial port control area is used for realizing communication control over one serial port.
Referring to fig. 7, fig. 7 is a schematic flowchart of a multi-serial port communication control method according to a second embodiment of the present invention; in fig. 7, the serial port control area includes a first serial port option area and an information area, and the multi-serial port communication control method may include:
701. monitoring all serial port control areas in a human-computer interaction interface of the upper computer to obtain control information input in at least one serial port control area, wherein serial port information included in the control information is obtained according to selection operation of a target serial port in a first serial port option area, and information to be transmitted included in the control information is obtained according to input operation of an information area.
For example, as shown in fig. 2 or fig. 4, the user may select a target serial port through the pull-down serial port option list in the first serial port option area, and input information to be transmitted in the information area.
702. And transmitting the information to be transmitted to a lower computer through the target serial port indicated by the serial port information.
Correspondingly, the lower computer receives the information to be transmitted. The lower computer can be a machine table or other external equipment such as a USB flash disk.
703. And receiving reply information fed back by the lower computer to the information to be transmitted.
After receiving the information to be transmitted, the lower computer performs corresponding processing, and feeds back reply information to the upper computer after the processing is finished. For example, the information to be transmitted is a debugging parameter, and after the lower computer completes debugging according to the debugging parameter, the lower computer feeds back reply information indicating completion to the upper computer, or for example, the information to be transmitted is only data transmitted to the lower computer, and the lower computer only needs to complete reception, and after the lower computer receives the data, the lower computer feeds back reply information indicating that the data has been successfully received to the upper computer.
704. And outputting and displaying the reply information in the information area.
After the reply information fed back by the lower computer is received, the reply information is displayed in the information area, so that a user can visually know the processing result of the lower computer aiming at the information to be transmitted, and the next operation of the user or the upper computer is facilitated.
As an optional implementation manner, the information area may include an information sending area and an information receiving area, and further, the upper computer may obtain information to be transmitted according to an input operation of the information sending area, and the received reply information is displayed in the information receiving area. The information to be transmitted and the reply information are displayed separately, so that the method can be more visual, and the visual effect of a human-computer interaction interface can be improved.
Illustratively, the human-computer interaction interface 10 as shown in FIG. 3 includes an information sending area 40 and an information receiving area.
Further optionally, the information to be transmitted may be any sub-series transmission information in series transmission information, the user may input the information to be transmitted in the information sending area manually or the upper computer directly extracts and displays the information from the series transmission information in the information sending area, and then, after the reply information is output and displayed in the information receiving area, when the information to be transmitted is not the last sub-series transmission information in the series transmission information, if the reply information indicates that the next sub-series transmission information can be sent, the next sub-series transmission information of the information to be transmitted is obtained from the series transmission information, and the next sub-series transmission information is used as new information to be transmitted, and the process goes to execute step 702. The process may be ended until it is determined that the information to be transmitted is the last sub-series transmission information of the series transmission information.
According to the embodiment of the invention, the next control instruction can be intelligently triggered, and the control intelligence is improved.
Further, if the information to be transmitted is a control instruction, the reply information is instruction response information, the control instruction is used for instructing a lower computer to execute a target action event, and the instruction response information comprises an execution result of the lower computer on the target action event; furthermore, after the reply information is output and displayed in the information receiving area, when the control instruction is not the last control instruction in the series of control instructions, if the execution result included in the instruction response information indicates that the lower computer has successfully executed the target action event, the next control instruction is obtained and used as new information to be transmitted, and the process is shifted to the execution step 702 until the control instruction is judged to be the last control instruction in the series of control instructions, and the process can be ended; the intelligent control of the control instruction can be realized, the control efficiency is improved, and the control operation is simplified.
Further, the communication data is divided into a plurality of sub-packets, if the to-be-transmitted information is one sub-packet in the communication data, after the reply information is output and displayed in the information receiving area, if the to-be-transmitted information is not the last sub-packet in the communication data, and if the reply information indicates that the to-be-transmitted information has been successfully received, the next sub-packet of the to-be-transmitted information is obtained from the communication data, and the next sub-packet is used as new to-be-transmitted information, and the process goes to step 702. The process may be ended until it is determined that the information to be transmitted is the last subpacket of the communication data. The sequential transmission of communication data can be realized, the intellectualization is realized, and the control operation is simplified.
Therefore, by implementing the embodiment, the input of the user can be monitored through the human-computer interaction interface, the reply information fed back by the lower computer can be displayed, the user can conveniently and visually know the processing result of the lower computer, and the user or the upper computer can conveniently perform the next operation; and, still be favorable to improving control intellectuality.
Referring to fig. 8, fig. 8 is a schematic flow chart of a multi-serial port communication control method according to a third embodiment of the present invention; fig. 8 is explained from the perspective of an upper computer, and as shown in fig. 8, the multi-serial port communication control method may include:
801. and starting software by the upper computer.
It should be noted that the software herein refers to the multi-serial communication control system or the multi-serial communication control software described above.
After the software is installed, the upper computer performs initialization setting of the software, where the initialization setting includes setting of a baud rate of the serial port, setting of a check bit, a data bit and a stop bit of the serial port, setting of a transmission protocol, and the like.
802. And traversing each serial port by the upper computer, and detecting the connection state of the serial ports, wherein the connection state comprises connected state and unconnected state.
After the upper computer starts software, serial port connection state detection is carried out so as to detect a connected serial port and allocate a serial port number to the serial port.
For example, the upper computer comprises 4 serial ports including COM11, COM22, COM33 and COM44, it should be noted that 11, 22, 33 and 44 are only used for distinguishing the difference of the serial ports, but are not serial port numbers referred by the present invention. The COM11, the COM22 and the COM33 are connected to the machine through USB lines respectively, the COM44 is not used, and the COM11, the COM22 and the COM33 are detected to be connected through traversing the COM11, the COM22, the COM33 and the COM44, and the COM44 is not connected.
803. And the upper computer counts the number of the serial ports of the connected serial ports and distributes serial port numbers for the connected serial ports.
And sequentially distributing serial port numbers for the serial ports according to the traversal sequence. To illustrate with the example in step 802, COM11, COM22, and COM33 are connected serial ports, and if COM11, COM22, and COM33 are traversed in sequence, serial port numbers are assigned to three serial ports in sequence: the serial numbers of the COM11, the COM22 and the COM33 are COM1, COM2 and COM3 respectively, namely the serial number of the COM11 is COM1, the serial number of the COM22 is COM2 and the serial number of the COM33 is COM 3.
804. The upper computer sets a human-computer interaction interface according to the number of the serial ports and the serial port number, the human-computer interaction interface comprises serial port control areas with the number equal to that of the serial ports, and one serial port control area is used for controlling one connected serial port of the upper computer.
After the number of the serial ports connected with the serial ports is obtained and the serial port numbers are distributed, the setting of the human-computer interaction interface can be carried out, wherein only the connected serial ports are arranged on the human-computer interaction interface.
805. And the upper computer outputs and displays a human-computer interaction interface.
806. And the upper computer monitors the selection operation of the user on a first option area in the target serial port control area to obtain the serial port number of the target serial port.
807. And if the upper computer detects the triggering operation of the user on the serial port initialization key, initializing the target serial port, and allocating a serial port class and establishing a protocol transmission class for the target serial port.
If a user selects a target serial port to be controlled and then presses the serial port initialization key, the target serial port is initialized, and a serial port class and a protocol transmission class are allocated to the target serial port. After the target serial port is initialized, the target serial port is locked, and then the serial port can not be selected by other serial port control areas, so that repeated selection is avoided, and control errors are avoided.
And further distributing a serial port class and creating a protocol transmission class for the target serial port, wherein the distribution of the serial port class is equivalent to that the target serial port has a name of the target serial port, the communication protocol setting of the serial port is already finished when software is initialized, and the setting of the target serial port is finished only by calling a mode setting function.
Illustratively, the serial port initialization key is the "initialization" key shown in fig. 2 to 4.
808. And the upper computer performs communication test on the target serial port by using the created protocol transmission class.
Optionally, the performing, by the upper computer, a communication test on the target serial port by using the created protocol transmission class may include: and the upper computer sends a preset test instruction to the corresponding lower computer through the target serial port by using the created protocol transmission class, and after receiving feedback information of the lower computer aiming at the test instruction, the communication between the upper computer and the lower computer can be realized through the target serial port, so that the communication test is completed.
It should be noted that, after the communication test is completed, the machine identification module in the upper computer establishes a correspondence between the serial port class of the target serial port and the lower computer, and during subsequent communication, corresponding data transmission and reception are completed based on the established correspondence.
809. And the upper computer monitors the input of the target serial port control area to obtain information to be transmitted.
Optionally, a determination button and a cancel button are further disposed in the human-computer interaction interface, as shown in fig. 2 to 4, after the user inputs the information to be transmitted, the user may further determine the previous input operation through the determination button, or the user cancels the previous input operation through the cancel button.
810. And if the upper computer detects that the trigger operation of the information sending button is detected, the information to be transmitted is transmitted to the lower computer through the target serial port.
After the communication test is finished, if the information to be transmitted is monitored, the lower computer corresponding to the target serial port is accurately identified according to the established corresponding relation, and then the information is transmitted.
811. And the upper computer receives the reply information fed back by the lower computer.
812. And the upper computer displays the reply information in the information area.
Optionally, the human-computer interaction interface further includes a stop button, and the currently executed operation may be stopped by the stop button, and if the information to be transmitted is being transmitted, the transmission is stopped, resulting in a transmission failure.
In some implementable modes, the human-computer interaction interface further comprises an automatic button, and the automatic button is monitored in real time, and the method specifically comprises the following steps:
monitoring the triggering operation of a user on an automatic button;
and responding to the triggering operation of the automatic button, and transmitting preset transmission information through a serial port corresponding to the serial port control area.
The preset transmission information is transmitted through the serial port corresponding to the serial port control area, and specifically means that: and transmitting preset transmission information through the serial port corresponding to each serial port control area to realize the unified control of the connected serial ports arranged on all the human-computer interaction interfaces.
Exemplary, automatic buttons as shown in fig. 2-4.
It can be understood that when the user is monitored to trigger the automatic button at any time, automatic transmission is carried out, unified control of all serial ports is achieved, and the mode is favorable for executing the same control on all lower computers.
Through implementing the embodiment, a plurality of serial port control areas can be correspondingly arranged on a single human-computer interaction interface, and one serial port control area is used for realizing communication control of one serial port, so that the single human-computer interaction interface can control a plurality of serial ports, the single human-computer interaction interface can be visually presented in front of a user, the unified operation of the user is facilitated, the purpose of simplifying the serial port operation is achieved, and the accuracy of serial port control is favorably improved.
As shown in fig. 9, which is a schematic structural diagram of a multi-serial port communication control apparatus according to an embodiment of the present invention, the multi-serial port communication control apparatus may include:
the human-computer interaction module 901 is used for monitoring a plurality of serial port control areas of a human-computer interaction interface of the upper computer and obtaining control information input in at least one serial port control area, wherein the control information at least comprises serial port information and information to be transmitted, and one serial port control area corresponds to one serial port;
the control module 902 is configured to transmit the information to be transmitted through the target serial port indicated by the serial port information.
Optionally, the interaction implementation mode of the human-computer interaction module 901 may specifically be a human-computer interaction mode of a keyboard and a screen, or a human-computer interaction mode in which touch screen input and display are integrated, or a future human-computer interaction mode of brain-computer interaction, which is not limited in this invention.
The multi-serial communication control device may be the multi-serial communication control system or the multi-serial communication control software mentioned in the above embodiments.
Through implementing above-mentioned device, can correspond on single man-machine interface and set up a plurality of serial ports control area, a serial ports control area is used for realizing the communication control to a serial ports, consequently, the steerable a plurality of serial ports of single man-machine interface, single man-machine interface can present in the user directly perceivedly, and convenience of customers unified operation reaches the purpose of simplifying serial ports operation to be favorable to improving the rate of accuracy of serial ports control.
Optionally, the serial port control area includes a first serial port option area and an information area, the control module 902 is configured to monitor a plurality of serial port control areas of a human-computer interaction interface of the upper computer, and the manner of obtaining control information input in at least one serial port control area specifically includes:
the control module 902 is configured to monitor all serial port control areas in a human-computer interaction interface of the upper computer, and obtain control information input in at least one serial port control area, where the serial port information included in the control information is obtained according to a selection operation on a target serial port in the first serial port option area, and the information to be transmitted included in the control information is obtained according to an input operation in the information area.
Optionally, the control module 902 is further configured to receive reply information fed back by the lower computer to the information to be transmitted after transmitting the information to be transmitted to the lower computer through the target serial port indicated by the serial port information;
the human-computer interaction module 901 is further configured to output and display the reply information in an information area.
Optionally, the information area includes an information sending area and an information receiving area, and the information to be transmitted included in the control information is obtained according to an input operation of the information sending area; the manner for the human-computer interaction module 901 to output and display the reply information in the information area is specifically as follows:
the human-computer interaction module 901 is configured to output and display the reply information in the information receiving area.
Optionally, the multi-serial port communication control apparatus shown in fig. 9 further includes a communication module 903.
The communication module 903 is configured to initialize the target serial port if a trigger operation of a user on the serial port initialization key is detected after the human-computer interaction module 901 obtains serial port information according to a selection operation of the target serial port in the first serial port option area; and distributing a serial port class and establishing a protocol transmission class for the target serial port.
Optionally, the control module 902 is further configured to, after the communication module 903 allocates a serial port class and creates a protocol transmission class for the target serial port, perform a communication test on the target serial port by using the created protocol transmission class.
After the target serial port is initialized, the target serial port is locked, namely the target serial port is selected, and the target serial port cannot be used in other serial port control areas. Before communication, the target serial port can normally communicate through communication test.
Optionally, the serial port information included in the control information is a serial port number;
furthermore, the communication module 903 is further configured to traverse each serial port of the upper computer and detect a connection state of the serial ports before the human-computer interaction module 901 monitors a plurality of serial port control areas of a human-computer interaction interface of the upper computer and obtains control information input in at least one serial port control area, where the connection state includes connected and unconnected states; and counting the number of the serial ports of the connected serial ports and distributing serial port numbers for the connected serial ports.
Through the embodiment, when the multi-serial port communication control system or the multi-serial port communication control software is opened, the serial port connection state is detected, and the number of the serial ports connected with the serial ports is counted, so that a feasible man-machine interaction interface for multi-serial port communication control is provided for a user.
Optionally, the human-computer interaction module 901 is further configured to set a human-computer interaction interface according to the number of serial ports and the serial port number after the communication module 903 counts the number of the serial ports of the connected serial ports and allocates the serial port number to the connected serial ports, where the human-computer interaction interface includes serial port control areas equal to the number of the serial ports, and one serial port control area is used to control one connected serial port of the upper computer; and outputting and displaying a human-computer interaction interface on the upper computer.
Optionally, the human-computer interaction interface further comprises an automatic button; furthermore, the human-computer interaction module 901 is further configured to monitor a triggering operation of the user on the automatic button;
the control module 902 is further configured to transmit preset transmission information through a serial port corresponding to the serial port control area in response to the touch operation of the automatic button.
Optionally, if the information to be transmitted is any sub-series transmission information in the series transmission information;
furthermore, the control module 902 is further configured to, after the human-computer interaction module 901 outputs and displays the reply information in the information receiving area, when the to-be-transmitted information is not the last piece of sub-series transmission information in the series transmission information, if the reply information indicates that the next piece of sub-series transmission information can be sent, obtain the next piece of sub-series transmission information of the to-be-transmitted information from the series transmission information, use the next piece of sub-series transmission information as new to-be-transmitted information, and perform the step of transmitting the to-be-transmitted information to the lower computer through the target serial port indicated by the serial port information.
Fig. 10 is a schematic structural diagram of an upper computer according to an embodiment of the present invention; the upper computer shown in fig. 10 may include: the multi-serial communication control device may specifically be the multi-serial communication control device described in the embodiment of fig. 9, and for further description of the multi-serial communication control device, reference is made to the description of the embodiment of the device, which is not repeated herein.
An embodiment of the present invention further provides a terminal device, which may include:
a memory storing executable program code;
a processor coupled to the memory;
an input unit and a display unit coupled with the processor;
the processor calls an executable program code stored in the memory and executes the multi-serial port communication control method executed by the upper computer in each method embodiment;
an input unit for receiving information input by a user or generating a key signal input related to user setting and function control of an upper computer;
and a display unit for displaying information input by a user or information provided to the user and various menu interfaces.
The embodiment of the invention also discloses a computer readable storage medium which stores a computer program, wherein the computer program enables a computer to execute the multi-serial port communication control method executed by the upper computer in each method embodiment.
The embodiment of the invention also discloses a computer program product, which when running on a computer, causes the computer to execute part or all of the steps of any one of the method embodiments.
The embodiment of the invention also discloses an application publishing platform, which is used for publishing the computer program product, wherein when the computer program product runs on a computer, the computer is enabled to execute part or all of the steps of any one of the method embodiments.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
The method, the device and the upper computer for controlling the multi-serial port communication disclosed by the embodiment of the invention are described in detail, a specific embodiment is applied in the method to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (23)
1. A multi-serial port communication control method is characterized by comprising the following steps:
monitoring a plurality of serial port control areas of a man-machine interaction interface of an upper computer, and acquiring control information input in at least one serial port control area, wherein the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling a serial port;
and transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
2. The method according to claim 1, wherein the serial port control area comprises a first serial port option area and an information area, and the monitoring of the plurality of serial port control areas of the human-computer interaction interface of the upper computer to obtain the control information input in at least one serial port control area comprises:
monitoring all serial port control areas in a human-computer interaction interface of an upper computer to obtain control information input in at least one serial port control area, wherein serial port information included in the control information is obtained according to selection operation of the target serial port in the first serial port option area, and information to be transmitted included in the control information is obtained according to input operation of the information area.
3. The method of claim 2, wherein the serial port control area further comprises a serial port initialization key, the method further comprising:
after the serial port information is obtained according to the selection operation of the target serial port in the first serial port option area, if the triggering operation of a user on the serial port initialization key is detected, initializing the target serial port;
and distributing a serial port class and establishing a protocol transmission class for the target serial port.
4. The method of claim 3, wherein after assigning the serial class and creating the protocol transport class for the target serial port, the method further comprises:
and carrying out communication test on the target serial port by utilizing the created protocol transmission class.
5. The method according to any one of claims 1 to 4, wherein the serial port information included in the control information is serial port numbers, a plurality of serial port control areas of a human-computer interaction interface of the upper computer are monitored, and before the control information input in at least one serial port control area is obtained, the method further comprises:
traversing each serial port of the upper computer, and detecting the connection state of the serial ports, wherein the connection state comprises connected state and unconnected state;
and counting the number of the serial ports of the connected serial ports and distributing serial port numbers for the connected serial ports.
6. The method of claim 5, wherein after counting the number of serial ports of the connected serial port and assigning serial port numbers to the connected serial port, the method further comprises:
setting the human-computer interaction interface according to the number of the serial ports and the serial port number, wherein the human-computer interaction interface comprises serial port control areas with the number equal to that of the serial ports, and one serial port control area is used for controlling one connected serial port of the upper computer;
and outputting and displaying the human-computer interaction interface on the upper computer.
7. The method according to claim 2, wherein after the information to be transmitted is transmitted to a lower computer through the target serial port indicated by the serial port information, the method further comprises:
receiving reply information fed back by the lower computer to the information to be transmitted;
and outputting and displaying the reply information in the information area.
8. The method according to claim 7, wherein the information area includes an information sending area and an information receiving area, and the control information includes information to be transmitted obtained according to an input operation of the information sending area;
the outputting and displaying the reply information in the information area comprises:
and outputting and displaying the reply information in the information receiving area.
9. The method of claim 2, 7 or 8, wherein the human-machine interface further comprises an auto button, the method further comprising:
monitoring the triggering operation of the user on the automatic button;
and responding to the triggering operation of the automatic button, and transmitting preset transmission information through a serial port corresponding to the serial port control area.
10. The method according to claim 8, wherein if the information to be transmitted is any sub-series transmission information in a series transmission information, after the information receiving area outputs and displays the reply information, the method further comprises:
and when the information to be transmitted is not the last piece of sub-series transmission information in the series of transmission information, if the reply information indicates that the next piece of sub-series transmission information can be sent, acquiring the next piece of sub-series transmission information of the information to be transmitted from the series of transmission information, taking the next piece of sub-series transmission information as new information to be transmitted, and executing the step of transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
11. A multi-serial port communication control device is characterized by comprising:
the system comprises a human-computer interaction module, a serial port control module and a control module, wherein the human-computer interaction module is used for monitoring a plurality of serial port control areas of a human-computer interaction interface of an upper computer and acquiring control information input in at least one serial port control area, the control information at least comprises serial port information and information to be transmitted, and one serial port control area is used for controlling one serial port;
and the control module is used for transmitting the information to be transmitted to a lower computer through a target serial port indicated by the serial port information.
12. The device of claim 11, wherein the serial port control area comprises a first serial port option area and an information area, the control module is configured to monitor a plurality of serial port control areas of a human-computer interaction interface of the upper computer, and the manner of obtaining the control information input in at least one of the serial port control areas is specifically:
the control module is used for monitoring all serial port control areas in a human-computer interaction interface of the upper computer and obtaining control information input in at least one serial port control area, wherein serial port information included in the control information is obtained according to selection operation of the target serial port in the first serial port option area, and information to be transmitted included in the control information is obtained according to input operation of the information area.
13. The apparatus of claim 13, wherein the serial control area further comprises a serial initialization key, the apparatus further comprising:
the communication module is used for initializing the target serial port if the triggering operation of the user on the serial port initialization key is detected after the human-computer interaction module obtains the serial port information according to the selection operation of the target serial port in the first serial port option area; and distributing a serial port class and establishing a protocol transmission class for the target serial port.
14. The apparatus of claim 13, wherein:
the control module is further used for performing communication test on the target serial port by using the created protocol transmission class after the communication module allocates the serial port class and creates the protocol transmission class for the target serial port.
15. The device according to any one of claims 11 to 14, wherein the serial port information included in the control information is a serial port number;
the communication module is also used for traversing each serial port of the upper computer and detecting the connection state of the serial ports before the human-computer interaction module monitors a plurality of serial port control areas of a human-computer interaction interface of the upper computer and obtains control information input in at least one serial port control area, wherein the connection state comprises connected state and unconnected state; and counting the number of the serial ports of the connected serial ports and distributing serial port numbers to the connected serial ports.
16. The apparatus of claim 15, wherein:
the man-machine interaction module is also used for setting the man-machine interaction interface according to the serial port number and the serial port number after the communication module counts the serial port number of the connected serial port and distributes the serial port number to the connected serial port, the man-machine interaction interface comprises serial port control areas with the same serial port number as the serial port number, and one serial port control area is used for controlling one connected serial port of the upper computer; and outputting and displaying the human-computer interaction interface on the upper computer.
17. The apparatus of claim 12, wherein:
the control module is also used for receiving reply information fed back by the lower computer to the information to be transmitted after the information to be transmitted is transmitted to the lower computer through the target serial port indicated by the serial port information;
and the human-computer interaction module is also used for outputting and displaying the reply information in the information area.
18. The apparatus according to claim 17, wherein the information area includes an information sending area and an information receiving area, and the control information includes information to be transmitted obtained according to an input operation of the information sending area;
the mode that the human-computer interaction module is used for outputting and displaying the reply information in the information area is specifically as follows:
and the human-computer interaction module is used for outputting and displaying the reply information in the information receiving area.
19. The apparatus according to claim 12, 17 or 18, wherein the human-machine interface further comprises an auto button;
the human-computer interaction module is also used for monitoring the triggering operation of the user on the automatic button;
and the control module is also used for responding to the touch operation of the automatic button and transmitting preset transmission information through a serial port corresponding to the serial port control area.
20. The apparatus according to claim 18, wherein if the information to be transmitted is any sub-series transmission information in a series transmission information;
the control module is further configured to, after the human-computer interaction module outputs and displays the reply information in the information receiving area, when the to-be-transmitted information is not the last piece of sub-series transmission information in the series transmission information, if the reply information indicates that a next piece of sub-series transmission information can be sent, obtain a next piece of sub-series transmission information of the to-be-transmitted information from the series transmission information, use the next piece of sub-series transmission information as new to-be-transmitted information, and execute the step of transmitting the to-be-transmitted information to a lower computer through a target serial port indicated by the serial port information.
21. A host computer, comprising:
a multi-serial port communication control apparatus according to any of claims 11 to 20.
22. A host computer, comprising:
a memory storing executable program code;
a processor coupled with the memory;
an input unit and a display unit coupled with the processor;
the processor calls the executable program code stored in the memory for executing the multi-serial port communication control method according to any one of claims 1 to 10;
the input unit is used for receiving information input by a user or generating key signal input related to user setting and function control of the upper computer;
the display unit is used for displaying information input by a user or information provided for the user and various menu interfaces.
23. A computer-readable storage medium comprising instructions characterized in that: when run on a computer, cause the computer to perform the multi-serial port communication control method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010667832.4A CN111930080A (en) | 2020-07-13 | 2020-07-13 | Multi-serial port communication control method and device and upper computer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010667832.4A CN111930080A (en) | 2020-07-13 | 2020-07-13 | Multi-serial port communication control method and device and upper computer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111930080A true CN111930080A (en) | 2020-11-13 |
Family
ID=73312959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010667832.4A Pending CN111930080A (en) | 2020-07-13 | 2020-07-13 | Multi-serial port communication control method and device and upper computer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111930080A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115460109A (en) * | 2022-11-11 | 2022-12-09 | 广州粤芯半导体技术有限公司 | Connection state detection method and device, computer equipment and readable storage medium |
CN116165352A (en) * | 2023-04-23 | 2023-05-26 | 河北华清环境科技集团股份有限公司 | Quality control system of flue gas on-line monitor |
-
2020
- 2020-07-13 CN CN202010667832.4A patent/CN111930080A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115460109A (en) * | 2022-11-11 | 2022-12-09 | 广州粤芯半导体技术有限公司 | Connection state detection method and device, computer equipment and readable storage medium |
CN116165352A (en) * | 2023-04-23 | 2023-05-26 | 河北华清环境科技集团股份有限公司 | Quality control system of flue gas on-line monitor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3896916A1 (en) | Network distribution method for household appliance, household appliance, mobile terminal and storage medium | |
CN107908296B (en) | KVM control method, device, storage medium and computer equipment | |
CN111930080A (en) | Multi-serial port communication control method and device and upper computer | |
CN105259806B (en) | Controller upgrading method and system, master controller and slave controller | |
CN109960445A (en) | Icon moving method, apparatus and system | |
CN104808940B (en) | Inter-terminal data transmission method and device | |
CN104571893A (en) | Method and device for handling notices in notification bar | |
CN111614523A (en) | Control method of household appliance, intelligent terminal and household appliance | |
CN105808042B (en) | A kind of information processing method and electronic equipment | |
CN110943894A (en) | Message testing method and device | |
CN113064683B (en) | Display method and system for control interface of electric control equipment, terminal and electric control equipment | |
CN106775727A (en) | A kind of control method and device of mobile terminal | |
CN105094650A (en) | Data transmission method, data transmission device and electronic device | |
CN113093753A (en) | Method, device, terminal and storage medium for remotely controlling multiple robots on same screen | |
CN111158246A (en) | Intelligent household appliance control system, device, method, medium and equipment | |
CN105892318B (en) | Terminal device control method, equipment and system | |
CN105931452B (en) | Method, apparatus, system and the terminal device of terminal device counter infrared ray signal interference | |
CN113973133A (en) | USB equipment redirection method and device, electronic equipment and storage medium | |
EP1895794B1 (en) | Remote management system and method for portable electronic devices | |
CN106599142B (en) | Data resource receiving method and device | |
CN105635948A (en) | Data sending method and data sending module | |
CN112583981A (en) | Method and device for displaying screen after screen breaking | |
CN210883797U (en) | Material sorting cabinet | |
KR101245624B1 (en) | Operating state display method of remote control for touchscreen mobile telephone | |
JP2019087208A (en) | Control system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20201113 |
|
WD01 | Invention patent application deemed withdrawn after publication |