Message packing system and method based on device, sub-device and block

By modeling the equipment structure, encapsulating messages, and adapting communication, the problem of chaotic signal management in industrial equipment has been solved, achieving unified message transmission and efficient communication loop, thus meeting the high precision and high reliability requirements of industrial automation.

CN121547433APending Publication Date: 2026-02-17YGSOFT INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511432957.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

In existing technologies, the signal management of industrial equipment and sub-equipment lacks a unified structured modeling system, resulting in chaotic signal recognition, difficulty in data association, insufficient adaptability of communication protocols, and non-standard message transmission, making it difficult to meet the high precision and high reliability requirements of industrial automation scenarios.

Method used

The device structure modeling module generates a device structure mapping table, the message encapsulation module encapsulates the message into a three-layer unified message format, the communication adaptation module selects the adaptation protocol, and the verification and association module performs format, data validity and message association verification, forming a full-process communication management system of structured modeling - unified encapsulation - reliable transmission - effective verification.

Benefits of technology

It has achieved unified positioning and management of signals from industrial equipment, improved the standardization and compatibility of communication, ensured the reliability and timeliness of message transmission, met the high precision and high reliability requirements of industrial automation scenarios, and formed a closed-loop communication system of instruction-execution-result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121547433A_ABST
    Figure CN121547433A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of industrial equipment automation, and particularly relates to a message packaging system based on equipment, sub-equipment and blocks. The message packaging system comprises an equipment structure modeling module, a message packaging module, a communication adaptation module and a verification and association module. All the modules are connected in sequence to form a whole-process communication management system for structured modeling, unified packaging, reliable transmission and effective verification; according to the invention, the equipment structure modeling module divides standardized levels according to physical characteristics and functions of industrial equipment, generates an equipment structure mapping table and establishes a signal value rationality range model, so that unified positioning and management of industrial equipment and sub-equipment signals are realized; the problems of disordered signal identification and difficult data association in an industrial scene in the prior art are solved, a uniform structure basis is provided for subsequent message packaging, and the standardization and accuracy of industrial signal management are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial equipment automation technology, specifically relating to a message packet assembly system and method based on equipment, sub-equipment and blocks. Background Technology

[0002] In the field of industrial automation technology, with the improvement of the intelligence level of industrial equipment, the number and types of various industrial equipment and sub-equipment such as mining weighing equipment and ore collection equipment in mining, workshop and other scenarios continue to increase, and the demand for real-time signal transmission and business command interaction between equipment is becoming increasingly complex. In existing technologies, there is a lack of a unified structured modeling system for signal management of industrial equipment and sub-equipment. The signal positioning rules of different industrial equipment vary, leading to chaotic signal identification, difficulties in data association between devices, and an inability to form a standardized industrial signal management model. At the same time, the message encapsulation format has not formed a unified standard. Communication between industrial equipment, server, and web terminals often results in data redundancy or missing key fields due to format incompatibility, affecting the standardization of industrial data transmission. In addition, facing diverse communication scenarios such as weak networks in industrial workshops, real-time monitoring in mining operation areas, and reliable transmission of industrial business instructions, existing communication protocols are difficult to adapt to, easily leading to message loss and excessive transmission latency, failing to meet the communication needs of industrial scenarios. Moreover, the message verification mechanism is imperfect, only able to perform simple verification on some data, unable to effectively filter abnormal data in industrial scenarios, and unable to establish business associations between messages, failing to form a closed loop of industrial communication of instruction-execution-result, resulting in insufficient data reliability. This makes it difficult to meet the high precision and high reliability requirements of equipment communication in industrial automation scenarios, hindering the efficient advancement of equipment collaborative operation and business processes in the field of industrial automation. Summary of the Invention

[0003] The purpose of this invention is to address the shortcomings of existing technologies by proposing a message packet assembly system and method based on devices, sub-devices, and blocks.

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a message packet assembly system based on devices, sub-devices and blocks includes a device structure modeling module, a message encapsulation module, a communication adaptation module and a verification and association module. Each module is connected in sequence to form a full-process communication management system with structured modeling, unified encapsulation, reliable transmission and effective verification. The equipment structure modeling module is used to divide the equipment into levels according to its physical characteristics and functions, generate an equipment structure mapping table, and establish a signal value reasonable range model. The message encapsulation module is used to encapsulate real-time signal data and service data into a unified message format with a three-layer structure of message header, message header payload, and message body payload, based on the device structure mapping table. The communication adaptation module is used to select an adaptation protocol according to different communication scenarios, process the unified message, and then transmit it. The verification and association module is used to perform format verification, data validity verification, and message association verification on the received unified message, process abnormal messages, and establish business associations between messages.

[0005] Preferably, the device structure modeling module divides the hierarchy into device sub-devices, block numbers, point numbers, and signal values; the device is the top-level unit and is assigned a unique device identifier; the sub-device is a module with an independent lifecycle and is assigned a sub-device identifier; when there is no independent sub-device, the sub-device identifier is set to 0; the block is a region divided according to physical proximity and is assigned a block identifier; the point number is a unique identifier for a specific hardware signal; and the signal value is associated with a data type identifier; the device structure mapping table stores the association relationships between device identifiers, sub-device identifiers, block identifiers, point number identifiers, data type identifiers, and physical descriptions.

[0006] Preferably, the message header includes a globally unique message identifier, sending time, sender, device identifier, sub-device identifier, message type, and source message identifier. The sending time is accurate to milliseconds. The message identifier is generated using a universally unique identification code. The message type is distinguished according to data type: real-time signal suffix is ​​status, instruction suffix is ​​instruction, result suffix is ​​result, and confirmation suffix is ​​confirmation. The source message identifier is filled in by non-initiator messages to associate with preceding messages. The message header payload includes business scenario-related fields and the verification value of the message body payload. The business scenario-related fields include the data source of the real-time signal and the business number of the business data. The verification value is calculated using the MD5 hash algorithm. The message body payload is divided into a real-time device signal set and a business data set according to the signal type. The real-time device signal set includes point number identifier, block identifier, data type identifier, and signal value. The business data set includes specific business fields, including work order number, execution status, and device operation parameters.

[0007] Preferably, the protocol selection logic of the communication adaptation module is to select the message queue telemetry transmission protocol and configure the quality of service level 2 in the weak network environment of the industrial workshop; For real-time interaction scenarios, the WebSocket protocol is selected and a full-duplex communication mode is adopted. Real-time interaction scenarios include web-based monitoring. For reliable business instruction scenarios, the WebAPI protocol is selected and a POST request method is adopted with an authorization token in the request header. Reliable business instruction scenarios include work order issuance. The communication adaptation module can also enable LZ4 compression algorithm or AES-128 encryption algorithm for messages. LZ4 compression algorithm is enabled in weak network environment, and AES-128 encryption algorithm is enabled in sensitive data scenarios. Sensitive data scenarios include device parameters and operator information. The key is managed uniformly by the system and updated regularly.

[0008] Preferably, the exception handling method of the verification and association module is to send an acknowledgment message to the sender and specify the missing field when the format is missing in order to request retransmission; When data is out of range, historical average interpolation is used for correction and an audible and visual alarm is triggered. The audible and visual alarm is used to notify maintenance personnel to troubleshoot equipment sensor malfunctions. When an association is illegal, the message is discarded and a log is recorded. The log contains the message content, the reason for the abnormal message reception time. The verification and association module also stores valid messages in the message association table according to device identifier, message type, source message identifier, unique message identifier, and service number. The message association table supports querying message links by device and service scenario.

[0009] A message packet assembly method based on devices, sub-devices, and blocks includes the following steps: S1 Equipment Structure Modeling: The equipment structure modeling module receives the physical parameters and signal characteristics of the equipment, divides them into levels, and generates an equipment structure mapping table and a signal value rationality range model, which is then synchronized to the message encapsulation module. S2 Unified Message Encapsulation: The message encapsulation module obtains real-time signal data or business data, encapsulates it into a unified message according to the three-layer structure of message header, message payload, and message body payload, and adds the check value of the message body payload to the message header payload. S3 Reliable Communication Transmission: The communication adaptation module analyzes the characteristics of the communication scenario, selects the adaptation protocol, processes the unified message, and transmits it to the target end; S4 Validation and Association: The validation and association module receives the unified message, performs format validation, data validity validation and message association validation, processes abnormal messages, synchronizes valid messages to the business system and updates the message association table.

[0010] Preferably, in step S1, the signal value reasonableness range model sets a reasonable range for the signal value corresponding to each point number identifier, and the range is determined by the equipment parameters and industry standards.

[0011] Preferably, in step S2, the fields of the real-time device signal set are strictly matched with the device structure mapping table to support batch transmission, and the number of fields in the message body payload is dynamically adjusted according to the device type and business scenario to avoid invalid data occupying bandwidth.

[0012] Preferably, in step S3, when using the WebAPI protocol, a timeout retry mechanism is configured, and the retry interval is set as needed; when using the message queue telemetry transmission protocol, transmission is carried out according to the publish-confirm-release-confirm process; when using the WebSocket protocol, transmission delay is controlled to meet the real-time data display requirements.

[0013] Preferably, in step S4, the data validity verification includes verifying whether the point number identifier block identifier exists and matches the device type based on the device structure mapping table, verifying whether the signal value is within a reasonable range based on the signal value reasonable range model, and comparing the message body payload verification values ​​of the sending end and the receiving end. The message association verification includes verifying whether the source message identifier of the non-initiator message corresponds to the received preceding message, and the result message is associated with the unique message identifier of the instruction message.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention uses a device structure modeling module to divide industrial equipment into standardized levels according to their physical characteristics and functions, generates a device structure mapping table, and establishes a signal value rationality range model. This enables unified positioning and management of signals from industrial equipment and sub-equipment, solving the problems of chaotic signal recognition and difficult data association in industrial scenarios in existing technologies. It provides a unified structural basis for subsequent message encapsulation and significantly improves the standardization and accuracy of industrial signal management.

[0015] 2. The message encapsulation module, based on the device structure mapping table, encapsulates the real-time signal data and business data of industrial equipment into a three-layer unified message format with message header, message header payload, and message body payload. This format can adapt to the multi-terminal communication needs of industrial equipment, server, and Web, effectively avoiding data redundancy and field omissions, improving the compatibility of multi-terminal communication, ensuring the synchronous transmission of real-time signals and business data in industrial scenarios, and enhancing the standardization of data transmission.

[0016] 3. The communication adaptation module can select the appropriate protocol based on the communication characteristics of industrial scenarios. It adopts corresponding protocols and data processing methods for weak network environments in industrial workshops, real-time interaction scenarios in mining operation areas, and reliable transmission scenarios of industrial business instructions. This effectively solves the problems of message loss and excessive transmission delay caused by insufficient protocol compatibility in existing technologies, ensuring the reliability and timeliness of message transmission in different industrial scenarios and meeting the needs of diverse communication scenarios in the field of industrial automation.

[0017] 4. The verification and association module employs a three-layer verification mechanism—format verification, data validity verification, and message association verification—to comprehensively verify the validity of industrial messages, effectively filter abnormal messages, and ensure the integrity and legality of industrial data. Simultaneously, by establishing a message association table, it realizes business associations between messages, forming a closed-loop industrial communication system of "instruction-execution-result." This enhances data reliability and traceability, meeting the high-precision and high-reliability requirements of equipment communication in industrial automation scenarios, and providing strong support for efficient collaborative operations between equipment and smooth business processes in the industrial automation field. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of a message packet system structure based on devices, sub-devices, and blocks proposed in this invention; Figure 2 This is a schematic diagram of the message packet assembly method based on devices, sub-devices, and blocks proposed in this invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] This system includes a device structure modeling module, a message encapsulation module, a communication adaptation module, and a verification and association module. These modules are closely integrated to form a complete communication management system encompassing structured modeling, unified encapsulation, reliable transmission, and effective verification. The functions and implementation methods of each module are as follows: (1) Equipment structure modeling module Function: Establish a standardized signal positioning system for complex devices, generate a device structure mapping table, and provide a unified structural basis for message encapsulation.

[0021] Implementation method: Based on the physical characteristics and functions of the equipment, the hierarchy is divided into equipment-sub-equipment-block-point number-signal value level: Device: Top-level unit, assigned a unique device identifier for locating specific devices; Sub-devices: Modules with independent lifecycles, such as independent sensors and actuators, are assigned sub-device identifiers. If there are no independent sub-devices, the identifier is set to 0. Block: A region divided according to physical proximity, with a block identifier assigned to enable centralized physical spatial management of signals; such as the front and rear of a device.

[0022] Point number: A unique identifier for a specific hardware signal, such as temperature signal point number 1, weight signal point number 2; Signal value: The actual data of the signal, associated with a data type identifier, such as 0 for integers and 1 for floating-point numbers.

[0023] Generate a device structure mapping table, store the association relationship between device identifier, sub-device identifier, block identifier, point number identifier, data type identifier, and physical description, and synchronize it to the message encapsulation module.

[0024] Establish a reasonable range model for signal values, and set a reasonable range for the signal value corresponding to each point number: signal value point number minimum threshold point number identifier point number maximum threshold point number identifier. Wherein, the minimum threshold of the point number is the minimum value of the signal corresponding to the point number identifier, and the maximum threshold of the point number is the maximum value, which is determined by the equipment parameters and industry standards. For example, the minimum threshold of temperature signal point number 1 is -40℃, and the maximum threshold is 85℃.

[0025] (2) Message encapsulation module Function: Based on the device structure mapping table, it encapsulates real-time signal data and business data into a unified message format that is applicable to multiple terminals.

[0026] Implementation method: Define a three-layer message structure: message header - message header payload - message body payload. Message header: contains a globally unique message identifier, sending time, sender, device identifier, sub-device identifier, message type, and source message identifier; The message identifier is generated using a universally unique identifier (UUID) to ensure uniqueness, and the sending time is accurate to milliseconds. The message type includes distinguishing between real-time signals and business data. Real-time signals are suffixed with status, instructions with instructions, results with results, and acknowledgments with acknowledgments. The source message identifier includes non-initiator messages, which are used to associate with preceding messages.

[0027] Message header payload: Carries fields related to the business scenario, such as the data source of real-time signals and the business number of business data. It also contains the check value of the message body payload, which is calculated using the MD5 hash algorithm to verify data integrity. Message payload: Divided into two data sets according to signal type: Real-time device signal set: includes point number identifier, block identifier, data type identifier, and signal value, supports batch transmission, and the fields strictly match the device structure mapping table; Business data set: contains specific business fields such as work order number, execution status, and equipment operation parameters, ensuring that business data is transmitted synchronously with equipment signals, with no redundant fields.

[0028] The message body payload is structured, and the number of fields is dynamically adjusted according to the device type and business scenario to avoid invalid data consuming bandwidth.

[0029] (3) Communication adaptation module Function: Select the appropriate protocol according to different communication scenarios to achieve reliable transmission of unified messages, adapting to diverse scenarios such as weak industrial networks, real-time interaction, and reliable commands.

[0030] Implementation method: Protocol selection logic: In a weak network environment in an industrial workshop: Select the Message Queuing Telemetry Transport Protocol (MQTT), configure Quality of Service (QoS) level 2 (QoS=2), and ensure that messages are transmitted "exactly once" through the publish-acknowledge-release-acknowledge process to avoid loss; For real-time interactive scenarios (such as web-based monitoring): select the WebSocket protocol, adopt full-duplex communication mode, and control the transmission latency to ≤100 milliseconds to meet the requirements of real-time data display; For reliable business instruction scenarios such as work order issuance: select the WebAPI protocol, use the POST request method, carry an authorization token in the request header to ensure security, and support a timeout retry mechanism.

[0031] Data processing: In a weak network environment: use the LZ4 compression algorithm to compress messages. The compression ratio is calculated as follows:

[0032] Prioritize ensuring a compression rate of ≥50%. If the bandwidth requirement of the scenario is low, the compression rate can be appropriately reduced, but the transmission stability requirements must be met. For sensitive data scenarios such as equipment parameters and operator information, the AES-128 encryption algorithm is enabled, and the key is managed uniformly by the system and updated regularly to prevent data leakage.

[0033] (4) Verification and Association Module Functions: Verify message validity, filter abnormal messages, establish business relationships between messages, form a closed-loop communication system of instruction-execution-result, and ensure reliable and usable data.

[0034] Implementation method: Three-layer verification mechanism: Format validation: Check whether the required fields in the message header, such as unique message identifier, sending time, device identifier, and message type, are missing, and whether the message type conforms to the suffix rules, such as status corresponding to real-time signals and instructions corresponding to business instructions. Data validity verification: Based on the equipment structure mapping table, verify that the point number identifier and block identifier exist and match the equipment type; Based on the signal value reasonableness range model, verify whether the signal value meets the minimum threshold and maximum threshold of the signal value point. Compare the message payload checksums (MD5 hash results) at the sending and receiving ends to ensure that the data has not been tampered with; Message association verification: Non-initiator messages need to verify whether the source message identifier corresponds to the received preceding message. If the result message is associated with the unique message identifier of the instruction message, it is necessary to ensure that the link is traceable.

[0035] Exception handling: Missing format: Send an acknowledgment message to the sender, specifying the missing field and requesting retransmission; Data out of range: Historical mean interpolation is used for correction, and the correction formula is as follows:

[0036] Simultaneously, an audible and visual alarm is triggered to notify maintenance personnel to investigate equipment sensor malfunctions. Illegal association: Discard the message, log the message content, reception time, and cause of the error for easy tracing later.

[0037] Association Management: Valid messages are stored in the message association table according to device identifier, message type, source message identifier, unique message identifier, and service number, supporting quick query of message links by device and service scenario.

[0038] The message encapsulation method is as follows: This method, based on the aforementioned system modules, executes the following steps to achieve consistent communication between the device, server, and web client: Equipment structure modeling: The equipment structure modeling module receives the physical parameters and signal characteristics of the equipment, divides the equipment-sub-equipment-block-point number hierarchy, generates the equipment structure mapping table and the reasonable range model of signal values, and synchronizes it to the message encapsulation module; Unified message encapsulation: The message encapsulation module obtains real-time signals or business data from the device, encapsulates them according to a three-layer structure of message header - message header payload - message body payload, calculates the message body check value and adds it to the message header payload, and generates a standardized message. Reliable communication transmission: The communication adaptation module analyzes scenario characteristics, such as weak network, real-time, and reliable commands, selects the appropriate adaptation protocol (MQTT / WebSocket / WebAPI), compresses or encrypts the message, and transmits it to the target end; Validation and Association: The validation and association module receives messages, performs three-level validation of format, data, and association, handles abnormal messages, synchronizes valid messages to the business system, updates the message association table, and completes the communication loop.

[0039] The following three closely linked embodiments fully demonstrate the application of the present invention in a real-time signal reporting-business instruction issuance-result feedback scenario. Each embodiment shares the device structure and message format, forming a business closed loop, ensuring that those skilled in the art can reproduce the present invention based on the embodiments.

[0040] Example 1: Real-time device signal reporting, based on device-sub-device-block signal encapsulation The scenario is as follows: The unattended mining weighing equipment 001 needs to report real-time weight signals of the cargo box to the server and the web interface. This equipment includes one independent weighing sub-device, with sub-device identifier = 20, and has independent online / offline functions and can perform fault detection independently. The cargo box is divided into a front weighing area and a rear weighing area according to its physical location. The front weighing area block identifier = 0, covering a range of 0-250 cm from the cargo box, corresponding to the left sensor group. The rear weighing area block identifier = 1, covering a range of 251-500 cm from the cargo box, corresponding to the right sensor group. The weight signal corresponds to the point number identifier = 0, the data type identifier = 0 (i.e., integer type), and the weight unit is kilograms. Based on the equipment's rated load of 100 tons and industry standards, the reasonable range of the weight signal is set to the signal value, with the unit being kilograms.

[0041] The implementation steps are as follows: Equipment Structure Modeling: The equipment structure modeling module receives parameters from the mining weighing equipment 001: Equipment Type = Mining Weighing, Number of Sub-equipment = 1, Number of Blocks = 2, Signal Type = Weight. It generates core entries in the equipment structure mapping table: Equipment Identifier = Mining Weighing Equipment 001; Sub-equipment Identifier = 20, physically described as an independent weighing sub-equipment containing 2 sets of sensors; Block Identifier = 0, physically described as the 0-250 cm weighing area of ​​the cargo box, with the left sensor group; Block Identifier = 1, physically described as the 251-500 cm weighing area of ​​the cargo box, with the right sensor group; Point Number Identifier = 0, physically described as a weight detection signal with an accuracy of ±1 kg; Data Type Identifier = 0, synchronized to the message encapsulation module; simultaneously, it establishes a weight signal reasonableness range model signal value for subsequent data validity verification.

[0042] Message Encapsulation: The weighing sub-equipment collects weight data (74753 kg) from the front and rear of the cargo box via sensors on the left and right sides, respectively, and transmits the data to the message encapsulation module. The module encapsulates the message using a three-layer structure: "message header - message header payload - message body payload". Header: The unique message identifier is generated using a UUID, with the sending time accurate to milliseconds. The sender is an unattended vehicle-mounted system. The device identifier is "Mining Weighing Equipment 001," the sub-device identifier is "20," the message type is "Real-time Weight Status of Cargo Container," "Real-time Signal," with a status suffix. The source message identifier is left blank. This is an initiator message with no prior associations. Message header payload: contains "Data source = left sensor group S001 / right sensor group S002, check value = A1B2C3D4E5F6, the check value is the result of the message body payload calculated using the MD5 hash algorithm; The message payload consists of a set of real-time device signals, containing two sets of signal data: the first set is for the front weighing area: point number identifier = 0, block identifier = 0, data type identifier = 0, signal value = 74753 kg; the second set is for the rear weighing area: point number identifier = 0, block identifier = 1, data type identifier = 0, signal value = 74753 kg. Both sets of data match the fields in the device structure mapping table, with no redundant information. The final standardized message is generated, with an overall size of 1.1 kilobytes, meeting the bandwidth requirements of industrial communication.

[0043] Communication Transmission: The communication adaptation module analyzes the scenario characteristics. The equipment is deployed in the mining operation area and needs to be synchronized to the web-based monitoring screen in real time. The transmission distance is ≤500 meters, which is determined to be a real-time interactive scenario, so the WebSocket protocol is selected. The module encapsulates messages in full-duplex communication mode. The frame header includes a message length of 1.1 kilobytes and a frame type of "real-time signal", while the frame body is a standardized message. A long WebSocket connection is established with the server and the web client, with a connection timeout of 10 seconds. The message is transmitted to the target end without network fluctuations during transmission, with a latency of 80 milliseconds, meeting the real-time monitoring requirements. The latency is ≤300 milliseconds. Validation and Association: The server-side and web-side validation and association modules synchronously receive messages and perform three-layer validation: Format validation: No required fields such as unique message identifier, sending time, device identifier, and message type are missing; the message type suffix is ​​status, which conforms to the real-time signal naming rules, and the format is valid; Data validity verification: Query the equipment structure mapping table. Point number identifier = 0 and block identifier = 0 / 1 both exist and match the mining weighing equipment 001; verify the signal value = 74753 kg, which satisfies 74753∈[0,100000]; calculate the MD5 hash result of the message body payload of the receiving end, which is consistent with A1B2C3D4E5F6 in the message header payload. The data has not been tampered with, and the validity verification is passed. Association verification: The source message identifier is left blank, which conforms to the initiator message rules, and the association verification passes. After the verification passes, the module synchronizes the message to the server's real-time database, and the storage period is 30 days. The web monitoring interface displays the following: front weight of mining weighing equipment 001-sub-equipment 20: 74753 kg, rear weight: 74753 kg. The server business system determines that the weight data reaches the ore sampling threshold. The sampling threshold is ≥50000 kg, triggering the sampling instruction issuance process, which provides data support for Example 2.

[0044] Example 2: Issuance of business invoice instructions, instruction transmission based on a unified message format. Scene The server-side business system triggers the sampling process based on the weight data of 74,753 kg in Example 1, and needs to issue a sampling ticket instruction to the ore collection device 001. This collection device has no independent sub-devices, and all functional modules work together. The block identifier corresponding to the sampling operation area is 0, the sampling status signal point identifier is 1, that is, the data type identifier is 1, floating point type, and the sampling weight unit is kilograms. According to the ore detection standard, the reasonable range of sampling weight is set as the signal value (unit: kilograms) to ensure that the sample volume meets the detection accuracy requirements.

[0045] Implementation steps Equipment Structure Modeling: The equipment structure modeling module receives parameters from ore acquisition equipment 001, including equipment type = ore acquisition, number of sub-equipment = 0, number of blocks = 1, and signal type = sampling status. It generates core entries in the equipment structure mapping table: Equipment identifier = ore acquisition equipment 001, sub-equipment identifier = 0, physical description: no independent sub-equipment, module linkage operation; block identifier = 0, physical description: sampling machine collaborative area, 3 fixed sampling locations; point number identifier = 1, physical description: sampling weight detection signal, accuracy ±0.1 kg; data type identifier = 1, synchronized to the message encapsulation module; and establishes a sampling weight reasonable range model signal value for subsequent sampling result verification.

[0046] Message encapsulation: The server-side business system generates core data for sampling tickets and transmits it to the message encapsulation module; the module encapsulates instruction messages according to a unified structure. Header: Unique message identifier = 2E0C46A3-8DE8-4667-8DD6-5213822F3A48 (generated by UUID), and the corresponding sending time is also generated. The sender is the mine back-end business system. Device identifier = ore collection device 001, sub-device identifier = 0, message type = ore sampling ticket instruction, and the source message identifier is left blank. Message header payload: Contains key information about the sampling ticket—work order number = AA952010-0688-4D98-B7EB-9E965778EDF4. Invoice Number = 2024111201001, Execution Mode = 1, Invoice Status = 2, Creation Time, Total Weight = 5000.5 kg, Number of Sample Batches = 200, Operator Information, Remarks = Sampled according to GB / T14596-2021 standard, Historical Sample Number = 201111200012 (associated with historical batches), Verification Value = F6E5D4C3B2A; Message payload: A collection of business data, including key parameters for sampling execution—sub-device association identifier = 150C46A3-8DE8-4667-8DD6-5213822F3A78 (the sampling execution unit associated with the data acquisition device), vehicle license plate number = New A00001, equipment code = E20000194818015021003E08, rated load = 50.0 tons, empty weight = 22.5 tons, and total length = 1. 125 mm, number of boxes = 1, number of supports = 2, support positions = 210, 521, box length = 735 mm, box width = 350 mm, box height = 110 mm, bottom height = 121 mm, step position = 564 mm, step height = 35 mm, target collaborative device = #1 sampler, planned sampling positions = 3 mm, 10 mm, 15 mm, current execution status = 1; all parameters match the sampling business logic to ensure that the equipment can automatically execute according to instructions.

[0047] Communication Transmission: The communication adaptation module analyzes the scenario characteristics (sampling commands must be delivered 100% to avoid missed sampling leading to batch detection failure; the transmission environment is a temporary mine network) and determines it as a "reliable business command scenario," selecting the WebAPI protocol. The module converts the standardized message into an HTTP request body, sets the content type to application / json, and carries an authorization token in the request header (TokenXXX, valid for 1 hour to prevent illegal commands). A request is sent to the designated interface (port=8080, path= / device / command) of the ore collection device 001. The first request times out due to network fluctuations (timeout time=5 seconds), and the module triggers a retry mechanism (number of retries=3, interval=5 seconds). The second request is successfully delivered, ensuring no command loss.

[0048] Verification and Correlation: The verification module of ore acquisition equipment 001 receives the instruction message and performs three-layer verification: Format validation: The message type suffix is ​​"instruction", and all required fields such as unique message identifier and device identifier are present and valid; Data validity verification: Query the device structure mapping table, block identifier = 0 exists and matches the sampling area; planned sampling positions = 3 mm, 10 mm, and 15 mm are all within the physical range (0-20 mm) of block identifier = 0; calculate the MD5 hash result of the received end message body payload, which is consistent with F6E5D4C3B2A1 in the message header payload, so the data is valid; Association Verification: The source message identifier is left blank. If it conforms to the initiator's instruction rules, the association verification passes. After the verification passes, the device stores the instruction in the local execution queue (priority = high, ensuring priority execution), and generates a confirmation message (feedback on the reception status): Unique message identifier = 7C3E8A9D-7BF6-4B12-8CE7-567890B1C2D3, source message identifier = 2E0C46A3-8DE8-4667-8DD6-5213822F3A48 (unique message identifier of the associated instruction message), sender = ore collection device 001, message type = ore sampling ticket confirmation. After receiving the "confirmation" message, the server records "sampling instruction has been delivered to ore collection device 001", updates the work order status to "instruction delivered", and waits for the execution result.

[0049] Example 3: Business execution result feedback, business closed loop based on message association The scenario is as follows: After receiving the sampling instruction from Example 2, the ore sampling device 001, in collaboration with the #1 sampler, completes ore sampling at three fixed points as planned and needs to send the sampling results back to the server. The feedback message must be associated with the unique message identifier of the instruction message to ensure that the "instruction-execution-result" link is traceable, and at the same time trigger the subsequent ore composition detection process to form a business closed loop.

[0050] The implementation steps are as follows: Message Encapsulation: After the ore sampling device 001 completes sampling, it collects the execution result data through the sampling weight sensor: actual sampling positions 3.2 mm, 10.1 mm, and 15.2 mm (deviation from planned positions ≤ 0.5 mm, meeting accuracy requirements), sampling weight 1.2 kg (weight of a single sample), execution status = 3 (completed), execution remarks "Sampling completed, sample undamaged and uncontaminated," and transmits the data to the message encapsulation module; the module encapsulates the result message according to a unified structure: Header: Unique message identifier = 6B3D79E1-8CF5-4A23-9CD8-456789A0B1C2 (UUID generation), corresponding sending time, sender = ore collection device 001, device identifier = ore collection device 001, sub-device identifier = 0, message type = ore sampling ticket result, source message identifier = 2E0C46A3-8DE8-4667-8DD6-5213822F3A48; Message header payload: Includes work order number = AA952010-0688-4D98-B7EB-9E965778EDF4, which is consistent with the instruction work order number to ensure business association, ticket status = 3 (completed), sample weight = 1.2 kg, sampling completion time, check value = C1D2E3F4A5B6, and the check value is the MD5 hash result of the message body payload; Message payload: This is a set of business data, containing key information about the sampling results—sub-device association identifier = 150C46A3-8DE8-4667-8DD6-5213822F3A78 (consistent with the instruction sub-device association identifier), actual sampling location = 3.2 mm, 10.1 mm, 15.2 mm, target cooperating device = #1 sampler, execution status = 3 (completed), remarks = sampling completed, sample undamaged and uncontaminated, sample storage location = compartment 1 of the cargo box; the result data corresponds one-to-one with the instruction parameters, ensuring the continuity of business logic.

[0051] Communication Transmission: The communication adaptation module analyzes the scenario characteristics (ore collection device 001 is deployed in an industrial workshop, where dense equipment results in a weak network with bandwidth ≤1 Mbps), determining it to be a weak network environment, and selects the MQTT protocol; the module uses the LZ4 compression algorithm for message processing, with the message size being 1.8 kilobytes before compression and 1.1 kilobytes after compression. Calculated according to the compression ratio formula: although the compression ratio does not reach the ideal 50%, the workshop's weak network bandwidth requirement is low (≤1 Mbps), and the compressed message size can meet the transmission requirements without increasing transmission latency; at the same time, the MQTT protocol QoS=2 is configured, and the topic is constructed as = device / ore collection device 001 / ore sampling ticket result, named according to the device type / device identifier / message type rules, facilitating server subscription, and transmitted according to the publish-confirm-release-confirm process to avoid message loss; finally, the message is successfully delivered to the server with a 100% success rate and a latency of 220 milliseconds, meeting the transmission requirements of the weak network scenario.

[0052] Validation and Association: The server-side validation and association module receives the result message and performs three-layer validation and association: Format validation: The message type suffix is ​​"result", the source message identifier is complete, and fields such as unique message identifier and sending time are not missing; the format is valid. Data validity verification: Query the device structure mapping table, block identifier = 0 matches the sampling area; the difference between the actual sampling location and the planned sampling location is ≤ 0.5 mm, which meets the sampling accuracy requirements; the sampling weight = 1.2 kg satisfies 1.2 ∈ [0,5]; calculate the MD5 hash result of the message body payload of the receiving end, which is consistent with C1D2E3F4A5B6 in the message header payload, indicating that the data has not been tampered with, and the validity verification is passed; Association validation: Query the message association table; Source message identifier = 2E0C46A3-8DE8-4667-8DD6-5213822F3A48 corresponds to the sampling command in Example 2; The work order number = AA952010-0688-4D98-B7EB-9E965778EDF4 is completely consistent with the instruction, and the association is legal. After the verification and association are passed, the module will synchronize the result message to the server business system: update the sampling work order status to completed, and generate a sampling report (including equipment identification, sampling time, sample weight, and position deviation). The web monitoring interface displays "Ore collection equipment 001 sampling completed: sample weight 1.2 kg, actual sampling positions 3.2 mm, 10.1 mm, 15.2 mm, associated ticket number 2024111201001; at the same time, associate the weight data of Example 1 (74753 kg), generate a business link report of mining weighing equipment 001 weighing 74753 kg - ore collection equipment 001 sampling 1.2 kg, trigger the subsequent ore composition detection process, and complete the real-time signal-instruction-result full-link closed loop.

[0053] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A message packet assembly system based on devices, sub-devices, and blocks, characterized in that, It includes a device structure modeling module, a message encapsulation module, a communication adaptation module, and a verification and association module. These modules are connected in sequence to form a full-process communication management system with structured modeling, unified encapsulation, reliable transmission, and effective verification. The equipment structure modeling module is used to divide the equipment into levels according to its physical characteristics and functions, generate an equipment structure mapping table, and establish a signal value reasonable range model. The message encapsulation module is used to encapsulate real-time signal data and service data into a unified message format with a three-layer structure of message header, message header payload, and message body payload, based on the device structure mapping table. The communication adaptation module is used to select an adaptation protocol according to different communication scenarios, process the unified message, and then transmit it. The verification and association module is used to perform format verification, data validity verification, and message association verification on the received unified message, process abnormal messages, and establish business associations between messages.

2. The message packet assembly system based on devices, sub-devices, and blocks according to claim 1, characterized in that, The device structure modeling module divides the hierarchy into device, sub-device, block, point number, and signal value levels. The device is the top-level unit and assigned a unique device identifier. Sub-devices are modules with independent lifecycles and assigned sub-device identifiers; if no independent sub-device exists, the sub-device identifier is set to 0. Blocks are regions divided based on physical proximity and assigned block identifiers. Point numbers are unique identifiers for specific hardware signals. Signal values ​​are associated with data type identifiers. The device structure mapping table stores the relationships between device identifiers, sub-device identifiers, block identifiers, point number identifiers, data type identifiers, and physical descriptions.

3. The message packet assembly system based on devices, sub-devices, and blocks according to claim 1, characterized in that, The message header includes a globally unique message identifier, sending time, sender, device identifier, sub-device identifier, message type, and source message identifier. The sending time is accurate to milliseconds. The message identifier is generated using a universally unique identification code. The message type is distinguished by data type: real-time signal suffix is ​​status, instruction suffix is ​​instruction, result suffix is ​​result, and confirmation suffix is ​​confirmation. The source message identifier is filled in by non-initiator messages to associate with preceding messages. The message header payload includes business scenario-related fields and the verification value of the message body payload. The business scenario-related fields include the data source of the real-time signal and the business number of the business data. The verification value is calculated using the MD5 hash algorithm. The message body payload is divided into a real-time device signal set and a business data set according to the signal type. The real-time device signal set includes point number identifier, block identifier, data type identifier, and signal value. The business data set includes specific business fields, including work order number, execution status, and device operation parameters.

4. The message packet assembly system based on devices, sub-devices, and blocks according to claim 1, characterized in that, The protocol selection logic of the communication adaptation module is to select the message queue telemetry transmission protocol and configure the service quality level 2 in the weak network environment of the industrial workshop. For real-time interaction scenarios, the WebSocket protocol is selected and a full-duplex communication mode is adopted. Real-time interaction scenarios include web-based monitoring. For reliable business instruction scenarios, the WebAPI protocol is selected and a POST request method is adopted with an authorization token in the request header. Reliable business instruction scenarios include work order issuance. The communication adaptation module can also enable LZ4 compression algorithm or AES-128 encryption algorithm for messages. LZ4 compression algorithm is enabled in weak network environment, and AES-128 encryption algorithm is enabled in sensitive data scenarios. Sensitive data scenarios include device parameters and operator information. The key is managed uniformly by the system and updated regularly.

5. The message packet assembly system based on devices, sub-devices, and blocks according to claim 1, characterized in that, The exception handling method of the verification and association module is to send an acknowledgment message to the sender and specify the missing field when the format is missing in order to request retransmission. When data is out of range, historical average interpolation is used for correction and an audible and visual alarm is triggered. The audible and visual alarm is used to notify maintenance personnel to troubleshoot equipment sensor malfunctions. When an association is illegal, the message is discarded and a log is recorded. The log contains the message content, the reason for the abnormal message reception time. The verification and association module also stores valid messages in the message association table according to device identifier, message type, source message identifier, unique message identifier, and service number. The message association table supports querying message links by device and service scenario.

6. A message packet assembly method based on devices, sub-devices, and blocks, characterized in that, The system based on any one of claims 1-5 includes the following steps: S1 Equipment Structure Modeling: The equipment structure modeling module receives the physical parameters and signal characteristics of the equipment, divides them into levels, and generates an equipment structure mapping table and a signal value rationality range model, which is then synchronized to the message encapsulation module. S2 Unified Message Encapsulation: The message encapsulation module obtains real-time signal data or business data, encapsulates it into a unified message according to the three-layer structure of message header, message payload, and message body payload, and adds the check value of the message body payload to the message header payload. S3 Reliable Communication Transmission: The communication adaptation module analyzes the characteristics of the communication scenario, selects the adaptation protocol, processes the unified message, and transmits it to the target end; S4 Validation and Association: The validation and association module receives the unified message, performs format validation, data validity validation and message association validation, processes abnormal messages, synchronizes valid messages to the business system and updates the message association table.

7. The message packet assembly method based on devices, sub-devices, and blocks as described in claim 6, characterized in that, In step S1, the signal value reasonable range model sets a reasonable range for the signal value corresponding to each point number identifier. The range is determined by the equipment parameters and industry standards.

8. The message packet assembly method based on devices, sub-devices, and blocks as described in claim 6, characterized in that, In step S2, the fields of the real-time device signal set are strictly matched with the device structure mapping table to support batch transmission, and the number of fields in the message body payload is dynamically adjusted according to the device type and business scenario to avoid invalid data occupying bandwidth.

9. The message packet assembly method based on devices, sub-devices, and blocks as described in claim 6, characterized in that, In step S3, when using the WebAPI protocol, a timeout retry mechanism is configured, and the retry interval is set as needed; when using the message queue telemetry transmission protocol, transmission is carried out according to the publish-confirm-release-confirm process; when using the WebSocket protocol, transmission latency is controlled to meet the real-time data display requirements.

10. The message packet assembly method based on devices, sub-devices, and blocks as described in claim 6, characterized in that, In step S4, the data validity verification includes verifying whether the point number identifier block identifier exists and matches the device type based on the device structure mapping table, verifying whether the signal value is within a reasonable range based on the signal value reasonable range model, and comparing the message body payload verification values ​​of the sending end and the receiving end. The message association verification includes verifying whether the source message identifier of the non-initiator message corresponds to the received preceding message, and the result message is associated with the unique message identifier of the instruction message.