CN115576537A - Stack type model configuration method and device for serial port data packet and parser - Google Patents

Stack type model configuration method and device for serial port data packet and parser Download PDF

Info

Publication number
CN115576537A
CN115576537A CN202211495055.5A CN202211495055A CN115576537A CN 115576537 A CN115576537 A CN 115576537A CN 202211495055 A CN202211495055 A CN 202211495055A CN 115576537 A CN115576537 A CN 115576537A
Authority
CN
China
Prior art keywords
module
component
user
data packet
parser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211495055.5A
Other languages
Chinese (zh)
Other versions
CN115576537B (en
Inventor
王腾
沙中明
耿永斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Magbyte Data Technology Co ltd
Original Assignee
Shandong Magbyte Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Magbyte Data Technology Co ltd filed Critical Shandong Magbyte Data Technology Co ltd
Priority to CN202211495055.5A priority Critical patent/CN115576537B/en
Priority claimed from CN202211495055.5A external-priority patent/CN115576537B/en
Publication of CN115576537A publication Critical patent/CN115576537A/en
Application granted granted Critical
Publication of CN115576537B publication Critical patent/CN115576537B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for configuring a stack model of a serial port data packet parser. According to the method, through a man-machine interaction mode, parameter editing and graphic connection actions are carried out based on instructions input by a user, so that the configuration of functions such as serial port data receiving and sending, analysis, logic judgment, edge calculation and the like can be realized, man-machine interaction is accurately and efficiently completed, the use of solidified code parameters is avoided, the pain points that the traditional configuration mode is poor in flexibility and incapable of configuring data processing and logic tasks are solved, the man-machine interaction experience degree of the user is improved, the operation and use threshold of the user is reduced, and the maintainability and the functionality of a project are improved.

Description

Stack type model configuration method and device for serial port data packet and parser
Technical Field
The invention relates to the technical field of serial port data processing, in particular to a method and a device for configuring a stack model of a serial port data packet parser.
Background
The serial communication has the characteristics of flexibility, universality and the like, so that the serial communication is widely applied to realizing data communication between equipment and between a sensor and a control system. The serial port protocol presents tens of thousands of different protocol types according to different industries, different equipment, different manufacturers and different transmission data quantity. The serial port communication parameters and rules of data packet assembly and sending and data packet receiving and analyzing, namely a TX end and an RX end, are required to be set according to a communication protocol for realizing serial port permission; due to different specific regulations of communication content protocols, serial communication realizes diversified characteristics.
The functions of assembling and sending, receiving, caching, analyzing, extracting, packaging and recombining the serial port data packet and the like are realized by depending on professional programmers to write a computer program according to protocol requirements, the function realization codes written according to the private serial port protocol can only meet the data communication requirements of private equipment, the code reusability is low, and the configuration in different protocols has no reusability. Therefore, the method for configuring the parameters presents different configuration efficiency and error probability aiming at different serial port communication protocols. The traditional parameter configuration method has respective disadvantages through code solidification parameters or through solidified interactive pages: the process of continuously debugging and trial and error in the development process is realized through the code curing parameters. Once the forming is finished, the difficulty of parameter adjustment is high, and codes need to be rewritten; through the solidified interactive page, a user is allowed to modify the configuration, but the design quality of an interactive interface and operation logic is uneven, and the flexibility is poor. Along with the development of industrial internet of things, a traditional configuration mode does not usually have edge calculation and a data preprocessing function, the data sharing and linkage cost of equipment communication among different models and systems is gradually increased, the requirements of interface butt joint and data interaction among different equipment are more and more complex, and the problems of serial port protocol function requirements and configuration interaction are increasingly highlighted.
In view of the above problems, no effective solution exists at present.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a stack model configuration method and a stack model configuration device for a serial port data packet parser.
In order to achieve the technical purpose, the technical scheme of the invention is realized as follows:
the first aspect provides a stack model configuration method for a serial port data packet and a resolver, which comprises the following steps:
establishing a stacked data package component model based on the data package component selected by the user;
receiving a first configuration instruction input by a user;
configuring at least one of a title and remark module, a data packet content module, a data interface label module and a port module in the stacked data packet component model based on a first configuration instruction to obtain a configured stacked data packet component model;
establishing a stacked parser component model based on the parser component selected by the user;
receiving a second configuration instruction input by a user;
configuring at least one of a title and remark module, a port module, an analysis rule module, a data interface tag module, a logic action module and an overtime processing module in the stack type resolver component model based on a second configuration instruction to obtain a configured stack type resolver component model;
receiving a relation binding instruction input by a user;
and based on the relation binding instruction, performing association binding on the configured stack type data package component model and the configured stack type resolver component model.
In some implementations of the first aspect, prior to building the stacked data package component model based on the user-selected data package components, the method further comprises:
receiving a first element dragging instruction input by a user;
selecting a data package component from the component types based on the first element dragging instruction and dragging the data package component to an editing area;
before building the stacked parser component model based on the user selected parser component, the method further comprises:
receiving a second element dragging instruction input by a user;
and selecting a resolver component in the component type based on the second element dragging instruction and dragging the resolver component to the editing area.
In some implementations of the first aspect, the method further comprises:
establishing and obtaining a plurality of configured stacked data package component models and/or a plurality of configured stacked parser component models based on a request input by a user;
based on the relation binding instruction, the configured stack type data packet component model and the configured stack type analyzer component model are associated and bound, and the method comprises the following steps:
and performing association binding on at least one component model in the plurality of configured stacked data package component models and at least one component model in the plurality of configured stacked parser component models based on the relationship binding instruction.
In some implementations of the first aspect, the structure of the stacked data packet component model is made up of multiple types of modules, one or more of the same type of modules in the stack and the order of stacking is not sensitive;
the structure of the stack type resolver component model is composed of multiple types of modules, one or more modules of the same type in the stack are provided, and the stack sequence has no sensitivity.
In some implementations of the first aspect, configuring the packet content module includes:
and for the content to be sent of the data packet, specifying the check bit and configuring automatic calculation parameters based on at least one of 16-system data, ASCII, UTF8 and GBK characters.
In some implementations of the first aspect, the logic action module is configured to perform a user-defined task, perform a logic judgment according to a data parsing result, and execute one or more action tasks, where the action task includes sending a data packet or updating a stored value or completing an API data interface request.
In some implementations of the first aspect, the timeout processing module is configured to define a time criterion for the timeout determination and the executed action task by a user, and perform the logic determination and execute the action task.
The second aspect provides a stacked model configuration device for a serial port data packet and a parser, comprising:
the model building module is used for building a stacked data package component model based on the data package component selected by the user;
the receiving module is used for receiving a first configuration instruction input by a user;
the configuration module is used for configuring at least one of a title and remark module, a data packet content module, a data interface label module and a port module in the stacked data packet component model based on a first configuration instruction to obtain a configured stacked data packet component model;
the model establishing module is also used for establishing a stack type resolver component model based on the resolver component selected by the user;
the receiving module is also used for receiving a second configuration instruction input by a user;
the configuration module is further used for configuring at least one of a title and remark module, a port module, an analysis rule module, a data interface tag module, a logic action module and an overtime processing module in the stack type analyzer component model based on a second configuration instruction to obtain a configured stack type analyzer component model;
the receiving module is also used for receiving a relation binding instruction input by a user;
and the association binding module is used for performing association binding on the configured stacked data package component model and the configured stacked resolver component model based on the relationship binding instruction.
In some implementations of the second aspect, the apparatus further includes a drag module;
before establishing a stacked data package component model based on a data package component selected by a user, the receiving module is further used for receiving a first element dragging instruction input by the user;
the dragging module is used for selecting a data packet component from the component type based on the first element dragging instruction and dragging the data packet component to an editing area;
before establishing a stacked parser component model based on the parser component selected by the user, the receiving module is further used for receiving a second element dragging instruction input by the user;
and the dragging module is also used for selecting a parser component in the component type based on the second element dragging instruction and dragging the parser component to the editing area.
A third aspect provides a computer storage medium having computer program instructions stored thereon that, when executed by a processor, implement a method as in the first aspect and any of some implementations of the first aspect.
The invention has the beneficial effects that: according to the invention, through a man-machine interaction mode, based on an instruction input by a user, parameter editing and graphic connection actions are carried out, so that the configuration of functions such as serial port data receiving and sending, analysis, logic judgment, edge calculation and the like can be realized, man-machine interaction is accurately and efficiently completed, the use of solidified code parameters is avoided, the pain points that the traditional configuration mode is poor in flexibility, data processing and logic tasks cannot be configured and the like are solved, the man-machine interaction experience degree of the user is improved, the operation and use threshold of the user is reduced, and the maintainability and the functionality of a project are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the examples will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary implementations of the invention and that other drawings may be derived from the provided drawings by those of ordinary skill in the art without inventive faculty.
The structure, proportion, size, sequence of elements in the drawings and the like in the description are only used for matching the content disclosed in the description, so that those skilled in the art can understand and read the description, and do not limit the limitation condition of the invention, so that the invention has no technical essence, and any modification of the structure, change of the proportion relation or size, and adjustment of the operation sequence still fall within the scope of the technical content disclosed by the invention without affecting the efficacy and the achievable purpose of the invention.
Fig. 1 is a schematic diagram of an overall interactive interface structure and elements according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of a method for configuring a stack model of a serial port data packet and a parser according to an embodiment of the present invention
Fig. 3 is a schematic flow chart of a method for implementing graphical configuration of a serial communication mode according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a model of a packet stack component according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a stack component model of parser according to an embodiment of the present invention;
FIG. 6 is a flow diagram of a configuration data package component model according to an embodiment of the present invention;
FIG. 7 is a flow diagram of a configuration parser component model provided by an embodiment of the invention;
fig. 8 is a schematic structural diagram of a stacked model configuration apparatus for a serial port data packet and a parser according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. In this embodiment, steps 4-14 are not in sequence, and changing the sequence has no effect on the final result. All other embodiments obtained by a person skilled in the art without making any inventive step are within the scope of protection of the present invention.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
Aiming at the problems in the background art, the embodiment of the application provides a method, a device and a storage medium for configuring a stack model of a serial port data packet parser, and the method, the device and the storage medium are used for performing parameter editing and graph connection actions based on an instruction input by a user in a man-machine interaction mode, so that the configuration of functions such as serial port data receiving and sending, parsing, logic judgment, edge calculation and the like can be realized, man-machine interaction is accurately and efficiently completed, solidified code parameters are avoided, the problem that a traditional configuration mode is poor in flexibility and cannot configure pain points such as data processing and logic tasks is solved, the man-machine interaction experience of the user is improved, the operation and use threshold of the user is reduced, and the maintainability and the functionality of a project are improved.
The method, the apparatus, and the storage medium for configuring the stacked model of the serial port data packet parser according to the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an overall interactive interface structure and elements provided according to an embodiment of the present invention, and fig. 2 is a schematic flowchart of a serial port data packet and parser stack model configuration method provided by an embodiment of the present invention, where an execution subject of the configuration method may be a processor, or may be other devices with a computing function, and is not limited specifically. The above-described execution body does not constitute a limitation of the present application.
Among the various reference numerals of fig. 1, 1 is a menu bar; 2 is a component area; 3 is an editing area; 4 is a configuration area; 5 is a component; 6 is a data packet stack type component model; 7 is data packet title and remark; 8 is the data packet content; 9 is a data interface label; 10 is a TX port configuration; 11 is a stack type component model of the resolver; 12 is parser title and remark; 13 is configured for RX port; 14 is a resolution rule; 15 is a data interface label; 16 is a logical action; 17 is timeout processing; 18 is an associative link.
With reference to fig. 1 and fig. 2, the method for configuring a stack model of a serial port data packet and a parser according to the present invention may specifically be:
s101, establishing a stack type data package component model based on a data package component selected by a user;
s102, receiving a first configuration instruction input by a user;
s103, configuring at least one of a title and remark module, a data packet content module, a data interface label module and a port module in the stacked data packet component model based on a first configuration instruction to obtain a configured stacked data packet component model;
s104, establishing a stack type resolver component model based on the resolver component selected by the user;
s105, receiving a second configuration instruction input by a user;
s106, configuring at least one of a title and remark module, a port module, an analysis rule module, a data interface label module, a logic action module and an overtime processing module in the stack type analyzer component model based on a second configuration instruction to obtain a configured stack type analyzer component model;
s107, receiving a relation binding instruction input by a user;
and S108, based on the relation binding instruction, performing association binding on the configured stacked data package component model and the configured stacked parser component model.
In some embodiments, prior to building the stacked data packet component model based on the user-selected data packet components, the method further comprises:
receiving a first element dragging instruction input by a user;
selecting a data package component from the component types based on the first element dragging instruction and dragging the data package component to an editing area;
before building the stacked parser component model based on the user selected parser component, the method further comprises:
receiving a second element dragging instruction input by a user;
and selecting a resolver component in the component type based on the second element dragging instruction and dragging the resolver component to the editing area.
In some embodiments, the method further comprises:
establishing and obtaining a plurality of configured stacked data package component models and/or a plurality of configured stacked parser component models based on a request input by a user;
based on the relation binding instruction, the configured stack type data packet component model and the configured stack type analyzer component model are associated and bound, and the method comprises the following steps:
and performing association binding on at least one component model in the plurality of configured stacked data package component models and at least one component model in the plurality of configured stacked parser component models based on the relationship binding instruction.
In some embodiments, the structure of the stacked data packet component model is composed of multiple types of modules, one or more of the same type of modules in the stack and no sensitivity in the stacking order;
the structure of the stack type resolver component model is composed of multiple types of modules, one or more modules of the same type in the stack are provided, and the stack sequence has no sensitivity.
In some embodiments, configuring the packet content module comprises:
and for the content to be sent of the data packet, specifying the validity bit and configuring automatic calculation parameters based on at least one of 16-system data, ASCII, UTF8 and GBK characters.
In some embodiments, the logic action module is configured to perform a user-defined task, perform a logic determination according to a data parsing result, and perform one or more action tasks, where the action task includes sending a data packet or updating a stored value or completing an API data interface request.
In some embodiments, the timeout processing module is used for user defining the time standard of the timeout judgment and the executed action task, and making the logic judgment and executing the action task.
Specifically, in practical use, the method for configuring the stacked model of the serial port data packet and the parser may specifically include the following steps:
s1, the user selects the type of the component to be used in a page 'component area', and the component can be a data packet or a resolver. Moving the mouse to the component, pressing and holding the left button of the mouse, and selecting the component.
S2, the user moves the mouse to drag the selected component to the editing area, and after the selected component reaches the expected position, the mouse button is released. That is, S1 and S2 generate the first element drag instruction or the second element drag instruction.
And S3, according to the component selected by the user in the S1, releasing the coordinate point on the mouse, and generating and displaying a stack type component configuration model. The data packet parser has respective stacked configuration models, and the different configuration models are formed by one or more different configuration modules in a stack. Namely, a detailed operation procedure of building a stacked packet component model for S101 based on the user-selected packet component, and building a stacked parser component model for S104 based on the user-selected parser component.
S4, the user selects a module in the stack type configuration model by using a mouse, the display of the configuration area is triggered to be updated, and the parameters of the selected module can be configured and stored in the configuration area. According to different serial port protocols and functional requirements, the step can be repeatedly executed for multiple times until the complete protocol rule is defined. Namely, the process of S102, S103, S105, and S106.
The steps S1 to S4 may be repeated to complete the configuration operation of all the components according to the communication function, and the editing area may simultaneously include one or more stacked component models.
S5, establishing a relation between the component models in the editing area by a user in a dragging and connecting mode. Moving the mouse to a certain component model in the editing area, pressing and holding the left button of the mouse, pulling out a line from the component model by moving the mouse, continuously moving the mouse to another component model, releasing the button of the mouse, and connecting the two selected stack component models by the line. Thereby establishing an association relationship between the components. In this process, the instruction generated by the user dragging is the relationship binding instruction in S107.
S6, the user clicks the line generated in the step S5, and the configuration of the relevant relation parameters can be completed in the configuration area.
Repeating the steps S5-S6, and completing the configuration operation of the relationship among all the components according to the communication function requirement, wherein the components can simultaneously contain one or more association relationships.
Further, the component area comprises a serial port component, a logic task component, an API component, and other protocol components such as TCP.
Further, the serial port component comprises a data packet and a resolver.
Furthermore, the data packet is designed as a stack module, and the stack model comprises a header and remark module, a data content module, a data interface label module and a TX port module.
Furthermore, the data packet header and remark module is used for storing and displaying the basic information of the data packet.
Further, the data content module comprises specific instruction content and data type of the data packet, use state of a data interface label and a method for automatically calculating different check bits;
further, the TX port module includes the name, baud rate, validity bit, data bit, stop bit, sending type, receiving type, etc. of the port selected by the packet.
Furthermore, the analyzer is designed as a stack module, and the stack model of the analyzer comprises a title and remark module, an RX port module, an analysis rule module, a data interface tag module, a logic action module and an overtime processing module.
Further, the resolver title and remark module is used for storing and displaying basic information of the resolver.
Further, the parsing rule module includes definitions of a total data length, a packet header, a packet body, a packet tail, an extraction rule and a storage interface of the returned data corresponding to the data packet command by the parser.
Further, the data interface tag module comprises a data interface of the shared variable to which the valid data extracted by the parser is stored or output by edge calculation processing, and the data interface tag module is a data transmission channel.
Further, the logic action module comprises an action flow of the analyzer and has a functional unit which makes a logic judgment according to the analyzed data value and executes a specified task. Logic judgment rules can be defined in the module, and functions of flows such as association and relay among components can be realized.
Further, the timeout processing module comprises a resolver for performing emergency or exception processing on the condition that no response message is received within the specified time.
Furthermore, the editing area is a placement area of the stacked component model, and the association relation between the components is established through dragging and connecting line operation.
Furthermore, the editing area can simultaneously contain one or more stack type component models, and according to the requirements of different communication functions, the function configuration can be completed through the independent use of the components, or the configuration of the designated function can be completed through the arbitrary collocation and use of different component models.
Further, the line defines the association relationship between the components, and indicates the flow direction of the data in the execution flow and the execution flow of the logic judgment function executed by the component model.
Further, the one or more associations between the components include a stacked component model pointing to one or more stacked component models.
In addition, as shown in fig. 1 to 7, in practical use, the specific implementation method of the stacked model configuration method for a serial port data packet and a parser according to the embodiment of the present invention may include the following steps:
1. in the component area 2, a component type to be used is selected, and the component 5 may be a packet or a parser. Move the mouse over the component 5, press the left mouse button and hold, and select the component.
2. And moving the mouse to drag the selected component 5 to the editing area 3, and releasing a mouse button after the desired position is reached.
3. And (3) according to the component 5 selected by the user in the step 1, releasing the coordinate point on the mouse, and generating and displaying a component configuration model. The data packet and parser have respective stack configuration models, namely a data packet stack component model 6 and a parser stack component model 11, and different configuration models are formed by different configuration modules.
4. Clicking and selecting a configuration module in the data packet stack type component model 6: a packet header and remark 7 that will trigger the configuration field 4 to present an entry box for the packet name and remark, allowing the user to define the packet name and remark.
5. Clicking to select a configuration module in the data packet stack type component model 6: the data packet content 8 will trigger the configuration area 4 to present the interactive components defined for the data packet content, allowing the user to enter the data packet content.
6. Clicking to select a configuration module in the data packet stack type component model 6: the data interface tag 9 will trigger the configuration area 4 to display a configuration interface for the packet data interface, allowing a user to create a data interface for receiving input data external to the packet. In one packet stacked component model 6, 0 or more data interface tags 9 are allowed to exist.
7. Clicking to select a configuration module in the data packet stack type component model 6: the TX port configuration 10 is to trigger the configuration area 4 to display the TX port parameters of the serial port, and includes: port name, baud rate, data bits, stop bits, check mode, data transmission format, etc.
8. Click to select a configuration module in the parser stack component model 11: parser title and remark 12, which will trigger configuration field 4 to expose the input boxes for the parser name and remark, allowing the user to define the parser name and remark.
9. Click to select a configuration module in the parser stack component model 11: the RX port configuration 13 is to trigger the configuration area 4 to display the RX port parameters of the serial port, and includes: port name, baud rate, data bits, stop bits, check mode, data transmission format, etc.
10. Clicking a configuration module in the selection parser stack type component model 11: the parsing rule 14 is to trigger the configuration area 4 to display the interaction components defined by the parsing rule of the parser, allow the user to select or customize the parsing rule, complete the extraction of the specified data, and store the format.
11. Click to select a configuration module in the parser stack component model 11: and the data interface tag 15 is used for triggering the configuration area 4 to display a configuration interface of the data interface of the resolver, and allowing a user to create the data interface for storing the extracted data and outputting the data to other components. In one parser stacked component model 11, 0 or more data interface tags 15 are allowed to exist.
12. Click to select a configuration module in the parser stack component model 11: and an action task 16, allowing a user to define a task, making a logic judgment according to the data analysis result, and executing one or more action tasks. The action task may be to send a data packet or update a stored value or to complete an API data interface request.
13. Click to select a configuration module in the parser stack component model 11: and a timeout process 17 for allowing the user to define a time standard for timeout judgment and an executed action task, perform logical judgment according to the current storage parameters, and execute one or more action tasks. The action task may be to send a data packet or update a stored value or to complete an API data interface request.
14. And establishing the relation between the components in the editing area by using a dragging connection mode. Moving the mouse to a certain stack type component model in the editing area, pressing a left mouse button and keeping the left mouse button, pulling out a line from the component model by moving the mouse, continuously moving the mouse to another stack type component model and releasing a mouse button, and connecting the two selected component models by the line. Thereby establishing an association relationship between the components.
15. And clicking 14 the line generated in the step to complete the configuration of the relevant relation parameters in the configuration area.
According to the communication function requirement, repeating the steps until the complete protocol rule configuration operation and the configuration operation of the relationship among the components are defined and completed. One or more component models may be included in the edit section. One or more associations may be included between component models.
In summary, the present invention can quickly complete the definition of the packet content and the packet parsing rule in the serial communication protocol, and execute the definition of the logic task and configure the edge calculation according to the parsing result. The component types can be selected in a dragging mode, such as a data packet component and a parser component, and dragged to an editing area; after the mouse is released, establishing a component stack model in the editing area according to the selected component; clicking a configurable module in the component stack type model to complete the setting of corresponding parameters in a configuration area; and (4) realizing the relation binding of the data packet component and the parser component in a dragging and connecting mode, thereby completing the setting of parameters and rules in the serial port communication. According to the invention, complex configuration of functions such as serial port data receiving and sending, analysis, logic judgment, edge calculation and the like can be realized only by simple element dragging, parameter editing and graphic connection actions through a graphical interaction interface, man-machine interaction is accurately and efficiently completed, solidified code parameters are avoided, pain points such as poor flexibility, incapability of configuring data processing and logic tasks and the like in a traditional configuration mode are solved, the man-machine interaction experience of a user is improved, the operation and use threshold of the user is reduced, and the maintainability and the functionality of a project are improved.
By means of the serial port data packet and parser stack model configuration method, complex communication protocol parameters and rule definitions can be completed only through the stack model assembly and simple element dragging and parameter editing through a graphical interaction interface, tasks such as interface butt joint between devices and between device platforms and data edge calculation are assisted to be established, man-machine interaction is accurately and efficiently completed, solidified code parameters are avoided being used, the problem that a traditional configuration mode is poor in flexibility and cannot configure data processing and logic tasks is solved, user man-machine interaction experience is improved, user operation use thresholds are lowered, and maintainability and functionality of projects are improved.
Corresponding to the embodiment of the method in fig. 2, the present invention further provides a stacked model configuration apparatus for a serial port data packet and a parser, as shown in fig. 8, the apparatus may include:
a model building module 801, configured to build a stacked data packet component model based on a data packet component selected by a user;
a receiving module 802, configured to receive a first configuration instruction input by a user;
a configuration module 803, configured to configure at least one of a header and remark module, a packet content module, a data interface label module, and a port module in the stacked packet component model based on the first configuration instruction, to obtain a configured stacked packet component model;
the model establishing module 801 is further used for establishing a stack type resolver component model based on the resolver component selected by the user;
the receiving module 802 is further configured to receive a second configuration instruction input by the user;
the configuration module 803 is further configured to configure at least one of a title and remark module, a port module, an analysis rule module, a data interface label module, a logic action module and an overtime processing module in the stack parser component model based on the second configuration instruction, so as to obtain a configured stack parser component model;
the receiving module 802 is further configured to receive a relationship binding instruction input by a user;
and the association binding module 804 is configured to perform association binding on the configured stacked data packet component model and the configured stacked parser component model based on the relationship binding instruction.
In some embodiments, the apparatus further comprises a drag module;
before establishing a stacked data package component model based on a data package component selected by a user, the receiving module is further used for receiving a first element dragging instruction input by the user;
the dragging module is used for selecting a data package component from the component types based on the first element dragging instruction and dragging the data package component to an editing area;
before the stack type resolver component model is established based on the resolver component selected by the user, the receiving module is also used for receiving a second element dragging instruction input by the user;
and the dragging module is also used for selecting a parser component in the component type based on the second element dragging instruction and dragging the parser component to the editing area.
In some embodiments, the configuration module 803 is further configured to establish and obtain a plurality of configured stacked data packet component models and/or a plurality of configured stacked parser component models based on a request input by a user;
the association binding module 804 is further configured to perform association binding on at least one component model in the configured stacked data package component models and at least one component model in the configured stacked parser component models based on the relationship binding instruction.
In some embodiments, the structure of the stacked data packet component model is composed of multiple types of modules, one or more of the same type of modules in the stack and no sensitivity in the stacking order;
the structure of the stack type resolver component model is composed of multiple types of modules, one or more modules of the same type in the stack are provided, and the stack sequence has no sensitivity.
In some embodiments, the configuration module 803 is further configured to specify and configure the automatic calculation parameters for the content to be sent of the data packet based on at least one of 16-ary data, ASCII, UTF8, and GBK characters.
In some embodiments, the logic action module is configured to perform a user-defined task, perform a logic determination according to the data parsing result, and perform one or more action tasks, where the action task includes sending a data packet or updating a stored value or completing an API data interface request.
In some embodiments, the timeout processing module is used for user defining the time standard of the timeout judgment and the executed action task, and performing logic judgment and executing the action task.
By means of the stacked model configuration device of the serial port data packet parser, complex communication protocol parameters and rule definitions can be completed only through the stacked model component and by using a graphical interaction interface to perform simple element dragging and parameter editing, tasks such as interface docking and data edge calculation between equipment and equipment platforms are assisted to be established, man-machine interaction is accurately and efficiently completed, solidified code parameters are avoided being used, the problem that a traditional configuration mode is poor in flexibility and cannot configure data processing and logic tasks is solved, user man-machine interaction experience is improved, user operation use thresholds are lowered, and maintainability and functionality of projects are improved.
It can be understood that each module/unit in the stacked model configuration device for a serial port data packet and a parser shown in fig. 8 has a function of implementing each step in the stacked model configuration method for a serial port data packet and a parser provided in the embodiment of the present application, and can achieve the corresponding technical effect, and therefore, for brevity, no further description is provided herein.
Fig. 9 is a schematic structural diagram of a computing device according to an embodiment of the present invention. As shown in fig. 9, computing device 900 includes an input interface 901, a central processor 902, a memory 903, and an output interface 904. The input interface 901, the central processing unit 902, the memory 903, and the output interface 904 are connected to each other via a bus 910.
The computing device shown in fig. 9 may also be implemented as an execution device of a stacked model configuration method of a serial port packet parser, and the computing device may include: a processor and a memory storing computer executable instructions; the processor can realize the serial port data packet and stack model configuration method of the parser provided by the embodiment of the invention when executing the computer executable instruction.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores computer program instructions; the computer program instructions, when executed by a processor, implement the method for configuring a stack model of a serial port data packet and a parser according to an embodiment of the present invention.
It should be clear that each embodiment in this specification is described in a progressive manner, and the same or similar parts among the embodiments may be referred to each other, and for brevity, the description is omitted. The present application is not limited to the specific configurations and processes described above and shown in the figures. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions or change the order between the steps after comprehending the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic Circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor Memory devices, read-Only memories (ROMs), flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-mentioned steps, that is, the steps may be performed in the order mentioned in the embodiments, may be adjusted as necessary in an order different from the order in the embodiments, or may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware for performing the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As described above, only the specific embodiments of the present application are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered within the scope of the present application.

Claims (10)

1. A method for configuring a stack model of a serial port data packet and a parser is characterized by comprising the following steps:
establishing a stacked data package component model based on the data package component selected by the user;
receiving a first configuration instruction input by a user;
configuring at least one of a title and remark module, a data packet content module, a data interface label module and a port module in the stacked data packet component model based on the first configuration instruction to obtain a configured stacked data packet component model;
establishing a stacked parser component model based on the parser component selected by the user;
receiving a second configuration instruction input by a user;
configuring at least one of a title and remark module, a port module, an analysis rule module, a data interface tag module, a logic action module and an overtime processing module in the stack type analyzer component model based on the second configuration instruction to obtain a configured stack type analyzer component model;
receiving a relation binding instruction input by a user;
and based on the relation binding instruction, performing association binding on the configured stack type data package component model and the configured stack type resolver component model.
2. The method of claim 1, wherein prior to establishing a stacked data packet component model based on the user-selected data packet component, the method further comprises:
receiving a first element dragging instruction input by a user;
selecting a data package component from the component types based on the first element dragging instruction and dragging the data package component to an editing area;
before building the stacked parser component model based on the user selected parser components, the method further comprises:
receiving a second element dragging instruction input by a user;
and selecting a resolver component from the component types based on the second element dragging instruction and dragging the resolver component to an editing area.
3. The method of claim 1, further comprising:
establishing and obtaining a plurality of configured stacked data package component models and/or a plurality of configured stacked parser component models based on a request input by a user;
based on the relation binding instruction, performing association binding on the configured stacked data packet component model and the configured stacked parser component model, including:
and performing association binding on at least one component model in the plurality of configured stacked data package component models and at least one component model in the plurality of configured stacked parser component models based on the relationship binding instruction.
4. The method of claim 1, wherein the structure of the stacked data packet component model is composed of multiple types of modules, one or more of the same type of modules in the stack and no sensitivity in the stack order;
the structure of the stack type resolver component model is composed of multiple types of modules, one or more modules of the same type in the stack are provided, and the stack sequence has no sensitivity.
5. The method of claim 1, wherein configuring the packet content module comprises:
and for the content to be sent of the data packet, specifying the validity bit and configuring automatic calculation parameters based on at least one of 16-system data, ASCII, UTF8 and GBK characters.
6. The method of claim 1, wherein the logical action module is configured to perform a user-defined task, perform a logical decision according to the result of the data parsing, and perform one or more action tasks, wherein the action task includes sending a data packet or updating a stored value or completing an API data interface request.
7. The method of claim 1, wherein the timeout processing module is configured to define a time criterion for the timeout determination and the executed action task by the user, and perform the logic determination and execute the action task.
8. A stack model configuration device for a serial port data packet and a parser is characterized by comprising:
the model building module is used for building a stack type data package component model based on the data package component selected by the user;
the receiving module is used for receiving a first configuration instruction input by a user;
the configuration module is used for configuring at least one of a title and remark module, a data packet content module, a data interface label module and a port module in the stacked data packet component model based on the first configuration instruction to obtain a configured stacked data packet component model;
the model establishing module is also used for establishing a stack type resolver component model based on the resolver component selected by the user;
the receiving module is further used for receiving a second configuration instruction input by a user;
the configuration module is further configured to configure at least one of a title and remark module, a port module, an analysis rule module, a data interface tag module, a logic action module and an overtime processing module in the stack parser component model based on the second configuration instruction, so as to obtain a configured stack parser component model;
the receiving module is also used for receiving a relation binding instruction input by a user;
and the association binding module is used for performing association binding on the configured stacked data packet component model and the configured stacked parser component model based on the relation binding instruction.
9. The apparatus of claim 8, further comprising a drag module;
before establishing a stacked data package component model based on a data package component selected by a user, the receiving module is further configured to receive a first element dragging instruction input by the user;
the dragging module is used for selecting a data packet component in the component type based on the first element dragging instruction and dragging the data packet component to an editing area;
before the stack type resolver component model is established based on the resolver component selected by the user, the receiving module is further used for receiving a second element dragging instruction input by the user;
the dragging module is further used for selecting a parser component in the component type based on the second element dragging instruction and dragging the parser component to the editing area.
10. A computer storage medium having computer program instructions stored thereon which, when executed by a processor, implement the method of any one of claims 1-7.
CN202211495055.5A 2022-11-26 Stack model configuration method and device for serial port data packet and analyzer Active CN115576537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211495055.5A CN115576537B (en) 2022-11-26 Stack model configuration method and device for serial port data packet and analyzer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211495055.5A CN115576537B (en) 2022-11-26 Stack model configuration method and device for serial port data packet and analyzer

Publications (2)

Publication Number Publication Date
CN115576537A true CN115576537A (en) 2023-01-06
CN115576537B CN115576537B (en) 2024-05-14

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116968A (en) * 2012-11-19 2013-05-22 佳都新太科技股份有限公司 Method based on graphical alarm process custom
CN107577459A (en) * 2017-08-21 2018-01-12 杰为软件系统(深圳)有限公司 A kind of towed cross-platform development system and method based on modularization
CN110908641A (en) * 2019-11-27 2020-03-24 中国建设银行股份有限公司 Visualization-based stream computing platform, method, device and storage medium
CN115248684A (en) * 2022-08-12 2022-10-28 王腾 Graphical programming method for intelligent gateway data processing and flow control

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103116968A (en) * 2012-11-19 2013-05-22 佳都新太科技股份有限公司 Method based on graphical alarm process custom
CN107577459A (en) * 2017-08-21 2018-01-12 杰为软件系统(深圳)有限公司 A kind of towed cross-platform development system and method based on modularization
CN110908641A (en) * 2019-11-27 2020-03-24 中国建设银行股份有限公司 Visualization-based stream computing platform, method, device and storage medium
CN115248684A (en) * 2022-08-12 2022-10-28 王腾 Graphical programming method for intelligent gateway data processing and flow control

Similar Documents

Publication Publication Date Title
CN111459889B (en) Equipment data model generation method and device for Internet of things platform
CN106548326B (en) Method and system for linking handling scene and workflow engine of handling scene
CN109582289B (en) Method, system, storage medium and processor for processing rule flow in rule engine
CN106487560A (en) A kind of acquisition method of server configuration information, apparatus and system
CN111736837A (en) Method, device and equipment for restoring webpage operation, readable storage medium and system
CN111782199A (en) Development method of PLC graphical editor based on XML technology
CN111464515A (en) Data conversion method, device, equipment and storage medium
CN111104181A (en) Webpage data filling system for visually editing task flow
CN116384295B (en) Top file generation method and device, computer equipment and storage medium
CN115576537A (en) Stack type model configuration method and device for serial port data packet and parser
CN113420189A (en) Intelligent terminal android App control method and system based on RPA
CN113254014A (en) Sketch plug-in-based interface development method, device and system
CN115576537B (en) Stack model configuration method and device for serial port data packet and analyzer
CN111694637B (en) Online full-automatic multi-agent control simulation compiling system
WO2014124243A2 (en) Systems and methods for metadata-driven command processor and structured program transfer protocol
CN114090074A (en) Method and device for configuring operating environment, storage medium and electronic device
CN113238746A (en) Hybrid programming control method, device, equipment and storage medium
CN110297647B (en) Method and terminal for updating npm packet by front-end engineering
CN113050935A (en) Method and device for generating mixed object, computing equipment and computer readable storage medium
CN110647546A (en) Third-party rule engine generation method and device
CN110968303A (en) Interactive process design method and system for material calculation and material data mining
CN112394972A (en) Cloud application publishing method, device, equipment and storage medium
CN114253441B (en) Method and device for enabling target function, storage medium and electronic device
CN111338885A (en) Dynamic collection and statistical method and device of APP data and data service center
CN108196853A (en) For disposing the method for Android system SDK, storage medium, equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant