CN111932862A - Communication method with lower computer, upper computer, computer system and storage medium - Google Patents
Communication method with lower computer, upper computer, computer system and storage medium Download PDFInfo
- Publication number
- CN111932862A CN111932862A CN202010732828.1A CN202010732828A CN111932862A CN 111932862 A CN111932862 A CN 111932862A CN 202010732828 A CN202010732828 A CN 202010732828A CN 111932862 A CN111932862 A CN 111932862A
- Authority
- CN
- China
- Prior art keywords
- computer
- lower computer
- handle
- interface handle
- upper 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
Images
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08C—TRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
- G08C19/00—Electric signal transmission systems
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a communication method with a lower computer, the upper computer, a computer system and a storage medium. The communication method between the upper computer and the lower computer in the execution embodiment of the upper computer can be communicated with a plurality of lower computers at the same time, has a multichannel measurement function, and is convenient for setting a plurality of groups of experiments to achieve the purposes of comparison and the like when being applied to experimental data acquisition. Compared with the prior art, the method does not need to use a complex and expensive multi-channel testing instrument, and does not need to arrange a plurality of upper computers to correspond to the lower computers one by one, thereby saving the experiment cost. The invention is widely applied to the technical field of computers.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a communication method with a lower computer, an upper computer, a computer system and a storage medium.
Background
The scientific measuring instrument generally adopts an upper computer and a lower computer structure, namely a hardware circuit with circuit driving and data acquisition functions is used as the lower computer, equipment with interaction and data processing functions is used as the upper computer, and the upper computer and the lower computer are connected through communication protocols such as a USB bus, an RS-232 interface, Ethernet, Bluetooth or WiFi and the like. In the structure, the lower computer is used for measuring and collecting data generated in a scientific experiment, and the data is uploaded to the upper computer for processing.
The existing scientific measuring instrument communicates in a one-to-one mode, namely, an upper computer is only connected with a lower computer. In the use process of the scientific measuring instrument, there is a requirement of multi-channel testing, for example, a large number of comparison experiments are often required when experimental parameters are optimized and tested, and data acquisition is required for a plurality of experiments at the same time, so that the measuring instrument is required to be equipped for each experiment, and each measuring instrument is used as a lower computer and needs to be equipped with an upper computer such as a computer, which requires higher use cost and maintenance cost. Some multi-channel test instruments are on the market, and rely on complex hardware circuits and software algorithms to realize the function of multi-channel test, so the multi-channel test instruments are expensive and complex to maintain.
Disclosure of Invention
In view of at least one of the above technical problems, it is an object of the present invention to provide a communication method with a lower computer, an upper computer, a computer system, and a storage medium.
In one aspect, an embodiment of the present invention includes a method for communicating with a lower computer, including:
acquiring an interface handle;
registering the interface handle;
performing connection test with the corresponding lower computer through the interface handle;
and when the connection test result is successful, communicating with the lower computer through the interface handle.
Further, the obtaining the interface handle includes:
when the interface handle is stored in the memory area, the interface handle is read from the memory area.
Further, the obtaining the interface handle includes:
searching from a connected device list according to the hardware identification code;
when connected equipment corresponding to the hardware identification code is searched, storing an instance path of the connected equipment into an array;
acquiring a file handle of the connected equipment;
when the connected equipment is not opened, acquiring the corresponding interface handle through the file handle of the connected equipment;
and identifying the connected equipment as a lower computer corresponding to the interface handle.
Further, the hardware identification code is a supplier identification code and/or a product identification code.
Further, the communication method with the lower computer further comprises the following steps:
and when the connection test result is successful, identifying the lower computer.
Further, the communication method with the lower computer further comprises the following steps:
and when the communication is completed or fails, releasing the interface handle.
On the other hand, the embodiment of the invention further comprises an upper computer, which comprises a memory and a processor, wherein the memory is used for storing at least one program, and the processor is used for loading the at least one program to execute the communication method with the lower computer in the embodiment.
In another aspect, an embodiment of the present invention further includes a computer system, including:
an upper computer in the embodiment;
a plurality of lower computers; each lower computer is connected with the upper computer.
Furthermore, each lower computer has a data acquisition function.
In another aspect, the present invention further includes a storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used for executing the method of the embodiment when being executed by the processor.
The invention has the beneficial effects that: the communication method between the upper computer and the lower computer in the execution embodiment of the upper computer can be communicated with a plurality of lower computers at the same time, has a multichannel measurement function, and is convenient for setting a plurality of groups of experiments to achieve the purposes of comparison and the like when being applied to experimental data acquisition. Compared with the prior art, the method does not need to use a complex and expensive multi-channel testing instrument, and does not need to arrange a plurality of upper computers to correspond to the lower computers one by one, thereby saving the experiment cost.
Drawings
FIG. 1 is a schematic diagram of a hardware architecture of a communication method between an application and a lower computer in the embodiment;
FIG. 2 is a flow chart of a communication method with a lower computer in the embodiment;
FIG. 3 is a schematic diagram of a computer system according to an embodiment.
Detailed Description
In this embodiment, a hardware architecture of the communication method between the application and the lower computer may be as shown in fig. 1. Fig. 1 includes an upper computer and a plurality of lower computers, in which a solid line indicates that the upper computer and the corresponding lower computer are connected on a physical layer or a link layer and the lower computer is in an opened operating state, a dotted line indicates that the upper computer and the corresponding lower computer are connected but the lower computer is not opened, and no arrow connection between the upper computer and the lower computer indicates that the upper computer and the lower computer are not connected. For example, when the upper computer is a personal computer with a USB interface, the lower computer is an instrument with a data acquisition function, such as an electrochemical measurement instrument, the upper computer and the lower computer may be connected through the USB interface, and specifically, the upper computer and the plurality of lower computers may be connected through a USB hub.
The upper computer can run a Windows operating system XP or a more advanced version of the Windows operating system. The Windows operating system provides a bottom driver for the USB device, and interfaces with the bottom driver are I/O request packets (IRPs), and the Windows operating system provides a function interface for the application. A driver must be built between them that passes messages, i.e., device drivers, between the underlying driver and the Win32 application. Under the support of the device driver, function interfaces such as ReadFile (), WriteFile (), and the like can be called to transfer upper computer requests to lower computer devices so as to complete data communication of the upper computers and the lower computers. The lower computer is used as hardware, the hardware ID is used as the identifier of the device, all USB devices have supplier identification codes (VID) and product identification codes (PID) according to the specification of a USB specification, and most hardware devices with the same model have the same VID and PID because the repeated VID and PID can not bring serious influence on the use of products. The driver establishes communication between the hardware equipment of the lower computer and the program of the upper computer.
In a USB drive in a Windwos kernel, a driver is called by an upper computer application program firstly to obtain a file handle of a USB device for communication through a USB, and a drive file, namely a drive file handle (file handle), is opened through a path of the drive file, wherein the file handle is a unique identification basis for the opened drive file and is different after being opened every time. The communication of the upper computer and the lower computer can be realized through the drive file handle, when the drive file is closed, the upper computer and the lower computer are completely disconnected, and if the drive file handle is connected again, the drive file handle needs to be opened again. Because the USB equipment drive is more complicated, Windows operating system platform mostly adopts Microsoft corporation's Windwos DDK to drive and develop, and from Windows operating system XP SP, the Windows operating system integrates the general WinUSB Device drive and WinUSB.dll connected with OS bottom layer and application layer, can complete the communication transmission of USB data rapidly, and can self-define the relevant function interface to meet different function needs through WinUSB. WinUSB communication steps mainly include 1, acquiring a file handle of equipment; 2. registering WinUSB handles of subsequent operations through file handles; 3 querying the USB descriptor of the device; 4 sending the control transmission to the default termination point; 5 sending an I/O request; 6 releasing the device handle.
In this embodiment, referring to fig. 2, the method of communicating with the lower computer includes:
s1, acquiring an interface handle;
s2, registering the interface handle;
s3, performing connection test with the corresponding lower computer through the interface handle;
and S4, when the connection test result is successful, communicating with the lower computer through the interface handle.
In this embodiment, the host computer executes steps S1-S4.
In performing step S1, the upper computer may perform the following substeps:
s101, detecting whether an interface handle of a lower computer is stored in a storage area of the upper computer, if so, executing a step S102, otherwise, executing steps S103-S106.
S102, reading an interface handle from a storage area;
s103, searching from a connected equipment list stored in the upper computer according to the hardware identification code; wherein the hardware identification code can be a supplier identification code, a product identification code or a combination of the supplier identification code and the product identification code;
s104, when the upper computer searches the connected equipment corresponding to the hardware identification code from the connected equipment list, storing the example path of the connected equipment into an array; wherein the size of the array is configured to be the same as the number of connected devices;
s105, acquiring a file handle (file handle);
s106, traversing the array, judging whether the connected equipment which is not opened exists in the connected equipment corresponding to the example path in the array, and if so, acquiring a corresponding interface handle through the file handle of the connected equipment which is not opened; after the interface handle is obtained, the connected device pointed by the interface handle becomes the lower computer in this embodiment.
In this embodiment, when the upper computer runs a Windows operating system XP or an operating system of a more advanced version, the interface handle in steps S101 to S106 is correspondingly specifically a WinUSB interface handle, and the file handle may also be referred to as a drive file handle.
Since the devices of the same model generally have the same vendor identification code and product identification code in actual use, the plurality of connected devices searched from the connected device list are the devices of the same model when step S103 is executed in the present embodiment.
The upper computer executes step S2 and registers the interface handle obtained by executing steps S101 to S106.
The upper computer executes step S3, and performs a connection test with the lower computer to which the interface handle points by executing the interface handle obtained in steps S101 to S106; the result of the connection test may be successful or unsuccessful.
And the upper computer executes the step S4 to determine the result of the connection test. And when the connection test result is successful, the upper computer communicates with the lower computer pointed by the interface handle. Optionally, when the connection test result is successful, the upper computer and the lower computer are identified through the USB protocol, for example, the upper computer and the lower computer are identified with each other, and the communication between the upper computer and the lower computer may be prevented from causing interference to other devices through the identification.
The result of the upper computer executing the step S4 may be that communication is completed or communication fails, and the upper computer may then execute the following steps:
and S5, releasing the interface handle.
In this embodiment, the steps S1-S5 may be set to a complete communication process, that is, when the lower computer with the data collection function collects data and uploads the data, the upper computer executes the steps S1-S5 once.
In this embodiment, by executing steps S1 to S4, when the upper computer has a plurality of connected devices, these connected devices can be identified as lower computers and communicate with them. The WinUSB can be improved to obtain a computer program for executing the steps S1-S4, and the computer program is installed in the upper computer to control the upper computer to execute the steps S1-S4, so that the communication between the upper computer and the multiple lower computers can be realized without modifying hardware equipment.
In this embodiment, the computer program for executing steps S1 to S4 may be stored in a memory, and the memory may be installed in the upper computer and connected to the processor of the upper computer, so that the processor of the upper computer loads the computer program to execute the communication method with the lower computer in this embodiment.
In this embodiment, as shown in fig. 3, the upper computer and the plurality of lower computers may constitute a computer system, wherein at least some of the lower computers are connected to the upper computer, and at least some of the lower computers connected to the upper computer are kept in an open working state. The upper computer executes the communication method with the lower computer in this embodiment.
The lower computer in fig. 3 has a data collection function, and may be an electrochemical apparatus, for example, for collecting experimental data in an electrochemical experiment.
The upper computer executes the communication method with the lower computer in the embodiment, can simultaneously communicate with a plurality of lower computers, has the function of multi-channel measurement, and is convenient for setting a plurality of groups of experiments to achieve the purposes of comparison and the like when being applied to experimental data acquisition. Compared with the prior art, the method does not need to use a complex and expensive multi-channel testing instrument, and does not need to arrange a plurality of upper computers to correspond to the lower computers one by one, thereby saving the experiment cost.
In the present embodiment, a storage medium in which a processor-executable program is stored, the processor-executable program being configured to execute a communication method with a lower computer in the embodiment when executed by a processor, achieves the same technical effects as those described in the embodiment.
It should be noted that, unless otherwise specified, when a feature is referred to as being "fixed" or "connected" to another feature, it may be directly fixed or connected to the other feature or indirectly fixed or connected to the other feature. Furthermore, the descriptions of upper, lower, left, right, etc. used in the present disclosure are only relative to the mutual positional relationship of the constituent parts of the present disclosure in the drawings. As used in this disclosure, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. In addition, unless defined otherwise, all technical and scientific terms used in this example have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this embodiment, the term "and/or" includes any combination of one or more of the associated listed items.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element of the same type from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present disclosure. The use of any and all examples, or exemplary language ("e.g.," such as "or the like") provided with this embodiment is intended merely to better illuminate embodiments of the invention and does not pose a limitation on the scope of the invention unless otherwise claimed.
It should be recognized that embodiments of the present invention can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer readable memory. The methods may be implemented in a computer program using standard programming techniques, including a non-transitory computer-readable storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner, according to the methods and figures described in the detailed description. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.
Further, operations of processes described in this embodiment can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described in this embodiment (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be embodied in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optically read and/or write storage medium, RAM, ROM, or the like, such that it may be read by a programmable computer, which when read by the storage medium or device, is operative to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described in this embodiment includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
A computer program can be applied to input data to perform the functions described in the present embodiment to convert the input data to generate output data that is stored to a non-volatile memory. The output information may also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including particular visual depictions of physical and tangible objects produced on a display.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiment, and any modifications, equivalent substitutions, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention as long as the technical effects of the present invention are achieved by the same means. The invention is capable of other modifications and variations in its technical solution and/or its implementation, within the scope of protection of the invention.
Claims (10)
1. A communication method with a lower computer is characterized by comprising the following steps:
acquiring an interface handle;
registering the interface handle;
performing connection test with the corresponding lower computer through the interface handle;
and when the connection test result is successful, communicating with the lower computer through the interface handle.
2. The method according to claim 1, wherein the obtaining of the interface handle comprises:
when the interface handle is stored in the memory area, the interface handle is read from the memory area.
3. The method according to claim 1, wherein the obtaining of the interface handle comprises:
searching from a connected device list according to the hardware identification code;
when connected equipment corresponding to the hardware identification code is searched, storing an instance path of the connected equipment into an array;
acquiring a file handle of the connected equipment;
when the connected equipment is not opened, acquiring the corresponding interface handle through the file handle of the connected equipment;
and identifying the connected equipment as a lower computer corresponding to the interface handle.
4. The method of communicating with a lower computer according to claim 1, wherein the hardware identification code is a vendor identification code and/or a product identification code.
5. The method of communicating with a lower computer according to claim 1, further comprising:
and when the connection test result is successful, identifying the lower computer.
6. The method of communicating with a lower computer according to claim 1, further comprising:
and when the communication is completed or fails, releasing the interface handle.
7. A host computer comprising a memory for storing at least one program and a processor for loading the at least one program to perform the method of any one of claims 1 to 6.
8. A computer system, comprising:
the upper computer of claim 7;
a plurality of lower computers; each lower computer is connected with the upper computer.
9. The computer system of claim 8, wherein each of the lower computers has data acquisition capabilities.
10. A storage medium having stored therein a program executable by a processor, wherein the program executable by the processor is adapted to perform the method of any one of claims 1-6 when executed by the processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010732828.1A CN111932862A (en) | 2020-07-27 | 2020-07-27 | Communication method with lower computer, upper computer, computer system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010732828.1A CN111932862A (en) | 2020-07-27 | 2020-07-27 | Communication method with lower computer, upper computer, computer system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111932862A true CN111932862A (en) | 2020-11-13 |
Family
ID=73315667
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010732828.1A Pending CN111932862A (en) | 2020-07-27 | 2020-07-27 | Communication method with lower computer, upper computer, computer system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111932862A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117724920A (en) * | 2024-02-07 | 2024-03-19 | 四川赛狄信息技术股份公司 | Test method and device of embedded equipment, upper computer and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070273655A1 (en) * | 2006-05-24 | 2007-11-29 | I-Hau Yeh | Remote Controller with a Communication Function |
CN203224999U (en) * | 2013-03-19 | 2013-10-02 | 王保栋 | Remote control and temperature acquisition system based on power line carrier communication technology |
CN109710469A (en) * | 2018-11-29 | 2019-05-03 | 中国气象局气象探测中心 | It is a kind of for testing the method and system of meteorological observation equipment |
CN110855447A (en) * | 2019-10-23 | 2020-02-28 | 郑州众智科技股份有限公司 | Communication connection method, communication method and generator set controller communication system |
-
2020
- 2020-07-27 CN CN202010732828.1A patent/CN111932862A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070273655A1 (en) * | 2006-05-24 | 2007-11-29 | I-Hau Yeh | Remote Controller with a Communication Function |
CN203224999U (en) * | 2013-03-19 | 2013-10-02 | 王保栋 | Remote control and temperature acquisition system based on power line carrier communication technology |
CN109710469A (en) * | 2018-11-29 | 2019-05-03 | 中国气象局气象探测中心 | It is a kind of for testing the method and system of meteorological observation equipment |
CN110855447A (en) * | 2019-10-23 | 2020-02-28 | 郑州众智科技股份有限公司 | Communication connection method, communication method and generator set controller communication system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117724920A (en) * | 2024-02-07 | 2024-03-19 | 四川赛狄信息技术股份公司 | Test method and device of embedded equipment, upper computer and medium |
CN117724920B (en) * | 2024-02-07 | 2024-04-26 | 四川赛狄信息技术股份公司 | Test method and device of embedded equipment, upper computer and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10956291B2 (en) | Method, computer apparatus, and user interface for performing automatic test upon storage devices | |
US8549478B2 (en) | Graphical user interface input element identification | |
US8732529B2 (en) | Mobile communication terminal capable of testing application and method thereof | |
EP3379358B1 (en) | Control system, control device, control program, and control method | |
EP2042875A2 (en) | Sample processing apparatus and data processing apparatus | |
CN111198790A (en) | Robot testing method, robot testing device and robot | |
CN101996117B (en) | Computer test system and method thereof | |
CN103383669A (en) | Method for identifying universal serial bus host, and electronic device thereof | |
US20170277614A1 (en) | Intelligent test robot system | |
CN109165156B (en) | Bar code testing method and device and terminal equipment | |
US11915149B2 (en) | System for managing calculation processing graph of artificial neural network and method of managing calculation processing graph by using the same | |
US20140052403A1 (en) | Test system and test method thereof | |
CN111932862A (en) | Communication method with lower computer, upper computer, computer system and storage medium | |
CN115981927A (en) | Device and method for batch testing of USB (universal serial bus) equipment based on windows system | |
CN112181479A (en) | Method and device for determining difference between code file versions and electronic equipment | |
CN100498732C (en) | Universal serial bus device test system and its method | |
CN102760086A (en) | Data detection control method and device based on flexible testing technology | |
US20230102127A1 (en) | Systems and methods for identifying samples of interest by comparing aligned time-series measurements | |
CN114679402A (en) | Method and device for testing communication protocol between upper computer and lower computer of medical robot | |
CN114740825A (en) | Data measurement calibration method and device, vehicle controller, vehicle and medium | |
CN107390638B (en) | Machine tool machining method, terminal and numerical control machine tool | |
CN108312179B (en) | Elastic part testing method and device based on mechanical arm and mechanical arm | |
CN107220053B (en) | BIOS management method and electronic equipment | |
US9779012B1 (en) | Dynamic and global in-system debugger | |
EP3182320B1 (en) | Technique for inspecting a host computer |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210120 Address after: 510000 building 4, No.6 Huafeng Road, Huangpu District, Guangzhou City, Guangdong Province Applicant after: Guangdong Dingcheng Electronic Technology Co.,Ltd. Address before: 510006 No. 230 West Ring Road, University of Guangdong, Guangzhou Applicant before: Guangzhou University |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201113 |