CN112069176A - Communication protocol database design method, device, equipment and storage medium - Google Patents
Communication protocol database design method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112069176A CN112069176A CN202010869772.4A CN202010869772A CN112069176A CN 112069176 A CN112069176 A CN 112069176A CN 202010869772 A CN202010869772 A CN 202010869772A CN 112069176 A CN112069176 A CN 112069176A
- Authority
- CN
- China
- Prior art keywords
- data frame
- communication
- display
- field
- communication data
- 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
Links
- 238000004891 communication Methods 0.000 title claims abstract description 283
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000013461 design Methods 0.000 title claims description 26
- 230000005540 biological transmission Effects 0.000 claims description 43
- 230000015654 memory Effects 0.000 claims description 17
- 230000014509 gene expression Effects 0.000 claims description 15
- 230000006870 function Effects 0.000 claims description 8
- 238000012545 processing Methods 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000012546 transfer Methods 0.000 claims description 5
- 238000012800 visualization Methods 0.000 abstract description 5
- 230000008859 change Effects 0.000 abstract description 4
- 230000008569 process Effects 0.000 abstract description 4
- 238000012360 testing method Methods 0.000 abstract description 3
- 238000006243 chemical reaction Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000003749 cleanliness Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000000087 stabilizing effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/211—Schema design and management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/26—Visual data mining; Browsing structured data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Communication Control (AREA)
Abstract
The invention provides a method, a device, equipment and a storage medium for designing a database of a communication protocol, which solve the technical problem that communication software needs to be updated synchronously when the existing communication protocol is updated. The method comprises the following steps: describing a communication data frame in a communication protocol according to a data frame description rule to form a communication data frame field set; describing parameters in the communication data frame according to a parameter description rule to form a parameter field set; describing the display form of the parameter value on the interface according to a value display rule to form a value display field set; and forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set, and establishing a communication protocol database. The invention processes the communication protocol into the data form in the database, so that the establishment and the update of the communication protocol only need to change the database without modifying the communication software, thereby reducing the workload of programming and testing and realizing the visualization of the communication protocol data.
Description
Technical Field
The invention relates to the technical field of communication protocols, in particular to a method, a device, equipment and a storage medium for designing a database of a communication protocol.
Background
The communication protocol used by various current devices is various, and the communication interfaces are also various. With the continuous update of the equipment, the communication protocol is changed, and each change of the communication protocol means the change of communication software, and simultaneously, a large amount of development and maintenance workload is brought. When communication software is debugged, the communication protocol software needs to be compiled, developed and debugged quickly, so that short-time and high-intensity work is brought to software programming developers; when communication software is developed, the requirements on the robustness and robustness of the software are particularly high, and a large amount of software testing work needs to be invested; secondly, the change of the communication software may cause the mismatching of the communication protocol, the error of data settlement, the failure of the equipment and other serious problems.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for designing a database of a communication protocol, which solve the technical problems that the existing communication protocol is complicated and is not easy to match, and communication software needs to be updated synchronously when the communication protocol is updated.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for designing a database of a communication protocol, where the method includes:
describing a communication data frame in a communication protocol according to a data frame description rule to form a communication data frame field set;
describing parameters in the communication data frame according to a parameter description rule to form a parameter field set;
describing the display form of the parameter value on the interface according to a value display rule to form a value display field set;
and forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set, and establishing a communication protocol database.
In an embodiment, the describing a communication data frame in a communication protocol according to a data frame description rule to form a communication data frame field set includes:
allocating communication protocol identification fields for communication protocols, and distinguishing different types of communication protocols in communication software;
respectively distributing a communication data frame identity identification field and a subordinate communication data frame identity identification field for the communication data frame and the subordinate communication data frame;
configuring coding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
configuring length identification fields of a communication data frame and a lower-level communication data frame;
configuring description fields for describing all data types contained in the communication data frame and the lower-level communication data frame;
a check field is configured to check the validity of the description data.
In an embodiment, the describing parameters in the communication data frame according to the parameter description rule to form a parameter field set includes:
configuring a transmission parameter identity identification field corresponding to a communication data frame;
configuring and acquiring a name field, a unit field, an initial value field and a data type field of a transmission parameter;
judging whether the transmission parameters are valid or not, and reconfiguring invalid transmission parameters;
converting the data type of the effective transmission parameter into a result character string by using a formatting character string field;
judging whether the result character string needs to be calculated or not, and directly converting the result character string which does not need to be calculated into display data; and converting the result character string needing to be calculated into display data by using the function expression field.
In an embodiment, the describing, according to a value display rule, a display form of a parameter value on an interface to form a value display field set includes:
matching different types of display controls according to the types of different parameter values;
configuring a control display field for determining whether the display control is visible or not, and not displaying the invisible display control;
configuring a control coordinate field of a display position of a display control to be displayed in a display interface;
configuring control size fields for displaying the height and width of a control in a display interface;
dividing attribute node fields according to values of display control attributes;
and configuring different display type fields for the divided attribute nodes.
In one embodiment, the display controls are divided into:
numeric controls, drop-down list controls, boolean controls, and string controls.
In a second aspect, the present invention provides an apparatus for designing a database of communication protocols, the apparatus comprising:
a data frame description module: the system is used for describing communication data frames in a communication protocol according to a data frame description rule to form a communication data frame field set;
a parameter description module: the parameter description module is used for describing parameters in the communication data frame according to parameter description rules to form a parameter field set;
a display module: the display form of the parameter value on the interface is described according to the value display rule to form a value display field set;
a storage module: and the data processing module is used for forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set and establishing a communication protocol database.
In an embodiment, the data frame description module specifically includes:
a first distribution unit: the system is used for distributing communication protocol identity identification fields for communication protocols and distinguishing different types of communication protocols in communication software;
a second allocation unit: the system comprises a communication data frame, a subordinate communication data frame and a communication data frame, wherein the communication data frame and the subordinate communication data frame are respectively distributed with a communication data frame identity field and a subordinate communication data frame identity field;
an encoding unit: the system is used for configuring encoding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
an identification unit: length identification fields for configuring the communication data frame and the lower-level communication data frame;
a description unit: a description field for configuring and describing all data types contained in the communication data frame and the lower communication data frame;
a checking unit: and a check field for configuring the check to describe the validity of the data.
In one embodiment, the parameter description module specifically includes:
a configuration unit: the system comprises a communication data frame, a transmission parameter identity identification field and a communication data frame, wherein the transmission parameter identity identification field is used for configuring a transmission parameter identity identification field corresponding to the communication data frame;
an acquisition unit: the device comprises a name field, a unit field, an initial value field and a data type field which are used for configuring and acquiring transmission parameters;
a first judgment unit: used for judging whether the transmission parameter is valid or not and reconfiguring the invalid transmission parameter;
a formatting unit: the data type of the effective transfer parameter is converted into a result character string by using the formatting character string field;
a second judgment unit: the device is used for judging whether the result character string needs to be calculated or not and directly converting the result character string which does not need to be calculated into display data;
a calculation unit: the function expression field converts the resulting string that needs to be computed into display data.
In one embodiment, the display module specifically includes:
a matching unit: the display control module is used for matching different types of display control according to the types of different parameter values;
a third judging unit: the control display field is used for configuring and determining whether the display control is visible or not, and the invisible display control is not displayed;
a position calibration unit: the control coordinate field is used for configuring the display position of the display control to be displayed in the display interface;
a display control size specifying unit: a control size field for configuring a height and a width of a display control in a display interface;
dividing a unit: the attribute node fields are divided according to the values of the display control attributes;
an attribute node configuration unit: and configuring different display type fields for the attribute nodes of which the division is finished.
In one embodiment, the display controls matched in the matching unit are divided into:
numeric controls, drop-down list controls, boolean controls, and string controls.
In a third aspect, the present invention provides an apparatus comprising:
a processor, a memory, an interface to communicate with a gateway;
the memory is used for storing programs and data, and the processor calls the programs stored in the memory to execute the database design method of the communication protocol provided by any one of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium containing a program which, when executed by a processor, is configured to perform the database design method for a communication protocol provided in any one of the first aspect.
It can be seen from the above description that, in the method, apparatus, device and storage medium for designing a database of a communication protocol according to embodiments of the present invention, the communication protocol is processed into a data form in the database and the data form is stored to form parameter data of the communication protocol, so that the establishment and update of the communication protocol only changes corresponding parameter data in the database without changing the communication software, thereby reducing programming and testing workload, improving reusability of the communication software, and stabilizing robustness and robustness of the communication software. The database contains a plurality of communication protocol description rules, so that the communication software can be compatible with a plurality of communication protocols, the programming difficulty of the communication software is simplified, and the working efficiency is improved. And the data included in the communication protocol is displayed, so that the visualization of the communication protocol data is realized.
Drawings
Fig. 1 is a schematic flow chart illustrating a method for designing a database of a communication protocol according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a description rule flow of a data frame description rule form according to the present invention;
FIG. 3 is a schematic diagram illustrating a description rule flow of a parameter description rule form according to the present invention;
FIG. 4 is a schematic diagram illustrating a rule flow of the numerical display rule form according to the present invention;
fig. 5 is a schematic diagram illustrating a color display area division of a numerical control in a database design method of a communication protocol according to an embodiment of the present invention;
fig. 6 is a schematic diagram illustrating an upper computer software interface developed by using a database design method of a communication protocol according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating an ethernet communication software interface developed by a database design method using a communication protocol according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of a database design apparatus for communication protocols according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and more obvious, the present invention is further described below with reference to the accompanying drawings and the detailed description. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Based on the shortcomings in the prior art, an embodiment of the present invention provides a specific implementation manner of a database design method for a communication protocol, and as shown in fig. 1, the method specifically includes:
s110: describing a communication data frame in a communication protocol according to a data frame description rule to form a communication data frame field set;
specifically, the communication data frame field set may extract various data types, such as characters (char), integers (int), floating point numbers (float), double-precision floating point numbers (double), character strings, and the like, from the communication data frames in the communication protocol as needed. The communication protocol can be converted into data in the database, and the communication software can convert the communication data frame into required data by using the data in the database.
S120: describing parameters in the communication data frame according to a parameter description rule to form a parameter field set;
specifically, the parameter field set may scale parameters in the communication data frame, such as 1 representing 0.05 ° or 1 representing 0.001 meter; or the unit conversion can be carried out on the parameters in the communication data frame, for example, the speed m/s is converted into km/h; the conversion of the bit domain data can also be realized, other types of conversion are certainly not excluded, and the required display data is obtained through the conversion process, so that a data source is provided for realizing the visualization of the description data.
S130: describing the display form of the parameter value on the interface according to a value display rule to form a value display field set;
specifically, the numerical value display field set enables the display data to be displayed on the interface as required by specifying the corresponding relation among the display name, the display numerical value, the maximum and minimum values, the display mode, the display format and the display unit of the display data.
S140: and forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set, and establishing a communication protocol database.
Specifically, the database is used as an on-carrier of the data form, and the Access database is taken as an example, so that the validity and the integrity of the data form can be ensured; the security of the data form can be effectively ensured by using the password protection of the database; all data forms support data export and export according to standard SQL statements, and the method can be applied to any operating system; the data searching function is utilized, so that the searching, replacing and extracting of the data form are convenient to realize. The communication data in the communication software is analyzed into the data in the database, so that the communication protocols and the communication software are mutually independent, and meanwhile, the database is utilized to establish the interconnection and intercommunication between the communication software and the communication protocols, and more communication protocols are matched and compatible.
In the embodiment, the communication protocol is processed into the data form in the database and is stored, the communication protocol in the communication software is described through the data frame description rule data form, and the communication software and the communication protocol are independent, so that the database is only changed for establishing and updating the communication protocol, the communication software is not required to be changed, the programming and testing workload is reduced, the reusability of the communication software is improved, and the robustness of the communication software are stabilized. The database comprises a plurality of communication protocols, so that the communication software can be compatible with the plurality of communication protocols, the programming difficulty of the communication software is simplified, and the working efficiency is improved. And the data included in the communication protocol is displayed according to the specification of the data form, so that the visualization of the communication protocol data is realized.
Based on the above embodiment, as a preferred embodiment, as shown in fig. 2, the step 110 specifically includes the following steps:
s111: allocating communication protocol identification fields for communication protocols, and distinguishing different types of communication protocols in communication software;
specifically, the communication software includes multiple types of communication protocols, so that each communication protocol should be assigned with an identification field for distinguishing different communication protocols for subsequent steps to identify, thereby avoiding errors in identifying each communication protocol in the subsequent steps.
S112: respectively distributing a communication data frame identity identification field and a subordinate communication data frame identity identification field for the communication data frame and the subordinate communication data frame;
specifically, the communication protocol includes a communication data frame and a lower communication data frame included in the communication data frame (the lower communication data frame is a communication data frame that may be too long and may be omitted or disordered during transmission, and the data frame needs to be split and transmitted in segments, each segment of the data frame is a lower communication data frame of the communication data frame), and in order to distinguish the communication data frame and the lower communication data frame in each communication protocol, a communication data frame identification field and a lower communication data frame identification field corresponding to the communication data frame and the lower communication data frame are respectively allocated to the communication data frame and the lower communication data frame, so that identification disorder is avoided.
S113: configuring coding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
specifically, the starting point and the destination point of the communication data frame and the next communication data frame are both data link layers, and encoding fields are configured for the communication data frame and the next communication data frame in the communication protocol, so that the processing and analysis of the data link layers are facilitated.
S114: configuring length identification fields of a communication data frame and a lower-level communication data frame;
specifically, in this step, the length identification field identifies the lengths of the communication data frame and the lower-level communication data frame, so as to facilitate subsequent display.
S115: configuring description fields for describing all data types contained in the communication data frame and the lower-level communication data frame;
specifically, the data type of the parameter included in the communication data frame or the lower communication data frame may be a character (char), an integer (int), a floating point (float), a double-precision floating point (double), and a character string. For example: the expression "Pa ═ B [ B-c ]; "is used to describe the starting position and length of a certain parameter in the communication data frame or the next communication data frame.
In the formula: p represents a display parameter identifier; a is a number starting from 1; b represents that the parameter occupies a plurality of bytes; b represents a start position in a communication data frame; c represents the occupied length; '; ' is a segmentation symbol. For example: "P1 ═ B [0-8 ]; "indicates that P1 takes 8 bytes starting at position 0 in the data frame (P1 is the field associated with the argument description rules dataform).
The basic data type characters (char), integers (int), floating point numbers (float), double precision floating point numbers (double) and character strings are described by the above expressions.
A communication data frame or a lower communication data frame may also be present in the bit operation. For example: the expression "Pa ═ b & c)/c may be utilized; "is used to describe the bit manipulation contained in the communication data frame or the lower communication data frame.
In the formula: db represents the number of bytes in the communication data frame; '&' is a bitwise and operator; c is which bit to AND-operate with. For example: "P2 ═ (D8& 2)/2; "indicates that the second bit of the 8 th byte is given to the parameter P2.
And corresponding operational characters in the communication data frame or the lower communication data frame. May be represented by the expression "Pa ═ B [ B-c ]; "or" Pa ═ b & c)/c; "to realize the calculation or conversion of data. For example: "P3 ═ B [9-4 ]. 1.8+ 32" indicates conversion from degrees celsius to degrees fahrenheit.
The computer language of the communication data frame or the lower-level communication data frame can be converted into expression description through the expression, the expression supports the description of all the communication data frames, and more communication protocols can be compatible.
S116: a check field is configured to check the validity of the description data.
Specifically, in the interface display, the display data are too much, the interface display is easy to be disordered, a user can hardly find the desired data, the validity of the data is verified through the verification field, the data which is not required to be displayed can not be displayed, and the simplicity and the cleanliness of the interface are improved.
In this embodiment, various data types (such as characters, integers, floating point numbers, double-precision floating point numbers, character strings, and the like), bit operation calculations, or conversions can be extracted as needed for communication data frames in a communication protocol. Data in the communication protocol can be described by expression; when the communication software uses the data in the database, the data in the communication protocol can be described through the description field, so that only the description field in the database is updated without modifying the communication software under the condition that the equipment needs to update the communication protocol synchronously, the development and debugging processes of the communication software are saved, and the working efficiency is greatly improved.
Based on the above embodiment, as a preferred embodiment, as shown in fig. 3, the step 120 specifically includes the following steps:
s121: configuring a transmission parameter identity identification field corresponding to a communication data frame;
and associating the parameter description rule data form to the data frame description rule data form by reading the communication protocol identity, so that the transmission parameters matched with the communication data frame can be conveniently described according to the expression in the data frame description rule data form.
S122: configuring and acquiring a name field, a unit field, an initial value field and a data type field of a transmission parameter;
the transfer parameter includes various data characteristics, such as name, unit, initial value and data type of the transfer parameter, which are also data to be displayed in the subsequent display, and are extracted for preparing the subsequent display.
S123: judging whether the transmission parameters are valid or not, and reconfiguring invalid transmission parameters;
and the validity of the transmission parameters determines whether the description data is accurate, and the invalid transmission parameters are returned to S121 for reconfiguration, so that the invalid transmission parameters are prevented from reporting the normal data as a fault.
S124: converting the data type of the effective transmission parameter into a result character string by using a formatting character string field;
the data type of the transmission parameter is not single, the effective data type of the transmission parameter is converted into a result character string of a unified data type by utilizing the formatted character string field, the calculated amount is reduced, and meanwhile, the centralized processing of subsequent data is facilitated.
S125: judging whether the result character string needs to be calculated or not, and directly converting the result character string which does not need to be calculated into display data;
s126: and converting the result character string needing to be calculated into display data by using the function expression field.
In the embodiment, the transmission parameters of the communication data frame in the communication protocol are identified and converted into the display data, and the communication data frame is converted into the display data meeting the display requirement, so that a data source is provided for realizing visualization of the description data.
Based on the above embodiment, as a preferred embodiment, as shown in fig. 4, the step 130 specifically includes the following steps:
s131: matching different types of display controls according to the types of different parameter values;
s132: configuring a control display field for determining whether a display control is visible;
s133: the invisible display control is not displayed;
s134: configuring a control coordinate field of a display position of a display control to be displayed in a display interface;
s135: configuring control size fields for displaying the height and width of a control in a display interface;
s136: dividing attribute node fields according to values of display control attributes;
s137: and configuring different display type fields for the divided attribute nodes.
In this embodiment, the parameter data includes different types of data, and the display controls that need to be displayed are necessarily different. For example, data such as the current time, the physical address of the device, the physical address of the target device, the storage position of a log recorded in the running process of the device, a control instruction, the running state of the target device, fault display and the like are displayed, the data can be displayed properly only by matching with a display control conforming to the data, and the display data are displayed graphically by using the display control. Each parameter data corresponds to a display control which is adaptive to the parameter data, and each display control corresponds to an attribute node and a display type of the display control. Certainly, in order to save the occupied space of the display control, part of the display control can be selected to be invisible; the position coordinates of the display control in the interface are constrained, the height and the width of a display space are limited, and the display of the display control in the interface as required is realized; each display control has its own attribute node and display type, so that the display controls display different types in different attribute nodes.
Based on the above embodiment, the display control may be divided into:
numeric controls, drop-down list controls, boolean controls, and string controls.
It will be understood by those skilled in the art that numeric controls, drop-down list controls, boolean controls, and string controls are encapsulation of display data in Labview. Wherein, the numerical control mainly displays specific numerical values; the main attribute of the drop-down list type control is an editing item, and each item corresponds to a value by inserting the corresponding item and displaying the drop-down example; the boolean control occupies 1 byte, in fact a 2-valued control, i.e. a transition between 0 and 1; the character string type control mainly comprises four display styles: normal, backslash symbol (\), hexadecimal, password.
For the numerical control, taking the "water temperature" display as an example, 12 sets of numerical values are specified in table 1.
TABLE 1
The 12 sets of values demarcate 5 zones on the axis, as shown in fig. 5, in which zones the values of the transmission parameters are passed, and the represented control can present different zone colors for alarming. As shown in table 1, the [30,0] section is red, (the 0, 50] section is yellow, (the 50, 80] section is green, (the 80, 90] section is yellow, and the 90, 100] section is red.
For the drop-down list type control, taking "device status" display as an example, the drop-down list type control is specified in table 2.
TABLE 2
Ctrl_name | Ctrl_value | |
Device status | ||
0 | Invalidation | |
Device status | 1 | To be aligned with |
Device status | 10 | In alignment with |
Device status | 20 | System readiness |
Device status | 30 | In positioning navigation |
Device status | 99 | In calibration |
Device status | 100 | In realignment |
Device status | 999 | Positioning navigation termination |
As shown in table 2 below, the device status corresponds to one value, one entry for each value. For example: when the device status receives "10", the interface displays "in alignment". Other states can be displayed according to the design idea.
For the delta control, the "altitude fault" display is taken as an example and specified in table 3.
TABLE 3
Ctrl_name | Ctrl_value | Ctrl_display | Description of the invention |
|
0 | 65280 (Green) | Pseudo-temporal RGB color |
Altitude meter fault | 1 | 16776960 (yellow) | Real time RGB color |
As shown in table 3 below, the boolean control is assigned two values "0" or "1", and when the elevation fault is "0", the fault is a false-time fault, the boolean control displays green; and when the elevation fault is 1, the real-time fault is detected, and the Boolean type control displays yellow. According to the design idea, other fault types or types such as switches can be displayed.
The character string type control is specified in table 4, taking "character information" display as an example.
TABLE 4
As shown in table 4 below, the display rules of the text information are mainly shown in the table, and three encoding modes (ANSI1, GB23122, UTF-8) are provided.
It should be noted that Ctrl _ name represents a control name; ctrl _ value represents the attribute node of the frame; ctrl _ display represents control-specific display content.
In conclusion, by using the above method, the upper computer software shown in fig. 6 CAN be easily developed by combining the access database and the Labview, and the upper computer software realizes the CAN communication protocol. The ethernet communication software shown in fig. 7 can be completed by simply adjusting the database on the basis of the software of the upper computer. The above embodiments fully illustrate that the present invention is reasonable, effective and worth popularizing.
Based on the same inventive concept, the embodiment of the present application further provides a database design apparatus for a communication protocol, which can be used to implement the database design method for a communication protocol described in the above embodiment, as described in the following embodiments. Because the principle of solving the problems of the database design device of the communication protocol is similar to the database design method of the communication protocol, the implementation of the database design device of the communication protocol can be implemented by referring to the database design method of the communication protocol, and repeated parts are not described again. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
An embodiment of the present invention provides a database design apparatus for communication protocols, as shown in fig. 8. In fig. 8, the apparatus includes:
the data frame description module 210: the system is used for describing communication data frames in a communication protocol according to a data frame description rule to form a communication data frame field set;
the parameter description module 220: the parameter description module is used for describing parameters in the communication data frame according to parameter description rules to form a parameter field set;
the display module 230: and the display form of the parameter value on the interface is described according to the value display rule to form a value display field set.
The storage module 240: and the data processing module is used for forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set and establishing a communication protocol database.
Based on the foregoing embodiment, as a preferred embodiment, the communication protocol processing module 210 specifically includes:
first distribution unit 211: the system is used for distributing communication protocol identity identification fields for communication protocols and distinguishing different types of communication protocols in communication software;
the second distribution unit 212: the system comprises a communication data frame, a subordinate communication data frame and a communication data frame, wherein the communication data frame and the subordinate communication data frame are respectively distributed with a communication data frame identity field and a subordinate communication data frame identity field;
encoding section 213: the system is used for configuring encoding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
the recognition unit 214: an identification field for configuring the lengths of the communication data frame and the subordinate communication data frame;
the description unit 215: a description field for configuring and describing all data types contained in the communication data frame and the lower communication data frame;
the verification unit 216: and a check field for configuring the check to describe the validity of the data.
Based on the foregoing embodiment, as a preferred embodiment, the data conversion module 220 specifically includes:
the configuration unit 221: the system comprises a communication data frame, a transmission parameter identity identification field and a communication data frame, wherein the transmission parameter identity identification field is used for configuring a transmission parameter identity identification field corresponding to the communication data frame;
the acquisition unit 222: the device comprises a name field, a unit field, an initial value field and a data type field which are used for configuring and acquiring transmission parameters;
the first judgment unit 223: used for judging whether the transmission parameter is valid or not and reconfiguring the invalid transmission parameter;
the formatting unit 224: the data type of the effective transfer parameter is converted into a result character string by using the formatting character string field;
second determination unit 225: the device is used for judging whether the result character string needs to be calculated or not and directly converting the result character string which does not need to be calculated into display data;
the calculation unit 226: and the function expression field is used for converting the result character string needing to be calculated into display data.
Based on the foregoing embodiment, as a preferred embodiment, the display format determining module 230 specifically includes:
the matching unit 231: the display control module is used for matching different types of display control according to the types of different parameter values;
the third judgment unit 232: the control display field is used for configuring and determining whether the display control is visible or not, and the invisible display control is not displayed;
position calibration unit 233: the control coordinate field is used for configuring the display position of the display control to be displayed in the display interface;
display control size specifying unit 234: a control size field for configuring a height and a width of a display control in a display interface;
the dividing unit 235: the attribute node fields are divided according to the values of the display control attributes;
the attribute node configuring unit 236: and configuring different display type fields for the attribute nodes of which the division is finished.
Based on the above embodiment, as a preferred embodiment, the display controls matched in the matching unit are divided into:
numeric controls, drop-down list controls, boolean controls, and string controls.
An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the database design method of the communication protocol in the foregoing embodiment, and referring to fig. 9, the electronic device 300 specifically includes the following contents:
a processor 310, a memory 320, a communication unit 330, and a bus 340;
the processor 310, the memory 320 and the communication unit 330 complete communication with each other through the bus 340; the communication unit 330 is used for implementing information transmission between server-side devices and terminal devices and other related devices.
The processor 310 is used to call the computer program in the memory 320, and the processor executes the computer program to implement all the steps of the database design method of the communication protocol in the above-mentioned embodiment.
Those of ordinary skill in the art will understand that: the Memory may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory is used for storing programs, and the processor executes the programs after receiving the execution instructions.
Further, the software programs and modules within the aforementioned memories may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor may be an integrated circuit chip having signal processing capabilities. The processor may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The present application further provides a computer-readable storage medium comprising a program which, when executed by a processor, is configured to perform the database design method for communication protocols provided in any of the method embodiments described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media capable of storing program codes, such as ROM, RAM, magnetic or optical disk, etc., and the specific type of media is not limited in this application.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for designing a database of communication protocols, the method comprising:
describing a communication data frame in a communication protocol according to a data frame description rule to form a communication data frame field set;
describing parameters in the communication data frame according to a parameter description rule to form a parameter field set;
describing the display form of the parameter value on the interface according to a value display rule to form a value display field set;
and forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set, and establishing a communication protocol database.
2. The method of claim 1, wherein describing the communication data frames in the communication protocol according to the data frame description rule to form a communication data frame field set comprises:
allocating communication protocol identification fields for communication protocols, and distinguishing different types of communication protocols in communication software;
respectively distributing a communication data frame identity identification field and a subordinate communication data frame identity identification field for the communication data frame and the subordinate communication data frame;
configuring coding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
configuring identification fields of the lengths of a communication data frame and a subordinate communication data frame;
configuring description fields for describing all data types contained in the communication data frame and the lower-level communication data frame;
a check field is configured to check the validity of the description data.
3. The method of claim 1, wherein the describing the parameters in the communication data frame according to the parameter description rule to form a parameter field set comprises:
configuring a transmission parameter identity identification field corresponding to a communication data frame;
configuring and acquiring a name field, a unit field, an initial value field and a data type field of a transmission parameter;
judging whether the transmission parameters are valid or not, and reconfiguring invalid transmission parameters;
converting the data type of the effective transmission parameter into a result character string by using a formatting character string field;
judging whether the result character string needs to be calculated or not, and directly converting the result character string which does not need to be calculated into display data;
and converting the result character string needing to be calculated into display data by using the function expression field.
4. The method of claim 1, wherein the describing the display form of the parameter values on the interface according to the value display rule to form a value display field set comprises:
matching different types of display controls according to the types of different parameter values;
configuring a control display field for determining whether the display control is visible or not, and not displaying the invisible display control;
configuring a control coordinate field of a display position of a display control to be displayed in a display interface;
configuring control size fields for displaying the height and width of a control in a display interface;
dividing attribute node fields according to values of display control attributes;
and configuring different display type fields for the divided attribute nodes.
5. The method of claim 4, wherein the display control is classified into:
numeric controls, drop-down list controls, boolean controls, and string controls.
6. An apparatus for database design of communication protocols, the apparatus comprising:
a data frame description module: the system is used for describing communication data frames in a communication protocol according to a data frame description rule to form a communication data frame field set;
a parameter description module: the parameter description module is used for describing parameters in the communication data frame according to parameter description rules to form a parameter field set;
a display module: the display form of the parameter value on the interface is described according to the value display rule to form a value display field set;
a storage module: and the data processing module is used for forming a corresponding data form in the database according to the communication data frame field set, the parameter field set and the numerical display field set and establishing a communication protocol database.
7. The apparatus for database design of communication protocols according to claim 6, wherein the data frame description module specifically comprises:
a first distribution unit: the system is used for distributing communication protocol identity identification fields for communication protocols and distinguishing different types of communication protocols in communication software;
a second allocation unit: respectively distributing a communication data frame identity identification field and a subordinate communication data frame identity identification field for the communication data frame and the subordinate communication data frame;
an encoding unit: the system is used for configuring encoding fields for a communication data frame and a lower-level communication data frame in a communication protocol;
an identification unit: length identification fields for configuring the communication data frame and the lower-level communication data frame;
a description unit: a description field for configuring and describing all data types contained in the communication data frame and the lower communication data frame;
a checking unit: and a check field for configuring the check to describe the validity of the data.
8. The apparatus for database design of communication protocols as claimed in claim 6, wherein the parameter description module specifically comprises:
a configuration unit: the system comprises a communication data frame, a transmission parameter identity identification field and a communication data frame, wherein the transmission parameter identity identification field is used for configuring a transmission parameter identity identification field corresponding to the communication data frame;
an acquisition unit: the device comprises a name field, a unit field, an initial value field and a data type field which are used for configuring and acquiring transmission parameters;
a first judgment unit: used for judging whether the transmission parameter is valid or not and reconfiguring the invalid transmission parameter;
a formatting unit: the data type of the effective transfer parameter is converted into a result character string by using the formatting character string field;
a second judgment unit: the device is used for judging whether the result character string needs to be calculated or not and directly converting the result character string which does not need to be calculated into display data;
a calculation unit: and the function expression field is used for converting the result character string needing to be calculated into display data.
9. An electronic device, comprising:
a processor, a memory, an interface to communicate with a gateway;
the memory is used for storing programs and data, and the processor calls the programs stored in the memory to execute the communication protocol database design method of any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium includes a program which, when executed by a processor, is configured to perform the communication protocol database design method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010869772.4A CN112069176B (en) | 2020-08-26 | 2020-08-26 | Database design method, device and equipment of communication protocol and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010869772.4A CN112069176B (en) | 2020-08-26 | 2020-08-26 | Database design method, device and equipment of communication protocol and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112069176A true CN112069176A (en) | 2020-12-11 |
CN112069176B CN112069176B (en) | 2024-01-30 |
Family
ID=73658980
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010869772.4A Active CN112069176B (en) | 2020-08-26 | 2020-08-26 | Database design method, device and equipment of communication protocol and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112069176B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609354A (en) * | 2021-08-11 | 2021-11-05 | 塬数科技(无锡)有限公司 | Method and device for dynamically configuring data acquisition protocol |
CN113970666A (en) * | 2021-10-22 | 2022-01-25 | 深圳市新威尔电子有限公司 | RS485 communication signal-based program design method |
CN114928662A (en) * | 2022-04-22 | 2022-08-19 | 深圳市天陆海导航设备技术有限责任公司 | Communication method for supporting multiple interfaces by user-defined protocol |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101132364A (en) * | 2007-08-23 | 2008-02-27 | 当代天启技术(北京)有限公司 | Data addressing and repeating method and system in control network |
CN101266485A (en) * | 2008-04-08 | 2008-09-17 | 南京迪玛斯电气有限公司 | Thermal power unit operation energy consumption actual measurement system |
WO2009026788A1 (en) * | 2007-08-24 | 2009-03-05 | Jianzhong Zhang | Method, device and system for establishing a communication protocol |
CN102055814A (en) * | 2010-11-25 | 2011-05-11 | 深圳市科陆电子科技股份有限公司 | Method for realizing cross-network segment real-time collection |
CN103593688A (en) * | 2013-11-20 | 2014-02-19 | 北京三生创新科技发展公司 | Positioning beacon, electronic label system with positioning beacon and communication method |
CN105549517A (en) * | 2016-03-03 | 2016-05-04 | 广州白云空港设备技术发展有限公司 | Boarding bridge and bridge equipment remote monitoring device based on flight information |
CN109460231A (en) * | 2018-09-25 | 2019-03-12 | 北京通广龙电子科技有限公司 | Upper computer software implementation method based on XML |
CN111428462A (en) * | 2020-03-04 | 2020-07-17 | 厦门科灿信息技术有限公司 | Communication protocol template construction method and terminal equipment |
-
2020
- 2020-08-26 CN CN202010869772.4A patent/CN112069176B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101132364A (en) * | 2007-08-23 | 2008-02-27 | 当代天启技术(北京)有限公司 | Data addressing and repeating method and system in control network |
WO2009026788A1 (en) * | 2007-08-24 | 2009-03-05 | Jianzhong Zhang | Method, device and system for establishing a communication protocol |
CN101266485A (en) * | 2008-04-08 | 2008-09-17 | 南京迪玛斯电气有限公司 | Thermal power unit operation energy consumption actual measurement system |
CN102055814A (en) * | 2010-11-25 | 2011-05-11 | 深圳市科陆电子科技股份有限公司 | Method for realizing cross-network segment real-time collection |
CN103593688A (en) * | 2013-11-20 | 2014-02-19 | 北京三生创新科技发展公司 | Positioning beacon, electronic label system with positioning beacon and communication method |
CN105549517A (en) * | 2016-03-03 | 2016-05-04 | 广州白云空港设备技术发展有限公司 | Boarding bridge and bridge equipment remote monitoring device based on flight information |
CN109460231A (en) * | 2018-09-25 | 2019-03-12 | 北京通广龙电子科技有限公司 | Upper computer software implementation method based on XML |
CN111428462A (en) * | 2020-03-04 | 2020-07-17 | 厦门科灿信息技术有限公司 | Communication protocol template construction method and terminal equipment |
Non-Patent Citations (3)
Title |
---|
JOHN J等: "ZINC- A Free database of commercially available compounds for virtual screening", JOURNAL OF CHEMICAL INFORMATION AND MODELING, vol. 45, no. 1, pages 177 - 182, XP055113478, DOI: 10.1021/ci049714+ * |
念路兵;郑磊;胡兴朝;胡之冉;: "一种基于Linux系统的PLC至数据库直传模块", 中国新通信, vol. 21, no. 22, pages 43 - 44 * |
李鹏;姜琳;: "井下多参数涌水异常在线监测软件设计", 科技创新与应用, no. 24, pages 15 - 17 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113609354A (en) * | 2021-08-11 | 2021-11-05 | 塬数科技(无锡)有限公司 | Method and device for dynamically configuring data acquisition protocol |
CN113970666A (en) * | 2021-10-22 | 2022-01-25 | 深圳市新威尔电子有限公司 | RS485 communication signal-based program design method |
CN114928662A (en) * | 2022-04-22 | 2022-08-19 | 深圳市天陆海导航设备技术有限责任公司 | Communication method for supporting multiple interfaces by user-defined protocol |
CN114928662B (en) * | 2022-04-22 | 2023-09-29 | 深圳市天陆海导航设备技术有限责任公司 | Communication method for supporting multiple interfaces by custom protocol |
Also Published As
Publication number | Publication date |
---|---|
CN112069176B (en) | 2024-01-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112069176A (en) | Communication protocol database design method, device, equipment and storage medium | |
CN112104664B (en) | Protocol conversion method, device and equipment for data of Internet of things | |
CN109858019B (en) | Dialogue state tracking method and device, storage medium and semantic recognition system | |
CN106662854B (en) | The method and system of the configuration of device for control system | |
CN106528129A (en) | Web application interface generation system and method | |
CN108365967A (en) | Method, system, terminal and the computer readable storage medium of dynamic configuration communications parameter | |
US20180164778A1 (en) | Method and System for Monitoring a Plant of Process Automation | |
EP3309638B1 (en) | Exportation of field data in multiple worksheets | |
CN101651683B (en) | Method for generating analysis source code of signaling message | |
CN102662352B (en) | System and method for automatically recording geometric parameters of numerical-control tools | |
CN102164050A (en) | Log parsing method and log parsing node device | |
CN109150854B (en) | Dynamic configurable communication protocol conversion system based on XML file | |
CN107992306A (en) | A kind of avionics software interface realizes uniformity automatic check method | |
CN105005543A (en) | Interface generation apparatus and method | |
CN111683066A (en) | Heterogeneous system integration method and device, computer equipment and storage medium | |
US8510463B2 (en) | Systems and methods for facilitating communication with a fieldbus device | |
CN114153980A (en) | Knowledge graph construction method and device, inspection method and storage medium | |
CN105426305A (en) | Control attribute analysis system and method | |
CN108089968A (en) | A kind of method of host's machine monitoring virtual-machine data storehouse state | |
CN103793519A (en) | Automatic tool supporting exportation of mass data | |
CN108897556B (en) | Set-top box production data writing method | |
EP3418913A1 (en) | System and method for merging a source data from a source application into a target data of a target application | |
US11579930B2 (en) | Resource determination based on resource definition data | |
CN113001538B (en) | Command analysis method and system | |
CN109754087B (en) | Quantum program conversion method and device and electronic equipment |
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 | ||
GR01 | Patent grant |