Protocol processing method and device of dynamic ring monitoring equipment, equipment, storage medium and computer program product
By acquiring the resource and protocol configuration information of environmental monitoring equipment, identifying and initializing the target protocol plugin, performing protocol parsing and data standardization, and combining it with message bus distribution, the problem of protocol processing flexibility in environmental monitoring systems is solved, achieving flexible adaptation of device access and unified data format.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZTE NETVIEW TECH
- Filing Date
- 2026-03-16
- Publication Date
- 2026-07-03
AI Technical Summary
Existing environmental monitoring systems lack a unified management mechanism for device access and protocol processing, resulting in poor protocol processing flexibility and difficulty in adapting to the continuous access needs of multiple types of devices. Furthermore, differences in device interaction data formats increase the difficulty of system integration and maintenance.
By acquiring the resource configuration information and protocol configuration information of the target acquisition channel, the target protocol plugin is determined, and initialization is performed based on the preset interface specifications. Call relationships are established, protocol parsing and data standardization are carried out, distribution is performed in conjunction with the message bus, and dynamic updates are performed in response to configuration change or upgrade commands.
It achieves flexible adaptation of protocol processing logic, improves the protocol processing flexibility of environmental monitoring equipment, reduces the difficulty of system integration and maintenance, and supports continuous access of multiple types of devices and unified data format.
Smart Images

Figure CN122332210A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of intelligent hardware and environmental monitoring technology, and in particular to a protocol processing method, apparatus, device, storage medium and computer program product for environmental monitoring equipment. Background Technology
[0002] As the number of devices connected to environmental monitoring systems continues to increase, the communication types, access methods, and protocol formats of field devices are becoming increasingly complex. Different manufacturers and models of environmental monitoring equipment typically employ their own independent communication protocols and data organization methods. This means that existing systems often need to develop separate parsing logic for each specific device when handling device access and protocol processing, directly coupling the protocol processing logic within the acquisition program or business program. Consequently, when the connected devices change or new device types are added, it is usually necessary to modify, compile, and deploy the existing program. The protocol processing lacks a unified management mechanism, and the high degree of coupling between the acquisition channel and the protocol logic makes it difficult to adapt to the continuous access needs of multiple types of devices. On the other hand, in existing environmental monitoring scenarios, after the data from equipment interactions is collected and parsed, it often needs to be further transmitted to different business modules for processing. However, due to differences in data formats, field structures, and expression methods among different devices, inconsistencies in data connection between subsequent modules can easily occur, increasing the difficulty of system integration and maintenance. Furthermore, during equipment operation, the parameters of the acquisition channels, protocol configurations, and even the protocol processing programs themselves may need to be adjusted according to changes in on-site access conditions. Existing technologies typically lack a unified dynamic update mechanism for acquisition channels and protocol processing logic, resulting in poor flexibility in the protocol processing of environmental monitoring equipment. Therefore, improving the flexibility of protocol processing in environmental monitoring equipment has become an urgent technical problem to be solved. Summary of the Invention
[0003] The main objective of this application is to provide a protocol processing method, apparatus, device, storage medium, and computer program product for environmental monitoring equipment, aiming to solve the technical problem of how to improve the flexibility of protocol processing in environmental monitoring equipment.
[0004] To achieve the above objectives, this application provides a protocol processing method for environmental monitoring equipment, the method comprising the following steps: Obtain resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information; Load the target protocol plugin and initialize it based on the preset interface specification so that the target protocol plugin establishes a calling relationship with the target acquisition channel; Based on the target acquisition channel, device interaction data is acquired, and the target protocol plugin is called to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; The standardized data is sent to the message bus for external modules to subscribe to. In response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated.
[0005] In one embodiment, the step of obtaining resource configuration information for a target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and determining the target protocol plugin associated with the target acquisition channel based on the protocol configuration information, includes: Obtain the channel identifier information corresponding to the target acquisition channel and the resource parameter set associated with the channel identifier information, wherein the resource parameter set is used to characterize the access type, communication parameters and channel activation status of the target acquisition channel; Based on the channel identification information, a set of protocol parameters corresponding to the target acquisition channel is obtained, wherein the set of protocol parameters includes at least protocol identification information and plugin identification information related to protocol calls; Based on the plugin identification information in the protocol parameter set, the target protocol plugin corresponding to the target acquisition channel is determined from the preset plugin library, so as to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information.
[0006] In one embodiment, the step of loading the target protocol plugin and initializing the target protocol plugin based on a preset interface specification to establish a calling association between the target protocol plugin and the target acquisition channel includes: Read the plugin description information corresponding to the target protocol plugin, and load the target protocol plugin based on the plugin description information to obtain the interface instance corresponding to the target protocol plugin; Based on the preset interface specification, the interface instance is subjected to interface verification processing, and the channel context information corresponding to the target acquisition channel is transmitted to the interface instance that passes the verification to trigger the initialization processing of the target protocol plugin. Based on the interface instance after initialization, a call mapping relationship is established between the target protocol plugin and the target acquisition channel, so that the target protocol plugin and the target acquisition channel establish a call association relationship.
[0007] In one embodiment, the step of acquiring device interaction data based on the target acquisition channel and calling the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain corresponding standardized data includes: Based on the communication parameters corresponding to the target acquisition channel, data interaction is performed with the target device to obtain the original message data returned by the target device, and the original message data is determined as the device interaction data; The device interaction data is input into the target protocol plugin that establishes a call association with the target acquisition channel. The target protocol plugin then performs field recognition, content extraction, and format conversion on the device interaction data according to preset protocol rules to obtain the corresponding parsing result data. Based on preset data representation standards, the parsed data is uniformly encapsulated and formatted to obtain corresponding standardized data.
[0008] In one embodiment, the step of sending the standardized data to the message bus for subscription processing by an external module includes: Based on preset message organization rules, the standardized data is subjected to topic identifier matching and message encapsulation processing to generate target message data corresponding to the standardized data. The target message data is sent to the message bus, and the target message data is published in the message bus according to the publishing channel corresponding to the topic identifier; In response to a subscription request initiated by an external module for the publishing channel, the target message data is pushed to the corresponding external module to send the standardized data to the message bus for subscription processing by the external module.
[0009] In one embodiment, the step of dynamically updating the target acquisition channel and / or the target protocol plugin in response to a configuration change command or upgrade command includes: Obtain the configuration change instruction or the upgrade instruction, and parse the configuration change instruction or the upgrade instruction to determine the target update object and the update content corresponding to the target update object, wherein the target update object includes the target acquisition channel and / or the target protocol plugin; When the target update object is the target acquisition channel, the resource configuration information corresponding to the target acquisition channel is adjusted based on the update content, and the channel running parameters corresponding to the adjusted resource configuration information are rebuilt or reloaded. When the target update object is the target protocol plugin, the target protocol plugin is replaced or switched based on the update content, and the calling association between the target protocol plugin and the target acquisition channel is re-established. Based on the updated target acquisition channel and / or the updated target protocol plugin, the corresponding protocol processing flow is restored to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change instructions or upgrade instructions.
[0010] Furthermore, to achieve the above objectives, this application also proposes a protocol processing device for an environmental monitoring device, the protocol processing device for the environmental monitoring device comprising: The information acquisition module is used to acquire resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information. The associated module is invoked to load the target protocol plugin and initialize the target protocol plugin based on a preset interface specification, so as to establish an association between the target protocol plugin and the target acquisition channel. The protocol parsing module is used to acquire device interaction data based on the target acquisition channel, and call the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data. The data forwarding module is used to send the standardized data to the message bus for external modules to subscribe to. The dynamic update module is used to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change commands or upgrade commands.
[0011] Furthermore, to achieve the above objectives, this application also proposes a protocol processing device for an environmental monitoring device, the device comprising: a memory, a processor, and a protocol processing program for the environmental monitoring device stored in the memory and executable on the processor, the protocol processing program for the environmental monitoring device being configured to implement the steps of the protocol processing method for the environmental monitoring device as described above.
[0012] In addition, to achieve the above objectives, this application also proposes a storage medium storing a protocol processing program for an environmental monitoring device, wherein when the protocol processing program for the environmental monitoring device is executed by a processor, it implements the steps of the protocol processing method for the environmental monitoring device as described above.
[0013] In addition, to achieve the above objectives, this application also proposes a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the protocol processing method for the environmental monitoring equipment described above.
[0014] This application obtains resource configuration information for the target acquisition channel and corresponding protocol configuration information, determines the target protocol plugin associated with the target acquisition channel based on the protocol configuration information, loads the target protocol plugin, and initializes the target protocol plugin based on a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel; acquires device interaction data based on the target acquisition channel, and calls the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; sends the standardized data to the message bus for external modules to subscribe to; and dynamically updates the target acquisition channel and / or the target protocol plugin in response to configuration change or upgrade commands. This application associates target acquisition channels with corresponding target protocol plugins and initializes the plugins based on preset interface specifications, enabling the protocol processing logic to adapt to different acquisition channels according to the configuration method. Furthermore, by calling the target protocol plugins to parse the device interaction data and output standardized data, and then distributing it in conjunction with the message bus, the protocol parsing is separated from subsequent data use. At the same time, by dynamically updating the target acquisition channels and / or target protocol plugins, the channel configuration and protocol processing logic can be adjusted as needed, improving the flexibility of protocol processing in environmental monitoring equipment. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating the first embodiment of the protocol processing method for the environmental monitoring equipment of this application; Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the protocol processing method for the environmental monitoring equipment of this application; Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the protocol processing method for the environmental monitoring equipment of this application; Figure 4 This is a schematic diagram of the plug-in protocol engine system architecture in one embodiment of the protocol processing method for environmental monitoring equipment of this application; Figure 5 This is a schematic diagram of the OTA upgrade process in one embodiment of the protocol processing method for the environmental monitoring equipment of this application; Figure 6 This is a schematic diagram of the module structure of the protocol processing device of the environmental monitoring equipment in an embodiment of this application; Figure 7 This is a schematic diagram of the hardware operating environment involved in the protocol processing method of the environmental monitoring equipment in this embodiment of the application.
[0016] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0017] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0018] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0019] It should be noted that as the number of devices connected to environmental monitoring systems continues to increase, the communication types, access methods, and protocol formats of field devices are becoming increasingly complex. Different manufacturers and models of environmental monitoring equipment typically employ their own independent communication protocols and data organization methods. This means that existing systems often need to develop corresponding parsing logic for each specific device when connecting devices and processing protocols, directly coupling the protocol processing logic within the acquisition program or business program. Consequently, when the connected devices change or new device types are added, it is usually necessary to modify, compile, and deploy the existing program. The protocol processing lacks a unified management mechanism, and the coupling between the acquisition channel and the protocol logic is high, making it difficult to adapt to the continuous access needs of multiple types of devices. On the other hand, in existing environmental monitoring scenarios, after the data from equipment interactions is collected and parsed, it often needs to be further transmitted to different business modules for processing. However, due to differences in data formats, field structures, and expression methods among different devices, inconsistencies in data connection between subsequent modules can easily occur, increasing the difficulty of system integration and maintenance. Furthermore, during equipment operation, the parameters of the acquisition channels, protocol configurations, and even the protocol processing programs themselves may need to be adjusted according to changes in on-site access conditions. Existing technologies typically lack a unified dynamic update mechanism for acquisition channels and protocol processing logic, resulting in poor flexibility in the protocol processing of environmental monitoring equipment. Therefore, improving the flexibility of protocol processing in environmental monitoring equipment has become an urgent technical problem to be solved.
[0020] The main solution of this application is as follows: Obtain resource configuration information for the target acquisition channel and corresponding protocol configuration information; determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information; load the target protocol plugin and initialize it according to a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel; acquire device interaction data based on the target acquisition channel and call the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; send the standardized data to the message bus for external modules to subscribe to; and dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change or upgrade commands.
[0021] This application associates target acquisition channels with corresponding target protocol plugins and initializes the plugins based on preset interface specifications, enabling the protocol processing logic to adapt to different acquisition channels according to the configuration method. Furthermore, by calling the target protocol plugins to parse the device interaction data and output standardized data, and then distributing it in conjunction with the message bus, the protocol parsing is separated from subsequent data use. At the same time, by dynamically updating the target acquisition channels and / or target protocol plugins, the channel configuration and protocol processing logic can be adjusted as needed, improving the flexibility of protocol processing in environmental monitoring equipment.
[0022] It should be noted that the execution subject of the method in this embodiment can be a computing service device with data processing, network communication, and program execution functions, or it can be a protocol processing device of the aforementioned environmental monitoring device with the same or similar functions. This embodiment and the following embodiments will be described using the protocol processing device of the environmental monitoring device as an example.
[0023] Based on this, a first embodiment of the protocol processing method for the environmental monitoring equipment of this application is proposed. Please refer to [link / reference]. Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the protocol processing method for the environmental monitoring equipment of this application.
[0024] In this embodiment, the protocol processing method of the environmental monitoring device includes the following steps: S1: Obtain resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information; It should be noted that the target acquisition channel refers to the channel object used for data interaction with the target device. Resource configuration information refers to the configuration information related to the establishment and operation of the target acquisition channel. Protocol configuration information refers to the protocol processing configuration content corresponding to the target acquisition channel. The target protocol plugin refers to the plugin object determined according to the protocol configuration information, used for protocol processing of the data exchanged with the device corresponding to the target acquisition channel.
[0025] Specifically, firstly, the system, based on the access requirements of the target device, obtains resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel. The resource configuration information clarifies the resource attributes and communication conditions of the target acquisition channel, while the protocol configuration information characterizes the protocol processing method corresponding to the target acquisition channel during subsequent data interaction. In other words, this step does not involve fixing the protocol processing logic first and then finding an adapter; instead, it first establishes a "channel-configuration" correspondence around the target acquisition channel, ensuring that the target acquisition channel possesses both resource-side and protocol-side descriptions.
[0026] Furthermore, after obtaining the resource configuration information and the protocol configuration information, the system further matches available protocol processing objects based on the protocol configuration information to determine the target protocol plugin associated with the target acquisition channel. This determination process essentially involves filtering out the target protocol plugin corresponding to the target acquisition channel from candidate protocol plugins based on the protocol category, protocol identifier, or protocol call description represented in the protocol configuration information, and establishing a correspondence between the target protocol plugin and the target acquisition channel.
[0027] This step first obtains the resource configuration information for the target acquisition channel, then obtains the protocol configuration information corresponding to the target acquisition channel, and determines the target protocol plugin associated with the target acquisition channel based on the protocol configuration information. This ensures that the determination of the protocol processing object is not fixed within the acquisition process, but is based on the correspondence between the target acquisition channel and the protocol configuration information. In this way, when different target acquisition channels correspond to different protocol processing requirements, the corresponding target protocol plugin can be determined through the protocol configuration information, thereby establishing a configurable association between the target acquisition channel and the protocol processing logic, and providing a foundation for the adaptability and flexibility of subsequent protocol processing.
[0028] S2: Load the target protocol plugin and initialize the target protocol plugin based on the preset interface specification so that the target protocol plugin establishes a calling association with the target acquisition channel; S3: Acquire device interaction data based on the target acquisition channel, and call the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; It should be noted that the preset interface specification is a pre-defined interface rule used to constrain the access, invocation, and data interaction methods of the target protocol plugin. Initialization processing refers to the process of preparing and connecting the plugin according to the preset interface specification after loading it. Invocation association refers to the correspondence between the target protocol plugin and the target acquisition channel, enabling data interaction and function invocation. Device interaction data refers to the data content acquired when communicating with the target device through the target acquisition channel. Protocol parsing processing refers to the process of identifying, splitting, extracting, and converting the device interaction data according to the corresponding protocol rules. Standardized data refers to data that meets unified expression requirements after being parsed by the target protocol plugin.
[0029] Specifically, firstly, the system loads the identified target protocol plugin and performs initialization processing on it according to a preset interface specification. This initialization process may include checking the plugin interface, loading runtime parameters, preparing the plugin's internal processing entry point, and enabling the target protocol plugin to recognize the channel environment and call requests corresponding to the target acquisition channel. Through this process, the target protocol plugin is no longer an independent processing unit, but can respond to subsequent data processing tasks directed to the target acquisition channel, thereby establishing a call association between the target protocol plugin and the target acquisition channel.
[0030] Furthermore, after completing the aforementioned association, the system interacts with the target device through the target acquisition channel to obtain corresponding device interaction data, and then transmits this data to the target protocol plugin. Subsequently, the target protocol plugin performs protocol parsing processing on the device interaction data according to the corresponding protocol rules, such as identifying data content, extracting fields, formatting, and converting results to form data content that meets unified expression requirements, ultimately obtaining the corresponding standardized data. Thus, the target acquisition channel is responsible for data access, and the target protocol plugin is responsible for protocol parsing; the two work together to complete the processing from raw interaction data to standardized data.
[0031] This step first loads and initializes the target protocol plugin, establishing a call relationship between it and the target acquisition channel. Then, it acquires device interaction data based on the target acquisition channel and calls the target protocol plugin for protocol parsing to obtain the corresponding standardized data. This approach allows the protocol processing logic to connect to the corresponding acquisition channel based on preset interface specifications, avoiding the direct embedding of protocol parsing within the channel processing flow. Furthermore, it enables device interaction data from different sources to be parsed through the corresponding target protocol plugin and uniformly converted into standardized data. Based on this, a relatively clear division of labor is established between the acquisition channel and protocol parsing, providing a better foundation for the access and processing of different protocol data.
[0032] S4: Send the standardized data to the message bus for external modules to subscribe to; S5: In response to a configuration change command or upgrade command, dynamically update the target acquisition channel and / or the target protocol plugin.
[0033] It should be noted that the message bus refers to a data interaction channel used to transmit the standardized data and support external modules in acquiring the standardized data. An external module refers to a functional module located outside the protocol processing flow that receives and uses the standardized data. A configuration change instruction refers to a control instruction used to adjust the configuration content of the target acquisition channel and / or the target protocol plugin. An upgrade instruction refers to a control instruction used to trigger an update process for the target acquisition channel and / or the target protocol plugin. Dynamic update processing refers to the process of adjusting, replacing, reloading, or re-associating the target acquisition channel and / or the target protocol plugin during system operation.
[0034] Specifically, after obtaining the standardized data, it is sent to the message bus. This sending process can be understood as follows: the data, after being uniformly expressed, is written into the message bus according to a preset data transmission method, so that the message bus acts as a data distribution carrier to store or forward the standardized data. Subsequently, external modules that have established a data receiving relationship with the message bus can subscribe to the standardized data according to their respective data needs, thereby obtaining data content related to their own business processing. Through this process, after the standardized data completes protocol parsing, it is no longer directly limited to a single subsequent processing object, but provides a unified data output path to external modules via the message bus.
[0035] Furthermore, during system operation, if a configuration change command or upgrade command is received, the system performs dynamic update processing on the target acquisition channel and / or the target protocol plugin. Specifically, for the target acquisition channel, its corresponding configuration content can be adjusted based on the configuration change command or the upgrade command; for the target protocol plugin, its corresponding plugin content can be replaced, reloaded, or re-associated based on the configuration change command or the upgrade command. After this dynamic update processing, the target acquisition channel and / or the target protocol plugin can continue to participate in subsequent protocol processing flows in their updated state.
[0036] This step first sends the standardized data to the message bus for external modules to subscribe to, connecting the output of the standardized data with subsequent use via the message bus. This allows external modules to obtain the standardized data through subscription, reducing the direct binding between the protocol processing results and any single subsequent module. Simultaneously, in response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated, enabling the acquisition side and protocol processing side to adjust according to changing requirements during operation. Based on the combination of these technical features, the standardized data distribution method and protocol processing flow adjustment method have better adaptability and adjustability.
[0037] This embodiment obtains resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel. Based on the protocol configuration information, it determines the target protocol plugin associated with the target acquisition channel. The target protocol plugin is loaded and initialized according to a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel. Device interaction data is obtained based on the target acquisition channel, and the target protocol plugin is invoked to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data. The standardized data is sent to the message bus for external modules to subscribe to. In response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated. This embodiment associates the target acquisition channel with the corresponding target protocol plugin and initializes the plugin based on a preset interface specification, enabling the protocol processing logic to adapt to different acquisition channels according to the configuration method. Furthermore, by calling the target protocol plugin to parse the device interaction data and output standardized data, and then distributing it in conjunction with the message bus, the protocol parsing is separated from subsequent data use. At the same time, by dynamically updating the target acquisition channel and / or the target protocol plugin, the channel configuration and protocol processing logic can be adjusted as needed, improving the flexibility of protocol processing of the environmental monitoring equipment.
[0038] Based on the first embodiment described above, a second embodiment of the protocol processing method for the environmental monitoring equipment of this application is proposed. Please refer to... Figure 2 , Figure 2 This is a schematic diagram of a sub-process in the second embodiment of the protocol processing method for the environmental monitoring equipment of this application.
[0039] like Figure 2 As shown, in this embodiment, step S1 includes: S11: Obtain the channel identifier information corresponding to the target acquisition channel and the resource parameter set associated with the channel identifier information, wherein the resource parameter set is used to characterize the access type, communication parameters and channel activation status of the target acquisition channel; S12: Based on the channel identification information, obtain the protocol parameter set corresponding to the target acquisition channel, wherein the protocol parameter set includes at least protocol identification information and plugin identification information related to protocol calls; S13: Based on the plugin identification information in the protocol parameter set, determine the target protocol plugin corresponding to the target acquisition channel from the preset plugin library, so as to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information.
[0040] It should be noted that channel identification information refers to the identification content used to distinguish and locate the target acquisition channel. Resource parameter set refers to the parameter content associated with the channel identification information and used to describe the resource attributes of the target acquisition channel. Communication parameters refer to the parameter information used by the target acquisition channel when conducting data communication. Channel activation status refers to the status information indicating whether the target acquisition channel is currently available. Preset plugin library refers to a pre-defined set of plugins used to store multiple candidate protocol plugins.
[0041] Specifically, firstly, the system determines the target acquisition channel matching the access object corresponding to the target device and obtains the channel identification information corresponding to the target acquisition channel. Based on the channel identification information, the system further reads the resource parameter set associated with the target acquisition channel. This resource parameter set describes the resource attributes of the target acquisition channel, including the access type used by the target acquisition channel, the communication parameters corresponding to data communication, and the current channel activation status of the target acquisition channel. Through this process, a resource-side description for a specific acquisition channel can be established first, enabling the subsequent protocol configuration acquisition process to proceed based on the target acquisition channel.
[0042] Furthermore, after obtaining the channel identification information and resource parameter set, the system obtains the protocol parameter set corresponding to the target acquisition channel based on the channel identification information. The protocol parameter set includes at least protocol identification information and plugin identification information related to protocol invocation. The protocol identification information characterizes the data processing protocol category corresponding to the target acquisition channel, and the plugin identification information indicates the protocol plugin object to be invoked. Subsequently, based on the plugin identification information in the protocol parameter set, the system retrieves and determines the target protocol plugin corresponding to the target acquisition channel from a preset plugin library, thereby completing the correspondence establishment from channel identification information to resource parameter set, then to protocol parameter set, and finally to target protocol plugin.
[0043] This step first obtains the channel identifier information and associated resource parameter set corresponding to the target acquisition channel. Then, based on the channel identifier information, it obtains the corresponding protocol parameter set. Furthermore, based on the plugin identifier information in the protocol parameter set, it determines the target protocol plugin corresponding to the target acquisition channel from a preset plugin library. Therefore, the determination of the target protocol plugin is based on the correspondence between the target acquisition channel, the resource parameter set, and the protocol parameter set, giving the protocol plugin matching process a clear configuration basis, rather than being pre-fixed in a single processing flow. In this way, different target acquisition channels can determine the corresponding target protocol plugin based on their respective resource attributes and protocol parameters, thereby improving the targeting and configurability of protocol processing object matching.
[0044] Based on the first embodiment described above, in this embodiment, step S2 includes: S21: Read the plugin description information corresponding to the target protocol plugin, and load the target protocol plugin based on the plugin description information to obtain the interface instance corresponding to the target protocol plugin; S22: Based on the preset interface specification, perform interface verification processing on the interface instance, and pass the channel context information corresponding to the target acquisition channel to the verified interface instance to trigger the initialization processing of the target protocol plugin; S23: Based on the interface instance after initialization, establish a call mapping relationship between the target protocol plugin and the target acquisition channel, so that the target protocol plugin and the target acquisition channel establish a call association relationship.
[0045] It should be noted that the plugin description information refers to information describing the identifier, loading method, and interface definition of the target protocol plugin. Loading processing refers to the process of introducing the target protocol plugin into the current runtime environment and making it callable. Interface instance refers to the interface object formed after the target protocol plugin has undergone loading processing, which can be called by the system. Channel context information refers to information related to the runtime environment of the target acquisition channel.
[0046] Specifically, firstly, for the identified target protocol plugin, the system reads the plugin description information corresponding to the target protocol plugin. This plugin description information characterizes the basic description content and access requirements of the target protocol plugin. Based on this information, the system performs a loading process on the target protocol plugin, introducing it into the current protocol processing environment and forming a corresponding interface instance. In other words, at this stage, the system does not directly proceed to protocol parsing, but first converts the plugin object into a callable interface object based on the plugin description information, providing a foundation for subsequent specification verification and initialization processing.
[0047] Furthermore, after obtaining the interface instance, the system performs interface verification processing on the interface instance according to the preset interface specifications to determine whether the interface instance meets the predetermined access and invocation requirements. For interface instances that pass the verification, the system transmits the channel context information corresponding to the target acquisition channel to the interface instance to trigger the initialization processing of the target protocol plugin, enabling the target protocol plugin to recognize and adapt to the operating environment corresponding to the target acquisition channel. Subsequently, based on the interface instance after initialization, the system establishes a call mapping relationship between the target protocol plugin and the target acquisition channel, so that after the target acquisition channel subsequently acquires device interaction data, it can invoke the corresponding target protocol plugin to perform protocol processing through this call mapping relationship, thereby establishing a call association relationship between the target protocol plugin and the target acquisition channel.
[0048] This step first reads and loads the plugin description information corresponding to the target protocol plugin to obtain the interface instance corresponding to the target protocol plugin. Then, it performs interface verification on the interface instance based on the preset interface specification and triggers initialization processing in conjunction with the channel context information corresponding to the target acquisition channel. Finally, it establishes a call mapping relationship between the target protocol plugin and the target acquisition channel. Therefore, the target protocol plugin does not directly access the target acquisition channel in an unconstrained manner, but participates in subsequent calls only after loading, verification, initialization, and mapping establishment. This gives the association establishment process between the target protocol plugin and the target acquisition channel clear specification constraints and a context adaptation basis, thereby improving the standardization and adaptability of the protocol plugin access and calling process.
[0049] This embodiment obtains resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel. Based on the protocol configuration information, it determines the target protocol plugin associated with the target acquisition channel. The target protocol plugin is loaded and initialized according to a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel. Device interaction data is obtained based on the target acquisition channel, and the target protocol plugin is invoked to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data. The standardized data is sent to the message bus for external modules to subscribe to. In response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated. This embodiment associates the target acquisition channel with the corresponding target protocol plugin and initializes the plugin based on a preset interface specification, enabling the protocol processing logic to adapt to different acquisition channels according to the configuration method. Furthermore, by calling the target protocol plugin to parse the device interaction data and output standardized data, and then distributing it in conjunction with the message bus, the protocol parsing is separated from subsequent data use. At the same time, by dynamically updating the target acquisition channel and / or the target protocol plugin, the channel configuration and protocol processing logic can be adjusted as needed, improving the flexibility of protocol processing of the environmental monitoring equipment.
[0050] Based on the second embodiment described above, a third embodiment of the protocol processing method for the environmental monitoring equipment of this application is proposed. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of a sub-process in the third embodiment of the protocol processing method for the environmental monitoring equipment of this application.
[0051] In this embodiment, step S3 includes: S31: Based on the communication parameters corresponding to the target acquisition channel, perform data interaction with the target device to obtain the original message data returned by the target device, and determine the original message data as the device interaction data; S32: Input the device interaction data into the target protocol plugin that establishes a call association with the target acquisition channel, and have the target protocol plugin perform field recognition, content extraction and format conversion processing on the device interaction data according to preset protocol rules to obtain the corresponding parsing result data; S33: Based on the preset data expression specifications, the parsed result data is uniformly encapsulated and the data format is organized to obtain the corresponding standardized data.
[0052] It should be noted that field identification refers to the process of locating and distinguishing data fields in the device interaction data. Format conversion refers to the process of converting the parsed data content into a predetermined expression form. Parsing result data refers to the data result obtained after the target protocol plugin completes protocol parsing processing. Preset data expression specifications refer to pre-defined data organization rules used to constrain the unified expression method of the parsed result data.
[0053] Specifically, based on the communication parameters corresponding to the target acquisition channel, data interaction is performed with the target device. That is, the system relies on the communication conditions corresponding to the target acquisition channel to initiate data requests to the target device or receive data content returned by the target device, thereby obtaining the original message data returned by the target device and identifying this original message data as the device interaction data. In this process, the target acquisition channel mainly undertakes the functions of device access and data carrying, ensuring that subsequent protocol parsing objects have a clear data source.
[0054] Furthermore, after obtaining the device interaction data, the system inputs the device interaction data into the target protocol plugin that establishes a call association with the target acquisition channel. The target protocol plugin then performs field recognition, content extraction, and format conversion on the device interaction data according to preset protocol rules to obtain the corresponding parsed result data. Subsequently, based on preset data expression specifications, the parsed result data undergoes unified field encapsulation and data format organization, so that the parsed data content is output in a unified data expression manner, ultimately obtaining the corresponding standardized data. Thus, the target acquisition channel completes the acquisition of raw message data, the target protocol plugin completes protocol parsing, and the preset data expression specifications complete the result unification. The three work together to form a processing link from the device's raw message to standardized data.
[0055] This step first involves data interaction with the target device based on the communication parameters corresponding to the target acquisition channel to obtain raw message data and identify it as device interaction data. Then, the device interaction data is input into the target protocol plugin that has established a call association with the target acquisition channel. The target protocol plugin performs field recognition, content extraction, and format conversion according to preset protocol rules to obtain parsed result data. Finally, standardized data is formed based on preset data expression specifications. Therefore, the raw message data returned by the target device is first parsed according to protocol rules and then organized according to a unified expression specification, enabling device interaction data from different sources to form a more consistent data output format, which is beneficial for subsequent data use and processing.
[0056] Based on the second embodiment described above, in this embodiment, step S4 includes: S41: Based on preset message organization rules, perform topic identifier matching and message encapsulation processing on the standardized data to generate target message data corresponding to the standardized data; S42: Send the target message data to the message bus, and publish the target message data in the message bus according to the publishing channel corresponding to the topic identifier; S43: In response to a subscription request initiated by an external module for the publishing channel, the target message data is pushed to the corresponding external module to send the standardized data to the message bus for the external module to perform subscription processing.
[0057] Specifically, after obtaining the standardized data, it is processed according to preset message organization rules. Specifically, the system first matches the standardized data with a topic identifier based on its category, source, or purpose to determine the topic identifier corresponding to the standardized data; then, based on the topic identifier and a predetermined message format, it performs message encapsulation processing on the standardized data to form target message data corresponding to the standardized data. Through this process, the standardized data, originally a unified data representation result, is further transformed into a message object that can be published and distributed within the message transmission system.
[0058] Furthermore, after generating the target message data, the system sends the target message data to the message bus and publishes it within the message bus according to the publishing channel corresponding to the topic identifier. Subsequently, when an external module initiates a subscription request for the publishing channel, the system responds to the subscription request and pushes the target message data to the corresponding external module. Thus, the standardized data, through topic matching, message encapsulation, bus publishing, and subscription push processes, achieves the transmission from the protocol processing result to data receivable by external modules, sending the standardized data to the message bus for external modules to subscribe to.
[0059] This step first performs topic identification matching and message encapsulation processing on the standardized data based on preset message organization rules to generate target message data. Then, the target message data is sent to the message bus and published according to the publishing channel corresponding to the topic identifier. Finally, in response to subscription requests initiated by external modules for the publishing channel, the target message data is pushed to the corresponding external modules. Thus, standardized data is no longer directly connected to a single external module, but is uniformly distributed through topic identifiers, publishing channels, and the message bus. This allows different external modules to obtain the corresponding message data based on subscription requests, thereby improving the decoupling between standardized data output and subsequent use.
[0060] Based on the second embodiment described above, in this embodiment, step S5 includes: S51: Obtain the configuration change instruction or the upgrade instruction, and parse the configuration change instruction or the upgrade instruction to determine the target update object and the update content corresponding to the target update object, wherein the target update object includes the target acquisition channel and / or the target protocol plugin; S52: When the target update object is the target acquisition channel, adjust the resource configuration information corresponding to the target acquisition channel based on the update content, and rebuild or reload the channel running parameters corresponding to the adjusted resource configuration information. When the target update object is the target protocol plugin, replace or switch the target protocol plugin based on the update content, and re-establish the calling association between the target protocol plugin and the target acquisition channel. S53: Restore the corresponding protocol processing flow based on the updated target acquisition channel and / or the updated target protocol plugin, so as to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change instructions or upgrade instructions.
[0061] It should be noted that an upgrade command is a control command used to trigger an upgrade or replacement operation on a related processing object in the system. Channel operating parameters refer to the parameter information used by the target acquisition channel during actual operation. Replacement loading refers to the process of replacing the original target protocol plugin with another plugin version and completing a reload.
[0062] Specifically, the system acquires the configuration change instruction or the upgrade instruction and parses it to determine the target update object that needs to be updated and the corresponding update content. The target update object includes the target acquisition channel and / or the target protocol plugin. In other words, at this stage, the system first identifies and deconstructs the incoming control instructions to clarify whether the update targets the channel-side object, the protocol plugin-side object, or both, and further clarifies the corresponding update content, providing a basis for subsequent differentiated update processing.
[0063] Furthermore, after determining the target update object and update content, the system performs corresponding update operations based on the object type. When the target update object is the target acquisition channel, the system adjusts the resource configuration information corresponding to the target acquisition channel based on the update content, and rebuilds or reloads the channel operating parameters corresponding to the adjusted resource configuration information. When the target update object is the target protocol plugin, the system replaces or switches the version of the target protocol plugin based on the update content, and re-establishes the call association between the target protocol plugin and the target acquisition channel. After completing the above updates, the system restores the corresponding protocol processing flow based on the updated target acquisition channel and / or the updated target protocol plugin, allowing the updated object to continue participating in subsequent protocol processing, and dynamically updates the target acquisition channel and / or the target protocol plugin in response to configuration change or upgrade commands.
[0064] This step first obtains the configuration change or upgrade command, and then determines the target update object and corresponding update content through parsing. Next, it adjusts resource configuration information and rebuilds or reloads channel operating parameters for the target acquisition channel, or replaces or switches versions of the target protocol plugin, and re-establishes the call association between the target protocol plugin and the target acquisition channel. Finally, it restores the corresponding protocol processing flow based on the updated target acquisition channel and / or target protocol plugin. This allows the update process to be not limited to a fixed object, but can be adjusted on both the target acquisition channel side and the target protocol plugin side according to the command content, and the protocol processing flow can be restored after the update, thereby improving the adjustability and continuity of the protocol processing flow.
[0065] This embodiment obtains resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel. Based on the protocol configuration information, it determines the target protocol plugin associated with the target acquisition channel. The target protocol plugin is loaded and initialized according to a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel. Device interaction data is obtained based on the target acquisition channel, and the target protocol plugin is invoked to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data. The standardized data is sent to the message bus for external modules to subscribe to. In response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated. This embodiment associates the target acquisition channel with the corresponding target protocol plugin and initializes the plugin based on a preset interface specification, enabling the protocol processing logic to adapt to different acquisition channels according to the configuration method. Furthermore, by calling the target protocol plugin to parse the device interaction data and output standardized data, and then distributing it in conjunction with the message bus, the protocol parsing is separated from subsequent data use. At the same time, by dynamically updating the target acquisition channel and / or the target protocol plugin, the channel configuration and protocol processing logic can be adjusted as needed, improving the flexibility of protocol processing of the environmental monitoring equipment.
[0066] Please see Figure 4 and Figure 5 , Figure 4 This is a schematic diagram of the plug-in protocol engine system architecture in one embodiment of the protocol processing method for environmental monitoring equipment according to this application. Figure 5 This is a schematic diagram of the OTA upgrade process in one embodiment of the protocol processing method for the environmental monitoring equipment of this application.
[0067] In one embodiment, a pluggable protocol engine system is provided, comprising the following parts: Protocol Engine Service module It is used for unified management of device communication channels, protocol plugin loading, data parsing and processing, standardized data output, and message publishing.
[0068] Protocol plugin library module (Lua protocol library) A script-based protocol description approach is adopted to achieve plug-in encapsulation of device protocol logic.
[0069] Resource Management Module Used to manage serial port resources (RS485 / RS232), network resources (TCP / IP ports), and device channel resources.
[0070] Data bus module (MQTT message bus) It is used to achieve unified publishing, distribution and decoupled transmission of parsed data.
[0071] Configuration management module (HTTP+JSON interface) Used for system parameter configuration, resource management, protocol binding, service status monitoring, and operation and maintenance management.
[0072] OTA upgrade module Used for unified upgrades and management of protocol engine services and protocol plugin libraries.
[0073] In this embodiment, the protocol parsing engine supports multi-serial port device acquisition (RS485 / RS232), multi-TCP port network acquisition (network port devices), dynamic resource configuration, Lua protocol library loading and hot updating, standardized data output, unified MQTT publishing, and HTTP+JSON configuration management. The acquisition channel is the resource, the protocol is the plugin, parsing is the engine, and data travels via a bus. The protocol engine service OTA upgrade targets the protocol engine service binary program and its dependent libraries, and the upgrade method is a complete program upgrade. The Lua protocol library plugin OTA upgrade targets Lua script files, and the upgrade method supports hot updating without requiring a restart of the engine service. This embodiment achieves unified management of protocol parsing capabilities, avoiding redundant construction by multiple vendors; lowers the protocol development threshold and improves protocol delivery efficiency through a plugin mechanism; supports hot updates of protocols, avoiding system downtime for upgrades; decouples system modules, improving system stability and maintainability; supports long-term coexistence of multiple protocols, ensuring smooth system evolution; achieves standardized delivery and unified operation and maintenance management of protocol capabilities; is suitable for multi-platform deployment and has good engineering feasibility.
[0074] This application also provides a protocol processing device for environmental monitoring equipment. Please refer to... Figure 6 , Figure 6 This is a schematic diagram of the module structure of the protocol processing device for the environmental monitoring equipment according to an embodiment of this application. The protocol processing device for the environmental monitoring equipment includes: The information acquisition module 601 is used to acquire resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information. The association module 602 is invoked to load the target protocol plugin and initialize the target protocol plugin based on a preset interface specification, so that the target protocol plugin establishes a calling association relationship with the target acquisition channel; The protocol parsing module 603 is used to acquire device interaction data based on the target acquisition channel, and call the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; The data forwarding module 604 is used to send the standardized data to the message bus for external modules to subscribe to. The dynamic update module 605 is used to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change instructions or upgrade instructions.
[0075] The protocol processing device for environmental monitoring equipment provided in this application adopts the protocol processing method for environmental monitoring equipment in the above embodiments, and can solve the technical problem of how to improve the flexibility of protocol processing for environmental monitoring equipment. Compared with the prior art, the beneficial effects of the protocol processing device for environmental monitoring equipment provided in this application are the same as the beneficial effects of the protocol processing method for environmental monitoring equipment provided in the above embodiments, and other technical features in the protocol processing device for environmental monitoring equipment are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.
[0076] This application provides a protocol processing device for an environmental monitoring device. The protocol processing device for the environmental monitoring device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the protocol processing method of the environmental monitoring device in the above embodiment.
[0077] The following is for reference. Figure 7 , Figure 7 This is a schematic diagram of the hardware operating environment involved in the protocol processing method of the environmental monitoring device in the embodiments of this application. It shows a schematic diagram of the structure of the protocol processing device suitable for implementing the environmental monitoring device in the embodiments of this application. Figure 7 The protocol processing device of the environmental monitoring equipment shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0078] like Figure 7As shown, the protocol processing device of the environmental monitoring equipment may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage device 1003 into the random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the protocol processing device of the environmental monitoring equipment. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the protocol processing device of the environmental monitoring equipment to communicate wirelessly or wiredly with other devices to exchange data. Although the diagram shows a protocol processing device of an environmental monitoring equipment with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented or possessed alternatively.
[0079] In particular, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. When the computer program is executed by the processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0080] The protocol processing device for environmental monitoring equipment provided in this application adopts the protocol processing method for environmental monitoring equipment in the above embodiments, which can solve the technical problem of how to improve the flexibility of protocol processing for environmental monitoring equipment. Compared with the prior art, the beneficial effects of the protocol processing device for environmental monitoring equipment provided in this application are the same as the beneficial effects of the protocol processing method for environmental monitoring equipment provided in the above embodiments, and other technical features in the protocol processing device for environmental monitoring equipment are the same as the features disclosed in the method of the previous embodiment, and will not be repeated here.
[0081] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0082] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0083] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the protocol processing method of the environmental monitoring device in the above embodiments.
[0084] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the protocol processing device of the environmental monitoring equipment, the protocol processing device of the environmental monitoring equipment performs the following actions: acquires resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel; determines the target protocol plugin associated with the target acquisition channel based on the protocol configuration information; loads the target protocol plugin and initializes it based on a preset interface specification to establish a call association between the target protocol plugin and the target acquisition channel; acquires device interaction data based on the target acquisition channel and calls the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain corresponding standardized data; sends the standardized data to the message bus for external modules to subscribe to; and dynamically updates the target acquisition channel and / or the target protocol plugin in response to configuration change or upgrade instructions. Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. These programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0086] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0087] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the protocol processing method of the above-described environmental monitoring equipment, thereby solving the technical problem of how to improve the flexibility of protocol processing in environmental monitoring equipment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the protocol processing method of the environmental monitoring equipment provided in the above embodiments, and will not be repeated here.
[0088] This application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the protocol processing method for environmental monitoring equipment as described above.
[0089] The computer program product provided in this application can solve the technical problem of how to improve the flexibility of protocol processing in environmental monitoring equipment. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the protocol processing method for environmental monitoring equipment provided in the above embodiments, and will not be repeated here.
[0090] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.
Claims
1. A protocol processing method of a moving ring monitoring device, characterized by, The method includes: Obtain resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information; Load the target protocol plugin and initialize it based on the preset interface specification so that the target protocol plugin establishes a calling relationship with the target acquisition channel; Based on the target acquisition channel, device interaction data is acquired, and the target protocol plugin is called to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data; The standardized data is sent to the message bus for external modules to subscribe to. In response to configuration change or upgrade commands, the target acquisition channel and / or the target protocol plugin are dynamically updated.
2. The method of claim 1, wherein, The step of obtaining resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and determining the target protocol plugin associated with the target acquisition channel based on the protocol configuration information, includes: Obtain the channel identifier information corresponding to the target acquisition channel and the resource parameter set associated with the channel identifier information, wherein the resource parameter set is used to characterize the access type, communication parameters and channel activation status of the target acquisition channel; Based on the channel identification information, a set of protocol parameters corresponding to the target acquisition channel is obtained, wherein the set of protocol parameters includes at least protocol identification information and plugin identification information related to protocol calls; Based on the plugin identification information in the protocol parameter set, the target protocol plugin corresponding to the target acquisition channel is determined from the preset plugin library, so as to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information.
3. The method of claim 1, wherein, The step of loading the target protocol plugin and initializing it based on a preset interface specification to establish a calling association between the target protocol plugin and the target acquisition channel includes: Read the plugin description information corresponding to the target protocol plugin, and load the target protocol plugin based on the plugin description information to obtain the interface instance corresponding to the target protocol plugin; Based on the preset interface specification, the interface instance is subjected to interface verification processing, and the channel context information corresponding to the target acquisition channel is transmitted to the interface instance that passes the verification to trigger the initialization processing of the target protocol plugin. Based on the interface instance after initialization, a call mapping relationship is established between the target protocol plugin and the target acquisition channel, so that the target protocol plugin and the target acquisition channel establish a call association relationship.
4. The method of claim 1, wherein, The step of acquiring device interaction data based on the target acquisition channel and calling the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data includes: Based on the communication parameters corresponding to the target acquisition channel, data interaction is performed with the target device to obtain the original message data returned by the target device, and the original message data is determined as the device interaction data; The device interaction data is input into the target protocol plugin that establishes a call association with the target acquisition channel. The target protocol plugin then performs field recognition, content extraction, and format conversion on the device interaction data according to preset protocol rules to obtain the corresponding parsing result data. Based on preset data representation standards, the parsed data is uniformly encapsulated and formatted to obtain corresponding standardized data.
5. The method of claim 1, wherein, The step of sending the standardized data to the message bus for external modules to subscribe to includes: Based on preset message organization rules, the standardized data is subjected to topic identifier matching and message encapsulation processing to generate target message data corresponding to the standardized data. The target message data is sent to the message bus, and the target message data is published in the message bus according to the publishing channel corresponding to the topic identifier; In response to a subscription request initiated by an external module for the publishing channel, the target message data is pushed to the corresponding external module to send the standardized data to the message bus for subscription processing by the external module.
6. The method of claim 1, wherein, The step of dynamically updating the target acquisition channel and / or the target protocol plugin in response to a configuration change command or upgrade command includes: Obtain the configuration change instruction or the upgrade instruction, and parse the configuration change instruction or the upgrade instruction to determine the target update object and the update content corresponding to the target update object, wherein the target update object includes the target acquisition channel and / or the target protocol plugin; When the target update object is the target acquisition channel, the resource configuration information corresponding to the target acquisition channel is adjusted based on the update content, and the channel running parameters corresponding to the adjusted resource configuration information are rebuilt or reloaded. When the target update object is the target protocol plugin, the target protocol plugin is replaced or switched based on the update content, and the calling association between the target protocol plugin and the target acquisition channel is re-established. Based on the updated target acquisition channel and / or the updated target protocol plugin, the corresponding protocol processing flow is restored to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change instructions or upgrade instructions.
7. A protocol processing apparatus of a loop monitoring device, characterized by comprising: The device includes: The information acquisition module is used to acquire resource configuration information for the target acquisition channel and protocol configuration information corresponding to the target acquisition channel, and to determine the target protocol plugin associated with the target acquisition channel based on the protocol configuration information. The associated module is invoked to load the target protocol plugin and initialize the target protocol plugin based on a preset interface specification, so as to establish an association between the target protocol plugin and the target acquisition channel. The protocol parsing module is used to acquire device interaction data based on the target acquisition channel, and call the target protocol plugin to perform protocol parsing processing on the device interaction data to obtain the corresponding standardized data. The data forwarding module is used to send the standardized data to the message bus for external modules to subscribe to. The dynamic update module is used to dynamically update the target acquisition channel and / or the target protocol plugin in response to configuration change commands or upgrade commands.
8. A computer device, comprising: The device includes: a memory, a processor, and a protocol processing program for the environmental monitoring device stored in the memory and executable on the processor, wherein the protocol processing program for the environmental monitoring device is configured to implement the steps of the protocol processing method for the environmental monitoring device as described in any one of claims 1 to 6.
9. A storage medium, characterized by The storage medium stores a protocol processing program for an environmental monitoring device. When the protocol processing program for the environmental monitoring device is executed by a processor, it implements the steps of the protocol processing method for the environmental monitoring device as described in any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the protocol processing method for the environmental monitoring equipment as described in any one of claims 1 to 6.