CN109976834B - Protocol stack parameter configuration method and device - Google Patents

Protocol stack parameter configuration method and device Download PDF

Info

Publication number
CN109976834B
CN109976834B CN201910252985.XA CN201910252985A CN109976834B CN 109976834 B CN109976834 B CN 109976834B CN 201910252985 A CN201910252985 A CN 201910252985A CN 109976834 B CN109976834 B CN 109976834B
Authority
CN
China
Prior art keywords
parameter
protocol stack
api
function
document
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.)
Active
Application number
CN201910252985.XA
Other languages
Chinese (zh)
Other versions
CN109976834A (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.)
Shanghai Rentong Electronic Technology Co ltd
Original Assignee
Shanghai Rentong Electronic 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 Shanghai Rentong Electronic Technology Co ltd filed Critical Shanghai Rentong Electronic Technology Co ltd
Priority to CN201910252985.XA priority Critical patent/CN109976834B/en
Publication of CN109976834A publication Critical patent/CN109976834A/en
Application granted granted Critical
Publication of CN109976834B publication Critical patent/CN109976834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The invention discloses a method and a device for configuring protocol stack parameters, which comprise the following steps: according to the parameter document and the parameter value input through the user interaction interface, the configuration parameter is transmitted to a self-packaging API of the protocol stack through the S-Function packaging module; analyzing the configuration parameters by using a self-packaging API to obtain an analysis result, and transmitting the analysis result to a protocol stack API; because the parameter document is pre-configured by the user according to the protocol stack standard, the user does not need to carry out complex coding in the calling process, and the parameter configuration process of the TRDP protocol stack can be simplified. And the protocol stack API required by the parameter configuration process is self-packaged, so that the configuration parameters are firstly transmitted to the self-packaging API through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.

Description

Protocol stack parameter configuration method and device
Technical Field
The invention relates to the technical field of train communication, in particular to a method and a device for configuring protocol stack parameters.
Background
With the rapid increase of the communication data volume of the current train, the traditional train bus is difficult to meet the requirement of large data volume transmission. The standard for Ethernet, IEC61375-3-4-2014, specifies the ECN (Ethernet communication Network) standard in TCN (Train communication Network). TRDP (Train Real-Time Data Protocol) is an example Protocol based on ECN. The protocol can meet the requirement of large data volume transmission in the existing train communication, and can simultaneously meet the requirements of real-time performance and reliability. Therefore, the TRDP protocol stack is widely applied in the train communication industry at present.
Because the TRDP standard is given in the form of open source code (C language), a user needs to configure parameters of a TRDP protocol stack in the process of using the TRDP protocol stack, and a parameter configuration method provided in the prior art is as follows: specifically, because the configuration parameters in the TRDP protocol stack parameter configuration code are provided by a configuration parameter document, a user needs to acquire the configuration parameters from the configuration parameter document, set the configuration parameters in a complex coding mode, and input the configuration parameters into the TRDP protocol stack.
Therefore, the parameter configuration method provided in the prior art needs a user to implement the parameter configuration method through a complex encoding mode, which results in a complex parameter configuration process of the TRDP protocol stack.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for configuring a protocol stack parameter, which do not require a user to configure the protocol stack parameter in a complex encoding manner, and simplify a parameter configuration process of a TRDP protocol stack.
A method for configuring protocol stack parameters comprises the following steps:
according to the parameter document and the parameter value input through the user interaction interface, the configuration parameter is transmitted to a self-packaging API of the protocol stack through the S-Function packaging module;
analyzing the configuration parameters by using the self-packaging API to obtain an analysis result, and transmitting the analysis result to a protocol stack API;
the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
Preferably, the protocol stack is a train real-time data protocol TRDP protocol stack.
Preferably, the configuration parameters include:
the protocol stack intrinsic parameters are pre-configured in the parameter document, and the user selection parameters are input by the user through the user interactive interface.
Preferably, the configuration process of the parameter document specifically includes:
extracting parameters to be configured and formulating constraint conditions for the parameters to be configured according to a protocol stack standard;
generating a spreadsheet Excel format parameter document according to the parameters to be configured and the constraint conditions;
and converting the Excel format parameter document into an XML format parameter document.
Preferably, the self-encapsulated API is pre-encapsulated according to the parameter document and the protocol stack API, and specifically includes:
compiling an XML document parsing function for parsing the XML format parameter document;
and the XML document analysis function and the protocol stack API are reintegrated to form the self-packaging API.
Preferably, the specific configuration process of the S-Function encapsulation module includes:
writing a graphical interface interaction function OpenGui () function based on a figure function and a java method of Matlab, wherein the OpenGui () can analyze the XML format parameter document;
taking the OpenGui () Function as a callback Function of OpenFcn of an S-Function module;
and packaging the S-Function module based on the OpenGui () Function and the self-packaging API to obtain the S-Function packaging module.
Preferably, when the configuration parameter is the user-selected parameter, the passing the configuration parameter to a self-encapsulation API of a protocol stack via an S-Function encapsulation module includes:
analyzing the user selection parameters by using the OpenGui () function, and writing an analysis result into a MASK;
and the S-Function encapsulation module acquires the analysis result in the MASK and transmits the analysis result to the self-encapsulation API.
Preferably, when the configuration parameter is the intrinsic parameter, the transmitting the configuration parameter to a self-encapsulation API of a protocol stack via an S-Function encapsulation module includes:
and the S-Function packaging module calls the XML document analysis Function to analyze the XML format parameter document to obtain an XML format parameter document analysis result.
A protocol stack parameter configuration apparatus, comprising:
the configuration parameter transmission module is used for transmitting the configuration parameters to a self-packaging API of the protocol stack through the S-Function packaging module according to the parameter document and the parameter values input through the user interaction interface;
the analysis module is used for analyzing the configuration parameters by using the self-packaging API to obtain an analysis result;
the analysis result transmission module is used for transmitting the analysis result to a protocol stack API by utilizing the self-packaging API;
the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
Based on the technical scheme, the embodiment of the invention discloses a method and a device for configuring protocol stack parameters, wherein the method comprises the following steps: according to the parameter document and the parameter value input through the user interaction interface, the configuration parameter is transmitted to a self-packaging API of the protocol stack through the S-Function packaging module; analyzing the configuration parameters by using the self-packaging API to obtain an analysis result, and transmitting the analysis result to a protocol stack API; the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API. Because the parameter document is pre-configured by the user according to the protocol stack standard, the user can directly configure the parameters of the protocol stack according to the parameter document and the parameter values input through the user interaction interface, the parameter configuration is not required to be performed through a complex coding mode, and the parameter configuration process of the TRDP protocol stack can be simplified. And the protocol stack API required by the parameter configuration process is packaged to obtain a self-packaging API, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process involved in direct interaction between the S-Function packaging module and the protocol stack API is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.
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 description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a protocol stack parameter configuration method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a user interaction interface according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating the type, function description and caller of a self-package API according to an embodiment of the present invention;
fig. 4 is a diagram illustrating types of self-package APIs called in different communication modes according to an embodiment of the present invention;
FIG. 5 is a flowchart of a parameter document configuration method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an Excel format parameter document according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an XML-formatted parameter document according to an embodiment of the present invention;
fig. 8 is a flowchart of another protocol stack parameter configuration method according to an embodiment of the present invention;
fig. 9 is a flowchart of another protocol stack parameter configuration method according to an embodiment of the present invention;
fig. 10 is a block diagram of a protocol stack parameter configuration apparatus 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. 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.
Fig. 1 shows a flowchart of a protocol stack parameter configuration method, where the protocol stack parameter configuration method in the embodiment of the present invention is applied to a parameter configuration process of a protocol stack, and optionally, a protocol stack in the embodiment of the present invention is a TRDP protocol stack, and referring to fig. 1, the method may include:
step S100, according to the parameter document and the parameter value input through the user interaction Interface, transmitting the configuration parameter to a self-packaging API (Application Programming Interface) of the protocol stack through an S-Function packaging module;
it should be noted that the parameter document is pre-configured by the user according to the protocol stack standard; the configuration parameters in the embodiment of the invention are divided into protocol stack intrinsic parameters and user selection parameters, the protocol stack intrinsic parameters are pre-configured in the parameter document, the user selection parameters are input by a user through a user interaction interface, the protocol stack intrinsic parameters are configured in the parameter document, and the user selection parameters require the user to input proper values in the user interaction interface according to a value range.
Referring to the schematic diagram of the user interaction interface shown in fig. 2, in the embodiment of the present invention, user interface interfaces such as selectable item values and character filling boxes are provided in the user interaction interface, so that a user configures parameter values through the user interface interfaces. NetworkId, ComId, Name, DataSetId, Source, Destination and the like in the user interaction interface are parameter names of the configuration parameters which are correspondingly set, a parameter value selection box corresponds to the back of each parameter Name, and the parameter value selection box is a parameter value selection interface in the application. The parameter value selection frame restricts the parameter value selection range, and a user can select a corresponding parameter value in the parameter value selection frame. The parameter selection boxes set before the parameters such as au8UINT 816 and au16UINT 1616 in the parameter configuration interface are also used as parameter value selection interfaces in the application, and a user can select the parameters in a checking mode.
The self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
And the S-Function encapsulation module carries system functions required by the protocol stack parameter configuration process.
The user interaction interface in the embodiment of the invention is generated according to the parameter document, by compiling an m-script graphical interface interaction function OpenGui (), the content of the parameter document is analyzed by utilizing the function, the parameter value required to be set by a user in the parameter document is displayed on a graphical interface, and the user interface interfaces such as a selectable value, a character filling frame and the like are provided for the user in the graph.
Step S110, the configuration parameters are analyzed by the self-packaging API to obtain an analysis result, and the analysis result is transmitted to a protocol stack API.
And analyzing the configuration parameters by using the self-packaging API to obtain an analysis result, transmitting the analysis result to a protocol stack API, and using the analysis result by the protocol stack API to configure the parameters of the protocol stack.
The user interaction interface in the embodiment of the invention is generated according to the parameter document, so the content displayed by the graphical interface conforms to the specification of the parameter in the parameter document, the parameter value input by the user through the user interaction interface necessarily conforms to the specification of the parameter in the parameter document, and the parameter value in the code does not need to be repeatedly checked whether conforms to the specification of the parameter in the parameter document in a complex coding mode, thereby further simplifying the parameter configuration process of the TRDP protocol stack.
In addition, the protocol stack API and the S-Function module are packaged in advance before the protocol stack parameter configuration method is executed, wherein the protocol stack API required by the parameter configuration process is packaged to obtain the self-packaging API, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process directly involved in interaction between the S-Function packaging module and the protocol stack API is simplified, and the parameter configuration process of the TRDP protocol stack can be simplified.
The step of packaging the S-Function module is to establish a corresponding relationship between a Function in the S-Function module used in the parameter configuration process and a Function in the self-package API, so that the S-Function module can conveniently call the Function in the self-package API, simplify the Function call process, and further simplify the parameter configuration process of the TRDP protocol stack.
Based on this, the following describes the encapsulation process of the protocol stack API and the encapsulation process of the S-Function module in detail:
because the interface form of the protocol stack API is inconvenient for the S-Function module to directly call, the S-Function module may call a plurality of protocol stack API interfaces in the parameter configuration process, and the calling process is complicated. Reference is made to table 1 below, for example:
taking a TRDP _ Init module in an S-Function encapsulation module as an example, the TRDP _ Init module corresponds to three module functions, namely Start, Outputs and Terminate, if API encapsulation of a protocol stack is not performed, a parsexmfile Function is necessarily called to parse an XML file when the protocol stack is initialized, and then two APIs of tlc _ Init and tlc _ openSession of the protocol stack are called to initialize the protocol stack, so that an additional code amount is required to match an output of the parsexmfile Function and inputs of the tlc _ Init and tlc _ openSession functions; furthermore, the tlc _ openSession Function involves 7 input parameters and is all complex data types, and if the functions are to be called directly in the S-Function module, additional header files of the data types are required to be added in the S-Function module, so that the Function calling process is complex.
Figure BDA0002012851040000071
TABLE 1
In order to make the S-Function call to the protocol stack API more convenient and concise, in the embodiments of the present invention, the API is encapsulated according to the parameter document and the protocol stack API to obtain a self-encapsulated API, and the embodiments of the present invention provide the following process of encapsulating the protocol stack API according to the parameter document and the protocol stack API to obtain the self-encapsulated API:
compiling an XML document analysis function for analyzing the XML format parameter document; and the XML document analysis function and the protocol stack API are reintegrated to form the self-packaging API.
With reference to table 1, for example, the specific process of obtaining the self-encapsulated API by performing the protocol stack API encapsulation according to the parameter document and the protocol stack API as described above is as follows:
writing an XML document parsing Function parseXmlFile for parsing an XML format parameter document, and reintegrating the XML document parsing Function parseXmlFile and the protocol stack API to form the self-encapsulation API for calling of Start (), output (), and Terminate () functions of S-Function, specifically, after two functions of tlc _ init and tlc _ openSession are encapsulated into a trpp _ init (void × pUserRef), the number of input parameters is less and the functions belong to a simple data type, so that the calling of an S-Function module is facilitated. Similarly, two functions, namely, tlc _ closed and tlc _ terminate, can be packaged into a trdp _ term function.
The TRDP protocol stack supports two communication modes of process data and message data, the communication of the process data is divided into two modes of PUSH and PULL, and the communication of the message data is divided into three modes of notify, notify-reply and notify-reply-confirm. In the process data mode, a person who sends data periodically or sends a request data is called publisher, and a person who receives data sent by the publisher in real time is called subscriber; in the message data mode, the party sending notify/request is called a caller, and the party receiving notify/request is called a receiver. To support these communication modes, as shown in fig. 3, the self-package API, the functional description of the self-package API, and the caller corresponding to the self-package API required by the above communication process are listed, and fig. 4 shows the types of the self-package APIs required to be called by publisher, caller, subscriber, and replier under various communication modes.
The embodiment of the invention provides a specific configuration process of an S-Function packaging module as follows:
writing a graphical interface interaction function OpenGui () function based on a figure function and a java method of Matlab, wherein the OpenGui () can analyze the XML format parameter document; taking the OpenGui () Function as a callback Function of OpenFcn of an S-Function module; and packaging the S-Function module based on the OpenGui () Function and the self-packaging API to obtain the S-Function packaging module.
Before executing the protocol stack parameter configuration method, the protocol stack API is packaged in advance, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process involved in direct interaction between the S-Function packaging module and the protocol stack API is simplified, and the S-Function module is packaged, so that the corresponding relation is established between the functions in the S-Function module and the functions in the self-packaging API, which are used in the parameter configuration process, so that the S-Function module can conveniently call the functions in the self-packaging API, the Function calling process is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.
Because the protocol stack parameter configuration method disclosed in the embodiment of the present invention is executed based on a parameter document, the following embodiment of the present invention introduces a configuration process of the parameter document in detail, fig. 5 shows a flowchart of a parameter document configuration method, and referring to fig. 5, the method may include:
step S200, extracting parameters to be configured and formulating constraint conditions for the parameters to be configured according to a protocol stack standard;
the parameter to be configured is a configuration parameter required for a parameter configuration process of the protocol stack.
According to the embodiment of the invention, the parameters to be configured can be extracted and constraint conditions can be formulated for the parameters to be configured according to the IEC61375-2-3 protocol stack standard.
The constraint condition is constraint content corresponding to the parameter to be configured, for example, constraint content in the aspects of the value, the attribute, and the like of the parameter to be configured, and the embodiment of the present invention is not particularly limited.
Step S210, generating a spreadsheet Excel format parameter document according to the parameters to be configured and the constraint conditions;
in the process of generating the spreadsheet Excel format parameter document, different types of parameters to be configured may be set in the same sheet of the Excel document, or different types of parameters to be configured may be set in different sheets of the Excel document, which is not limited in the embodiment of the present invention.
In the embodiment of the invention, an Excel format parameter document can be generated according to the IEC61375-2-3 protocol stack standard, and the Excel format parameter document covers all parameters to be configured specified by the IEC61375-2-3 standard.
For example, as shown in fig. 6, a schematic diagram of an Excel format parameter document includes configuration parameters such as: the < bus Interface Configuration > Configuration parameters comprise Configuration parameters of networkId, name, hostpip and leaderIp, and the corresponding constraint conditions of the Configuration parameters of networkId, name, hostpip and leaderIp can be set in the Excel format parameter document.
The setting process of the constraint conditions in the Excel format parameter document can be as follows: for the selectable content with limited dispersion, selectable items are provided for technicians to select through an Excel format parameter document, and the blocking attribute value shown in FIG. 6 has two types of 'ON' and 'OFF'; for non-limited discrete content, a technician can enter a specific value, in the embodiment of the invention, the Excel format parameter document is utilized to set the parameter range, the value corresponding to the configuration parameter is constrained according to the constraint condition, and when the technician enters a value which does not accord with the constraint condition, the Excel format parameter document can give a prompt that the value does not accord with the constraint condition.
And S220, converting the Excel format parameter document into an XML format parameter document.
Specifically, the content in the Excel format parameter document can be read, and the content read from the Excel format parameter document is written into the XML document according to the format form of the XML format parameter document, so as to generate the XML format parameter document. And filling default values specified by the IEC61375-2-3 standard in the XML document if the content read from the Excel format parameter document is empty.
As fig. 7 shows the structure of the XML format parameter document, the structure of the XML format parameter document may be: in the total < device attributes \ structure, < device configuration-attributes >, < bus-interface-list \ com-parameter-list >, < dataset-list > and < device attributes \ structure are nested, and other structures are nested layer by layer under the structure, for example, < bus-interface-list \ structure is nested, and < bus-interface-attributes \ structure is further nested.
Each structure in the XML format parameter document conforms to the IEC61375-2-3 standard.
When the configuration parameter is the user-selected parameter, an embodiment of the present invention provides the following protocol stack parameter configuration method, fig. 8 shows a flowchart of the protocol stack parameter configuration method, and referring to fig. 8, the method may include:
step S300, analyzing the user selection parameters by utilizing an OpenGui () function, and writing an analysis result into MASK;
step S310, the S-Function encapsulation module acquires the analysis result in the MASK and transmits the analysis result to the self-encapsulation API;
step S320, analyzing the configuration parameters by using the self-encapsulation API to obtain the analysis result, and transmitting the analysis result to a protocol stack API.
The process of analyzing the configuration parameters by using the self-packaging API mainly converts the configuration parameter format into a configuration parameter format which can be directly identified by a protocol stack API, and transmits the configuration parameter format into the protocol stack API.
Because the parameter document is pre-configured by the user according to the protocol stack standard, the user can directly perform the parameter configuration of the protocol stack through the parameter value input by the user interactive interface, the configuration parameter input by the user through the user interactive interface is analyzed by utilizing the OpenGui () function, the parameter configuration is not required to be performed through a complex coding mode, and the parameter configuration process of the TRDP protocol stack can be simplified. And the protocol stack API required by the parameter configuration process is packaged to obtain a self-packaging API, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process involved in direct interaction between the S-Function packaging module and the protocol stack API is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.
When the configuration parameter is the intrinsic parameter, an embodiment of the present invention provides a protocol stack parameter configuration method, where fig. 9 shows a flowchart of the protocol stack parameter configuration method, and referring to fig. 9, the method may include:
s400, calling the XML document analysis Function by an S-Function packaging module, and analyzing the XML format parameter document to obtain an XML format parameter document analysis result;
and the S-Function packaging module calls an XML document parsing Function parseXmlFile to parse the XML format parameter document to obtain an XML format parameter document parsing result.
The XML-format parameter document may be loaded by the user through an XML-format parameter document loading path provided in the user interaction interface, or may be loaded in other forms.
And step S410, analyzing the XML format parameter document analysis result by using the self-packaging API to obtain a parameter analysis result, and transmitting the parameter analysis result to a protocol stack API.
The self-packaging API analyzes the XML format parameter document analysis result, mainly converts the configuration parameter format in the XML format parameter document analysis result into the configuration parameter format which can be directly identified by the protocol stack API, and transmits the configuration parameter format to the protocol stack API.
The XML format parameter document is pre-configured by a user according to the protocol stack standard, the user can directly configure the parameters of the protocol stack according to the XML format parameter document, the S-Function packaging module calls the XML document parsing Function to parse the XML format parameter document, the parameter configuration is not required to be performed through a complex coding mode, and the parameter configuration process of the TRDP protocol stack can be simplified. And the protocol stack API required by the parameter configuration process is packaged to obtain a self-packaging API, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process involved in direct interaction between the S-Function packaging module and the protocol stack API is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.
The following introduces a protocol stack parameter configuration device provided in the embodiment of the present invention, and the protocol stack parameter configuration device described below may be referred to in correspondence with the protocol stack parameter configuration method described above.
Fig. 10 is a block diagram of a configuration apparatus for protocol stack parameters according to an embodiment of the present invention, and referring to fig. 10, the configuration apparatus for protocol stack parameters may include:
the configuration parameter transmission module 100 is used for transmitting the configuration parameters to a self-packaging API of the protocol stack through the S-Function packaging module according to the parameter document and the parameter values input through the user interaction interface;
the analysis module 110 is configured to analyze the configuration parameters by using the self-encapsulation API to obtain an analysis result;
the analysis result transmission module 120 is configured to transmit the analysis result to a protocol stack API by using the self-encapsulation API;
the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
The protocol stack is a TRDP protocol stack.
The configuration parameters include:
the protocol stack intrinsic parameters are pre-configured in the parameter document, and the user selection parameters are input by the user through the user interactive interface.
Further comprising: a parameter document configuration module, the parameter document configuration module specifically configured to:
extracting parameters to be configured and formulating constraint conditions for the parameters to be configured according to a protocol stack standard;
generating a spreadsheet Excel format parameter document according to the parameters to be configured and the constraint conditions;
and converting the Excel format parameter document into an XML format parameter document.
Further comprising: an API encapsulation module, the API encapsulation module specifically configured to:
compiling an XML document parsing function for parsing the XML format parameter document;
and the XML document analysis function and the protocol stack API are reintegrated to form the self-packaging API.
Further comprising: an S-Function configuration module, the S-Function configuration module specifically configured to:
writing a graphical interface interaction function OpenGui () function based on a figure function and a java method of Matlab, wherein the OpenGui () can analyze the XML format parameter document;
taking the OpenGui () Function as a callback Function of OpenFcn of an S-Function module;
and packaging the S-Function module based on the OpenGui () Function and the self-packaging API to obtain the S-Function packaging module.
When the configuration parameter is the user-selected parameter, the configuration parameter transmitting module is specifically configured to:
analyzing the user selection parameters by using the OpenGui () function, and writing an analysis result into a MASK;
and the S-Function encapsulation module acquires the analysis result in the MASK and transmits the analysis result to the self-encapsulation API.
When the configuration parameter is the intrinsic parameter, the configuration parameter passing module is specifically configured to:
and calling the XML document analysis function to analyze the XML format parameter document to obtain an XML format parameter document analysis result.
In summary, the following steps:
the embodiment of the invention discloses a method and a device for configuring protocol stack parameters, which comprises the following steps: according to the parameter document and the parameter value input through the user interaction interface, the configuration parameter is transmitted to a self-packaging API of the protocol stack through the S-Function packaging module; analyzing the configuration parameters by using the self-packaging API to obtain an analysis result, and transmitting the analysis result to a protocol stack API; the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API. Because the parameter document is pre-configured by the user according to the protocol stack standard, the user can directly configure the parameters of the protocol stack according to the parameter document and the parameter values input through the user interaction interface, the parameter configuration is not required to be performed through a complex coding mode, and the parameter configuration process of the TRDP protocol stack can be simplified. And the protocol stack API required by the parameter configuration process is packaged to obtain a self-packaging API, so that the configuration parameters are firstly transmitted to the self-packaging API of the protocol stack through the S-Function packaging module and then transmitted to the protocol stack API through the self-packaging API, the complex Function calling process involved in direct interaction between the S-Function packaging module and the protocol stack API is simplified, and the parameter configuration process of the TRDP protocol stack is further simplified.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method for configuring protocol stack parameters is characterized by comprising the following steps:
according to a parameter document and a parameter value input through a user interaction interface, transmitting a configuration parameter to a self-packaging API of a protocol stack through an S-Function packaging module, wherein the user interaction interface is generated by analyzing the content of the parameter document through a compiled m-script graphical interface interaction Function OpenGui (), and carrying out graphical interface display on the parameter value which needs to be set by a user in the parameter document, and the S-Function packaging module carries a system Function which is needed in the parameter configuration process of the protocol stack;
analyzing the configuration parameters by using the self-packaging API to obtain an analysis result, and transmitting the analysis result to a protocol stack API;
the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
2. The method of claim 1, wherein the protocol stack is a TRDP protocol stack.
3. The method of claim 2, wherein the configuration parameters comprise:
the protocol stack intrinsic parameters are pre-configured in the parameter document, and the user selection parameters are input by the user through the user interactive interface.
4. The method according to claim 3, wherein the configuration process of the parameter document specifically includes:
extracting parameters to be configured and formulating constraint conditions for the parameters to be configured according to a protocol stack standard;
generating a spreadsheet Excel format parameter document according to the parameters to be configured and the constraint conditions;
and converting the Excel format parameter document into an XML format parameter document.
5. The method according to claim 4, wherein the self-encapsulating API is pre-encapsulated according to the parameter document and the protocol stack API, and specifically comprises:
compiling an XML document parsing function for parsing the XML format parameter document;
and the XML document analysis function and the protocol stack API are reintegrated to form the self-packaging API.
6. The method of claim 5, wherein the specific configuration process of the S-Function encapsulation module comprises:
writing a graphical interface interaction function OpenGui () function based on a figure function and a java method of Matlab, wherein the OpenGui () can analyze the XML format parameter document;
taking the OpenGui () Function as a callback Function of OpenFcn () of an S-Function module;
and packaging the S-Function module based on the OpenGui () Function and the self-packaging API to obtain the S-Function packaging module.
7. The method of claim 6, wherein when the configuration parameter is the user-selected parameter, the passing the configuration parameter into a self-encapsulation API of a protocol stack via an S-Function encapsulation module comprises:
analyzing the user selection parameters by using the OpenGui () function, and writing the analysis result into a MASK;
and the S-Function encapsulation module acquires the analysis result in the MASK and transmits the analysis result to the self-encapsulation API.
8. The method of claim 5, wherein when the configuration parameter is the intrinsic parameter, the passing the configuration parameter to a self-encapsulation API of a protocol stack via an S-Function encapsulation module comprises:
and the S-Function packaging module calls the XML document analysis Function to analyze the XML format parameter document to obtain an XML format parameter document analysis result.
9. An apparatus for configuring parameters of a protocol stack, comprising:
the system comprises a configuration parameter transmission module, a self-packaging API (application program interface) module and a self-packaging API (application program interface) module, wherein the configuration parameter transmission module is used for transmitting configuration parameters to the self-packaging API of a protocol stack through the S-Function packaging module according to a parameter document and a parameter value input through a user interaction interface, the user interaction interface analyzes the content of the parameter document through a compiled m-script graphical interface interaction Function OpenGui (), the parameter value required to be set by a user in the parameter document is displayed through a graphical interface, and the S-Function packaging module carries a system Function required by the parameter configuration process of the protocol stack;
the analysis module is used for analyzing the configuration parameters by using the self-packaging API to obtain an analysis result;
the analysis result transmission module is used for transmitting the analysis result to a protocol stack API by utilizing the self-packaging API;
the parameter document is pre-configured by a user according to a protocol stack standard; the self-packaging API is pre-packaged according to the parameter document and the protocol stack API.
CN201910252985.XA 2019-03-29 2019-03-29 Protocol stack parameter configuration method and device Active CN109976834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910252985.XA CN109976834B (en) 2019-03-29 2019-03-29 Protocol stack parameter configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910252985.XA CN109976834B (en) 2019-03-29 2019-03-29 Protocol stack parameter configuration method and device

Publications (2)

Publication Number Publication Date
CN109976834A CN109976834A (en) 2019-07-05
CN109976834B true CN109976834B (en) 2022-01-28

Family

ID=67081866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910252985.XA Active CN109976834B (en) 2019-03-29 2019-03-29 Protocol stack parameter configuration method and device

Country Status (1)

Country Link
CN (1) CN109976834B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166485B (en) * 2019-06-14 2022-07-08 北京经纬恒润科技股份有限公司 Protocol scheduling and using method and device
CN114765633A (en) * 2021-01-04 2022-07-19 株洲中车时代电气股份有限公司 Network message analysis method and device based on train real-time Ethernet protocol

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674582A (en) * 2005-03-17 2005-09-28 北京北方烽火科技有限公司 Static configuration and dynamic configuration combination MAPsec configuration method
CN102055770A (en) * 2011-01-17 2011-05-11 西安电子科技大学 Automatic secure protocol code implementation system based on extensive markup language (XML) description
CN103529821A (en) * 2013-09-29 2014-01-22 重庆邮电大学 Configurable method and device for diagnostic protocol stack system based on CAN (controller area network) bus
CN105282207A (en) * 2014-07-25 2016-01-27 中国科学院声学研究所 Communication method and system based on communication protocol stack capable of being assembled
CN105656736A (en) * 2016-01-05 2016-06-08 杭州古北电子科技有限公司 Software-defined wide area network system with low power consumption and configuration method thereof
CN106506210A (en) * 2016-11-04 2017-03-15 广东亿迅科技有限公司 A kind of set various protocols realize the method and its system of connection interface
CN107147630A (en) * 2017-04-27 2017-09-08 上海斐讯数据通信技术有限公司 It is a kind of to realize the method and device that OMCI protocol stack codes are automatically generated
CN107239271A (en) * 2016-03-29 2017-10-10 滴滴(中国)科技有限公司 Develop document structure tree method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8245189B2 (en) * 2007-06-21 2012-08-14 International Business Machines Corporation Generically managing the configuration of heterogeneous software artifacts
US10587580B2 (en) * 2016-10-26 2020-03-10 Ping Identity Corporation Methods and systems for API deception environment and API traffic control and security

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1674582A (en) * 2005-03-17 2005-09-28 北京北方烽火科技有限公司 Static configuration and dynamic configuration combination MAPsec configuration method
CN102055770A (en) * 2011-01-17 2011-05-11 西安电子科技大学 Automatic secure protocol code implementation system based on extensive markup language (XML) description
CN103529821A (en) * 2013-09-29 2014-01-22 重庆邮电大学 Configurable method and device for diagnostic protocol stack system based on CAN (controller area network) bus
CN105282207A (en) * 2014-07-25 2016-01-27 中国科学院声学研究所 Communication method and system based on communication protocol stack capable of being assembled
CN105656736A (en) * 2016-01-05 2016-06-08 杭州古北电子科技有限公司 Software-defined wide area network system with low power consumption and configuration method thereof
CN107239271A (en) * 2016-03-29 2017-10-10 滴滴(中国)科技有限公司 Develop document structure tree method and device
CN106506210A (en) * 2016-11-04 2017-03-15 广东亿迅科技有限公司 A kind of set various protocols realize the method and its system of connection interface
CN107147630A (en) * 2017-04-27 2017-09-08 上海斐讯数据通信技术有限公司 It is a kind of to realize the method and device that OMCI protocol stack codes are automatically generated

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Impact of routing protocols on packet retransmission over wireless networks";Thibault Bernard等;《 2013 IEEE International Conference on Communications (ICC)》;20131107;第2079-2082页 *
"一种软件定义的嵌入式RTU多协议自动适配数据传输方法";金惠英 等;《江苏水利》;20170801(第8期);第65-68页 *

Also Published As

Publication number Publication date
CN109976834A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN109976834B (en) Protocol stack parameter configuration method and device
US6564265B2 (en) Apparatus for encoding and decoding data according to a protocol specification
CN108289060B (en) Data processing method and device based on RPC service
CN110275831B (en) Mock data verification method and device of protocol interface
CN109710533A (en) A kind of interface test method, device and server
EP2418825A1 (en) Method and system for generating open telecommunication service based on internet
CN111552838B (en) Data processing method and device, computer equipment and storage medium
US20110137958A1 (en) Implementation Method of DATACOM Data Command Platform
US11709722B2 (en) Extensible communication framework and communication method supporting multiple communication protocols
CN115136256A (en) Information processing method, information processing apparatus, information processing program, and recording medium
CN110446228A (en) Data transmission method, device, terminal device and storage medium
CN111930444B (en) Instruction coupling device, method, equipment and storage medium for verifying processor core
CN111787396B (en) Video stream parsing method and device
CN115344318A (en) Visual configuration method and system for document data processing service
CN109586979B (en) Message transmission method and device
CN111953662A (en) Data processing method, device and system and storage medium
CN105278928A (en) IVR external interface configuration method and IVR external interface configuration device
CN110995577A (en) Multi-channel adaptation method and device for message and storage medium
CN113438226B (en) Message generating and analyzing method, device and system based on hybrid transmission protocol
EP3119067B1 (en) Client-server system for network services and applications for mobile telecommunications terminals
CN111147359B (en) Message conversion method, device and storage medium suitable for multiple channels
KR100962393B1 (en) Classification charging device and Method thereof
McQuistin et al. Investigating Automatic Code Generation for Network Packet Parsing
CN110569069A (en) Configuration management method, configuration management system and device with storage function
CN112448971B (en) Data analysis platform, data analysis method and storage medium

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