A method and system for simulating ship equipment data communication
Patent Information
- Application Number
- CN202410014785.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-04
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-01-04
AI Technical Summary
[0003]为了解决船舶智能系统推广应用前的测试需对船舶进行改造,且耗费大量人力、时间和资金成本的问题,本发明提出了一种船舶设备数据通讯模拟方法及系统,通过模拟实船设备与船舶智能系统之间的实时数据通讯,给予船舶智能系统开发和测试人员与实船相同的船舶设备通讯环境和相应的数据,用于测试船舶智能系统与实船设备的通讯及相关智能功能,减少了登船改造和船上测试时间,提升智能船舶系统上船的适用性和可靠性,降低测试的时间和资金成本,提升效率
[0027]本发明提供了一种船舶设备数据通讯模拟方法及系统,S1收集被模拟设备相关数据并存储、生成配置文件,S2读取并分析配置信息并创建通讯线程,S3生成模拟数据并缓存,S4输出模拟数据;通过模拟实船设备与船舶智能系统之间的实时数据通讯,给予船舶智能系统开发和测试人员与实船相同的船舶设备通讯环境和相应的数据,用于测试船舶智能系统与实船设备的通讯及相关智能功能,减少了登船改造和船上测试时间,提升智能船舶系统上船的适用性和可靠性,降低测试的时间和资金成本,提升效率。
Smart Images

Figure CN117834503B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship intelligent system testing, and in particular to a method and system for simulating ship equipment data communication. Background Technology
[0002] Intelligent ship systems can continuously collect real-time data from ship equipment, perform calculations and analyses to provide corresponding auxiliary decision-making information for ship navigation. However, before being deployed and widely applied on ships, extensive testing and verification are required to ensure that the system can achieve its expected functions and operate stably. Currently, the common practice is to deploy the intelligent ship system to be tested on a test vessel to conduct functional and applicability tests on the newly developed intelligent ship system. The test scenario is realistic and can accurately reflect the functionality and adaptability of the intelligent ship system under test. However, this testing method requires finding a suitable test vessel and modifying the vessel, which requires a lot of coordination and modification time and consumes a lot of manpower, time, and financial costs. Therefore, providing a simple and effective method for testing intelligent ship systems has become a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0003] To address the issue of requiring ship modifications and incurring significant manpower, time, and financial costs for testing before the widespread application of intelligent ship systems, this invention proposes a method and system for simulating ship equipment data communication. By simulating real-time data communication between actual ship equipment and the intelligent ship system, it provides the developers and testers of the intelligent ship system with the same communication environment and corresponding data as the actual ship. This method is used to test the communication between the intelligent ship system and the actual ship equipment, as well as related intelligent functions. It reduces the time required for onboard modifications and testing, improves the applicability and reliability of intelligent ship systems on board, reduces testing time and financial costs, and increases efficiency.
[0004] The present invention provides the following specific solution:
[0005] A method for simulating data communication of ship equipment includes the following steps:
[0006] S1. Data Collection, Storage, and Configuration File Generation: Collect the output data, basic data, and communication information data of the simulated ship's equipment. The output data is the data output by the simulated ship's equipment in a time sequence during operation. The basic data includes the equipment ID and equipment name on the ship. The communication information data includes the communication interface, communication interface protocol of each piece of equipment on the ship, communication cycle, communication protocol, data transmission format, and output mode. Store the output data in a database according to table fields, and store the mapping relationship between the table fields and the transmission formats of the output data, basic data, and communication information data, as well as the relationship between the output data and the basic data and communication information data, in the configuration file.
[0007] S2. Read and analyze configuration information and create communication thread: Read the configuration information of each equipment of the ship from the configuration file mentioned in S1, organize the content of the configuration information into data form, create a cache space, generate basic database read statements, and create a communication thread to execute the communication tasks of the simulated ship equipment.
[0008] S3. Generate and cache simulated data: Based on the basic database read statement generated in S2, read the output data from the database, and according to the mapping relationship between the database table fields and the data transmission format, convert the output data into simulated data and store it in the cache space.
[0009] S4. Simulated Data Output: Based on the characteristics of each piece of equipment on the ship and the communication content being executed, configure the corresponding output mode, extract the simulated data from the cache space mentioned in S3, organize the corresponding output statements according to the communication interface protocols of each piece of equipment on the ship, and output them through the communication thread. The output mode includes active output and passive output. Active output is when the ship equipment actively outputs simulated data in NEMA format using communication protocols such as RS232, RS485, or RS422. Passive output is when the ship equipment passively outputs simulated data in Modbus RTU or Modbus TCP format through the Modbus protocol after receiving a request.
[0010] Preferably, the configuration file can be manually set according to the parameters and performance of the simulated ship equipment, or the communication parameters under the simulated ship equipment can be selectively configured according to the environmental conditions of the simulated ship equipment.
[0011] Preferably, the communication interface in S1 includes a network connection interface and a serial connection interface; the communication protocol includes a network transmission protocol and a serial communication protocol; the network transmission protocol may include Hypertext Transfer Protocol (HTTP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP); the serial communication protocol may include RS232, RS485, and RS422, communication-related standards developed and published by the Electronic Industries Association; the data transmission format may include the standard GPS data format NEMA, the Modbus RTU communication format in remote terminal device mode, the Modbus TCP communication format under the Transmission Control Protocol, and a lightweight data exchange format JSON.
[0012] Preferably, the method for implementing simulated data output in the active output mode in S4 is as follows: according to the communication cycle of the simulated ship equipment, the simulated data is extracted from the buffer space, the statement is transmitted to the serial interface module through the network interface module, the output statement is organized according to the communication interface protocol, and finally the output is executed through the communication thread.
[0013] Preferably, the method for implementing simulated data output in the passive output mode in S4 is as follows: when a data request is received, the simulated data is extracted from the cache space, the output statement is organized according to the communication interface protocol, and the output is executed through the communication thread.
[0014] Preferably, the method for outputting analog data for different communication protocol types is as follows:
[0015] S41. The communication protocol is the network transmission protocol. The simulated data is organized into an output statement according to the output format set in the communication interface protocol and output through the network connection interface.
[0016] S42. The communication protocol is the serial communication protocol. The analog data is organized into output statements according to the communication interface protocol, transmitted through the network connection interface, and then output through the serial connection interface.
[0017] It should be noted that the "S41" and "S42" mentioned above are used to distinguish different types of communication protocols, rather than to describe a specific order or sequence. They should be understood to be interchangeable or can be performed simultaneously in actual application scenarios.
[0018] Preferably, the sources of the output data, the basic data, and the communication information data in S1 include actual ship data collection, equipment documentation, and actual ship operation history records.
[0019] Preferably, communication threads are created in S2 for different simulated ship equipment, which can be executed simultaneously without affecting each other.
[0020] A ship equipment data communication simulation system includes: a database module, a configuration file module, a data communication processing module, a network interface module, and a serial interface module;
[0021] The database module stores the output data of the ship equipment by table fields. The output data is the data output by the simulated ship equipment in a time sequence during operation.
[0022] The configuration file module configures the device ID, device name, communication interface, communication interface protocol, communication cycle, communication protocol, output mode, data transmission format, and the mapping relationship between database table fields and the data transmission format of the simulated ship equipment.
[0023] The data communication processing module reads the output data from the database, then converts the output data into simulated data according to the mapping relationship between the database table fields and the data transmission format, organizes it into output statements according to the communication interface protocol in the configuration file, and outputs it through the network interface module or the serial interface module.
[0024] The network interface module: under the network transmission protocol of TCP, UDP or HTTP, transmits the output statement within the local area network through the network connection interface;
[0025] The serial interface module transmits the output statements through a serial connection interface under the serial communication protocol of RS232, RS485 or RS422.
[0026] The beneficial effects of this invention are:
[0027] This invention provides a method and system for simulating data communication between ship equipment. The method comprises: S1 collecting and storing relevant data from the simulated equipment and generating a configuration file; S2 reading and analyzing the configuration information and creating a communication thread; S3 generating and caching simulated data; and S4 outputting the simulated data. By simulating real-time data communication between actual ship equipment and the ship's intelligent system, this method provides ship intelligent system developers and testers with the same ship equipment communication environment and corresponding data as on a real ship. It is used to test the communication and related intelligent functions between the ship's intelligent system and the actual ship equipment, reducing onboard modification and testing time, improving the applicability and reliability of the intelligent ship system on board, reducing testing time and financial costs, and increasing efficiency. Attached Figure Description
[0028] Figure 1 A flowchart of a ship equipment data communication simulation method provided by the present invention.
[0029] Figure 2 This invention provides an architecture diagram of a ship equipment data communication simulation system. Detailed Implementation
[0030] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0031] Example 1:
[0032] like Figure 1 As shown, a method for simulating data communication of ship equipment includes the following steps:
[0033] S1. Data Collection, Storage, and Configuration File Generation: Collect the output data, basic data, and communication information data of the simulated ship's equipment. The output data is the data output by the simulated ship's equipment in a time sequence during operation. The basic data includes the equipment ID and equipment name on the ship. The communication information data includes the communication interface, communication interface protocol of each piece of equipment on the ship, communication cycle, communication protocol, data transmission format, and output mode. Store the output data in a database according to table fields, and store the mapping relationship between the table fields and the transmission formats of the output data, basic data, and communication information data, as well as the relationship between the output data and the basic data and communication information data, in the configuration file.
[0034] S2. Read and analyze configuration information and create communication thread: Read the configuration information of each equipment of the ship from the configuration file mentioned in S1, organize the content of the configuration information into data form, create a cache space, generate basic database read statements, and create a communication thread to execute the communication tasks of the simulated ship equipment.
[0035] S3. Generate and cache simulated data: Based on the basic database read statement generated in S2, read the output data from the database, and according to the mapping relationship between the database table fields and the data transmission format, convert the output data into simulated data and store it in the cache space.
[0036] S4. Simulated Data Output: Based on the characteristics of each piece of equipment on the ship and the communication content being executed, configure the corresponding output mode, extract the simulated data from the cache space mentioned in S3, organize the corresponding output statements according to the communication interface protocols of each piece of equipment on the ship, and output them through the communication thread. The output mode includes active output and passive output. Active output is when the ship equipment actively outputs simulated data in NEMA format using communication protocols such as RS232, RS485, or RS422. Passive output is when the ship equipment passively outputs simulated data in Modbus RTU or Modbus TCP format through the Modbus protocol after receiving a request.
[0037] Specifically, the configuration file can be manually set according to the parameters and performance of the simulated ship equipment, or the communication parameters under the simulated ship equipment can be selectively configured according to the environmental conditions of the simulated ship equipment.
[0038] Specifically, the communication interface in S1 includes a network connection interface and a serial connection interface; the communication protocol includes a network transmission protocol and a serial communication protocol; the network transmission protocol may include Hypertext Transfer Protocol (HTTP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP); the serial communication protocol may include RS232, RS485, and RS422, communication-related standards developed and published by the Electronic Industries Association; the data transmission format may include the standard GPS data format NEMA, the Modbus RTU communication format in remote terminal device mode, the Modbus TCP communication format under the Transmission Control Protocol, and a lightweight data exchange format JSON.
[0039] Specifically, the method for implementing simulated data output in the active output mode described in S4 is as follows: based on the communication cycle of the simulated ship equipment, the simulated data is extracted from the cache space, the statement is transmitted to the serial interface module through the network interface module, the output statement is organized according to the communication interface protocol, and finally the output is executed through the communication thread.
[0040] Specifically, the method for implementing simulated data output in the passive output mode described in S4 is as follows: when a data request is received, the simulated data is extracted from the cache space, the output statement is organized according to the communication interface protocol, and the output is executed through the communication thread.
[0041] Specifically, the methods for outputting simulated data for different communication protocol types are as follows:
[0042] S41. The communication protocol is the network transmission protocol. The simulated data is organized into an output statement according to the output format set in the communication interface protocol and output through the network connection interface.
[0043] S42. The communication protocol is the serial communication protocol. The analog data is organized into output statements according to the communication interface protocol, transmitted through the network connection interface, and then output through the serial connection interface.
[0044] Specifically, the sources of the output data, the basic data, and the communication information data mentioned in S1 include actual ship data collection, equipment documentation, and actual ship operation history records.
[0045] Specifically, S2 creates communication threads for different simulated ship equipment, which can be executed simultaneously without affecting each other.
[0046] Example 2:
[0047] like Figure 2 As shown, a ship equipment data communication simulation system includes: a database module, a configuration file module, a data communication processing module, a network interface module, and a serial interface module;
[0048] The database module stores the output data of the ship equipment by table fields. The output data is the data output by the simulated ship equipment in a time sequence during operation.
[0049] The configuration file module configures the device ID, device name, communication interface, communication interface protocol, communication cycle, communication protocol, output mode, data transmission format, and the mapping relationship between database table fields and the data transmission format of the simulated ship equipment.
[0050] The data communication processing module reads the output data from the database, then converts the output data into simulated data according to the mapping relationship between the database table fields and the data transmission format, organizes it into output statements according to the communication interface protocol in the configuration file, and outputs it through the network interface module or the serial interface module.
[0051] The network interface module: under the network transmission protocol of TCP, UDP or HTTP, transmits the output statement within the local area network through the network connection interface;
[0052] The serial interface module transmits the output statements through a serial connection interface under the serial communication protocol of RS232, RS485 or RS422.
[0053] In some embodiments, testers can simulate the operation of a real ship's communication and navigation equipment (including GPS, gyrocompass, autopilot, depth sounder, log, anemometer, and inclinometer), engine room equipment (including engine room monitoring system (AMS), power management system (PMS), switchboard, propulsion system, generator, liquid level telemetry system, flow meter, and shaft power meter), living quarters equipment (including air conditioning system), and other equipment that communicates using data transmission formats such as NEMA, Modbus, or JSON in the office. Furthermore, this invention supports data formats such as NEMA, Modbus RTU, Modbus TCP, and JSON, and multiple interface protocols such as RS232, RS485, RS422, TCP, UDP, and HTTP for communication, and arbitrary combinations of data formats and interface protocols are possible.
[0054] The communication simulation system provided in this invention pre-acquires information on ship-simulated equipment through methods such as real-ship data collection, equipment documentation, and real-ship operational history records, stores this information in a database, and generates configuration files. During operation, the system reads the communication interfaces and data mappings of the real-ship equipment to be simulated from the configuration files, and establishes a data communication transmission channel using network connection interface units or serial connection interface units. Based on the configured data mapping relationships, it reads relevant data from the database in a time-series manner, converts the data into corresponding protocol statements according to the real-ship equipment protocols, and transmits it through the established data communication transmission channel, enabling the intelligent system under test to receive the simulated real-ship equipment data in a timely manner. Currently, the intelligent ship integration platform on board uses the HTTP protocol and JSON data format for data transmission, employing a passive output mode.
[0055] Example 3:
[0056] The active output refers to the simulation system automatically outputting simulation data according to the configuration information through its internal program. The passive output refers to the simulation system responding to a request from an external system and outputting simulation data in response to the request.
[0057] In some embodiments, when simulating GPS device communication, the ship equipment data communication simulation system uses the RS485 serial communication interface protocol in active output mode. The output format of the GPS GPRMC statement is then:
[0058] $GPRMC,(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12)*hh(CR)(LF)
[0059] in,
[0060] Field $GPRMC: Statement ID,
[0061] Field 1: UTC time, in hhmmss.sss format.
[0062] Field 2: Status, A = Located, V = Not Located
[0063] Field 3: Latitude ddmm.mmmm, in degree format (add leading zeros if necessary).
[0064] Field 4: Latitude N (North Latitude) or S (South Latitude)
[0065] Field 5: Longitude dddmm.mmmm, in degrees and minutes format (add leading zeros if necessary).
[0066] Field 6: Longitude E (East) or W (West),
[0067] Field 7: Speed, Section, Knots
[0068] Field 8: Azimuth, degrees
[0069] Field 9: UTC date, DDMMYY format.
[0070] Field 10: Magnetic declination, (000 - 180) degrees (padding with 0s if necessary).
[0071] Field 11: Magnetic declination direction, E=East, W=West
[0072] Field 12: Mode Indicator (A=Autonomous Positioning, D=Differential, E=Estimation, N=Invalid Data)
[0073] *: Total checksum field
[0074] hh: Checksum of total sum.
[0075] (CR)(LF): Carriage return, line feed.
[0076] According to the communication cycle specified in the configuration information, data such as latitude, north and south latitude, longitude, east and west longitude, speed, and azimuth are retrieved from the cache space. This data, along with the current system time and date, is then filled into the output format. After calculating the verification information, the data is concatenated into the complete statement:
[0077] $GPRMC,060846.00,A,2158.2076,N,11339.6203,E,0.0,139.5,200521,2.8,W,A,S*57(CR)(LF),
[0078] The statement is then transmitted from the network interface module to the serial interface module, and then output according to the RS485 protocol.
[0079] Example 4:
[0080] In some embodiments, when simulating data communication of the AMS (engine room monitoring and alarm system), the ship equipment data communication simulation system uses the Modbus TCP or Modbus RTU protocol. Here, we take the Modbus TCP protocol as an example for explanation. The format of the Modbus TCP protocol is as follows:
[0081] Request format:
[0082]
[0083] Response format:
[0084]
[0085] When the system receives a ModbusTCP request statement from the network interface unit:
[0086] 00 1E 00 00 00 06 01 03 2E E0 00 0A
[0087] At that time, the ship's equipment data communication simulation system retrieves data from 10 addresses starting at address 12000 in the cache space and generates the corresponding statement:
[0088] 00 1E 00 00 00 17 01 03 14 78 2D 3F B9 1F 3B 42 4A E5 E3 43 10 EA 2140 7E DB 71 42 5E
[0089] The statement is then transmitted from the network interface module to the serial interface module, and then output according to the TCP protocol.
[0090] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail with reference to the accompanying drawings and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention. In short, all technical solutions and improvements that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention patent.
Claims
1. A method for simulating data communication of ship equipment, characterized in that, Includes the following steps: S1. Data Collection, Storage, and Configuration File Generation: Collect the output data, basic data, and communication information data of the simulated ship's equipment. The output data is the data output by the simulated ship's equipment in a time sequence during operation. The basic data includes the equipment ID and equipment name on the ship. The communication information data includes the communication interface, communication interface protocol of each piece of equipment on the ship, communication cycle, communication protocol, data transmission format, and output mode. Store the output data in a database according to table fields, and store the mapping relationship between the table fields and the transmission formats of the output data, basic data, and communication information data, as well as the relationship between the output data and the basic data and communication information data, in the configuration file. S2. Read and analyze configuration information and create communication thread: Read the configuration information of each equipment of the ship from the configuration file mentioned in S1, organize the content of the configuration information into data form, create a cache space, generate basic database read statements, and create a communication thread to execute the communication tasks of the simulated ship equipment. S3. Generate and cache simulated data: Based on the basic database read statement generated in S2, read the output data from the database, and according to the mapping relationship between the database table fields and the data transmission format, convert the output data into simulated data and store it in the cache space. S4. Simulated Data Output: Based on the characteristics of each piece of equipment on the ship and the communication content being executed, configure the corresponding output mode, extract the simulated data from the buffer space mentioned in S3, organize the corresponding output statements according to the communication interface protocols of each piece of equipment on the ship, and output them through the communication thread. The output mode includes active output and passive output. Active output is when the ship equipment actively outputs simulated data in NEMA format using communication protocols such as RS232, RS485, or RS422. Passive output is when the ship equipment passively outputs simulated data in Modbus RTU or Modbus TCP format via the Modbus protocol after receiving a request. The method for implementing simulated data output in the active output mode is as follows: according to the communication cycle of the simulated ship equipment, the simulated data is extracted from the cache space, the statement is transmitted to the serial interface module through the network interface module, the output statement is organized according to the communication interface protocol, and finally the output is executed through the communication thread. The method for implementing simulated data output in the passive output mode is as follows: when a data request is received, the simulated data is extracted from the cache space, the output statement is organized according to the communication interface protocol, and the output is executed through the communication thread.
2. The ship equipment data communication simulation method according to claim 1, characterized in that, The configuration file can be manually set according to the parameters and performance of the simulated ship equipment, or the communication parameters under the simulated ship equipment can be selectively configured according to the environmental conditions of the simulated ship equipment.
3. The ship equipment data communication simulation method according to claim 1, characterized in that, The communication interface described in S1 includes a network connection interface and a serial connection interface; the communication protocol includes a network transmission protocol and a serial communication protocol; the network transmission protocol may include Hypertext Transfer Protocol (HTTP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP); the serial communication protocol may include RS232, RS485, and RS422, communication-related standards developed and published by the Electronic Industries Association; the data transmission format may include the standard GPS data format NEMA, the Modbus RTU communication format in remote terminal device mode, the Modbus TCP communication format under the Transmission Control Protocol, and a lightweight data exchange format JSON.
4. The ship equipment data communication simulation method according to claim 3, characterized in that, The methods for outputting analog data for different communication protocol types are as follows: S41. The communication protocol is the network transmission protocol: the simulated data is organized into output statements according to the output format set in the communication interface protocol, and output through the network connection interface; S42. The communication protocol is the serial communication protocol: the analog data is organized into output statements according to the communication interface protocol, transmitted through the network connection interface, and then output through the serial connection interface.
5. The ship equipment data communication simulation method according to claim 1, characterized in that, The data sources for the output data, the basic data, and the communication information data mentioned in S1 include actual ship data collection, equipment documentation, and actual ship operation history records.
6. The ship equipment data communication simulation method according to claim 1, characterized in that, In S2, communication threads are created for different simulated ship equipment, which can be executed simultaneously without affecting each other.
7. A ship equipment data communication simulation system formed by the method of any one of claims 1-6, characterized in that, include: Database module, configuration file module, data communication processing module, network interface module, and serial interface module; The database module stores the output data of the ship equipment by table fields. The output data is the data output by the simulated ship equipment in a time sequence during operation. The configuration file module configures the device ID, device name, communication interface, communication interface protocol, communication cycle, communication protocol, output mode, data transmission format, and the mapping relationship between database table fields and the data transmission format of the simulated ship equipment. The data communication processing module reads the output data from the database, then converts the output data into simulated data according to the mapping relationship between the database table fields and the data transmission format, organizes it into output statements according to the communication interface protocol in the configuration file, and outputs it through the network interface module or the serial interface module. The network interface module: under the network transmission protocol of TCP, UDP or HTTP, transmits the output statement within the local area network through the network connection interface; The serial interface module transmits the output statements through a serial connection interface under the serial communication protocol of RS232, RS485 or RS422.
Citation Information
Patent Citations
Interactive ship cabin virtual training system based on 3D location roaming and training method
CN105608951A
Marine main engine remote control operation simulation training system
CN110148332A