Search

CN-121984886-A - Zero code protocol analysis and full link visual adjustment method for heterogeneous terminal

CN121984886ACN 121984886 ACN121984886 ACN 121984886ACN-121984886-A

Abstract

The invention relates to the technical field of software development, in particular to a zero code protocol analysis and full link visual debugging method of a heterogeneous terminal, which comprises the following steps of obtaining protocol configuration information of the heterogeneous terminal input by a user through a visual interface, and constructing a standardized protocol model example by analyzing communication parameters and message rules in the protocol configuration information; and initializing a communication server according to the communication parameters in the protocol model instance, and establishing a one-to-one mapping binding relation between the network monitoring port and the protocol model instance. The invention monitors the data flow of the network monitoring port, invokes the corresponding protocol model instance based on the protocol routing rule to execute the bidirectional data automatic conversion and the full-link adjustment, constructs the configured and running transparent test channel, breaks the black box operation defect of the conventional rule definition and effect verification splitting, and realizes the fusion integration of the mass storage terminal to the unified service platform.

Inventors

  • SUN YANPING
  • MO CHAOXIONG

Assignees

  • 广州拓维数字化技术有限公司

Dates

Publication Date
20260505
Application Date
20260312

Claims (9)

  1. 1. A zero code protocol analysis and full link visual adjustment method of a heterogeneous terminal is characterized by comprising the following steps: acquiring protocol configuration information of a heterogeneous terminal input by a user through a visual interface, and constructing a standardized protocol model instance by analyzing communication parameters and message rules in the protocol configuration information; Initializing a communication server according to communication parameters in the protocol model instance, and establishing a one-to-one mapping binding relation between a network monitoring port and the protocol model instance to form a protocol routing rule based on port definition; Performing static encoding and decoding verification on the input simulation test data by utilizing the protocol model instance, and generating a verification result by comparing a conversion result of the simulation test data with a preset expected value so as to confirm logic correctness of the protocol configuration information; And monitoring the data flow of the network monitoring port, calling the corresponding protocol model instance based on the protocol routing rule, and executing bidirectional data automatic conversion and full-link monitoring between the heterogeneous terminal and the service platform.
  2. 2. The method for resolving and full-link visual adjustment of a heterogeneous terminal according to claim 1, wherein the step of obtaining the protocol configuration information of the heterogeneous terminal input by a user through a visual interface and constructing a standardized protocol model instance by resolving communication parameters and message rules in the protocol configuration information is specifically as follows: generating a configuration form in the visual interface, acquiring the equipment model identification, the communication protocol type and the network port number of the heterogeneous terminal through the configuration form, and packaging the equipment model identification, the communication protocol type and the network port number into the communication parameters; Providing a field definition tool in the visual interface, acquiring a data message structure of the heterogeneous terminal through the field definition tool, wherein the data message structure comprises a field offset, a field data type and a byte length, and acquiring Aviator expression scripts for data verification and conversion; carrying out dynamic serialization processing based on a JSON format on the communication parameters, the data message structure and the Aviator expression script to generate a standardized protocol model instance, wherein the protocol model instance comprises a decoding rule set for describing uplink data and a coding rule set for describing downlink data; And allocating a unique model index ID to the protocol model instance, and storing the model index ID and the equipment model identifier in an associated mode.
  3. 3. The method for resolving zero code protocol and visualizing full link of heterogeneous terminal according to claim 1, wherein initializing a communication server according to communication parameters in the protocol model instance, and establishing a one-to-one mapping binding relationship between a network monitoring port and the protocol model instance, the step of forming a protocol routing rule based on port definition specifically comprises: Reading the communication protocol type and the network port number contained in the protocol model instance, and starting ServerBootstrap service instances corresponding to the communication protocol type by using a Netty network framework; Binding the network port number to the ServerBootstrap service instance and loading a custom protocol handling Handler in CHANNELPIPELINE of the ServerBootstrap service instance; injecting references of the protocol model instance into the protocol processing Handler, and establishing static binding mapping between the network monitoring port and the protocol model instance; And constructing a global routing mapping table, taking the network monitoring port as a key, taking the object reference of the protocol model instance as a value, and storing the object reference into the global routing mapping table to form the protocol routing rule based on port definition.
  4. 4. The method for resolving zero code protocol and visualizing full link of heterogeneous terminal according to claim 1, wherein the step of performing static codec verification on the input analog test data by using the protocol model instance and comparing the conversion result of the analog test data with a preset expected value to generate a verification result to confirm the logic correctness of the protocol configuration information comprises the following steps: In a state of not starting the real network connection, starting an independent static debugging environment, and loading the protocol model instance in the static debugging environment; receiving a hexadecimal simulation message input by a user, calling a decoding rule set in the protocol model instance to analyze the hexadecimal simulation message, and outputting analyzed JSON structured data; Receiving a JSON simulation instruction input by a user, calling a coding rule set in the protocol model instance to reversely convert the JSON simulation instruction, and outputting a generated binary byte stream; Comparing the generated binary byte stream with a preset expected binary stream, if the binary byte stream and the expected binary stream are completely consistent, generating the verification result marked as passing, otherwise, generating a failure report containing error field positioning information.
  5. 5. The method for resolving zero code protocol and performing full link visual call of heterogeneous terminal according to claim 3, wherein the steps of monitoring data traffic of the network monitoring port, calling the corresponding protocol model instance based on the protocol routing rule, and performing bidirectional data automatic conversion and full link call between heterogeneous terminal and service platform are as follows: Monitoring the network monitoring port in real time through the communication server, and capturing an original binary data stream from the heterogeneous terminal; Inquiring the global routing mapping table, and matching the global routing mapping table to the corresponding protocol model instance according to the network monitoring port; The original binary data stream is subjected to sub-packaging processing by utilizing a package sticking processing strategy in the protocol model example, and a complete data frame is obtained; Dynamically analyzing the complete data frame by using Aviator expression scripts in the protocol model instance to generate standardized service JSON data, and pushing the service JSON data to the service platform through a WebSocket channel; And receiving a control JSON instruction issued by the service platform, converting the control JSON instruction into a target binary instruction by utilizing a coding rule set in the protocol model instance, and transmitting the target binary instruction to the heterogeneous terminal through a Socket channel corresponding to the network monitoring port.
  6. 6. The method for resolving zero code protocol and visualizing full link of a heterogeneous terminal according to claim 5, wherein the step of packetizing the original binary data stream using a sticky packet processing policy in the protocol model instance, and obtaining a complete data frame comprises the steps of: Reading a packetization rule parameter configured in the protocol model example, wherein the packetization rule parameter comprises a length domain offset, a length domain byte number and a packet header identifier; retrieving the position of the header identifier in the original binary data stream to determine the starting position of the data frame; positioning the length domain data according to the length domain offset, and analyzing the length domain data to obtain the theoretical load length of the current data frame; And intercepting a byte sequence with a corresponding length from the initial position according to the theoretical load length, assembling the byte sequence into the complete data frame, transmitting the complete data frame to a subsequent decoding engine, and simultaneously buffering the rest byte data in a receiving buffer area to wait for the next processing.
  7. 7. The method for resolving zero code protocol and full link visual adjustment of heterogeneous terminal according to claim 5, wherein the steps of dynamically resolving the complete data frame by using Aviator expression script in the protocol model instance, generating standardized service JSON data, and pushing the service JSON data to the service platform through WebSocket channel are specifically as follows: Traversing a field list defined in the protocol model instance, and extracting corresponding byte fragments from the complete data frame aiming at each field in the field list; executing the Aviator expression script, and performing numerical conversion, bit operation and logic verification on the byte fragments to obtain field analysis values; And assembling the field analysis value into a JSON object in a key value pair form to form the standardized service JSON data, and sending the standardized service JSON data to the service platform through the WebSocket channel.
  8. 8. The method for resolving zero code protocol and performing full link visual adjustment of heterogeneous terminals according to claim 1, further comprising a step of performing reverse simulation by using the protocol model instance generation simulation device, wherein the step specifically comprises: under the condition that the service platform cannot be connected with a real heterogeneous terminal, invoking structure definition in the protocol model instance to automatically generate a simulation equipment operation instance; The simulation equipment operation example randomly generates simulation state data conforming to a protocol specification according to a downlink coding rule in the protocol model example; Simulating TCP client behaviors through the simulation equipment operation examples, actively connecting the network monitoring ports, and sending the simulation state data according to preset time intervals; and receiving a control instruction returned by the communication server, analyzing the control instruction by utilizing an uplink decoding rule in the protocol model instance, and updating the internal state of the simulation equipment operation instance according to the control instruction to construct a closed-loop virtual test environment.
  9. 9. The method for resolving zero code protocol and performing full link visual adjustment of heterogeneous terminals according to claim 5, further comprising the steps of service system integration and data push, wherein the steps specifically include: Setting an access point address and a push protocol type of the service platform in the protocol configuration information; After the standardized service JSON data is generated through the protocol model instance, establishing data connection with the service platform according to the access point address; packaging the standardized service JSON data into an HTTP POST request body or an MQTT message load, and sending the HTTP POST request body or the MQTT message load to the service platform; And responding to the confirmation message returned by the service platform, and if the confirmation message is not received within the preset timeout time, starting a retransmission mechanism to retransmit the standardized service JSON data until the transmission is successful or the maximum retransmission times are reached.

Description

Zero code protocol analysis and full link visual adjustment method for heterogeneous terminal Technical Field The invention relates to the technical field of software development, in particular to a zero code protocol analysis and full link visual debugging method of a heterogeneous terminal. Background Currently, two types of technical paths are mainly developed in the industry when the problem of integration of highly heterogeneous devices is solved. Despite their advances in flexibility in protocol adaptation, from the perspective of the disclosed solution, there are still general drawbacks in the key links that promote integration efficiency and reliability. Scheme one: platform-centric standardization and adaptation drive mode (adaptation of standardized drive) The underlying logic of this scheme is to digest isomerism by establishing a set of "unification criteria" and performing "one-way adaptations" on the device, edge or platform side. 1. Standardized definition the platform side (or industry alliance) predefines communication and data standards. At the data level, this is typically embodied as an "object model" or unified information model, providing a standardized description template for device functions, data points. 2. Unidirectional adaptation path-the device "actively closes" the platform standard by two paths: 1) Path a (device side native adaptation), which is the most ideal path. The device manufacturer develops the product according to the platform standard, and the device firmware native supports standard protocols and object models, and can directly talk with the platform. For example, the device needs to integrate a specific SDK provided by the platform, or design according to standard protocols such as WMMP. 2) Path B (edge side gateway adaptation) this spam scheme is employed when the device uses a proprietary protocol. An edge gateway or a protocol converter is additionally arranged between the equipment and the platform, and the private protocol is translated into a standard format of the platform through secondary development of an adaptation plug-in on the gateway. This essentially sinks the adaptation work from the cloud to the edge side. And (3) analyzing the advantages and disadvantages: The method has the advantages that once the adaptation is completed, the platform side processing is extremely uniform and efficient, and the method is easy to expand and manage and accords with the prospect of large-scale deployment The disadvantage is especially pronounced when dealing with the need for a fast, flexible integration of stock heterogeneous devices: 1. Integration of the storage quantity 'dummy equipment' is difficult, and the scheme is strongly dependent on active transformation of the equipment side or the gateway side. For a large number of deployed, protocol-cured, old industrial devices ("dumb devices"), it is not possible to retrofit the firmware, and the cost of adding dedicated gateways increases, resulting in these devices being excluded from the integration range. 2. The implementation period is long, and the method is a long, professional and uncontrollable process no matter the method pushes equipment manufacturers to produce according to new standards or develop gateway adapter plug-ins for private protocols. The platform user cannot autonomously control the integrated rhythm. 3. Secondary development and debugging thresholds still exist, "secondary development" in the gateway adaptation path, which is essentially still hard-coded or complex script development for a particular protocol. The process of configuring gateway protocol and data mapping is still professional and complicated, and lacks efficient debugging tools, configuration correctness can be verified only by linking with real equipment after deployment, and trial and error cost is high. Scheme II, actively adapting device mode by platform The core idea of the mode is that all isomerism digestion work is borne by the platform side without the need of device side cooperation modification. It is realized mainly by two technical paths, each having characteristics. Path 1 full custom code development-separate communication connections, data parsing and processing procedures are developed de novo for each specific device protocol on the platform side, one-to-one. Path 2, parameterized configuration conversion, the platform provides a general protocol framework and a visual configuration interface. The user generates the adaptation rule by filling in the form (such as selecting the protocol type, setting the port, defining the field structure, offset, data type and other parameters of the data packet), and the general engine built in the platform executes the actual protocol conversion and data processing. This is the main direction of evolution in this mode at present. The scheme has the advantages that: 1. The method has the advantages of zero invasion to equipment and extremely strong compatibility, and is