Upper computer system configuration method and device and upper computer system
By providing a common upper computer system configuration method among devices and using excel table configuration files to achieve automated configuration, the problems of high maintenance costs and insufficient flexibility of upper computer system in the prior art are solved, and lower maintenance and development costs and higher readability and scalability are achieved.
Patent Information
- Application Number
- CN202411777191.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, each debugging computer system can only debug communications of its matching equipment, and the equipment software update requires professional developers to maintain it, which consumes a lot of manpower and time costs, and the general software modscan is not flexible enough.
It provides a common configuration method for upper computer system between devices. By compiling the configuration module, parsing module, and generation module of upper computer system into library files, and sorting out the debugging tables of each device into a unified configuration file format, forming an excel table configuration file, realizing automated configuration.
Reduces maintenance costs, reduces development costs, improves the readability, reusability and scalability of test and debugging, and allows non-professional personnel to quickly start professional maintenance and debugging updates.
Smart Images

Figure CN119697015A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software systems, and in particular to a host computer system configuration method, device and host computer system. Background Art
[0002] In the field of power automation, in order to achieve automatic control and intelligent monitoring of all devices, the physical protocol used is the RS485 communication electrical standard protocol, on top of which run modbus, profibus and other software application protocols.
[0003] At present, various newly developed devices emerge in an endless stream, and there are also many types of host computer software for modbus debugging. There is a lack of coordination between developers and debuggers. The debugging software of different devices is very different in terms of interface, operation, and environment. In this context, the host computer software designed according to the debugging stage of each device will bring high design costs, communication costs, and implementation costs.
[0004] In the prior art, each debugging host computer system can only debug the communication of its matching device, and when the device software is updated later and the point table is updated, the host computer system needs to be maintained and updated by professional developers, which consumes a lot of manpower and time. The general software modscan can only display functions such as sending and receiving messages, and meet some fixed format data analysis, but it is not configured with functions such as the physical meaning of the data, upper and lower limit constraints, etc., and lacks flexibility. Summary of the invention
[0005] Purpose of the invention: The first purpose of the present invention is to provide a host computer system configuration method that is universal among devices, the second purpose is to provide a host computer system configuration device, and the third purpose is to provide a host computer system that is automatically configured using the above-mentioned host computer system configuration method.
[0006] Technical solution: A host computer system configuration method, comprising the following steps:
[0007] (1) Compile the configuration module, parsing module, and generation module of the host computer system into library files respectively, organize the debugging point tables of each device into a unified configuration file format in an Excel table, and form an Excel table configuration file corresponding to each device;
[0008] (2) Initialize the host computer system, generate the configuration file structure framework, establish window control connection and serial port connection, set the serial port communication parameters, and select the Excel spreadsheet configuration file corresponding to the device under test;
[0009] (3) Use the configuration module to configure the modbus communication code, process the configuration information in the excel spreadsheet configuration file corresponding to the device under test through the parsing module to form signal data, and generate a modbus message through the generation module to send it to the lower computer, waiting for the lower computer to respond;
[0010] (4) After receiving the modbus message, the lower computer returns a response signal. After receiving the response signal, the upper computer system determines the check code. If the check code passes, it compiles the code, reads the response data of the device under test, and outputs the response result.
[0011] Specifically, in step (1), the classes provided in the configuration module, the parsing module, and the generation module of the host computer system inherit the message sending and receiving base class.
[0012] Specifically, step (3) also includes: abstracting the data in the Excel spreadsheet configuration file corresponding to the device under test into classes for function calls according to different types.
[0013] Specifically, in step (2), the configuration file structure framework includes: data address, data name, data format, signal reading high and low bit order, data attribute, value range, value unit, initial value, read value, and write value.
[0014] Specifically, step (2) also includes: using a traversal function to traverse the data in the Excel spreadsheet configuration file and importing the data into the host computer system.
[0015] Specifically, in step (3), configuring the modbus communication code using the configuration module includes: making a one-to-one correspondence between each type of data in the device debugging point table and the address and byte length in the modbus message.
[0016] Preferably, in step (4), when the check code of the response signal of the lower computer is wrong or there is no response due to timeout, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response.
[0017] Preferably, in step (4), when the response data of the device under test returned by the lower computer response signal exceeds the set write range, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response.
[0018] The present invention also provides a host computer system configuration device, comprising:
[0019] Initial file generation module: used to compile the configuration module, parsing module and generation module of the host computer system into library files respectively, organize the debugging point table of each device into a unified configuration file format in an Excel table, and form an Excel table configuration file corresponding to each device;
[0020] System construction module: used to initialize the system, generate the configuration file structure framework, establish window control connection and serial port connection, set serial port communication parameters, and select the excel table configuration file corresponding to the device under test;
[0021] Signal transmission module: used to configure the modbus communication code using the configuration module, process the configuration information in the excel table configuration file corresponding to the device under test through the parsing module to form signal data, and form a modbus message through the generation module to send to the lower computer, waiting for the response of the lower computer;
[0022] Result output module: used to return a response signal after the lower computer receives the modbus message. The upper computer system determines the check code after receiving the response signal. After the determination is passed, it compiles, reads the response data of the device under test, and outputs the response result.
[0023] The present invention also provides a host computer system, which is automatically configured through the host computer system configuration method.
[0024] Beneficial effect: Compared with the prior art, the significant effect of the present invention is: in the face of the situation where different devices are debugged and tested in the modbus protocol communication, or the same device software is upgraded and the address point table changes, the maintenance and development cost of the host computer is high, and the process is cumbersome and repetitive. The present invention unifies the host computer editing platform, performs visual programming through excel files, and stores and edits the test point tables of different devices and different functions in a unified format. Even non-professionals can quickly get started and accurately use the present invention for professional maintenance, debugging and updating. The present invention solves the unique matching problem between equipment and software faced when equipment using modbus protocol communication is factory debugged and communication tested, reduces maintenance costs, greatly reduces related development costs, and improves the readability, reusability and scalability of test debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flow chart of the method of embodiment 1 of the present invention.
[0026] Figure 2 It is a schematic diagram of the data transmission process of Example 1 of the present invention. DETAILED DESCRIPTION
[0027] The present invention is further described below in conjunction with the accompanying drawings.
[0028] Example 1
[0029] See also Figure 1 As shown, this embodiment provides a host computer system configuration method, including the following steps:
[0030] (1) The configuration module, parsing module, and generation module of the host computer system are compiled into library files respectively. The classes provided in the configuration module, parsing module, and generation module inherit the message sending and receiving base class. The debugging point table of each device is organized into a unified configuration file format in an Excel table to form an Excel table configuration file corresponding to each device.
[0031] (2) Initialize the host computer system. First, generate the configuration file structure framework, including data address, data name, data format, signal read high and low bit sequence, data attribute, value range, value unit, initial value, read value, write value, etc. The corresponding relationship in the configuration file structure framework is: data address corresponds to the device debugging point table address, data name corresponds to the Chinese meaning, data format corresponds to the output data type, such as int, bool, float, etc., signal read high and low bit sequence corresponds to read signal high bit first or low bit first, data attribute corresponds to the data is read-only format or readable and writable, and value range corresponds to the upper and lower limits of the writable value. Establish window control connection and serial port connection, set serial port communication parameters, such as verification mode, number of bytes, stop bit, etc., select the excel table configuration file corresponding to the device to be tested, use the traversal function to traverse the data in the excel table configuration file, and import the data into the visual control of the host computer system for easy operation and function call.
[0032] (3) Please refer to Figure 2 As shown, the data in the Excel spreadsheet configuration file corresponding to the device under test, such as point position, data type, etc., are abstracted into classes of function calls according to different types, and the modbus communication code is configured using the configuration module. The various types of data in the device debugging point table, such as address, name, read and write permissions, etc., are matched one by one with the address and byte length in the modbus message. The configuration information in the Excel spreadsheet configuration file corresponding to the device under test is processed by the parsing module to form signal data, which is formed into a modbus message by the generating module and sent to the lower computer, waiting for the lower computer to respond.
[0033] (4) After receiving the modbus message, the lower computer returns a response signal. After receiving the response signal, the upper computer system determines the checksum, compiles it after the determination is passed, reads the response data of the device under test, and outputs a response result that meets the output format requirements; when the checksum of the lower computer response signal is wrong or there is no response due to timeout, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response, such as marking the entire row background in red; when the response data of the device under test returned by the lower computer response signal exceeds the set write range, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response, such as marking the entire row background in yellow.
[0034] Example 2
[0035] This embodiment provides a host computer system configuration device, including:
[0036] Initial file generation module: used to compile the configuration module, parsing module and generation module of the host computer system into library files respectively, organize the debugging point table of each device into a unified configuration file format in an Excel table, and form an Excel table configuration file corresponding to each device;
[0037] System construction module: used to initialize the system, generate the configuration file structure framework, establish window control connection and serial port connection, set serial port communication parameters, and select the excel table configuration file corresponding to the device under test;
[0038] Signal transmission module: used to configure the modbus communication code using the configuration module, process the configuration information in the excel table configuration file corresponding to the device under test through the parsing module to form signal data, and form a modbus message through the generation module to send to the lower computer, waiting for the response of the lower computer;
[0039] Result output module: used to return a response signal after the lower computer receives the modbus message. The upper computer system determines the check code after receiving the response signal. After the determination is passed, it compiles, reads the response data of the device under test, and outputs the response result.
[0040] Example 3
[0041] This embodiment provides a host computer system automatically configured by the host computer system configuration method described in Embodiment 1. The host computer system includes a configuration module, a parsing module, and a generation module.
[0042] In this embodiment, the configuration module has the functions of modbus communication address configuration, byte configuration, operation configuration, table configuration, and generation type configuration; the parsing module has the functions of parameter parsing, template parsing and table information parsing of the configuration information; the generation module has the function of generating corresponding signal data according to the parameters obtained by the configuration module and the parsing module, and sending it to the lower computer through serial port communication, and receiving the response signal after the lower computer responds.
[0043] Please refer to Table 1 below, which is a typical table of the upper computer system interface of this embodiment. By checking the data type and clicking the update button, the required data can be automatically updated. Through the configuration method described in Example 1, different device debugging point tables can be used to match the upper computer system with various types of devices, thereby achieving the universality of the upper computer system among different types of devices.
[0044] Table 1
[0045]
Claims
1. A host computer system configuration method, characterized in that: The following steps are involved: (1) Compile the configuration module, parsing module, and generation module of the host computer system into library files respectively, organize the debugging point tables of each device into a unified configuration file format in an Excel table, and form an Excel table configuration file corresponding to each device; (2) Initialize the host computer system, generate the configuration file structure framework, establish window control connection and serial port connection, set the serial port communication parameters, and select the Excel spreadsheet configuration file corresponding to the device under test; (3) Use the configuration module to configure the modbus communication code, process the configuration information in the excel spreadsheet configuration file corresponding to the device under test through the parsing module to form signal data, and generate a modbus message through the generation module to send it to the lower computer, waiting for the lower computer to respond; (4) After receiving the modbus message, the lower computer returns a response signal. After receiving the response signal, the upper computer system determines the check code. If it passes the check, it compiles, reads the response data of the device under test, and outputs the response result.
2. The host computer system configuration method according to claim 1, characterized in that: In the step (1), the classes provided in the configuration module, the parsing module and the generation module of the host computer system inherit the message sending and receiving base class.
3. The host computer system configuration method according to claim 2, characterized in that: The step (3) also includes: abstracting the data in the Excel spreadsheet configuration file corresponding to the device under test into classes for function calls according to different types.
4. The host computer system configuration method according to claim 1, characterized in that: In the step (2), the configuration file structure framework includes: data address, data name, data format, signal reading high and low bit order, data attribute, value range, value unit, initial value, read value, and write value.
5. The host computer system configuration method according to claim 1, characterized in that: The step (2) also includes: using a traversal function to traverse the data in the Excel table configuration file and importing the data into the host computer system.
6. The host computer system configuration method according to claim 1, characterized in that: In the step (3), configuring the modbus communication code using the configuration module includes: making a one-to-one correspondence between each type of data in the device debugging point table and the address and byte length in the modbus message.
7. The host computer system configuration method according to claim 1, characterized in that: In the step (4), when the check code of the response signal of the lower computer is wrong or there is no response due to timeout, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response.
8. The host computer system configuration method according to claim 1, characterized in that: In the step (4), when the response data of the device under test returned by the lower computer response signal exceeds the set write range, the upper computer system automatically marks the location of the device debugging point table corresponding to the signal response.
9. A host computer system configuration device, characterized in that: include: Initial file generation module: used to compile the configuration module, parsing module and generation module of the host computer system into library files respectively, organize the debugging point table of each device into a unified configuration file format in an Excel table, and form an Excel table configuration file corresponding to each device; System construction module: used to initialize the system, generate the configuration file structure framework, establish window control connection and serial port connection, set serial port communication parameters, and select the excel table configuration file corresponding to the device under test; Signal transmission module: used to configure the modbus communication code using the configuration module, process the configuration information in the excel table configuration file corresponding to the device under test through the parsing module to form signal data, and form a modbus message through the generation module to send to the lower computer, waiting for the response of the lower computer; Result output module: used to return a response signal after the lower computer receives the modbus message. The upper computer system determines the check code after receiving the response signal. After the determination is passed, it compiles, reads the response data of the device under test, and outputs the response result.
10. A method for configuring a host computer system, characterized in that: Automatic configuration is performed by the host computer system configuration method according to any one of claims 1 to 8.