A General Protocol Fast Parsing Method and System

The method and system generate universal protocol templates from user inputs, addressing inefficiencies in custom code development by enabling rapid and customizable protocol parsing across various scenarios.

CN115811555BActive Publication Date: 2025-07-15山东芯辰人工智能科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211461737.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2025-07-15
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

In the prior art, general protocol parsing requires customized code development, and the types of protocols that are complex, time-consuming and incomplete.

Method used

Provide a common protocol quick parsing method, which generates a common protocol template by obtaining protocol configuration parameter information, and configures protocol rules based on preset templates and core parameter data to achieve rapid parsing without code generation.

Benefits of technology

It realizes general protocol analysis with simple and fast operation, supports the reuse of multiple protocol templates, meets user custom development needs, and simplifies the protocol configuration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115811555B_ABST
    Figure CN115811555B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, electronic device and computer-readable storage medium for quickly parsing a general protocol, belonging to the field of communication technologies. It includes obtaining parameter information required for protocol configuration, generating a general protocol template according to a preset general template and the parameter information; obtaining the basic configuration of the general protocol, updating the general protocol template according to the basic configuration of the general protocol and obtaining an associated protocol template; obtaining core parameter data, and performing protocol rule configuration on the general protocol template according to the core parameter data; obtaining a persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario. Without the need for re-code development, a protocol matching the application scenario can be quickly and accurately obtained, solving the problem in the prior art that "customized code development is required for selecting a network protocol for an application scenario, with low efficiency and incomplete types".
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a method and system for quickly parsing a general protocol. Background Art

[0002] The statements in this part only mention the background art related to this application and do not necessarily constitute prior art.

[0003] A network protocol is a set of rules, standards, or agreements established for data exchange in a computer network, and is a set of rules that must be followed when peer entities communicating with each other in a computer network exchange information. Network protocols usually include standard protocols defined by an organization or institution in the industry and application layer protocols formulated by both communicating parties.

[0004] In different application scenarios, the network protocols used may be different, and it is necessary to parse the general protocol to complete the protocol configuration in different situations. However, the existing general protocol parsing and configuration require customized code development for the application scenario, which is complex and time-consuming to operate and the types of protocols targeted are not comprehensive. Summary of the Invention

[0005] To solve the deficiencies of the prior art, this application provides a method and system for quickly parsing a general protocol, which can complete the quick parsing of the general protocol without generating code.

[0006] In a first aspect, this application provides a method for quickly parsing a general protocol;

[0007] A method for quickly parsing a general protocol includes:

[0008] Obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information;

[0009] Obtain the basic configuration of the general protocol, update the general protocol template according to the basic configuration of the general protocol, and obtain an associated protocol template;

[0010] Obtain the core parameter data, and configure the protocol rules of the general protocol template according to the core parameter data;

[0011] According to the project application scenario, obtain a persistent protocol template based on the general protocol template and the associated protocol template.

[0012] In a second aspect, this application provides a system for quickly parsing a general protocol;

[0013] A system for quickly parsing a general protocol includes:

[0014] The general protocol template generation module is configured to: obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information;

[0015] The general protocol template update module is configured to: obtain the basic configuration of the general protocol, and update the general protocol template and obtain an associated protocol template according to the basic configuration of the general protocol;

[0016] The protocol rule configuration module is configured to: obtain the core parameter data, and perform protocol rule configuration of the general protocol template according to the core parameter data;

[0017] The persistent protocol generation module is configured to: obtain a persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario.

[0018] Thirdly, the present application provides an electronic device;

[0019] An electronic device includes a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the steps of the above general protocol fast parsing method are completed.

[0020] Fourthly, the present application provides a computer-readable storage medium;

[0021] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the steps of the above general protocol fast parsing method are completed.

[0022] Compared with the prior art, the beneficial effects of the present application are:

[0023] 1. The present application integrates multiple protocol templates. As long as the user provides partial information, it can refine and generate a general protocol template for a certain category / industry according to the user's needs from the universal general template. The configuration information of the refined general protocol template is persisted in the database, which can realize the reuse of the template; a custom template is provided, which meets the user's requirement for custom development according to the project needs. Custom development is carried out based on the template without complex conversion.

[0024] 2. The present application can perform fast parsing of the general protocol without custom code development, and the operation is simple and fast. Description of the Drawings

[0025] The specification drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application.

[0026] Figure 1A flowchart showing the process of the general protocol fast parsing method provided by the embodiments of the present application. Detailed implementation manners

[0027] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present application have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs.

[0028] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0029] In the case of no conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.

[0030] Term explanation:

[0031] Siemens.s7.client: An Ethernet S7 communication protocol, mainly used to connect a PLC to a PC workstation (PG / PC-PLC communication);

[0032] Modbus.client: The Modbus protocol is a common language applied to electronic controllers. Through this protocol, controllers can communicate with each other and with other devices via a network (such as Ethernet).

[0033] node.red: A powerful tool for building Internet of Things (IoT) applications. Its focus is on simplifying the "connection" of code blocks to perform tasks. It is a flow-based programming tool that has a visual editor allowing nodes to be connected together to create a flow.

[0034] Embodiment 1

[0035] In the prior art, custom code development is required for parsing network protocols for application scenarios, which is inefficient and has poor adaptability. Therefore, the present application provides a general protocol fast parsing method.

[0036] A general protocol fast parsing method includes:

[0037] Obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information.

[0038] Obtain the basic configuration of the general protocol, and update the general protocol template and obtain the associated protocol template according to the basic configuration of the general protocol.

[0039] Obtain the core parameter data, and configure the protocol rules of the general protocol template according to the core parameter data.

[0040] Obtain the persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario.

[0041] Further, obtaining the parameter information required for protocol configuration and generating a general protocol template according to a preset general template and the parameter information includes:

[0042] Obtain the parameter information required for protocol configuration, and obtain the protocol template associated with the parameter information according to a preset general gateway project and a debugging general template.

[0043] Replace the core parameters of the protocol template according to the parameter information, and encapsulate the regenerated protocol to generate a general protocol template.

[0044] Further, the parameter information required for protocol configuration includes protocol type, protocol directory, and protocol name.

[0045] Further, obtaining the parameter information required for protocol configuration and generating a general protocol template according to a preset general template and the parameter information further includes:

[0046] Store the configuration information of the general protocol template in the database.

[0047] Further, obtaining the basic configuration of the general protocol, and updating the general protocol template and obtaining the associated protocol template according to the basic configuration of the general protocol includes:

[0048] Obtain the basic configuration of the general protocol, and update the gateway project parameter code file and the protocol project parameter code file in the general protocol template according to the basic configuration of the general protocol.

[0049] Obtain the associated protocol template according to the basic configuration of the general protocol.

[0050] Further, the basic configuration of the general protocol includes application name, application directory, associated protocol template, and associated gateway template.

[0051] Further, the core parameter data includes associated gateway network segment and associated communication protocol.

[0052] Further, obtaining the persistent protocol template based on the project application scenario, the general protocol template, and the associated protocol template includes:

[0053] Start the project service in response to an operation initiated by the user to affect the project, start the gateway service and the protocol service in the general protocol, search for the associated protocol template, and obtain the persistent protocol template;

[0054] Obtain the request / send parameters in the project application scenario, and update the configuration information of the persistent protocol template according to the request / send parameters.

[0055] Next, in combination with Figure 1 A detailed description of a general protocol fast parsing method disclosed in this embodiment will be given. A general protocol fast parsing method provided in this embodiment includes the following steps:

[0056] S1. Obtain the parameter information required for protocol configuration, and generate a general protocol template according to the preset general template and the parameter information; among them, the parameter information required for protocol configuration includes the protocol type, protocol directory, and protocol name, which are configured by the user when creating a connection template. The specific steps include:

[0057] S101. Obtain the parameter information required for protocol configuration, search in the preset general gateway project and the debugging general template, and obtain the protocol template associated with the parameter information; specifically, the parameter information required for protocol configuration includes the protocol type, protocol directory, and protocol name. When the user creates a connection template, the protocol type, protocol directory, and protocol name required in the protocol configuration will be manually added.

[0058] S102. Replace the corresponding parameters of the associated protocol template according to the parameter information, encapsulate the regenerated protocol, generate a general protocol template, refine it from the universal general template, and generate a general protocol template for a certain category / industry;

[0059] S103. Store the configuration information of the general protocol template in the database, and persist the configuration information of the refined general protocol template in the database, which can realize the repeated use by the user.

[0060] S2. Obtain the basic configuration of the general protocol, and update the general protocol template and obtain the associated protocol template according to the basic configuration of the general protocol; among them, when the user creates a project application, the protocol template to be created is selected, and the basic configuration of the protocol is configured. The basic configuration of the general protocol includes the application name, application directory, associated protocol template, and associated gateway template. The specific steps include:

[0061] S201. Obtain the basic configuration of the general protocol, and update the gateway project parameter code file and protocol project parameter code file in the general protocol template according to the basic configuration of the general protocol. Specifically, copy the service core code according to the basic configuration of the general protocol, and replace the configured gateway project parameter code file and protocol project parameter code file.

[0062] S202. Obtain the associated protocol template according to the associated protocol template information in the basic configuration of the general protocol.

[0063] S203. Save the configuration information of the associated protocol template to the service file code and store it in the database.

[0064] S3. Obtain the core parameter data, and configure the protocol rules of the general protocol template according to the core parameter data. Among them, the core parameter data includes the associated gateway network segment and the associated communication protocol. Specifically, after the user creates the project application framework, the associated gateway network segment and the associated communication protocol are required in the page configuration. Obtain the user's requirements for the associated gateway network segment and the associated communication protocol, and then search for and obtain the associated gateway network segment and the associated communication protocol from the database, upload the data to the cloud through the gateway, and transfer the data to the lbsmart server (self-developed server) through gateway processing in the cloud. After the lbsmart server (self-developed server) receives the gateway transmission data, persist the configuration information to the database. At the same time, the application layer transmits data through the MQTT protocol, and the edge-side client receives data through the subscription and publication mechanism of the MQTT protocol. Then, the edge side searches for the corresponding protocol template through the gateway and passes the message to the corresponding protocol template, such as Siemens.s7.client, Modbus.client, Yongtong binary parsing protocol, general HTTP request protocol and other templates.

[0065] In some embodiments, the corresponding data is also sent to node.red. Node.red performs online logic orchestration based on the data, automatically generates code according to the logic, and then generates the corresponding template. The display form of this module on the page is in the form of drag-and-drop building blocks, realizing low-code online development programming, which can be adjusted according to the actual application scenario.

[0066] S4. Based on the project application scenario, obtain the persistent protocol template based on the general protocol template and the associated protocol template. The specific steps include:

[0067] S401. Start the project service in response to the operation of the user starting the project, start the gateway service and protocol service in the general protocol, search for the associated protocol template, and obtain the persistent protocol template. Specifically, after the user starts the project application, start the replaced gateway service and protocol service; then search for and load the persistent template from the associated part in the database.

[0068] S402. Obtain the request / sending parameters in the project application scenario, and update the configuration information of the persistent protocol template according to the request / sending parameters. Specifically, after all services are started, obtain the request / sending parameters in the project application scenario, then obtain the interface configuration of the corresponding part in the protocol template according to the parameters in the application scenario, obtain the parameters from the interface configuration, and during this process, judge whether there is an interface mapping. If there is an interface mapping, it is necessary to obtain the data of the mapped interface. After all interface data is obtained, encapsulate and package the parameter information and transmit it to the protocol configuration.

[0069] Embodiment Two

[0070] This embodiment discloses a general protocol fast parsing system, including:

[0071] A general protocol template generation module, configured to: obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information;

[0072] A general protocol template update module, configured to: obtain the basic configuration of the general protocol, update the general protocol template according to the basic configuration of the general protocol, and obtain an associated protocol template;

[0073] A protocol rule configuration module, configured to: obtain core parameter data, and perform protocol rule configuration of the general protocol template according to the core parameter data;

[0074] A persistent protocol generation module, configured to: obtain a persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario.

[0075] It should be noted here that the above general protocol template generation module, general protocol template update module, protocol rule configuration module, and persistent protocol generation module correspond to the steps in Embodiment One. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment One. It should be noted that the above modules can be executed in a computer system such as a set of computer executable instructions as part of the system.

[0076] Embodiment Three

[0077] Embodiment Three of the present invention provides an electronic device, including a memory and a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the above steps are completed.

[0078] Embodiment Four

[0079] Embodiment 4 of the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the above steps are completed.

[0080] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or a device for implementing the functions specified in multiple blocks.

[0081] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or the functions specified in multiple blocks.

[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, and a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or the functions specified in multiple blocks.

[0083] In the above embodiments, the descriptions of each embodiment have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0084] The above is only the preferred embodiment of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for quickly parsing a general protocol, characterized in that Including: Obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information; Obtain the basic configuration of the general protocol, update the general protocol template according to the basic configuration of the general protocol, and obtain the associated protocol template; Obtain the core parameter data, and configure the protocol rules of the general protocol template according to the core parameter data; Based on the project application scenario, obtain the persistent protocol template based on the general protocol template and the associated protocol template; The core parameter data includes the associated gateway network segment and the associated communication protocol; The user creates a project application framework, configures the associated gateway network segment and the associated communication protocol on the page, obtains the user's requirements for the associated gateway network segment and the associated communication protocol, searches and obtains the associated gateway network segment and the associated communication protocol from the database, uploads them to the cloud through the gateway, processes them through the gateway in the cloud, and transmits the data to the self-developed server. After receiving the data transmitted by the gateway, the self-developed server persists the configuration information to the database; The application layer transmits data through the MQTT protocol. The edge-side client receives the data through the subscription and publication mechanism of the MQTT protocol. The edge side finds the corresponding protocol template through the gateway and passes the message to the corresponding protocol template; Send the data to node.red. node.red performs online logic orchestration according to the data, automatically generates code according to the logic, generates the corresponding template, which is displayed as a drag-and-drop building block on the module page, and adjusts according to the application scenario; The obtaining of the persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario includes: Start the project service in response to the operation affected by the user starting the project, start the gateway service and the protocol service in the general protocol, search for the associated protocol template, and obtain the persistent protocol template; Obtain the request / send parameters in the project application scenario, and update the configuration information of the persistent protocol template according to the request / send parameters.

2. The general protocol fast parsing method according to claim 1, characterized in that, The obtaining of the parameter information required for protocol configuration and generating a general protocol template according to a preset general template and the parameter information includes: Obtain the parameter information required for protocol configuration, and obtain the protocol template associated with the parameter information according to a preset general gateway project and a debugging general template; Replace the core parameters of the protocol template according to the parameter information, encapsulate the regenerated protocol, and generate a general protocol template; Furthermore, the parameter information required for protocol configuration includes protocol type, protocol directory, and protocol name.

3. The general protocol fast parsing method according to claim 2, characterized in that, The obtaining of the parameter information required for protocol configuration and generating a general protocol template according to a preset general template and the parameter information further includes: Store the configuration information of the general protocol template in the database.

4. The general protocol fast parsing method according to claim 1, characterized in that The obtaining of the basic configuration of the general protocol, updating the general protocol template according to the basic configuration of the general protocol, and obtaining the associated protocol template includes: Obtain the basic configuration of the general protocol, and update the gateway project parameter code file and the protocol project parameter code file in the general protocol template according to the basic configuration of the general protocol; Obtain the associated protocol template according to the basic configuration of the general protocol; Furthermore, the basic configuration of the general protocol includes the application name, application directory, associated protocol template, and associated gateway template.

5. The general protocol fast parsing method according to claim 4, characterized in that The obtaining of the basic configuration of the general protocol, updating the general protocol template according to the basic configuration of the general protocol, and obtaining the associated protocol template further include: Saving the configuration information of the associated protocol template to the service file code.

6. A general protocol fast parsing system, characterized in that, It includes: A general protocol template generation module, configured to: obtain the parameter information required for protocol configuration, and generate a general protocol template according to a preset general template and the parameter information; A general protocol template update module, configured to: obtain the basic configuration of the general protocol, update the general protocol template according to the basic configuration of the general protocol, and obtain the associated protocol template; A protocol rule configuration module, configured to: obtain the core parameter data, and perform protocol rule configuration of the general protocol template according to the core parameter data; A persistent protocol generation module, configured to: obtain a persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario; The core parameter data includes the associated gateway network segment and the associated communication protocol; The user creates a project application framework, configures the associated gateway network segment and the associated communication protocol on the page, obtains the user's requirements for the associated gateway network segment and the associated communication protocol, searches for and obtains the associated gateway network segment and the associated communication protocol from the database, uploads them to the cloud through the gateway, processes them through the gateway in the cloud, and transmits the data to the self-developed server. After receiving the gateway-transmitted data, the self-developed server persists the configuration information to the database; The application layer transmits data through the MQTT protocol. The edge-side client receives the data through the subscription and publication mechanism of the MQTT protocol. The edge side finds the corresponding protocol template through the gateway and passes the message to the corresponding protocol template; Send the data to node.red. node.red performs online logic orchestration according to the data, automatically generates code according to the logic, generates a corresponding template, and displays it as a drag-and-drop form of building blocks on the module page, and adjusts it according to the application scenario; The obtaining of the persistent protocol template based on the general protocol template and the associated protocol template according to the project application scenario includes: Starting the project service in response to the operation of the user starting the project, starting the gateway service and the protocol service in the general protocol, searching for the associated protocol template, and obtaining the persistent protocol template; Obtaining the request / send parameters in the project application scenario, and updating the configuration information of the persistent protocol template according to the request / send parameters.

7. An electronic device, characterized in that, It includes a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the steps described in any one of claims 1-5 are completed.

8. A computer-readable storage medium, characterized in that, For storing computer instructions, when the computer instructions are executed by the processor, the steps described in any one of claims 1-5 are completed.

Citation Information

Patent Citations

  • Automatic initial development method and system, computer equipment and storage medium

    CN110286885A