Communication method and device based on graphic modeling

Through the communication method based on graph modeling, the deep learning model and graphical interface are used to solve the problems of low efficiency and insufficient intelligence in the existing technology of communication protocol development, and efficient and intuitive protocol design and data transmission are achieved.

CN119449900BActive Publication Date: 2025-04-15KAIYUN LIANCHUANG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510026443.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-15
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

The existing technology has problems in the development of communication protocols that are inefficient, difficult to maintain, lack of intuitive visualization tools, insufficient protocol compatibility verification and dynamic adaptation capabilities, inadequate protocol feature extraction and template generation, and inefficient protocol serialization and data verification.

Method used

Using a communication method based on graphical modeling, a protocol template data set is generated through deep learning models, a graphical protocol design interface is designed, and a communication protocol general block and logical block are integrated. A compatibility parameter matrix is ​​introduced to achieve intelligent connection correction, a protocol parser is automatically generated, and a network data flow is processed through a serialized function library and an algorithm function library.

Benefits of technology

It improves the efficiency and reliability of communication protocol development, provides efficient and intuitive visualization solutions, enhances the intelligence and automation capabilities of protocol design, and ensures the accuracy and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449900B_ABST
    Figure CN119449900B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a communication method and device based on graphical modeling, which analyzes historical protocol features through a deep learning model and generates a protocol template data set, thereby realizing intelligent protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to realize intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a communication method and device based on graphic modeling. Background Art

[0002] Traditional communication protocol design methods are usually based on manual coding, which is inefficient and error-prone. Existing technologies lack intuitive visualization tools in the protocol definition and parsing process, which increases the learning cost and maintenance difficulty for developers. The system is also relatively simple in terms of protocol compatibility verification and dynamic adaptation, and it is difficult to meet the needs of complex scenarios.

[0003] At the same time, the existing system has obvious deficiencies in protocol feature extraction and template generation. Traditional methods often rely on fixed protocol templates, lack intelligent protocol feature learning capabilities, and are difficult to adapt to the rapid evolution of new protocols. The system is also relatively mechanical in terms of protocol component reuse and logic block connection, and fails to fully utilize the advantages of graphical modeling.

[0004] In addition, existing technologies also have limitations in protocol serialization and data verification. There is a lack of a unified serialization function library and verification mechanism, the protocol parsing efficiency is low, and the reliability of data verification is limited. Solving these problems is of great significance to improving the efficiency of communication protocol development and system reliability. Summary of the invention

[0005] In response to the problems in the prior art, the present application provides a communication method and device based on graphical modeling, which can break through the limitations of traditional manual coding and provide an efficient and intuitive visualization solution for communication protocol development.

[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions:

[0007] In a first aspect, the present application provides a communication method based on graphical modeling, comprising:

[0008] Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract the communication protocol common block and the logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data according to the connection correction instruction to form a protocol hierarchy, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0009] Calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file;

[0010] A network data stream is received, and the protocol parser extracts field data from the network data stream according to the protocol hierarchy, passes the field data to the packaging function to generate a serialized data packet, extracts a target field from the serialized data packet, passes the target field to the check value calculation function to generate a check code, determines the check code according to a preset check rule to generate a verification mark, and writes the serialized data packet and the verification mark into a network transmission buffer.

[0011] Further, extracting the communication protocol common block and the logic block from the protocol template data set, establishing a graphical protocol design interface to load the communication protocol common block and the logic block, and monitoring the dragging operation of the communication protocol common block and the logic block to generate component connection data include:

[0012] According to the preset component classification rules, the communication protocol common block and the logic block are screened from the protocol template data set, field feature analysis is performed on the communication protocol common block to generate a field attribute table, logic feature analysis is performed on the logic block to generate a logic attribute table, the communication protocol common block and the logic block are loaded into the component cache area, a display template is called from the component display template library to construct a graphical protocol design interface, and data from the component cache area is read to generate a visual component on the graphical protocol design interface;

[0013] The method comprises the following steps: monitoring the mouse events of the graphical protocol design interface to obtain the component dragging coordinates, determining the component placement position according to the component dragging coordinates to generate position information, reading the field attribute table and the logic attribute table to obtain the component connection constraints, establishing a component association matrix based on the position information and the component connection constraints, and converting the component association matrix into component connection data.

[0014] Further, the calculating of a compatibility parameter matrix according to the component connection data, comparing the compatibility parameter matrix with a preset threshold value to generate a connection correction instruction, adjusting the component connection data according to the connection correction instruction to form a protocol hierarchy, reading the field attributes of the communication protocol common block and the logical attributes of the logic block, and writing the field attributes, the logical attributes and the protocol hierarchy into a protocol definition file includes:

[0015] Reading a component compatibility rule set from a compatibility rule library, substituting the component connection data into the component compatibility rule set to calculate the association degree between components, constructing a compatibility parameter matrix based on the association degree, comparing the parameter value in the compatibility parameter matrix with a preset threshold value to generate a difference mark, calculating the component position offset according to the difference mark to form a connection correction instruction, and applying the connection correction instruction to the component connection data to generate a protocol hierarchy structure;

[0016] The field name, data type, default value of the communication protocol common block and the conditional statement, operator, and execution sequence of the logic block are obtained from the attribute analysis module, and the field name, data type, default value, conditional statement, operator, execution sequence and protocol hierarchy are written into the protocol definition file according to a preset format.

[0017] Further, calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, and writing the keyword mapping set into the protocol definition file includes:

[0018] Reading function declarations of a packing function and an unpacking function from a protocol serialization function library, parsing the function declarations to extract a function name, a parameter list, and a return value type, combining the function name, the parameter list, and the return value type to form a function definition code, writing the function definition code in a function definition area of ​​the protocol definition file, and establishing a mapping relationship between the packing function and the unpacking function and a protocol component;

[0019] Extract keyword identifiers and reference types from the dynamic reference keyword table, combine the keyword identifiers and the reference types to construct a keyword mapping object, generate a keyword mapping set based on the keyword mapping object, write the keyword mapping set into the keyword definition area of ​​the protocol definition file, and establish a reference link between the keyword mapping set and the function definition code.

[0020] Further, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file, comprises:

[0021] Retrieving source codes of a byte length calculation function and a check value calculation function from an algorithm function library, extracting algorithm parameters and calculation logic from the source code, encapsulating the algorithm parameters and the calculation logic into a function module, writing the function module into the algorithm area of ​​the protocol definition file, and establishing call entries of the byte length calculation function and the check value calculation function;

[0022] The protocol hierarchy, function definition code and keyword mapping set in the protocol definition file are read, a data parsing code is generated according to a preset parsing rule, the function module is associated and bound with the data parsing code, and the data parsing code and the function module are compiled to generate an executable file of the protocol parser.

[0023] Further, the receiving of the network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, and extracting the target field from the serialized data packet, includes:

[0024] The network interface is monitored to obtain a network data stream, and the network data stream is segmented according to a preset data frame format. The protocol parser parses the header identifier of the data frame according to the protocol hierarchy structure, locates the field boundary from the data frame to extract the field data, and performs data type conversion and boundary check on the field data to generate processed field data;

[0025] The processed field data is passed into the packaging function for serialization processing according to the protocol specification, a serialized data packet is generated based on the serialization rule of the packaging function, the data structure of the serialized data packet is parsed to obtain the field offset, and the target field is intercepted from the serialized data packet according to the field offset.

[0026] Further, the step of passing the target field into the check value calculation function to generate a check code, determining the check code according to a preset check rule to generate a verification identifier, and writing the serialized data packet and the verification identifier into a network transmission buffer includes:

[0027] Obtaining the data length and data content of the target field, passing the data length and the data content as input parameters into the check value calculation function, generating a check code based on the check algorithm of the check value calculation function, reading a preset check rule from a check rule configuration table, matching the check code with the check rule, and generating a verification identifier according to the result of the match;

[0028] Obtain available cache space from the network transmission buffer, write the serialized data packet into the cache space according to a preset data storage format, add the verification identifier to the check field of the serialized data packet, and establish an index mapping of the serialized data packet in the network transmission buffer.

[0029] In a second aspect, the present application provides a communication device based on graphical modeling, comprising:

[0030] A graphic operation module, used to obtain historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the drag operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data according to the connection correction instruction to form a protocol hierarchy, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0031] A protocol parsing module, used to call a packing function and an unpacking function from a preset protocol serialization function library, write the packing function and the unpacking function into the protocol definition file, read a dynamic reference keyword table to generate a keyword mapping set, write the keyword mapping set into the protocol definition file, call a byte length calculation function and a check value calculation function from an algorithm function library, write the byte length calculation function and the check value calculation function into the protocol definition file, and generate a protocol parser according to the protocol definition file;

[0032] The data flow module is used to receive a network data stream, wherein the protocol parser extracts field data from the network data stream according to the protocol hierarchy, passes the field data to the packaging function to generate a serialized data packet, extracts a target field from the serialized data packet, passes the target field to the check value calculation function to generate a check code, determines the check code according to a preset check rule to generate a verification mark, and writes the serialized data packet and the verification mark into a network transmission buffer.

[0033] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the graphical modeling-based communication method when executing the program.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication method based on graphical modeling.

[0035] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the steps of the communication method based on graphical modeling when executed by a processor.

[0036] It can be seen from the above technical solution that the present application provides a communication method and device based on graphical modeling, which analyzes historical protocol features through a deep learning model and generates a protocol template data set, thereby realizing intelligent protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to achieve intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 One of the flowcharts of the communication method based on graphic modeling in the embodiment of the present application;

[0039] Figure 2 The second flowchart of the communication method based on graphic modeling in the embodiment of the present application;

[0040] Figure 3 The third flowchart of the communication method based on graphic modeling in the embodiment of the present application;

[0041] Figure 4 This is a fourth flow chart of a communication method based on graphic modeling in an embodiment of the present application;

[0042] Figure 5 This is a fifth flow chart of a communication method based on graphic modeling in an embodiment of the present application;

[0043] Figure 6 This is a sixth flow chart of a communication method based on graphic modeling in an embodiment of the present application;

[0044] Figure 7 FIG7 is a flow chart of a communication method based on graphic modeling in an embodiment of the present application;

[0045] Figure 8 A structural diagram of a communication device based on graphical modeling in an embodiment of the present application;

[0046] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0047] Reference numerals:

[0048] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0051] Taking into account the problems existing in the prior art, the present application provides a communication method and device based on graphical modeling, which analyzes historical protocol features through a deep learning model and generates a protocol template data set, thereby realizing intelligent protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to achieve intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0052] In order to break through the limitations of traditional manual coding and provide an efficient and intuitive visualization solution for communication protocol development, this application provides an embodiment of a communication method based on graphical modeling, see Figure 1 , the communication method based on graphic modeling specifically includes the following contents:

[0053] Step S101: Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data to form a protocol hierarchy according to the connection correction instruction, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0054] Optionally, this embodiment provides an intelligent protocol modeling method based on deep learning, which is mainly used in the visual design scenario of communication protocols. First, historical protocol definition data is systematically collected and sorted. These data sources include standard communication protocol libraries, enterprise custom protocols, and open source protocol frameworks. The raw data is cleaned by a data preprocessing engine, including removing duplicate definitions, correcting format errors, and supplementing missing fields. The preprocessed data is stored in a unified JSON format for subsequent processing.

[0055] The construction of the protocol feature vector adopts a multi-level feature extraction strategy. At the structural level, the inheritance relationship, nesting depth, branch structure and other features of the field are extracted; at the semantic level, the field naming rules are analyzed through natural language processing technology to extract the business meaning and usage scenarios of the field; at the constraint level, the data type, value range, validity rules and other features are extracted. These features are converted into numerical vectors through feature mapping functions and stored in sparse matrices to improve computing efficiency.

[0056] The deep learning model uses an improved Transformer architecture and is specifically optimized for protocol modeling scenarios. The encoder contains multiple layers of self-attention modules, and the number of attention heads in each layer is adaptively adjusted according to the feature dimension. The attention calculation uses an improved scaled dot product attention mechanism, and position encoding is introduced to maintain field order information. The decoder uses a cross-attention mechanism, which considers both input features and generated outputs to improve the coherence of template generation.

[0057] The model training adopts a multi-stage strategy. In the first stage, a large amount of standard protocol data is used for pre-training to learn the common protocol structure features; in the second stage, domain-specific protocol data is used for fine-tuning to meet the needs of specific application scenarios. Dynamic batch size and learning rate adjustment strategies are used during training to prevent overfitting. The loss function comprehensively considers structural similarity and semantic similarity to ensure the accuracy of the generated template.

[0058] The generation process of the protocol template dataset realizes intelligent template clustering and optimization. The model first clusters the protocol based on its functional characteristics and stores protocol templates with similar functions in categories. Then, the structure of each type of template is optimized, including field combination optimization, logical structure simplification, etc. The optimization process takes into account the performance requirements in actual applications, such as data packet size, parsing efficiency and other factors.

[0059] The extraction of common blocks and logic blocks of communication protocols adopts a hybrid method based on rules and statistics. The identification of common blocks is based on the frequency of field use and the degree of cross-protocol reuse, and the optimal field combination is determined through similarity calculation. The extraction of logic blocks focuses on operation modes such as conditional judgment, loop processing, and data conversion, and identifies common logical structures through pattern matching algorithms.

[0060] The implementation of the graphical protocol design interface adopts a component-based architecture. The interface framework uses a responsive design to ensure the display effect on different devices. The component library contains basic controls and composite controls, supports drag-and-drop operations and real-time preview. The interface layout uses a grid system to achieve precise positioning and alignment of components.

[0061] The monitoring of component dragging operations adopts an event-driven mode. Mouse events and touch events are captured through event listeners, and component positions and overlapping states are calculated in real time. Visual feedback is provided during the dragging process, such as alignment lines, adsorption effects, etc., to improve operation accuracy. The generation of component connection data is based on positional relationships and connection rules, and supports multiple connection methods.

[0062] The calculation of the compatibility parameter matrix takes into account constraints in multiple dimensions, including data type compatibility, field dependencies, business rule restrictions, etc. The matrix calculation adopts a parallel processing strategy to improve the efficiency of large-scale component analysis. The calculation results are normalized to facilitate comparison with the preset threshold.

[0063] The generation and execution of connection correction instructions realizes intelligent error correction. When an incompatible connection is detected, the system analyzes possible correction solutions, such as adjusting the connection order, adding conversion components, etc. The correction process takes into account the principle of minimum modification and tries to maintain the original design intent.

[0064] The formation of the protocol hierarchy is represented by a tree model. The relationships between nodes include inclusion, inheritance, reference and other types. The change history is maintained during the structural adjustment process to support operation rollback. The final generated protocol definition file adopts a standard format to ensure compatibility with existing tool chains.

[0065] This embodiment realizes the intelligentization and automation of protocol design through deep learning technology, significantly improving the efficiency of protocol development. The protocol template generated by the model has high accuracy and practicality, which can effectively reduce the complexity of protocol design. The graphical interface and intelligent correction mechanism make the protocol design process more intuitive and reliable. In practical applications, this solution has successfully supported protocol development work in multiple fields, especially in scenarios that require rapid customization of protocols.

[0066] Step S102: calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file;

[0067] Optionally, in this embodiment, in the protocol serialization function library, hierarchically designed packing and unpacking functions are implemented according to the characteristics of the protocol hierarchy. The base layer implements the serialization operation of atomic type data, including the processing of basic types such as integers, floating point numbers, and strings; the composite layer is responsible for the combined processing of complex data types such as structures and arrays; the extension layer supports the serialization requirements of user-defined data types. Functions at each level have undergone rigorous performance testing and optimization to ensure that they can efficiently process various types of data in practical applications.

[0068] The call of the packaging function adopts a dynamic dispatch mechanism, which automatically selects the most appropriate serialization method by analyzing the type characteristics of the data to be processed. For fixed-length data, the memory copy operation is directly used to improve the processing speed; for variable-length data, the length information is written first and then the actual data content; for nested data, each field is processed recursively. To improve performance, serialization path caching is implemented to optimize frequently used serialization operations.

[0069] The unpacking function is implemented based on the state machine mode, and the data stream is processed through predefined state transition rules. The parser dynamically adjusts the parsing state according to the type tag and length information in the data stream, and supports fragmentation and streaming parsing of data packets. For complex protocol structures, a recursive descent algorithm is used to ensure correct parsing of multi-layer nested data structures, while maintaining the parsing context information to ensure data integrity.

[0070] The design of the dynamic reference keyword table implements a flexible field reference mechanism. By analyzing the dependencies between fields in the protocol definition, a complete reference link network is constructed. The reference table records the type, scope, and life cycle information of each reference, and supports forward and backward references. In the case of circular references, the reference counting mechanism is used to prevent resource leakage and ensure the security of memory use.

[0071] The byte length calculation function uses a recursive strategy. It first processes fixed-length fields, accumulates the number of bytes they occupy, and then calculates the space requirements of variable-length fields. For conditional branch structures, the maximum possible length value is calculated by analyzing all possible execution paths. Considering the alignment requirements of different processor architectures, the processing logic of padding bytes is added in the calculation process.

[0072] The check value calculation module integrates a variety of check algorithms, including the basic CRC32 check, the more secure MD5 and SHA series algorithms. The check process supports data block processing, which is suitable for processing large-scale data transmission scenarios. For particularly important data fields, a double check mechanism is implemented to improve the reliability of data integrity verification through the combination of different algorithms.

[0073] During the generation of the protocol parser, the template engine technology is used to process the protocol definition file. The parser first loads the structure definition, function declaration, and keyword mapping information in the definition file, and then generates the corresponding parsing code based on the preset code template. The generated code supports conditional compilation and can be optimized according to the characteristics of the target platform to improve operating efficiency.

[0074] In actual operation, the parser achieves efficient state tracking by maintaining detailed parsing context. The context information contains key information such as the currently processed protocol level and field location. At the same time, it dynamically maintains the field value table to support complex data dependency processing. For possible abnormal situations, a complete error recovery mechanism is implemented to improve the stability of the system.

[0075] Memory management adopts a pooling design, pre-allocating multiple memory pools of different specifications and dynamically selecting appropriate memory blocks according to the size of the data packet. Through an intelligent memory recycling mechanism, performance loss caused by frequent memory allocation and release operations is avoided. For ultra-large data packets, a fragmentation processing mechanism is implemented to effectively control the peak memory usage.

[0076] This complete serialization and parsing mechanism performs well in practical applications, especially in dealing with complex protocol structures and large-scale data transmission scenarios. The optimized function call mechanism and memory management strategy significantly improve data processing performance, dynamic reference support enhances the scalability of the protocol, and the perfect verification mechanism ensures the reliability of data transmission.

[0077] Step S103: receiving a network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, extracting a target field from the serialized data packet, passing the target field into the check value calculation function to generate a check code, judging the check code according to a preset check rule to generate a verification mark, and writing the serialized data packet and the verification mark into a network transmission buffer.

[0078] Optionally, this embodiment captures network data streams in real time through a network interface monitoring module, and triggers the processing flow immediately when data arrives. The network interface adopts an asynchronous IO mechanism and supports multiplexing to ensure that a large number of data streams can be efficiently processed in high-concurrency scenarios. When data is received, the data stream is first segmented according to a preset frame format, and each data frame contains parts such as a header identifier, load data, and verification information.

[0079] In order to accurately extract field data, the protocol parser first parses the header identifier of the data frame and quickly locates the protocol version and data type through bitmap matching. According to the field boundary rules defined in the protocol hierarchy, the parser uses a sliding window mechanism to gradually scan the data frame to accurately locate the starting position and length of each field. During the field extraction process, the original data is formatted through the type conversion module, and data boundary checks are performed to ensure that the extracted field data conforms to the protocol specifications.

[0080] During data type conversion, special attention is paid to the byte order, and a byte order adaptation mechanism is implemented for different platforms. For example, for integer data transmitted across platforms, necessary conversion is performed according to the byte order specified by the protocol to ensure data consistency. At the same time, for special types such as floating-point numbers, a precision control mechanism is implemented to prevent precision loss during data conversion.

[0081] After being processed, the field data is passed to the packing function for serialization. The packing process strictly follows the data format defined by the protocol specification. The serialization process uses streaming processing and optimizes memory usage through the buffer management mechanism. For variable-length fields, the length information is written first, and then the actual data is written according to the specified encoding format. During the serialization process, the field index table is also maintained to record the offset position of each field in the data packet, which is convenient for subsequent target field extraction.

[0082] When extracting the target field from the serialized data packet, the parser first analyzes the data packet's structural information and obtains the field's offset. The target field is directly located through efficient memory operations to avoid repeated parsing of the entire data packet. For cross-border fields, a data reorganization mechanism is implemented to ensure the integrity of the field data.

[0083] The check value calculation adopts a configurable multi-level check mechanism. First, the data length and content of the target field are obtained as the input parameters of the check function. The check algorithm supports multiple methods such as CRC and Hash, which can be dynamically selected according to security requirements. For key business data, a segmented check mechanism is implemented to improve the reliability of data integrity verification. The table lookup method is used to optimize the calculation efficiency during the check process, and hardware acceleration instructions are supported to improve the check speed.

[0084] After the verification code is generated, the validity is determined according to the preset verification rules. The verification rules include multiple dimensions, such as value range, format requirements, business constraints, etc. The determination process adopts a decision tree structure to achieve fast rule matching. For different types of verification failures, the system generates corresponding error codes to facilitate problem location and processing. The verification results are recorded in the form of identification bits for subsequent data processing.

[0085] The network transmission buffer adopts a ring buffer design to support efficient data access operations. The buffer management module implements an intelligent memory allocation strategy and dynamically adjusts the buffer size according to the size of the data packet. Atomic operations are used during the writing process to ensure thread safety, and data consistency is guaranteed through a memory barrier mechanism.

[0086] When serialized data packets are written to the buffer, they are organized according to the predefined storage format. This includes fields such as header information, payload data, and verification identifiers. Byte alignment requirements are considered during data organization to ensure data access efficiency. At the same time, a data packet index is established to support rapid positioning and retrieval of specific data packets.

[0087] This embodiment shows excellent performance and reliability in practical applications. Through streaming processing and multi-level buffering mechanism, it effectively supports the real-time processing requirements of large-scale data. The perfect verification mechanism ensures the accuracy of data transmission, and the flexible configuration options meet the performance and security requirements in different scenarios. Especially in network communication scenarios that require fast response, this solution can effectively reduce processing delays and improve system throughput.

[0088] From the above description, it can be seen that the communication method based on graphical modeling provided by the embodiment of the present application can analyze historical protocol features and generate a protocol template data set through a deep learning model, thereby realizing the intelligentization of protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to realize intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0089] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 2 , and can also include the following:

[0090] Step S201: Filter the communication protocol common block and the logic block from the protocol template data set according to the preset component classification rule, perform field feature analysis on the communication protocol common block to generate a field attribute table, perform logic feature analysis on the logic block to generate a logic attribute table, load the communication protocol common block and the logic block into the component cache area, call the display template from the component display template library to build a graphical protocol design interface, read the data in the component cache area to generate a visual component on the graphical protocol design interface;

[0091] Step S202: monitor the mouse events of the graphical protocol design interface to obtain the component dragging coordinates, determine the component placement position according to the component dragging coordinates to generate position information, read the field attribute table and the logic attribute table to obtain component connection constraints, establish a component association matrix based on the position information and the component connection constraints, and convert the component association matrix into component connection data.

[0092] Optionally, this embodiment divides the components in the protocol template data set into different functional levels according to the functional requirements in the protocol design process. The protocol functions include the basic communication layer, the business processing layer, the security control layer, etc. Each layer is subdivided according to the frequency of use, reusability and functional independence to construct a systematic classification system. This hierarchical classification method makes the protocol design process more organized and convenient for subsequent feature analysis and processing.

[0093] Field feature analysis uses a multi-dimensional feature extraction method to extract feature information such as the value range, precision requirements, and unit attributes for numeric type fields, and analyzes attributes such as length restrictions, encoding formats, and special character processing rules for string type fields. By establishing a feature vector space for quantitative description, it ensures that the characteristics of each field can be accurately recorded and expressed. The extracted feature information is finally integrated into a structured field attribute table to provide a basis for subsequent component management and connection constraints.

[0094] During the logic feature analysis process, this embodiment focuses on the control flow and data processing rules in the protocol. By constructing a logic flow chart, the input conditions, execution rules, and output results of typical logic modules such as conditional judgment, loop structure, and data conversion are analyzed. At the same time, the dependencies and execution order between logic modules are considered, and these analysis results are organized into a logic attribute table to provide logical support for the design of complex protocols.

[0095] The component cache uses a hierarchical storage structure, including a fast access layer and a persistence layer. The fast access layer uses memory mapping technology to achieve fast loading and updating of component data; the persistence layer is responsible for reliable data storage and version management. The cache mechanism implements an intelligent preloading strategy, which predicts components that may be needed by analyzing the frequency and relevance of component use and loading them into the fast access layer in advance.

[0096] During the construction of the graphical protocol design interface, this embodiment calls the adapted display template from the component display template library. The template library contains a variety of visual components, such as connecting lines, node boxes, labels, etc. Each component supports style customization and interactive response. The interface layout adopts a grid system to achieve precise component positioning and alignment functions, and provides a flexible design space through view operations such as zooming and panning.

[0097] During the generation of visual components, this embodiment visually maps field attributes and logical attributes, and uses different graphic shapes, colors, connection styles and other visual elements to intuitively display the characteristics and constraint relationships of components. For complex logical structures, a hierarchical display mechanism is implemented, and designers can view detailed information at different levels by expanding or collapsing operations.

[0098] Mouse event monitoring uses an event delegation mechanism to capture user interaction operations through a unified event handler. The event processing process implements anti-shake and throttling optimization to ensure that the system can maintain stable response during frequent operations. The calculation of drag coordinates takes into account the scale and scroll offset of the view to ensure the accuracy of coordinate positioning.

[0099] When determining the placement of components, this embodiment implements intelligent space management by constructing a space occupancy map. During the placement process, automatic alignment and adsorption functions are implemented to help designers accurately locate components. At the same time, the hierarchical relationship of components is maintained to ensure the correct display order of overlapping components, providing strong support for the visual design of complex protocols.

[0100] Component connection constraints are implemented based on the rule engine and support the combination of multiple constraint types. Constraint rules include data type compatibility, direction restrictions, connection quantity restrictions, etc. Flexible connection control is achieved through rule combination and priority management. For connection requirements in special scenarios, this embodiment supports the dynamic addition of custom constraint rules.

[0101] The component association matrix is ​​represented by an adjacency matrix, which records the connection relationship and connection properties between components. Each element of the matrix contains information such as connection type, direction, and weight. The validity and integrity of the connection can be quickly verified through matrix operations. The conversion process from matrix to connection data realizes data compression and optimization, effectively reducing storage overhead.

[0102] This embodiment significantly improves the efficiency and reliability of protocol design in practical applications. Intelligent constraint checking and space management ensure the accuracy of the design process, and intuitive visual expression reduces the complexity of the design. Especially in the development stage that requires frequent modification and optimization, this solution shows obvious advantages and provides strong support for protocol design work.

[0103] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 3 , and can also include the following:

[0104] Step S301: read a component compatibility rule set from a compatibility rule library, substitute the component connection data into the component compatibility rule set to calculate the association between components, construct a compatibility parameter matrix based on the association, compare the parameter value in the compatibility parameter matrix with a preset threshold to generate a difference mark, calculate the component position offset according to the difference mark to form a connection correction instruction, and apply the connection correction instruction to the component connection data to generate a protocol hierarchy;

[0105] Step S302: Obtain the field name, data type, default value of the communication protocol common block and the conditional statement, operator, and execution sequence of the logic block from the attribute analysis module, and write the field name, the data type, the default value, the conditional statement, the operator, the execution sequence, and the protocol hierarchy into a protocol definition file in a preset format.

[0106] Optionally, this embodiment further addresses the component compatibility issues in protocol design. The rule set read from the compatibility rule base includes rules in multiple dimensions such as field type matching, value range constraints, and business logic associations. Each rule is equipped with a corresponding weight coefficient to reflect the importance of different rules when calculating the correlation.

[0107] When calculating component association, a multi-level evaluation mechanism is used. First, the component connection data is parsed to extract the attribute features of both connected parties. Then these features are matched with the compatibility rules to calculate the degree of satisfaction of each rule. For numerical type matching, normalization is used to ensure that parameters of different dimensions can be compared uniformly. For logical type matching, the degree of satisfaction of the rules is evaluated through the semantic similarity algorithm.

[0108] The compatibility parameter matrix is ​​constructed by weighted accumulation to combine the evaluation results of each rule. Each element in the matrix represents the comprehensive compatibility score between the corresponding component pairs. In order to improve the computational efficiency, a sparse matrix storage method is used to record only the parameter values ​​of component pairs with a connection relationship. At the same time, an incremental calculation mechanism for matrix updates is implemented to avoid repeated calculation of component pairs that have been evaluated.

[0109] When comparing parameter values ​​with preset thresholds, this embodiment adopts a segmented threshold strategy. Different types of component connections may have different compatibility requirements, so multiple threshold intervals are set. The difference identification generated by the comparison result not only contains information on whether the threshold is exceeded, but also contains quantitative indicators of the degree of excess, providing a basis for subsequent corrections.

[0110] The calculation of position offset takes full account of the spatial relationship between components. First, a spatial occupancy map of the components is constructed to analyze possible movement directions. Then, the component pairs that need to be adjusted are determined based on the difference identification, and the optimal movement path is calculated. During the calculation process, a heuristic algorithm is used to avoid local optimal solutions and ensure the rationality of the overall layout.

[0111] In the process of generating connection correction instructions, this embodiment not only considers position adjustment, but also includes the optimization of connection lines. For connections that need to be adjusted, the system will recalculate the path of the connection line to avoid interference with other components. The correction instructions are stored in a serialized form, supporting batch execution and rollback operations.

[0112] In the attribute analysis process, this embodiment implements a fine-grained attribute extraction mechanism. For the general block of the communication protocol, in addition to the basic field name and data type, the field value constraints, unit attributes, precision requirements and other features are also analyzed. For the logic block, the semantic structure of the conditional statement is deeply analyzed to identify the key judgment conditions and operators.

[0113] The topological sorting algorithm is used to determine the execution sequence to ensure that the dependencies between logic blocks are correctly handled. During the sorting process, by maintaining the dependency graph data structure, abnormal situations such as circular dependencies are detected in real time. At the same time, the identification of logic blocks for parallel execution is supported, providing possibilities for subsequent optimization.

[0114] The generation of the protocol definition file adopts a hierarchical structure design. The file format contains a clear hierarchical division, which is convenient for subsequent parsing and maintenance. During the writing process, automatic formatting and comment generation functions are implemented to improve the readability of the file. At the same time, the history of protocol evolution is saved through the version control mechanism.

[0115] This embodiment shows excellent adaptability and reliability in the protocol design process. Through intelligent compatibility analysis and automatic correction mechanism, the workload of manual adjustment is significantly reduced. Accurate attribute extraction and standardized file generation ensure the accuracy and completeness of protocol definition. Especially in the design process of complex protocols, this solution can effectively identify and solve potential compatibility problems and improve design efficiency.

[0116] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 4 , and can also include the following:

[0117] Step S401: read the function declarations of the packing function and the unpacking function from the protocol serialization function library, parse the function declaration to extract the function name, parameter list and return value type, combine the function name, the parameter list and the return value type to form a function definition code, write the function definition code in the function definition area of ​​the protocol definition file, and establish a mapping relationship between the packing function and the unpacking function and the protocol component;

[0118] Step S402: extract the keyword identifier and the reference type from the dynamic reference keyword table, combine the keyword identifier and the reference type to construct a keyword mapping object, generate a keyword mapping set based on the keyword mapping object, write the keyword mapping set in the keyword definition area of ​​the protocol definition file, and establish a reference link between the keyword mapping set and the function definition code.

[0119] Optionally, this embodiment maintains a rich set of packing and unpacking functions in the protocol serialization function library, which are specially optimized for different data types and processing scenarios. The parsing process of the function declaration uses a syntax analyzer to accurately identify key information such as the function name, parameter type, parameter order, and return value type, laying the foundation for subsequent code generation.

[0120] When parsing function declarations, this embodiment implements a parameter dependency analysis mechanism. By constructing a parameter dependency graph, the association relationship between parameters is ensured to be correctly processed. For example, when the value of a parameter depends on the calculation results of other parameters, the system will automatically adjust the processing order of the parameters to ensure the correctness of the data flow. For the processing of optional parameters and default values, conditional compilation is adopted to provide flexible parameter configuration options.

[0121] In the process of generating the function definition code, this embodiment adopts a templated code assembly method. First, the parsed function information is filled into the predefined code template, and then customized adjustments are made according to the specific application scenario. In order to improve the maintainability of the code, the system automatically generates detailed function comments, including parameter descriptions, usage examples, and precautions.

[0122] The mapping relationship between protocol components and functions is maintained through a mapping table. The mapping table uses a multi-level index structure and supports function matching based on multiple dimensions such as component type, data characteristics, and processing requirements. When a protocol component needs to be serialized, the system can quickly locate the most suitable processing function, improving operating efficiency.

[0123] This embodiment adopts a flexible identifier management mechanism when processing dynamic reference keywords. The design of keyword identifiers takes into account the isolation of namespaces to avoid naming conflicts between different modules. The definition of reference types supports multiple reference methods, including direct reference, indirect reference, and conditional reference, etc., to meet the reference requirements in different scenarios.

[0124] When constructing a keyword mapping object, this embodiment implements an intelligent type derivation mechanism. The system can automatically derive the appropriate data type based on the keyword usage context, reducing the workload of manual type declaration. For complex reference relationships, a reference chain is used to manage them, supporting the tracking and parsing of multi-level references.

[0125] The generation of keyword mapping sets adopts a recursive processing method. First, simple direct mapping relationships are processed, and then complex combination mappings are gradually expanded. In this process, the system will perform circular reference detection to prevent the occurrence of dead loops. At the same time, the processing efficiency of repeated references is optimized through the cache mechanism.

[0126] When writing a keyword mapping set in a protocol definition file, this embodiment uses a structured storage format. Each mapping entry contains complete context information, which is convenient for subsequent parsing and maintenance. At the same time, an incremental update mechanism is implemented. When modifying a mapping relationship, only the relevant part needs to be updated, avoiding the overhead of full rewrite.

[0127] In the process of establishing the reference link, this embodiment implements a bidirectional tracking mechanism. Not only can the relevant function definition be found from the keyword mapping, but also the used keywords can be tracked from the function definition. This bidirectional association greatly improves the maintainability and debuggability of the code.

[0128] This embodiment significantly improves the standardization and maintainability of the protocol implementation through this systematic function definition and keyword mapping mechanism. The intelligent type deduction and reference management mechanism reduces the workload of developers, and the perfect document generation function provides a clear usage guide. Especially when dealing with complex protocols, the solution can effectively manage a large number of function definitions and keyword mappings to ensure the correctness and efficiency of the protocol implementation.

[0129] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 5 , and can also include the following:

[0130] Step S501: Retrieve source code of a byte length calculation function and a check value calculation function from an algorithm function library, extract algorithm parameters and calculation logic in the source code, encapsulate the algorithm parameters and the calculation logic into a function module, write the function module into the algorithm area of ​​the protocol definition file, and establish call entries for the byte length calculation function and the check value calculation function;

[0131] Step S502: read the protocol hierarchy, function definition code and keyword mapping set in the protocol definition file, generate data parsing code according to preset parsing rules, associate and bind the function module with the data parsing code, and compile the data parsing code and the function module to generate an executable file of the protocol parser.

[0132] Optionally, when processing protocol data parsing, this embodiment extracts an efficient algorithm specifically used for byte length calculation and check value calculation from the algorithm function library. For byte length calculation, a dynamic calculation mechanism that adapts to different character encodings is implemented, and data blocks containing complex situations such as variable-length fields and nested structures can be accurately processed. For example, when processing a UTF-8 encoded string, the actual length of a multi-byte character can be accurately calculated by identifying the characteristic bit of the first byte.

[0133] When extracting algorithm parameters and calculation logic, this embodiment uses static analysis technology to convert source code into an abstract syntax tree for in-depth analysis. By identifying key calculation nodes and data flows, the core parameters and dependencies of the algorithm are extracted. These parameters include key information such as data type identification, length cardinality, and alignment requirements.

[0134] During the encapsulation of the check value calculation function, a unified interface for multiple check algorithms is implemented. According to different application scenarios and security requirements, different check algorithms such as CRC, MD5, and SHA can be flexibly selected. The algorithm selection process takes into account multiple factors such as data integrity requirements, computing overhead, and hardware support.

[0135] The encapsulation of function modules adopts a combined design pattern, organizing related algorithm parameters and calculation logic into independent functional units. Each module is equipped with a complete parameter verification and exception handling mechanism to ensure stable operation under various boundary conditions. Modules communicate through standardized interfaces, supporting flexible combination and expansion.

[0136] The call entry is established using a proxy mode, adding a proxy interface between the original function and the caller. This design allows the addition of parameter preprocessing, result caching, performance monitoring and other functions without modifying the original code. The proxy behavior can be flexibly adjusted through the configuration file to adapt to different operating environments.

[0137] When parsing the protocol hierarchy, this embodiment implements a recursive hierarchical traversal algorithm. Starting from the top-level protocol structure, the relationships and properties of each component are parsed layer by layer. For circular references and complex dependencies, a dependency graph is constructed for analysis and optimization to ensure the correctness of the parsing process.

[0138] The data parsing code generation uses template engine technology to convert the protocol structure into efficient parsing code according to the preset parsing rules. The parsing rules include type conversion, boundary checking, exception handling and other aspects to ensure that the generated code is both efficient and reliable. For example, for the processing of network byte order, the byte order conversion code is automatically generated to ensure the correctness of cross-platform data exchange.

[0139] In the process of associating and binding the function module with the parsing code, this embodiment implements an intelligent code injection mechanism. The system analyzes the data processing flow and injects the length calculation and checksum verification code at the appropriate location. This injection process takes into account performance optimization and minimizes unnecessary calculations and memory operations.

[0140] In the compilation phase, this embodiment adopts a layered compilation strategy. First, each module is compiled independently to generate intermediate code; then global optimization is performed, including inline expansion, dead code elimination, loop optimization, etc., to generate efficient machine code. Debug information is also added during the compilation process to facilitate subsequent problem location and performance analysis.

[0141] This embodiment shows excellent scalability and maintainability in the implementation of the protocol parser. Through modular design and standardized interfaces, it supports the rapid integration of new algorithms and new protocols. The automatically generated parsing code reduces the workload of manual coding while ensuring the quality of the code. Especially when dealing with complex protocols, the solution can effectively manage various calculations and verification logics and provide stable and reliable parsing functions.

[0142] The resulting executable file has good operating efficiency and resource utilization, and can meet the needs of various practical application scenarios. Through reasonable memory management and cache strategies, it can still maintain stable performance when processing large amounts of data. At the same time, the perfect error handling mechanism ensures that fault recovery can be performed gracefully in abnormal situations.

[0143] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 6 , and can also include the following:

[0144] Step S601: monitoring a network interface to obtain a network data stream, segmenting the network data stream according to a preset data frame format, the protocol parser parsing a header identifier of a data frame according to the protocol hierarchy, locating a field boundary from the data frame to extract field data, performing data type conversion and boundary checking on the field data to generate processed field data;

[0145] Step S602: passing the processed field data into the packaging function for serialization processing according to the protocol specification, generating a serialized data packet based on the serialization rule of the packaging function, parsing the data structure of the serialized data packet to obtain the field offset, and intercepting the target field from the serialized data packet according to the field offset.

[0146] Optionally, this embodiment adopts an efficient data capture mechanism during the network interface monitoring process. By setting the promiscuous mode of the network adapter, it is ensured that all data packets passing through the interface can be captured. At the same time, a buffer management strategy is implemented, and data loss is effectively avoided under high load conditions by adjusting the receiving buffer size and processing cycle.

[0147] The data frame segmentation process uses a sliding window mechanism to dynamically adjust the window size to adapt to different network environments and data characteristics. During the processing, a frame synchronization detection algorithm is implemented to accurately locate the starting position of each data frame by analyzing the frame header feature sequence. In the event of frame breakage or damage, the system can automatically perform frame reassembly and error recovery.

[0148] During the header identification parsing process, this embodiment implements a multi-layer protocol identification mechanism. By analyzing the identification features defined in the protocol hierarchy, the protocol type and version information to which the data frame belongs are parsed layer by layer. This hierarchical parsing method enables the system to flexibly handle various protocol combinations and supports dynamic expansion and updating of protocols.

[0149] Field boundary positioning uses an accurate offset calculation method. The start and end positions of each field are calculated based on the field length information and alignment requirements in the protocol definition. For variable-length fields, the field boundaries are dynamically determined by parsing information such as the length identifier or terminator. This method can accurately handle complex data structures and avoid field misalignment problems.

[0150] In the data type conversion process, this embodiment implements an intelligent type derivation and conversion mechanism. The system can automatically select the appropriate conversion method based on the definition attributes of the field, and handle various data types including integers, floating point numbers, strings, etc. For special data formats, such as timestamps, enumeration values, etc., special conversion functions are provided to ensure accurate interpretation of the data.

[0151] Boundary verification uses multiple verification strategies, including range checking, format verification, and consistency checking. Through the preset verification rules, the value of each field is verified for legitimacy, and abnormal data is discovered and processed in a timely manner. For the constraint relationship between related fields, a cross-validation mechanism is implemented to ensure the overall consistency of the data.

[0152] During the serialization process, this embodiment adopts an efficient data organization method. The packaging function converts the field data into a standard binary format according to the predefined serialization rules. In this process, data compression and alignment optimization are achieved, the size of the serialized data packet is reduced, and the transmission efficiency is improved.

[0153] The serialization rules are designed with cross-platform compatibility in mind, using a unified byte order and encoding format. Clear conversion rules are defined for different types of data to ensure correct parsing between different systems. At the same time, the forward compatibility of the protocol is supported through a version control mechanism, allowing new data fields to be added while maintaining existing functions.

[0154] When parsing the structure of a serialized data packet, this embodiment implements an efficient indexing mechanism. By establishing a field position index table, the offset position of any field can be quickly located. This index structure supports dynamic updates, can adapt to changes in the data packet structure, and improves the efficiency of data access.

[0155] The interception process of the target field adopts an optimized memory operation method. According to the field offset, the system directly operates on the original data buffer to avoid unnecessary data copying. For the data that needs to be saved, memory pool management is adopted to reduce the overhead of memory allocation and release.

[0156] This embodiment demonstrates excellent performance and reliability in network data processing. Through efficient data capture and processing mechanisms, data streams in high-speed network environments can be stably processed. Intelligent type conversion and verification mechanisms ensure the accuracy of data processing, while optimized serialization processing improves the efficiency of data transmission. Especially when processing complex protocols and large amounts of data, the solution can maintain stable performance and provide reliable data processing support for network applications.

[0157] In one embodiment of the communication method based on graphical modeling of the present application, see Figure 7 , and can also include the following:

[0158] Step S701: obtaining the data length and data content of the target field, passing the data length and the data content as input parameters to the check value calculation function, generating a check code based on the check algorithm of the check value calculation function, reading a preset check rule from a check rule configuration table, matching the check code with the check rule, and generating a verification identifier according to the result of the match;

[0159] Step S702: Obtain available cache space from the network transmission buffer, write the serialized data packet into the cache space according to a preset data storage format, add the verification identifier to the check field of the serialized data packet, and establish an index mapping of the serialized data packet in the network transmission buffer.

[0160] Optionally, when processing data verification of the target field, this embodiment first accurately calculates the data length. The calculation process takes into account the alignment requirements of different data types, and adopts a dynamic length calculation method for variable-length data to ensure the accuracy of length information. When processing special character encoding, a coding length recognition mechanism is implemented to correctly process multi-byte character sequences.

[0161] The implementation of the checksum calculation function uses a configurable multi-level check mechanism. Depending on the importance and security requirements of the data, you can choose a checksum algorithm of different strengths. For critical business data, a composite checksum algorithm that includes data integrity and security verification is used; for ordinary data, a lightweight checksum method is used to improve processing efficiency.

[0162] In the process of generating the verification code, this embodiment implements a data block processing mechanism. By dividing the large block of data into data blocks of appropriate size for verification calculation, the accuracy of the calculation is guaranteed and the processing efficiency is improved. For each data block, the system will save the intermediate verification results and support verification recovery in the breakpoint resuming scenario.

[0163] The validation rule configuration table adopts a hierarchical rule organization structure and supports multi-dimensional validation rule definitions. The rules include multiple aspects such as value range, format requirements, and dependencies, and flexible validation strategies are implemented through rule combination. The priority management of rules ensures that conflicts among multiple rules can be handled as expected.

[0164] The verification mark is generated using state coding technology, which not only contains the verification results, but also records detailed verification process information. By analyzing this information, the specific location and cause of data anomalies can be accurately located. The design of the verification mark takes forward compatibility into consideration and supports the subsequent addition of new verification rules.

[0165] The management of network transmission buffer adopts an efficient memory allocation strategy. By implementing a memory pool mechanism, frequent memory allocation and release operations are avoided. The size of the buffer is dynamically adjusted according to the network transmission characteristics, optimizing memory usage while ensuring data integrity.

[0166] The design of the data storage format takes into account the characteristics of network transmission. The use of aligned data structures reduces access overhead, and padding bytes ensure data boundary alignment. For data exchange between different platforms, automatic byte order conversion is implemented to ensure correct interpretation of data.

[0167] When writing serialized data packets, this embodiment implements a data compression mechanism. According to the data characteristics, an appropriate compression algorithm is selected to achieve a high compression rate while ensuring the decompression speed. For recurring data patterns, a reference counting method is used to avoid repeated storage.

[0168] The addition of the checksum field adopts a flexible location management strategy. According to the protocol definition, the checksum information can be inserted into different locations of the data packet. For large data packets transmitted in fragments, corresponding checksum information is added to each fragment to ensure data integrity during transmission.

[0169] The index mapping is established using a multi-level index structure. By establishing a mapping relationship between the packet identifier and the buffer location, fast data location and access are achieved. The index structure supports concurrent access and ensures data consistency in a multi-threaded environment through a lock mechanism.

[0170] This embodiment shows excellent performance and reliability when processing network data transmission. Through efficient verification mechanism and buffer management, the accuracy and efficiency of data transmission are ensured. Flexible rule configuration and verification strategy enable the system to adapt to different application scenarios, while the optimized storage structure and index mechanism provide excellent data access performance. Especially when processing high concurrency and large data volume transmission tasks, the solution can maintain stable processing capabilities and provide reliable data transmission guarantee for network communication.

[0171] In order to break through the limitations of traditional manual coding and provide an efficient and intuitive visual solution for communication protocol development, the present application provides an embodiment of a communication device based on graphic modeling for implementing all or part of the content of the communication method based on graphic modeling, see Figure 8 , the communication device based on graphic modeling specifically includes the following contents:

[0172] A graphic operation module 10 is used to obtain historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the drag operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data according to the connection correction instruction to form a protocol hierarchy, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0173] The protocol parsing module 20 is used to call the packing function and the unpacking function from the preset protocol serialization function library, write the packing function and the unpacking function into the protocol definition file, read the dynamic reference keyword table to generate a keyword mapping set, write the keyword mapping set into the protocol definition file, call the byte length calculation function and the check value calculation function from the algorithm function library, write the byte length calculation function and the check value calculation function into the protocol definition file, and generate a protocol parser according to the protocol definition file;

[0174] The data flow module 30 is used to receive a network data stream, the protocol parser extracts field data from the network data stream according to the protocol hierarchy, passes the field data to the packaging function to generate a serialized data packet, extracts a target field from the serialized data packet, passes the target field to the check value calculation function to generate a check code, judges the check code according to a preset check rule to generate a verification mark, and writes the serialized data packet and the verification mark into a network transmission buffer.

[0175] From the above description, it can be seen that the communication device based on graphical modeling provided by the embodiment of the present application can analyze historical protocol features and generate a protocol template data set through a deep learning model, thereby realizing the intelligentization of protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to realize intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0176] From the hardware level, in order to break through the limitations of traditional manual coding and provide an efficient and intuitive visualization solution for communication protocol development, the present application provides an embodiment of an electronic device for implementing all or part of the content of the communication method based on graphical modeling, and the electronic device specifically includes the following content:

[0177] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the communication device based on graphic modeling and the core business system, user terminal and related database and other related devices; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the communication method based on graphic modeling and the embodiment of the communication device based on graphic modeling in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0178] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0179] In practical applications, part of the communication method based on graphical modeling can be executed on the electronic device side as described above, or all operations can be completed in the client device. The selection can be made based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0180] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0181] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0182] In one embodiment, the communication method function based on graphic modeling can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:

[0183] Step S101: Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data to form a protocol hierarchy according to the connection correction instruction, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0184] Step S102: calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file;

[0185] Step S103: receiving a network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, extracting a target field from the serialized data packet, passing the target field into the check value calculation function to generate a check code, judging the check code according to a preset check rule to generate a verification mark, and writing the serialized data packet and the verification mark into a network transmission buffer.

[0186] From the above description, it can be seen that the electronic device provided in the embodiment of the present application analyzes historical protocol features and generates a protocol template data set through a deep learning model, thereby realizing intelligent protocol design. A graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to achieve intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through a serialized function library and an algorithm function library, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0187] In another embodiment, the communication device based on graphic modeling can be configured separately from the central processing unit 9100. For example, the communication device based on graphic modeling can be configured as a chip connected to the central processing unit 9100, and the function of the communication method based on graphic modeling is implemented through the control of the central processing unit.

[0188] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.

[0189] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0190] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0191] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0192] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0193] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0194] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0195] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0196] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the communication method based on graphical modeling in the above embodiments, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps of the communication method based on graphical modeling in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0197] Step S101: Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data to form a protocol hierarchy according to the connection correction instruction, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0198] Step S102: calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file;

[0199] Step S103: receiving a network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, extracting a target field from the serialized data packet, passing the target field into the check value calculation function to generate a check code, judging the check code according to a preset check rule to generate a verification mark, and writing the serialized data packet and the verification mark into a network transmission buffer.

[0200] As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present application analyzes historical protocol features and generates a protocol template data set through a deep learning model, thereby realizing intelligent protocol design. The graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to achieve intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through serialized function libraries and algorithm function libraries, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0201] The embodiments of the present application also provide a computer program product capable of implementing all steps of the communication method based on graphic modeling in the above embodiments, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the communication method based on graphic modeling are implemented. For example, the computer program / instruction implements the following steps:

[0202] Step S101: Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data to form a protocol hierarchy according to the connection correction instruction, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file;

[0203] Step S102: calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file;

[0204] Step S103: receiving a network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, extracting a target field from the serialized data packet, passing the target field into the check value calculation function to generate a check code, judging the check code according to a preset check rule to generate a verification mark, and writing the serialized data packet and the verification mark into a network transmission buffer.

[0205] As can be seen from the above description, the computer program product provided in the embodiment of the present application analyzes historical protocol features and generates a protocol template data set through a deep learning model, thereby realizing intelligent protocol design. A graphical protocol design interface is innovatively designed, integrating common blocks and logic blocks of communication protocols, and introducing a compatibility parameter matrix to achieve intelligent connection correction. The system automatically generates a protocol parser, processes network data streams through a serialized function library and an algorithm function library, and ensures the accuracy and reliability of data transmission. This method breaks through the limitations of traditional manual coding and provides an efficient and intuitive visualization solution for communication protocol development.

[0206] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0207] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0208] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0209] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0210] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A communication method based on graphical modeling, characterized in that: The method comprises: Acquire historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract the communication protocol common block and the logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the dragging operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data according to the connection correction instruction to form a protocol hierarchy, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file; Calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, writing the keyword mapping set into the protocol definition file, calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file; A network data stream is received, and the protocol parser extracts field data from the network data stream according to the protocol hierarchy, passes the field data to the packaging function to generate a serialized data packet, extracts a target field from the serialized data packet, passes the target field to the check value calculation function to generate a check code, determines the check code according to a preset check rule to generate a verification mark, and writes the serialized data packet and the verification mark into a network transmission buffer.

2. The communication method based on graphical modeling according to claim 1, characterized in that: The extracting of the communication protocol common block and the logic block from the protocol template data set, establishing a graphical protocol design interface to load the communication protocol common block and the logic block, and monitoring the dragging operation of the communication protocol common block and the logic block to generate component connection data include: According to the preset component classification rules, the communication protocol common block and the logic block are screened from the protocol template data set, field feature analysis is performed on the communication protocol common block to generate a field attribute table, logic feature analysis is performed on the logic block to generate a logic attribute table, the communication protocol common block and the logic block are loaded into the component cache area, a display template is called from the component display template library to construct a graphical protocol design interface, and data from the component cache area is read to generate a visual component on the graphical protocol design interface; The method comprises the following steps: monitoring the mouse events of the graphical protocol design interface to obtain the component dragging coordinates, determining the component placement position according to the component dragging coordinates to generate position information, reading the field attribute table and the logic attribute table to obtain the component connection constraints, establishing a component association matrix based on the position information and the component connection constraints, and converting the component association matrix into component connection data.

3. The communication method based on graphical modeling according to claim 1, characterized in that: The step of calculating a compatibility parameter matrix according to the component connection data, comparing the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjusting the component connection data according to the connection correction instruction to form a protocol hierarchy, reading the field attributes of the communication protocol common block and the logic attributes of the logic block, and writing the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file includes: Reading a component compatibility rule set from a compatibility rule library, substituting the component connection data into the component compatibility rule set to calculate the association degree between components, constructing a compatibility parameter matrix based on the association degree, comparing the parameter value in the compatibility parameter matrix with a preset threshold value to generate a difference mark, calculating the component position offset according to the difference mark to form a connection correction instruction, and applying the connection correction instruction to the component connection data to generate a protocol hierarchy structure; The field name, data type, default value of the communication protocol common block and the conditional statement, operator, and execution sequence of the logic block are obtained from the attribute analysis module, and the field name, data type, default value, conditional statement, operator, execution sequence and protocol hierarchy are written into the protocol definition file according to a preset format.

4. The communication method based on graphical modeling according to claim 1, characterized in that: The method of calling a packing function and an unpacking function from a preset protocol serialization function library, writing the packing function and the unpacking function into the protocol definition file, reading a dynamic reference keyword table to generate a keyword mapping set, and writing the keyword mapping set into the protocol definition file includes: Reading function declarations of a packing function and an unpacking function from a protocol serialization function library, parsing the function declarations to extract a function name, a parameter list, and a return value type, combining the function name, the parameter list, and the return value type to form a function definition code, writing the function definition code in a function definition area of ​​the protocol definition file, and establishing a mapping relationship between the packing function and the unpacking function and a protocol component; Extract keyword identifiers and reference types from the dynamic reference keyword table, combine the keyword identifiers and the reference types to construct a keyword mapping object, generate a keyword mapping set based on the keyword mapping object, write the keyword mapping set into the keyword definition area of ​​the protocol definition file, and establish a reference link between the keyword mapping set and the function definition code.

5. The communication method based on graphical modeling according to claim 1, characterized in that: The step of calling a byte length calculation function and a check value calculation function from an algorithm function library, writing the byte length calculation function and the check value calculation function into the protocol definition file, and generating a protocol parser according to the protocol definition file includes: Retrieving source codes of a byte length calculation function and a check value calculation function from an algorithm function library, extracting algorithm parameters and calculation logic from the source code, encapsulating the algorithm parameters and the calculation logic into a function module, writing the function module into the algorithm area of ​​the protocol definition file, and establishing call entries of the byte length calculation function and the check value calculation function; The protocol hierarchy, function definition code and keyword mapping set in the protocol definition file are read, a data parsing code is generated according to a preset parsing rule, the function module is associated and bound with the data parsing code, and the data parsing code and the function module are compiled to generate an executable file of the protocol parser.

6. The communication method based on graphical modeling according to claim 1, characterized in that: The receiving of the network data stream, the protocol parser extracting field data from the network data stream according to the protocol hierarchy, passing the field data into the packaging function to generate a serialized data packet, and extracting a target field from the serialized data packet, comprises: The network interface is monitored to obtain a network data stream, and the network data stream is segmented according to a preset data frame format. The protocol parser parses the header identifier of the data frame according to the protocol hierarchy structure, locates the field boundary from the data frame to extract the field data, and performs data type conversion and boundary check on the field data to generate processed field data; The processed field data is passed into the packaging function for serialization processing according to the protocol specification, a serialized data packet is generated based on the serialization rule of the packaging function, the data structure of the serialized data packet is parsed to obtain the field offset, and the target field is intercepted from the serialized data packet according to the field offset.

7. The communication method based on graphical modeling according to claim 1, characterized in that: The step of passing the target field into the check value calculation function to generate a check code, determining the check code according to a preset check rule to generate a verification identifier, and writing the serialized data packet and the verification identifier into a network transmission buffer includes: Obtaining the data length and data content of the target field, passing the data length and the data content as input parameters into the check value calculation function, generating a check code based on the check algorithm of the check value calculation function, reading a preset check rule from a check rule configuration table, matching the check code with the check rule, and generating a verification identifier according to the result of the match; Obtain available cache space from the network transmission buffer, write the serialized data packet into the cache space according to a preset data storage format, add the verification identifier to the check field of the serialized data packet, and establish an index mapping of the serialized data packet in the network transmission buffer.

8. A communication device based on graphical modeling, characterized in that: The device comprises: A graphic operation module, used to obtain historical protocol definition data to construct a protocol feature vector, pass the protocol feature vector into a deep learning model to generate a protocol template data set, extract a communication protocol common block and a logic block from the protocol template data set, establish a graphical protocol design interface to load the communication protocol common block and the logic block, monitor the drag operation of the communication protocol common block and the logic block to generate component connection data, calculate a compatibility parameter matrix based on the component connection data, compare the compatibility parameter matrix with a preset threshold to generate a connection correction instruction, adjust the component connection data according to the connection correction instruction to form a protocol hierarchy, read the field attributes of the communication protocol common block and the logic attributes of the logic block, and write the field attributes, the logic attributes and the protocol hierarchy into a protocol definition file; A protocol parsing module, used to call a packing function and an unpacking function from a preset protocol serialization function library, write the packing function and the unpacking function into the protocol definition file, read a dynamic reference keyword table to generate a keyword mapping set, write the keyword mapping set into the protocol definition file, call a byte length calculation function and a check value calculation function from an algorithm function library, write the byte length calculation function and the check value calculation function into the protocol definition file, and generate a protocol parser according to the protocol definition file; The data flow module is used to receive a network data stream, wherein the protocol parser extracts field data from the network data stream according to the protocol hierarchy, passes the field data to the packaging function to generate a serialized data packet, extracts a target field from the serialized data packet, passes the target field to the check value calculation function to generate a check code, determines the check code according to a preset check rule to generate a verification mark, and writes the serialized data packet and the verification mark into a network transmission buffer.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the communication method based on graphical modeling according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the communication method based on graphic modeling described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Network protocol formalization description tool under Android system environment

    CN104360836A

  • Internet protocol configuration method and device, equipment and computer readable storage medium

    CN110061861A