[go: up one dir, main page]

CN118803086A - Data protocol conversion method, device, electronic device and storage medium - Google Patents

Data protocol conversion method, device, electronic device and storage medium Download PDF

Info

Publication number
CN118803086A
CN118803086A CN202410984394.2A CN202410984394A CN118803086A CN 118803086 A CN118803086 A CN 118803086A CN 202410984394 A CN202410984394 A CN 202410984394A CN 118803086 A CN118803086 A CN 118803086A
Authority
CN
China
Prior art keywords
data
protocol
target
converted
protocol type
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.)
Pending
Application number
CN202410984394.2A
Other languages
Chinese (zh)
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.)
Changsha Basiliang Information Technology Co ltd
Original Assignee
Changsha Basiliang Information 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 Changsha Basiliang Information Technology Co ltd filed Critical Changsha Basiliang Information Technology Co ltd
Priority to CN202410984394.2A priority Critical patent/CN118803086A/en
Publication of CN118803086A publication Critical patent/CN118803086A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)

Abstract

本申请公开了一种数据协议转换方法、装置、电子设备及存储介质,涉及协议转换技术领域,该方法包括:接收待转换数据和所述待转换数据的目标协议类型;检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率,实现了将不同协议类型的数据转换为传输速率更高的指定协议数据的效果。

The present application discloses a data protocol conversion method, device, electronic device and storage medium, and relates to the field of protocol conversion technology. The method comprises: receiving data to be converted and a target protocol type of the data to be converted; detecting an actual protocol type of the data to be converted to obtain a detection result, and parsing the data to be converted based on the detection result to obtain parsed data; converting the parsed data into target protocol data according to the target protocol type, and outputting the target protocol data; adjusting the output rate of the target protocol data based on the actual protocol type and the target protocol type, thereby achieving the effect of converting data of different protocol types into designated protocol data with a higher transmission rate.

Description

一种数据协议转换方法、装置、电子设备及存储介质Data protocol conversion method, device, electronic device and storage medium

技术领域Technical Field

本申请涉及协议转换技术领域,尤其涉及一种数据协议转换方法、装置、电子设备及存储介质。The present application relates to the technical field of protocol conversion, and in particular to a data protocol conversion method, device, electronic device and storage medium.

背景技术Background Art

随着计算机网络技术的发展,出现了多种不同的网络协议,而不同类型的设备也可能使用不同的接口协议,例如USB(Universal Serial Bus,通用串行总线)、PCIe(Peripheral Component Interconnect Express,With the development of computer network technology, a variety of different network protocols have emerged, and different types of devices may also use different interface protocols, such as USB (Universal Serial Bus), PCIe (Peripheral Component Interconnect Express,

高速串行计算机扩展总线标准)、UART(Universal Asynchronous Receiver/Transmitter,通用异步收发器)、SATA(Serial Advanced Technology Attachment,串行高级技术附件)、HDMI(High Definition Multimedia Interface,高清多媒体接口)等。每个设备都有各自的信息交流方式,当两个设备需要相互沟通的时候,如果彼此不识别对方的交流方式,那么就无法相互沟通,协议转换即起到了为两个网络相互”翻译”的作用。但是目前的数据协议转换设备通常只能实现在同一领域内实现数据协议的转换,且由于接口数量有限、支持的协议转换类型单一、输出数据性能低下等原因,一般不能自适应地转换不同协议类型数据为不同接口设备所需求的数据。High-speed serial computer expansion bus standard), UART (Universal Asynchronous Receiver/Transmitter), SATA (Serial Advanced Technology Attachment), HDMI (High Definition Multimedia Interface), etc. Each device has its own way of exchanging information. When two devices need to communicate with each other, if they do not recognize each other's communication method, they cannot communicate with each other. Protocol conversion plays the role of "translating" between the two networks. However, current data protocol conversion devices can usually only realize data protocol conversion within the same field, and due to the limited number of interfaces, the single type of protocol conversion supported, and the low output data performance, they are generally unable to adaptively convert data of different protocol types into data required by different interface devices.

因此,如何将不同协议类型的数据转换为传输速率更高的指定协议数据,是目前一个亟需解决的问题。Therefore, how to convert data of different protocol types into specified protocol data with a higher transmission rate is a problem that needs to be solved urgently.

发明内容Summary of the invention

本申请的主要目的在于提供一种数据协议转换方法、装置、电子设备及存储介质,旨在解决如何将不同协议类型的数据转换为传输速率更高的指定协议数据的技术问题。The main purpose of the present application is to provide a data protocol conversion method, device, electronic device and storage medium, aiming to solve the technical problem of how to convert data of different protocol types into specified protocol data with a higher transmission rate.

为实现上述目的,本申请提出一种数据协议转换方法,所述的方法包括:To achieve the above purpose, the present application proposes a data protocol conversion method, the method comprising:

接收待转换数据和所述待转换数据的目标协议类型;Receiving data to be converted and a target protocol type of the data to be converted;

检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;Detecting an actual protocol type of the data to be converted to obtain a detection result, and parsing the data to be converted based on the detection result to obtain parsed data;

根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;Convert the parsed data into target protocol data according to the target protocol type, and output the target protocol data;

基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。Based on the actual protocol type and the target protocol type, an output rate of the target protocol data is adjusted.

在一实施例中,所述目标协议数据的输出速率由PID控制器进行控制,所述基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率的步骤包括:In one embodiment, the output rate of the target protocol data is controlled by a PID controller, and the step of adjusting the output rate of the target protocol data based on the actual protocol type and the target protocol type includes:

基于所述实际协议类型和所述目标协议类型,确定所述PID控制器的控制参数;Determining control parameters of the PID controller based on the actual protocol type and the target protocol type;

基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量;Based on the control parameter and the analysis data, determining an adjustment amount of the control parameter;

根据所述调整量对所述控制参数进行调整,得到目标控制参数,以通过配置有所述目标控制参数的所述控制器调整所述输出速率。The control parameter is adjusted according to the adjustment amount to obtain a target control parameter, so as to adjust the output rate through the controller configured with the target control parameter.

在一实施例中,所述基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量的步骤包括:In one embodiment, the step of determining the adjustment amount of the control parameter based on the control parameter and the parsed data comprises:

基于所述控制参数和所述解析数据进行建模,得到PID控制模型;Modeling is performed based on the control parameters and the analytical data to obtain a PID control model;

获取所述系统PID控制模型中的误差值,并基于所述误差值确定所述调整量。An error value in the system PID control model is obtained, and the adjustment amount is determined based on the error value.

在一实施例中,所述调整量包括第一调整量和第二调整量,所述控制参数包括比例增益系数和积分增益系数,所述目标控制参数包括目标比例增益系数和目标积分增益系数;In one embodiment, the adjustment amount includes a first adjustment amount and a second adjustment amount, the control parameter includes a proportional gain coefficient and an integral gain coefficient, and the target control parameter includes a target proportional gain coefficient and a target integral gain coefficient;

所述根据所述调整量对所述控制参数进行调整,得到目标控制参数的步骤包括:The step of adjusting the control parameter according to the adjustment amount to obtain the target control parameter comprises:

根据所述第一调整量对所述比例增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第一反馈状况;adjusting the proportional gain coefficient according to the first adjustment amount, and monitoring a first feedback condition generated during the output of the target protocol data;

在所述第一反馈状况中未出现错误反馈的情况下,返回执行所述根据所述第一调整量对所述比例增益系数进行调整的步骤;在所述第一反馈状况中出现错误反馈的情况下,根据预设修正量对所述第一调整量进行修正,并基于修正后的第一调整量对所述比例增益系数进行调整,得到所述目标比例增益系数;In the case where no error feedback occurs in the first feedback condition, returning to the step of adjusting the proportional gain coefficient according to the first adjustment amount; in the case where error feedback occurs in the first feedback condition, correcting the first adjustment amount according to a preset correction amount, and adjusting the proportional gain coefficient based on the corrected first adjustment amount to obtain the target proportional gain coefficient;

根据所述第二调整量对所述积分增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第二反馈状况;adjusting the integral gain coefficient according to the second adjustment amount, and monitoring a second feedback condition generated during the output of the target protocol data;

在所述第二反馈状况中出现错误反馈的情况下,返回执行根据所述第二调整量对所述积分增益系数进行调整的步骤;在所述第二反馈状况中未出现错误反馈的情况下,得到所述目标积分增益系数。In the case where error feedback occurs in the second feedback condition, the step of adjusting the integral gain coefficient according to the second adjustment amount is returned to be executed; in the case where error feedback does not occur in the second feedback condition, the target integral gain coefficient is obtained.

在一实施例中,所述检测所述待转换数据的实际协议类型,得到检测结果的步骤包括:In one embodiment, the step of detecting the actual protocol type of the data to be converted and obtaining the detection result includes:

检测接收所述待转换数据所调用接口的接口类型,并基于所述接口类型确定所述待转换数据的候选实际协议类型;Detecting the interface type of the interface called by receiving the data to be converted, and determining a candidate actual protocol type of the data to be converted based on the interface type;

提取所述待转换数据中头部信息的协议字段,并通过将所述协议字段与多个预设字段进行匹配,确定所述待转换数据的校验实际协议类型;Extracting the protocol field of the header information in the data to be converted, and determining the verification actual protocol type of the data to be converted by matching the protocol field with a plurality of preset fields;

在所述候选实际协议类型和所述校验实际协议类型一致的情况下,将所述候选实际协议类型作为所述实际协议类型,并基于所述实际协议类型对所述待转换数据进行标记,得到所述检测结果。In the case that the candidate actual protocol type is consistent with the verification actual protocol type, the candidate actual protocol type is used as the actual protocol type, and the to-be-converted data is marked based on the actual protocol type to obtain the detection result.

在一实施例中,所述根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据的步骤包括:In one embodiment, the step of converting the parsed data into target protocol data according to the target protocol type and outputting the target protocol data includes:

根据所述目标协议类型确定转换数据协议所用的预设函数;Determining a preset function used for converting a data protocol according to the target protocol type;

基于所述预设函数将所述解析数据转换为所述目标协议数据,并根据所述预设函数确定输出所述目标协议数据的输出接口;Converting the parsed data into the target protocol data based on the preset function, and determining an output interface for outputting the target protocol data according to the preset function;

通过所述输出接口输出所述目标协议数据。The target protocol data is output through the output interface.

在一实施例中,所述方法还包括:In one embodiment, the method further comprises:

对所述待转换数据进行编号,得到编号数据,并监测所述待转换数据在数据协议转换过程中的转换进度;Numbering the data to be converted to obtain numbered data, and monitoring the conversion progress of the data to be converted during the data protocol conversion process;

将所述编号数据和所述转换进度关联输出。The numbering data and the conversion progress are associated and outputted.

此外,为实现上述目的,本申请还提出一种数据协议转换装置,所述数据协议转换装置包括:In addition, to achieve the above purpose, the present application also proposes a data protocol conversion device, the data protocol conversion device comprising:

接收模块,用于接收待转换数据和所述待转换数据的目标协议类型;A receiving module, used for receiving data to be converted and a target protocol type of the data to be converted;

解析模块,用于检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;A parsing module, used for detecting the actual protocol type of the data to be converted, obtaining a detection result, and parsing the data to be converted based on the detection result to obtain parsed data;

转换模块,用于根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;A conversion module, used to convert the parsed data into target protocol data according to the target protocol type, and output the target protocol data;

控制模块,用于基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。A control module is used to adjust the output rate of the target protocol data based on the actual protocol type and the target protocol type.

此外,为实现上述目的,本申请还提出一种电子设备,所述设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序配置为实现如上文所述的数据协议转换方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data protocol conversion method described above.

此外,为实现上述目的,本申请还提出一种存储介质,所述存储介质为计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上文所述的数据协议转换方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data protocol conversion method described above are implemented.

此外,为实现上述目的,本申请还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现如上文所述的数据协议转换方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data protocol conversion method described above are implemented.

本申请提出一种数据协议转换方法,本申请首先通过接收待转换数据和所述待转换数据的目标协议类型,以获取进行协议转换的数据基础和转换目标;检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据,以对不同协议类型的数据进行有效的解析;根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据,以根据转换目标对不同协议数据进行协议类型的转换输出;基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率,以通过调整协议的输出速率满足不同接口设备对数据的传输速率要求。The present application proposes a data protocol conversion method. The present application first receives data to be converted and a target protocol type of the data to be converted to obtain a data basis and a conversion target for protocol conversion; detects the actual protocol type of the data to be converted to obtain a detection result, and parses the data to be converted based on the detection result to obtain parsed data, so as to effectively parse data of different protocol types; converts the parsed data into target protocol data according to the target protocol type, and outputs the target protocol data, so as to perform protocol type conversion and output of different protocol data according to the conversion target; adjusts the output rate of the target protocol data based on the actual protocol type and the target protocol type, so as to meet the data transmission rate requirements of different interface devices by adjusting the output rate of the protocol.

综上所述,本申请通过对不同协议类型的数据进行检测和解析,将不同协议类型的数据转换为目标协议数据,并通过调整目标协议数据的输出速率,以满足不同接口设备所要求的数据传输速率,从而支持不同领域数据协议的转换,实现了将不同协议类型的数据转换为传输速率更高的指定协议数据的效果。To summarize, the present application detects and parses data of different protocol types, converts data of different protocol types into target protocol data, and adjusts the output rate of the target protocol data to meet the data transmission rate required by different interface devices, thereby supporting the conversion of data protocols in different fields and achieving the effect of converting data of different protocol types into designated protocol data with a higher transmission rate.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

图1为本申请数据协议转换方法实施例一提供的流程示意图;FIG1 is a schematic diagram of a flow chart of a data protocol conversion method according to an embodiment of the present invention;

图2为本申请数据协议转换方法实施例二提供的流程示意图;FIG2 is a flow chart of a second embodiment of the data protocol conversion method of the present application;

图3为本申请实施例二提供的数据协议转换方法的系统框图;FIG3 is a system block diagram of a data protocol conversion method provided in Embodiment 2 of the present application;

图4为本申请实施例而提供的数据协议转换方法中数据通信的场景示意图;FIG4 is a schematic diagram of a data communication scenario in a data protocol conversion method provided in an embodiment of the present application;

图5为本申请实施例二提供的数据协议转换方法的简要流程示意图;FIG5 is a schematic diagram of a simplified flow chart of a data protocol conversion method provided in Embodiment 2 of the present application;

图6为本申请实施例数据协议转换装置的模块结构示意图;FIG6 is a schematic diagram of the module structure of a data protocol conversion device according to an embodiment of the present application;

图7为本申请实施例中数据协议转换方法涉及的硬件运行环境的设备结构示意图。FIG. 7 is a schematic diagram of the device structure of the hardware operating environment involved in the data protocol conversion method in the embodiment of the present application.

本申请目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式DETAILED DESCRIPTION

应当理解,此处所描述的具体实施例仅仅用以解释本申请的技术方案,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

为了更好的理解本申请的技术方案,下面将结合说明书附图以及具体的实施方式进行详细的说明。In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

本申请实施例的主要解决方案是:接收待转换数据和所述待转换数据的目标协议类型;检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。The main solution of the embodiment of the present application is: receiving data to be converted and a target protocol type of the data to be converted; detecting an actual protocol type of the data to be converted to obtain a detection result, and parsing the data to be converted based on the detection result to obtain parsed data; converting the parsed data into target protocol data according to the target protocol type, and outputting the target protocol data; adjusting the output rate of the target protocol data based on the actual protocol type and the target protocol type.

由于现有技术目前的数据协议转换设备由于接口数量有限、支持的协议转换类型单一、输出数据性能低下等原因,一般不能自适应地转换不同协议类型数据为不同接口设备所需求的数据。因此,如何将不同协议类型的数据转换为传输速率更高的指定协议数据,是目前一个亟需解决的问题。Due to the limited number of interfaces, the single type of protocol conversion supported, and the low output data performance, the current data protocol conversion devices in the prior art generally cannot adaptively convert data of different protocol types into data required by different interface devices. Therefore, how to convert data of different protocol types into designated protocol data with a higher transmission rate is a problem that needs to be solved urgently.

本申请提供一种解决方案,通过对不同协议类型的数据进行检测和解析,将不同协议类型的数据转换为目标协议数据,并通过调整目标协议数据的输出速率,以满足不同接口设备所要求的数据传输速率,实现了将不同协议类型的数据转换为传输速率更高的指定协议数据的效果。The present application provides a solution, which detects and parses data of different protocol types, converts data of different protocol types into target protocol data, and adjusts the output rate of the target protocol data to meet the data transmission rate required by different interface devices, thereby achieving the effect of converting data of different protocol types into designated protocol data with a higher transmission rate.

需要说明的是,本实施例的执行主体可以是一种具有数据处理、网络通信以及程序运行功能的计算服务设备,例如平板电脑、个人电脑、手机等,或者是一种能够实现上述功能的电子设备等。以下以电子设备为例,对本实施例及下述各实施例进行说明。It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.

基于此,本申请实施例提供了一种数据协议转换方法,参照图1,图1为本申请数据协议转换方法第一实施例的流程示意图。Based on this, an embodiment of the present application provides a data protocol conversion method, referring to Figure 1, which is a flow chart of the first embodiment of the data protocol conversion method of the present application.

本实施例中,所述数据协议转换方法包括步骤S10~S40:In this embodiment, the data protocol conversion method includes steps S10 to S40:

步骤S10,接收待转换数据和所述待转换数据的目标协议类型;Step S10, receiving data to be converted and a target protocol type of the data to be converted;

需要说明的是,待转换数据是指需要转换数据格式的数据,目标协议类型是指用户指定的输出协议格式。It should be noted that the data to be converted refers to the data whose data format needs to be converted, and the target protocol type refers to the output protocol format specified by the user.

步骤S20,检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;Step S20, detecting the actual protocol type of the data to be converted to obtain a detection result, and parsing the data to be converted based on the detection result to obtain parsed data;

需要说明的是,实际协议类型是指待转换数据的协议格式;检测结果是指大于待转换数据进行协议格式的检测后,得到标记结果;解析数据是指对检测出协议格式的数据,按照该协议格式对应的数据解析规则进行解析后得到的数据。It should be noted that the actual protocol type refers to the protocol format of the data to be converted; the detection result refers to the marking result obtained after the protocol format is detected on the data to be converted; and the parsed data refers to the data obtained after parsing the data with the detected protocol format according to the data parsing rules corresponding to the protocol format.

另外地,需要说明的是,检测待转换数据的实际协议类型可以通过在应用层中对待转换数据进行检测,也可以通过检测待转换数据的物理层信号来进行识别,本实施例中对检测待转换数据的具体实施方式并不作具体限定。In addition, it should be noted that the actual protocol type of the data to be converted can be detected by detecting the data to be converted in the application layer, or by detecting the physical layer signal of the data to be converted. The specific implementation method for detecting the data to be converted is not specifically limited in this embodiment.

另外地,还需要说明的是,由于接收到的待转换数据可以是多个待转换数据,所以在执行所述检测所述待转换数据的实际协议类型的步骤之前,还需获取所述待转换数据的优先级,并基于所述优先级执行所述检测所述待转换数据的实际协议类型的步骤,能够避免无法确定对多个待转换数据进行检测的顺序,为确定检测待转换数据的顺序提供了一种有效的方式。In addition, it should be noted that since the received data to be converted may be multiple data to be converted, before executing the step of detecting the actual protocol type of the data to be converted, it is necessary to obtain the priority of the data to be converted, and execute the step of detecting the actual protocol type of the data to be converted based on the priority. This can avoid the inability to determine the order in which multiple data to be converted are detected, and provides an effective way to determine the order in which the data to be converted are detected.

可以理解的是,由于不同协议数据的解析方式不同,所以进行步骤S20,通过对不同协议数据采用不同的解析方式,实现了对不同协议数据进行解析的效果。It is understandable that, since different protocol data are parsed in different ways, step S20 is performed to achieve the effect of parsing different protocol data by adopting different parsing ways for different protocol data.

在一种可行的实施方式中,步骤S20可以包括步骤S21~S23:In a feasible implementation, step S20 may include steps S21 to S23:

步骤S21,检测接收所述待转换数据所调用接口的接口类型,并基于所述接口类型确定所述待转换数据的候选实际协议类型;Step S21, detecting the interface type of the interface called by receiving the data to be converted, and determining a candidate actual protocol type of the data to be converted based on the interface type;

需要说明的是,候选实际协议类型是指仅通过接收数据所调用接口的接口类型,所初步判断的待转换数据的协议类型。It should be noted that the candidate actual protocol type refers to the protocol type of the data to be converted preliminarily determined only by the interface type of the interface called by the received data.

步骤S22,提取所述待转换数据中头部信息的协议字段,并通过将所述协议字段与多个预设字段进行匹配,确定所述待转换数据的校验实际协议类型;Step S22, extracting the protocol field of the header information in the data to be converted, and determining the actual verification protocol type of the data to be converted by matching the protocol field with a plurality of preset fields;

需要说明的是,协议字段是指标识待转换数据所使用的协议类型的字段,预设字段是指应用层中预先配置的字段,校验实际协议类型是指用于对候选实际协议类型进行准确性验证的协议类型。It should be noted that the protocol field refers to a field that identifies the protocol type used by the data to be converted, the preset field refers to a field pre-configured in the application layer, and the actual protocol type verification refers to a protocol type used to verify the accuracy of the candidate actual protocol type.

另外地,需要说明的是,预设字段可以是基于现有协议字段所预先配置的,也可以是用户自定义的字段,本实施方式中对预设字段的获取方式并不作具体限定。In addition, it should be noted that the preset field may be pre-configured based on an existing protocol field, or may be a user-defined field. In this implementation, the method for obtaining the preset field is not specifically limited.

可以理解的是,由于仅通过接收待转换数据所调用接口的接口类型,来判断待转换数据的实际协议类型,可能会存在判断得到的实际协议类型不准确的问题,所以进行步骤S22,通过对待转换数据的协议字段进行识别,以对根据接口类型确定的协议类型进行校验,提供了识别数据协议类型的准确性。It is understandable that since the actual protocol type of the data to be converted is determined only by receiving the interface type of the interface called by the data to be converted, there may be a problem of inaccurate actual protocol type. Therefore, step S22 is performed to identify the protocol field of the data to be converted to verify the protocol type determined according to the interface type, thereby providing accuracy in identifying the data protocol type.

示例性地,提取待转换数据在头部信息中记载的协议信息,并将该协议信息与预设检测函数中配置的协议信息进行匹配,将与该协议信息相匹配的应用层中预设检测函数所配置的协议信息,确定为该待转换数据的实际协议类型。Exemplarily, the protocol information recorded in the header information of the data to be converted is extracted, and the protocol information is matched with the protocol information configured in the preset detection function, and the protocol information configured by the preset detection function in the application layer that matches the protocol information is determined as the actual protocol type of the data to be converted.

步骤S23,在所述候选实际协议类型和所述校验实际协议类型一致的情况下,将所述候选实际协议类型作为所述实际协议类型,并基于所述实际协议类型对所述待转换数据进行标记,得到所述检测结果。Step S23, when the candidate actual protocol type is consistent with the verification actual protocol type, the candidate actual protocol type is used as the actual protocol type, and the to-be-converted data is marked based on the actual protocol type to obtain the detection result.

可以理解的是,由于不同协议数据需要运用不同解析方式进行解析,所以进行步骤S23,通过生成的标记有协议类型的待转换数据,避免了对待转换数据进行解析时无法获知待转换数据的协议类型,从而无法使用准确的解析规则对待转换数据进行解析,实现了提高解析不同协议类型数据的准确性。It can be understood that since different protocol data need to be parsed using different parsing methods, step S23 is performed. By generating data to be converted that is marked with the protocol type, it is avoided that the protocol type of the data to be converted cannot be known when the data to be converted is parsed, and thus the accurate parsing rules cannot be used to parse the data to be converted, thereby improving the accuracy of parsing data of different protocol types.

示例性地,在候选实际协议类型和校验实际协议类型一致的情况下,将该候选实际协议类型作为实际协议类型,并将该实际协议类型标记在待传输数据中,得到检测结果;在候选实际协议类型和校验实际协议类型不一致的情况下,终止待转换数据的协议转换过程,并输出告警提示信号。Exemplarily, when the candidate actual protocol type and the verification actual protocol type are consistent, the candidate actual protocol type is used as the actual protocol type, and the actual protocol type is marked in the data to be transmitted to obtain a detection result; when the candidate actual protocol type and the verification actual protocol type are inconsistent, the protocol conversion process of the data to be converted is terminated, and an alarm prompt signal is output.

本实施方式中,通过识别不同协议类型的数据,以对不同协议类型的数据进行顺利的解析,提高了解析不同协议类型数据的准确性。In this implementation, data of different protocol types are identified so as to be parsed smoothly, thereby improving the accuracy of parsing data of different protocol types.

步骤S30,根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;Step S30, converting the parsed data into target protocol data according to the target protocol type, and outputting the target protocol data;

需要说明的是,目标协议数据是指经过数据协议转换后得到的用户指定协议格式的数据。It should be noted that the target protocol data refers to data in a user-specified protocol format obtained after data protocol conversion.

在一种可行的实施方式中,步骤S30可以包括步骤S31~S33:In a feasible implementation, step S30 may include steps S31 to S33:

步骤S31,根据所述目标协议类型确定转换数据协议所用的预设函数;Step S31, determining a preset function used for converting a data protocol according to the target protocol type;

需要说明的是,预设函数是指预先设定用于执行数据协议转换操作的函数。It should be noted that the preset function refers to a function that is preset to perform a data protocol conversion operation.

示例性地,在用户配置的目标协议类型为PCIe的情况下,执行数据协议转换操作的主函数会调用PCIe的子函数执行转换数据协议;在用户配置的目标协议类型为UART的情况下,执行数据协议转换操作的主函数会调用UART的子函数执行转换数据协议;在用户配置的目标协议类型为USB的情况下,执行数据协议转换操作的主函数会调用USB的子函数执行转换数据协议;在用户配置的目标协议类型为TCP(Transmission Control Protocol,传输控制协议)的情况下,执行数据协议转换操作的主函数会调用TCP的子函数执行转换数据协议;在用户配置的目标协议类型为SATA的情况下,执行数据协议转换操作的主函数会调用SATA的子函数执行转换数据协议;在用户配置的目标协议类型为SPI(SerialPeripheral Interface,串行外设接口)的情况下,执行数据协议转换操作的主函数会调用SPI的子函数执行转换数据协议。Exemplarily, when the target protocol type configured by the user is PCIe, the main function that performs the data protocol conversion operation will call the sub-function of PCIe to convert the data protocol; when the target protocol type configured by the user is UART, the main function that performs the data protocol conversion operation will call the sub-function of UART to convert the data protocol; when the target protocol type configured by the user is USB, the main function that performs the data protocol conversion operation will call the sub-function of USB to convert the data protocol; when the target protocol type configured by the user is TCP (Transmission Control Protocol), the main function that performs the data protocol conversion operation will call the sub-function of TCP to convert the data protocol; when the target protocol type configured by the user is SATA, the main function that performs the data protocol conversion operation will call the sub-function of SATA to convert the data protocol; when the target protocol type configured by the user is SPI (Serial Peripheral Interface), the main function that performs the data protocol conversion operation will call the sub-function of SPI to convert the data protocol.

步骤S32,基于所述预设函数将所述解析数据转换为所述目标协议数据,并根据所述预设函数确定输出所述目标协议数据的输出接口;Step S32, converting the parsed data into the target protocol data based on the preset function, and determining an output interface for outputting the target protocol data according to the preset function;

需要说明的是,输出接口是指用于支持输出特定协议格式数据的物理接口。It should be noted that the output interface refers to a physical interface used to support the output of data in a specific protocol format.

另外地,需要说明的是,由于可以同时调用多个不同的预设函数,在不同的解析单元中进行协议格式的转换,所以将解析数据转换为目标协议数据,是可以将不同实际协议类型的解析数据,同时在不同的解析单元中通过与所述实际协议类型对应的预设函数进行协议格式的转换。In addition, it should be noted that since multiple different preset functions can be called at the same time to perform protocol format conversion in different parsing units, the parsed data can be converted into target protocol data. It is possible to convert parsed data of different actual protocol types and perform protocol format conversion in different parsing units through preset functions corresponding to the actual protocol types.

示例性地,在用户配置的目标协议类型为PCIe的情况下,调用PCIe的子函数将解析数据转换为PCIe协议数据,并根据PCIe的子函数确定输出PCIe协议数据的接口为PCIe接口;在用户配置的目标协议类型为UART的情况下,调用UART的子函数将解析数据转换为UART协议数据,并根据UART的子函数确定输出UART协议数据的接口为UART接口;在用户配置的目标协议类型为USB的情况下,调用USB的子函数将解析数据转换为USB协议数据,并根据USB的子函数确定输出USB协议数据的接口为USB接口;在用户配置的目标协议类型为TCP的情况下,调用TCP的子函数将解析数据转换为TCP协议数据,并根据TCP的子函数确定输出TCP协议数据的接口为TCP接口;在用户配置的目标协议类型为SATA的情况下,调用SATA的子函数将解析数据转换为SATA协议数据,并根据SATA的子函数确定输出SATA协议数据的接口为SATA接口;在用户配置的目标协议类型为SPI的情况下,调用SPI的子函数将解析数据转换为SPI协议数据,并根据SPI的子函数确定输出SPI协议数据的接口为SPI接口。Exemplarily, when the target protocol type configured by the user is PCIe, the sub-function of PCIe is called to convert the parsed data into PCIe protocol data, and the interface for outputting the PCIe protocol data is determined to be the PCIe interface according to the sub-function of PCIe; when the target protocol type configured by the user is UART, the sub-function of UART is called to convert the parsed data into UART protocol data, and the interface for outputting the UART protocol data is determined to be the UART interface according to the sub-function of UART; when the target protocol type configured by the user is USB, the sub-function of USB is called to convert the parsed data into USB protocol data, and the interface for outputting the USB protocol data is determined to be the USB interface according to the sub-function of USB. USB interface; when the target protocol type configured by the user is TCP, the TCP sub-function is called to convert the parsed data into TCP protocol data, and the interface for outputting the TCP protocol data is determined to be the TCP interface according to the TCP sub-function; when the target protocol type configured by the user is SATA, the SATA sub-function is called to convert the parsed data into SATA protocol data, and the interface for outputting the SATA protocol data is determined to be the SATA interface according to the SATA sub-function; when the target protocol type configured by the user is SPI, the SPI sub-function is called to convert the parsed data into SPI protocol data, and the interface for outputting the SPI protocol data is determined to be the SPI interface according to the SPI sub-function.

步骤S33,通过所述输出接口输出所述目标协议数据。Step S33: output the target protocol data through the output interface.

本实施方式中,通过对确定转换数据协议所用的函数以及输出数据所用的输出接口,实现将不同协议类型的数据进行顺利的转换以及输出的效果。In this implementation, by determining the function used to convert the data protocol and the output interface used to output the data, the effect of smoothly converting and outputting data of different protocol types is achieved.

步骤S40,基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。Step S40: adjusting the output rate of the target protocol data based on the actual protocol type and the target protocol type.

需要说明的是,输出速率是指目标协议数据通过输出接口进行输出的速率。It should be noted that the output rate refers to the rate at which the target protocol data is output through the output interface.

可以理解的是,由于不同接口设备所需求的数据协议格式不同,而不同协议格式数据的传输速率也不同,所以进行步骤S40,通过对目标协议数据输出速率的调整,实现了将转换协议后的输出数据调整至更高的传输速率。It is understandable that, since different interface devices require different data protocol formats and different protocol format data transmission rates are also different, step S40 is performed to adjust the output rate of the target protocol data to achieve the adjustment of the output data after the conversion protocol to a higher transmission rate.

在一种可行的实施方式中,所述目标协议数据的输出速率由PID控制器进行控制,步骤S40可以包括步骤S41~S43:In a feasible implementation manner, the output rate of the target protocol data is controlled by a PID controller, and step S40 may include steps S41 to S43:

步骤S41,基于所述实际协议类型和所述目标协议类型,确定所述PID控制器的控制参数;Step S41, determining control parameters of the PID controller based on the actual protocol type and the target protocol type;

需要说明的是,PID控制器是指控制目标协议数据进行输出的输出速率的器件,控制参数是指控制器中配置用于改变PID控制器控制输出速率程度的参数。It should be noted that the PID controller refers to a device that controls the output rate of the target protocol data, and the control parameter refers to a parameter configured in the controller to change the degree of control of the output rate of the PID controller.

步骤S42,基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量;Step S42, determining an adjustment amount of the control parameter based on the control parameter and the analysis data;

需要说明的是,调整量是指对控制参数进行调整的量值。It should be noted that the adjustment amount refers to the value of the adjustment of the control parameter.

在一种可行的实施方式中,步骤S42可以包括步骤S421~S422:In a feasible implementation, step S42 may include steps S421 to S422:

步骤S421,基于所述控制参数和所述解析数据进行建模,得到PID控制模型;Step S421, modeling based on the control parameters and the analytical data to obtain a PID control model;

需要说明的是,系统模型是指用于表示数据状态的数学模型。It should be noted that the system model refers to a mathematical model used to represent the data state.

示例性地,基于TDC(Time Delay Controller,时间延迟控制器)理论和MRAC(Model Reference Adaptive Control,模型参考自适应控制)方法对解析数据进行建模,得到二阶被控系统模型的传递函数:Exemplarily, the analytical data is modeled based on the TDC (Time Delay Controller) theory and the MRAC (Model Reference Adaptive Control) method to obtain the transfer function of the second-order controlled system model:

其中,b为与系统的惯性或动态响应有关的系数,a1代表系统阻尼或某些内部阻力因素,a2代表系统阻尼或某些内部阻力因素。Among them, b is a coefficient related to the inertia or dynamic response of the system, a1 represents the system damping or some internal resistance factors, and a2 represents the system damping or some internal resistance factors.

该二阶被控系统模型能够处理系统模型阶次、参数和输入信号方面的非预知变化,从而确保系统的稳定和高效运行,再将该二阶被控系统模型与PID控制器:The second-order controlled system model can handle unpredictable changes in system model order, parameters and input signals, thereby ensuring the stable and efficient operation of the system. The second-order controlled system model is then combined with the PID controller:

组成闭环反馈控制系统,即PID控制模型的传递函数:The transfer function of the closed-loop feedback control system, namely the PID control model, is:

即完成PID控制模型的建立。That completes the establishment of the PID control model.

步骤S422,获取所述PID控制模型中的误差值,并基于所述误差值确定所述调整量。Step S422, obtaining an error value in the PID control model, and determining the adjustment amount based on the error value.

需要说明的是,误差值是指PID控制模型中用于表示设定值和测量值之间误差的数值。It should be noted that the error value refers to the numerical value used to represent the error between the set value and the measured value in the PID control model.

示例性地,在基于TDC理论和MRAC方法建立的二阶被控系统模型,与PID控制器组成闭环反馈控制系统,即PID控制模型中,基于该闭环反馈控制系统的闭环传递函数所确定的PID控制模型的输出:Exemplarily, in a second-order controlled system model established based on TDC theory and MRAC method, a closed-loop feedback control system is formed with a PID controller, i.e., a PID control model. The output of the PID control model determined based on the closed-loop transfer function of the closed-loop feedback control system is:

其中,r(t)表示模型输出的设定值。Among them, r(t) represents the set value of the model output.

将该PID控制模型的输出减去该二阶被控系统模型的参考模型的输出:The output of the reference model of the second-order controlled system model is subtracted from the output of the PID control model:

ε(t)=yp(t)-ym(t)ε(t)= yp (t) -ym (t)

得到该闭环反馈控制系统的广义误差值ε(t),即误差值。其中参考模型的输出为:The generalized error value ε(t) of the closed-loop feedback control system is obtained, that is, the error value. The output of the reference model is:

其中,bm1与参考模型的动态特性有关,bm2与参考模型的一阶动态或阻尼有关,bm3与参考模型的静态增益有关,am1与参考模型的二阶动态特性有关,am2与参考模型的二阶阻尼或频率特性有关,am1与参考模型的静态误差或其他特性有关,r(t)表示模型输出的设定值。Among them, b m1 is related to the dynamic characteristics of the reference model, b m2 is related to the first-order dynamics or damping of the reference model, b m3 is related to the static gain of the reference model, a m1 is related to the second-order dynamic characteristics of the reference model, a m2 is related to the second-order damping or frequency characteristics of the reference model, a m1 is related to the static error or other characteristics of the reference model, and r(t) represents the set value of the model output.

基于该广义误差值得到性能指标函数:Based on the generalized error value, the performance index function is obtained:

通过梯度下降算法处理该性能指标函数,以确定调整控制参数的调整量。The performance indicator function is processed by a gradient descent algorithm to determine an adjustment amount for adjusting the control parameter.

本实施方式中,通过对控制参数和解析数据进行数学建模,以通过该模型确定调整控制参数的调整量,实现了为调整控制器参数提供准确的调整依据的效果。In this implementation, mathematical modeling is performed on the control parameters and analytical data, and the adjustment amount of the control parameters is determined through the model, thereby achieving the effect of providing an accurate adjustment basis for adjusting the controller parameters.

步骤S43,根据所述调整量对所述控制参数进行调整,得到目标控制参数,以通过配置有所述目标控制参数的所述控制器调整所述输出速率。Step S43: adjusting the control parameter according to the adjustment amount to obtain a target control parameter, so as to adjust the output rate through the controller configured with the target control parameter.

需要说明的是,目标控制参数是指能够将目标协议数据调整至满足输出数据的传输速率要求的控制器参数。It should be noted that the target control parameter refers to a controller parameter that can adjust the target protocol data to meet the transmission rate requirement of the output data.

在一种可行的实施方式中,所述调整量包括第一调整量和第二调整量,所述控制参数包括比例增益系数和积分增益系数,所述目标控制参数包括目标比例增益系数和目标积分增益系数;In a feasible implementation manner, the adjustment amount includes a first adjustment amount and a second adjustment amount, the control parameter includes a proportional gain coefficient and an integral gain coefficient, and the target control parameter includes a target proportional gain coefficient and a target integral gain coefficient;

需要说明的是,比例增益系数是指PID控制器的比例增益系数,该比例增益系数决定了控制器输出与误差,即实际输出与设定值之间的差成正比的程度;积分增益系数是指PID控制器的积分增益系数,该积分增益系数决定了控制器输出与误差的积分成正比的程度。It should be noted that the proportional gain coefficient refers to the proportional gain coefficient of the PID controller, which determines the degree to which the controller output is proportional to the error, that is, the difference between the actual output and the set value; the integral gain coefficient refers to the integral gain coefficient of the PID controller, which determines the degree to which the controller output is proportional to the integral of the error.

步骤S43中所述根据所述调整量对所述控制参数进行调整,得到目标控制参数的步骤可以包括步骤S431~S434:The step of adjusting the control parameter according to the adjustment amount to obtain the target control parameter in step S43 may include steps S431 to S434:

步骤S431,根据所述第一调整量对所述比例增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第一反馈状况;Step S431, adjusting the proportional gain coefficient according to the first adjustment amount, and monitoring a first feedback condition generated during the output of the target protocol data;

需要说明的是,第一反馈状况是指仅在比例增益系数被调整时生成的反馈状况,该反馈状况用于表示输出过程中的目标协议数据是否合格。It should be noted that the first feedback status refers to a feedback status generated only when the proportional gain coefficient is adjusted, and the feedback status is used to indicate whether the target protocol data in the output process is qualified.

示例性地,在PID控制器的比例增益系数的基础上增大第一调整量,并监测在目标协议数据的输出过程中生成的反馈状况,例如输出的目标协议数据是否存在丢包的情况。Exemplarily, the first adjustment amount is increased based on the proportional gain coefficient of the PID controller, and a feedback condition generated during the output of the target protocol data is monitored, such as whether there is packet loss in the output target protocol data.

步骤S432,在所述第一反馈状况中未出现错误反馈的情况下,返回执行所述根据所述第一调整量对所述比例增益系数进行调整的步骤;在所述第一反馈状况中出现错误反馈的情况下,根据预设修正量对所述第一调整量进行修正,并基于修正后的第一调整量对所述比例增益系数进行调整,得到所述目标比例增益系数;Step S432, when no error feedback occurs in the first feedback condition, returning to the step of adjusting the proportional gain coefficient according to the first adjustment amount; when error feedback occurs in the first feedback condition, correcting the first adjustment amount according to a preset correction amount, and adjusting the proportional gain coefficient based on the corrected first adjustment amount to obtain the target proportional gain coefficient;

需要说明的是,预设修正量是指预先设定对第一调整量进行修正的量值。It should be noted that the preset correction amount refers to a pre-set value for correcting the first adjustment amount.

示例性地,在第一反馈状况中未出现错误反馈的情况下,继续在PID控制器的比例增益系数上增大第一调整量;在第一反馈状况中出现错误反馈的情况下,在第一调整量的基础上减小预设修正量,并在当前比例增益系数上的基础上减小该减小后的第一调整量,得到目标比例增益系数。Exemplarily, when no erroneous feedback occurs in the first feedback condition, the first adjustment amount continues to be increased on the proportional gain coefficient of the PID controller; when erroneous feedback occurs in the first feedback condition, the preset correction amount is reduced on the basis of the first adjustment amount, and the reduced first adjustment amount is reduced on the basis of the current proportional gain coefficient to obtain the target proportional gain coefficient.

步骤S433,根据所述第二调整量对所述积分增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第二反馈状况;Step S433, adjusting the integral gain coefficient according to the second adjustment amount, and monitoring a second feedback condition generated during the output of the target protocol data;

需要说明的是,第二反馈情况是指在积分增益系数开始变动时生成的反馈状况,该反馈状况用于表示输出过程中的目标协议数据是否合格。It should be noted that the second feedback condition refers to the feedback condition generated when the integral gain coefficient starts to change, and the feedback condition is used to indicate whether the target protocol data in the output process is qualified.

示例性地,在PID控制器的积分增益系数的基础上增大第二调整量,并监测在目标协议数据的输出过程中生成的反馈状况,例如输出的目标协议数据是否存在丢包的情况。Exemplarily, the second adjustment amount is increased based on the integral gain coefficient of the PID controller, and the feedback condition generated during the output of the target protocol data is monitored, such as whether there is packet loss in the output target protocol data.

步骤S434,在所述第二反馈状况中出现错误反馈的情况下,返回执行根据所述第二调整量对所述积分增益系数进行调整的步骤;在所述第二反馈状况中未出现错误反馈的情况下,得到所述目标积分增益系数。Step S434, when error feedback occurs in the second feedback condition, return to the step of adjusting the integral gain coefficient according to the second adjustment amount; when no error feedback occurs in the second feedback condition, obtain the target integral gain coefficient.

示例性地,在第二反馈状况中出现错误反馈的情况下,继续在PID控制器的积分增益系数上增大第二调整量;在第二反馈状况中未出现错误反馈的情况下,将当前的积分增益系数作为目标积分增益系数。Exemplarily, when false feedback occurs in the second feedback condition, the second adjustment amount continues to be increased on the integral gain coefficient of the PID controller; when no false feedback occurs in the second feedback condition, the current integral gain coefficient is used as the target integral gain coefficient.

示例性地,为了助于理解本实施例调整控制参数的实现过程,请参照表1:For example, to help understand the implementation process of adjusting the control parameters in this embodiment, please refer to Table 1:

初始值/MbInitial value/Mb Kp参数Kp parameter Ki参数Ki parameter 错误反馈Error feedback 输出结果/MbOutput result/Mb 1010 0.0500.050 0.000.00 00 2020 1010 0.0600.060 0.000.00 00 6060 1010 0.0800.080 0.000.00 0.030.03 110110 1010 0.0750.075 0.100.10 0.010.01 105105 1010 0.0750.075 0.150.15 0.000.00 103103

表1Table 1

表1中以目标协议类型为TCP协议为例,该目标协议数据的输出速率初始值为每秒传输10Mb字节数,而控制该目标协议数据进行输出的PID控制器的Kp参数和Ki参数,即比例增益系数和积分增益系数分别为0.05和0,在此参数配置下的PID控制器控制该目标协议数据进行输出的输出速率为每秒传输20Mb字节数,且产生的错误反馈为0,即未出现错误反馈。因此基于第一调整量对Kp参数进行不断调整,直至在错误反馈为0.03,即第一反馈状况中出现错误反馈的情况下,根据预设修正量0.005对第一调整量进行修正,并在当前Kp参数0.08上的基础上减小该减小后的第一调整量,得到目标Kp参数0.075。然后根据第二调整量对Ki参数进行调整,通过在当前配置的Ki参数0的基础上增大第二调整量得到0.1,通过配置Kp参数为0.075,Ki参数为0.1的PID控制器控制该目标协议数据进行输出的速率为每秒传105Mb字节数,且产生的错误反馈为0.01,即第二反馈状况中出现错误反馈的情况下,基于第二调整量对Ki参数进行不断调整,直至错误反馈为0,即第二反馈状况中未出现错误反馈,得到目标Ki参数0.15。In Table 1, the target protocol type is TCP protocol as an example. The initial value of the output rate of the target protocol data is 10Mb bytes per second, and the Kp parameter and Ki parameter of the PID controller that controls the output of the target protocol data, that is, the proportional gain coefficient and the integral gain coefficient are 0.05 and 0 respectively. The output rate of the PID controller under this parameter configuration controls the output of the target protocol data to be 20Mb bytes per second, and the error feedback generated is 0, that is, no error feedback occurs. Therefore, the Kp parameter is continuously adjusted based on the first adjustment amount until the error feedback is 0.03, that is, when error feedback occurs in the first feedback condition, the first adjustment amount is corrected according to the preset correction amount 0.005, and the reduced first adjustment amount is reduced on the basis of the current Kp parameter 0.08, and the target Kp parameter 0.075 is obtained. Then, the Ki parameter is adjusted according to the second adjustment amount, and the second adjustment amount is increased to 0.1 based on the currently configured Ki parameter 0. By configuring the Kp parameter to be 0.075, the PID controller with the Ki parameter of 0.1 controls the target protocol data to output at a rate of 105 Mb bytes per second, and the error feedback generated is 0.01, that is, when error feedback occurs in the second feedback condition, the Ki parameter is continuously adjusted based on the second adjustment amount until the error feedback is 0, that is, no error feedback occurs in the second feedback condition, and the target Ki parameter is 0.15.

本实施方式中,仅通过对PID控制器的比例增益系数和积分增益系数进行调整,得到目标控制参数,从而通过配置有目标控制参数的控制器控制目标协议数据进行输出,实现了缩短将目标协议数据调整至更高输出速率所消耗时长的效果。In this embodiment, the target control parameters are obtained only by adjusting the proportional gain coefficient and the integral gain coefficient of the PID controller, so that the target protocol data is controlled and outputted through the controller configured with the target control parameters, thereby achieving the effect of shortening the time consumed to adjust the target protocol data to a higher output rate.

在一种可行的实施方式中,步骤S43之后还可以包括步骤S401:In a feasible implementation manner, step S43 may further include step S401:

步骤S401,记录所述目标控制参数,以在检测到复现实际协议类型和复现目标协议类型,与所述目标控制参数对应的实际协议类型和目标协议类型一致的情况下,基于所述目标控制参数对所述控制参数进行更新,其中,所述复现实际协议类型和复现目标协议类型为,在调整所述目标协议数据的输出速率后,检测到待转换数据中重复出现的实际协议类型和目标协议类型。Step S401, recording the target control parameter, so as to update the control parameter based on the target control parameter when the actual protocol type and the target protocol type are detected to be reproduced, and the actual protocol type and the target protocol type corresponding to the target control parameter are consistent, wherein the reproduced actual protocol type and the reproduced target protocol type are, after adjusting the output rate of the target protocol data, the actual protocol type and the target protocol type that are repeatedly detected in the data to be converted.

可以理解的是,由于不同接口设备对于具有相同实际协议类型和目标协议类型的数据所需求的数据传输速率是一致,所以进行步骤S401,避免了对具有相同实际协议类型和目标协议类型的待转换数据,进行重复的目标控制参数确定,提高了对不同协议类型的数据转换为传输速率更高的指定协议数据的转换速率。It can be understood that since the data transmission rates required by different interface devices for data with the same actual protocol type and target protocol type are consistent, step S401 is performed to avoid repeated target control parameter determination for data to be converted with the same actual protocol type and target protocol type, thereby improving the conversion rate of data of different protocol types into designated protocol data with a higher transmission rate.

本实施例中提出了一种数据协议转换方法,通过对不同协议类型的数据进行检测和解析,将不同协议类型的数据转换为目标协议数据,并通过调整目标协议数据的输出速率,以满足不同接口设备所要求的数据传输速率,实现了将不同协议类型的数据转换为传输速率更高的指定协议数据的效果。In this embodiment, a data protocol conversion method is proposed. By detecting and parsing data of different protocol types, the data of different protocol types are converted into target protocol data, and the output rate of the target protocol data is adjusted to meet the data transmission rate required by different interface devices, thereby achieving the effect of converting data of different protocol types into designated protocol data with a higher transmission rate.

基于本申请第一实施例,在本申请第二种实施例中,与上述实施例一相同或相似的内容,可以参考上文介绍,后续不再赘述。在此基础上,请参照图2,图2为本申请数据协议转换方法第二实施例的流程示意图,所述数据协议转换方法还包括步骤S100~S200:Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated later. On this basis, please refer to Figure 2, which is a flow chart of the second embodiment of the data protocol conversion method of the present application, and the data protocol conversion method also includes steps S100 to S200:

步骤S100,对所述待转换数据进行编号,得到编号数据,并监测所述待转换数据在数据协议转换过程中的转换进度;Step S100, numbering the data to be converted to obtain numbered data, and monitoring the conversion progress of the data to be converted during the data protocol conversion process;

需要说明的是,编号数据是指将待转换数据进行具象化后得到的数据,转换进度是指待转换数据在数据协议转换过程中已转换的数据量和剩余未转换的数据量。It should be noted that the numbered data refers to the data obtained after the data to be converted is visualized, and the conversion progress refers to the amount of data that has been converted and the amount of data that remains unconverted during the data protocol conversion process.

可以理解的是,由于对待转换数据进行协议转换时要求用户能够获知具体数据的转换进度,以在协议转换过程出现异常时能够及时介入进行干涉,所以进行步骤S100,为用户能够准确获知待转换数据的转换进度提供了可靠的数据基础。It is understandable that since the user is required to know the conversion progress of the specific data when performing protocol conversion on the data to be converted so as to be able to intervene in time when an abnormality occurs in the protocol conversion process, step S100 is performed to provide a reliable data basis for the user to accurately know the conversion progress of the data to be converted.

步骤S200,将所述编号数据和所述转换进度关联输出。Step S200, outputting the serial number data and the conversion progress in association with each other.

本实施例中,通过将待转换数据的转换进度进行输出,实现了使用户能够准确获知数据在协议转换过程的具体进度。In this embodiment, by outputting the conversion progress of the data to be converted, the user can accurately know the specific progress of the data in the protocol conversion process.

示例性地,为了助于理解本实施例结合上述实施例一后所得到的数据协议转换方法的实现流程,请参照图3,图3提供了一种数据协议转换方法所应用多种接口转换系统的系统框图,具体地:Exemplarily, in order to help understand the implementation process of the data protocol conversion method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3, which provides a system block diagram of multiple interface conversion systems used in the data protocol conversion method, specifically:

在FPGA(Field Programmable Gate Array,现场可编程门阵列)中配置有接口部分,该接口部分存在接口类型有HDMI接口、USB接口、PCIe接口、URAT接口、NETWORK接口、SATA接口和WiFi接口,控制部分中配置有FPGA和ARM,其中FPGA与ARM通过CONTROL_SIGNAL,即控制信号进行通信,ARM与SRAM,即静态随机存取存储器进行数据通信,另通过POWER_CONTROL,即电源控制部分为系统进行电源供给管控。An interface part is configured in the FPGA (Field Programmable Gate Array), and the interface types in the interface part include HDMI interface, USB interface, PCIe interface, URAT interface, NETWORK interface, SATA interface and WiFi interface. The control part is configured with FPGA and ARM, wherein FPGA and ARM communicate through CONTROL_SIGNAL, i.e., control signal, and ARM communicates data with SRAM, i.e., static random access memory. In addition, POWER_CONTROL, i.e., the power control part, is used to control the power supply for the system.

进一步地,请参照图4,图4提供了一种数据协议转换方法中数据通信的场景示意图,具体地:Further, please refer to FIG. 4 , which provides a schematic diagram of a scenario of data communication in a data protocol conversion method, specifically:

图4中表示上述FPGA与ARM进行通信的过程,其中Addr1---Addr8为地址线的标识,用于在微控制器或处理器与存储器等其他组件之间传输地址信息;D0---D15代表数据线,用于在微控制器和外部设备之间传输数据。每个“D”后面跟随的数字表示数据线的编号,总共有16条数据线,这意味着数据宽度是16位;nGS5表示控制信号,用于禁用(当信号为高电平时)或启用(当信号为低电平时)与FPGA中的功能;nOE是输出使能的负逻辑信号,用于控制数据输出的使能与否;nWE是写使能的负逻辑信号,用于控制数据写入操作的使能;EINT0是错误中断的输出信号,用于指示发生了某种错误,并可能请求ARM处理器进行中断处理。FIG4 shows the process of the above-mentioned FPGA communicating with ARM, where Addr1-Addr8 are the identifiers of the address lines, which are used to transmit address information between the microcontroller or processor and other components such as memory; D0-D15 represent data lines, which are used to transmit data between the microcontroller and external devices. The number following each "D" represents the number of the data line, and there are 16 data lines in total, which means that the data width is 16 bits; nGS5 represents a control signal, which is used to disable (when the signal is high) or enable (when the signal is low) the function in the FPGA; nOE is the negative logic signal of output enable, which is used to control whether the data output is enabled or not; nWE is the negative logic signal of write enable, which is used to control the enablement of data write operation; EINT0 is the output signal of error interrupt, which is used to indicate that some error has occurred and may request the ARM processor to interrupt processing.

进一步地,请参照图5,图5提供了一种数据协议转换方法的简要流程示意图,具体地:Further, please refer to FIG. 5 , which provides a brief flow chart of a data protocol conversion method, specifically:

通过ARM(Advanced RISC Machine,高级精简指令集机器)接收用户配置的协议转换类型,即目标协议类型,并将配置的协议转换类型通过FPGA与ARM通信模块传输至FPGA模块。FPGA会根据ARM配置的输出协议类型,即目标协议类型启动输入协议自适应检测模块,该自适应协议检测模块包括USB检测模块、PCIe检测模块、URAT检测模块、SATA检测模块、SPI检测模块、网口检测模块、IO检测模块和I2C检测模块,通过上述自适应协议检测模块对待转换数据进行协议格式检测,以将协议格式已知的待转换数据输入至数据处理模块进行解析和转换,得到目标协议数据。再将该目标协议数据通过自适应传输速率配置模块进行输出速率的调整,以适配不同接口设备所需求的数据传输速率。最后将适配完成输出速率的目标协议数据通过数据输出模块进行输出。The protocol conversion type configured by the user, i.e., the target protocol type, is received through ARM (Advanced RISC Machine, Advanced Reduced Instruction Set Machine), and the configured protocol conversion type is transmitted to the FPGA module through the FPGA and ARM communication modules. FPGA will start the input protocol adaptive detection module according to the output protocol type configured by ARM, i.e., the target protocol type. The adaptive protocol detection module includes a USB detection module, a PCIe detection module, a URAT detection module, a SATA detection module, an SPI detection module, a network port detection module, an IO detection module, and an I2C detection module. The protocol format detection is performed on the data to be converted through the above-mentioned adaptive protocol detection module, so that the data to be converted with known protocol format is input into the data processing module for parsing and conversion to obtain the target protocol data. Then the target protocol data is adjusted for the output rate through the adaptive transmission rate configuration module to adapt to the data transmission rate required by different interface devices. Finally, the target protocol data with the output rate adapted is output through the data output module.

需要说明的是,上述示例仅用于理解本申请,并不构成对本申请数据协议转换方法的限定,基于此技术构思进行更多形式的简单变换,均在本申请的保护范围内。It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data protocol conversion method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

本申请还提供一种数据协议转换装置,请参照图6,所述数据协议转换装置包括:The present application also provides a data protocol conversion device, please refer to FIG6, the data protocol conversion device includes:

接收模块10,用于接收待转换数据和所述待转换数据的目标协议类型;A receiving module 10 is used to receive data to be converted and a target protocol type of the data to be converted;

解析模块20,用于检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;The parsing module 20 is used to detect the actual protocol type of the data to be converted, obtain a detection result, and parse the data to be converted based on the detection result to obtain parsed data;

转换模块30,用于根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;A conversion module 30, configured to convert the parsed data into target protocol data according to the target protocol type, and output the target protocol data;

控制模块40,用于基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。The control module 40 is configured to adjust the output rate of the target protocol data based on the actual protocol type and the target protocol type.

可选地,所述目标协议数据的输出速率由PID控制器进行控制,所述控制模块40还用于:Optionally, the output rate of the target protocol data is controlled by a PID controller, and the control module 40 is further used for:

基于所述实际协议类型和所述目标协议类型,确定所述PID控制器的控制参数;Determining control parameters of the PID controller based on the actual protocol type and the target protocol type;

基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量;Based on the control parameter and the analysis data, determining an adjustment amount of the control parameter;

根据所述调整量对所述控制参数进行调整,得到目标控制参数,以通过配置有所述目标控制参数的所述控制器调整所述输出速率。The control parameter is adjusted according to the adjustment amount to obtain a target control parameter, so as to adjust the output rate through the controller configured with the target control parameter.

可选地,所述控制模块40还用于:Optionally, the control module 40 is further configured to:

基于所述控制参数和所述解析数据进行建模,得到PID控制模型;Modeling is performed based on the control parameters and the analytical data to obtain a PID control model;

获取所述PID控制模型中的误差值,并基于所述误差值确定所述调整量。An error value in the PID control model is obtained, and the adjustment amount is determined based on the error value.

可选地,所述调整量包括第一调整量和第二调整量,所述控制参数包括比例增益系数和积分增益系数,所述目标控制参数包括目标比例增益系数和目标积分增益系数;Optionally, the adjustment amount includes a first adjustment amount and a second adjustment amount, the control parameter includes a proportional gain coefficient and an integral gain coefficient, and the target control parameter includes a target proportional gain coefficient and a target integral gain coefficient;

所述控制模块40还用于:The control module 40 is also used for:

根据所述第一调整量对所述第一控制参数进行调整,并监测在所述目标协议数据的输出过程中生成的第一反馈状况;adjusting the first control parameter according to the first adjustment amount, and monitoring a first feedback condition generated during the output of the target protocol data;

根据所述第一调整量对所述比例增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第一反馈状况;adjusting the proportional gain coefficient according to the first adjustment amount, and monitoring a first feedback condition generated during the output of the target protocol data;

在所述第一反馈状况中未出现错误反馈的情况下,返回执行所述根据所述第一调整量对所述比例增益系数进行调整的步骤;在所述第一反馈状况中出现错误反馈的情况下,根据预设修正量对所述第一调整量进行修正,并基于修正后的第一调整量对所述比例增益系数进行调整,得到所述目标比例增益系数;In the case where no error feedback occurs in the first feedback condition, returning to the step of adjusting the proportional gain coefficient according to the first adjustment amount; in the case where error feedback occurs in the first feedback condition, correcting the first adjustment amount according to a preset correction amount, and adjusting the proportional gain coefficient based on the corrected first adjustment amount to obtain the target proportional gain coefficient;

根据所述第二调整量对所述积分增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第二反馈状况;adjusting the integral gain coefficient according to the second adjustment amount, and monitoring a second feedback condition generated during the output of the target protocol data;

在所述第二反馈状况中出现错误反馈的情况下,返回执行根据所述第二调整量对所述积分增益系数进行调整的步骤;在所述第二反馈状况中未出现错误反馈的情况下,得到所述目标积分增益系数。In the case where error feedback occurs in the second feedback condition, the step of adjusting the integral gain coefficient according to the second adjustment amount is returned to be executed; in the case where error feedback does not occur in the second feedback condition, the target integral gain coefficient is obtained.

可选地,所述解析模块20还用于:Optionally, the parsing module 20 is further used for:

检测接收所述待转换数据所调用接口的接口类型,并基于所述接口类型确定所述待转换数据的候选实际协议类型;Detecting the interface type of the interface called by receiving the data to be converted, and determining a candidate actual protocol type of the data to be converted based on the interface type;

提取所述待转换数据中头部信息的协议字段,并通过将所述协议字段与多个预设字段进行匹配,确定所述待转换数据的校验实际协议类型;Extracting the protocol field of the header information in the data to be converted, and determining the verification actual protocol type of the data to be converted by matching the protocol field with a plurality of preset fields;

在所述候选实际协议类型和所述校验实际协议类型一致的情况下,将所述候选实际协议类型作为所述实际协议类型,并基于所述实际协议类型对所述待转换数据进行标记,得到所述检测结果。In the case that the candidate actual protocol type is consistent with the verification actual protocol type, the candidate actual protocol type is used as the actual protocol type, and the to-be-converted data is marked based on the actual protocol type to obtain the detection result.

可选地,所述转换模块30还用于:Optionally, the conversion module 30 is further used for:

根据所述目标协议类型确定转换数据协议所用的预设函数;Determining a preset function used for converting a data protocol according to the target protocol type;

基于所述预设函数将所述解析数据转换为所述目标协议数据,并根据所述预设函数确定输出所述目标协议数据的输出接口;Converting the parsed data into the target protocol data based on the preset function, and determining an output interface for outputting the target protocol data according to the preset function;

通过所述输出接口输出所述目标协议数据。The target protocol data is output through the output interface.

可选地,所述数据协议转换装置还用于:Optionally, the data protocol conversion device is further used for:

对所述待转换数据进行编号,得到编号数据,并监测所述待转换数据在数据协议转换过程中的转换进度;Numbering the data to be converted to obtain numbered data, and monitoring the conversion progress of the data to be converted during the data protocol conversion process;

将所述编号数据和所述转换进度关联输出。The numbering data and the conversion progress are associated and outputted.

本申请提供的数据协议转换装置,采用上述实施例中的数据协议转换方法,能够解决如何将不同协议类型的数据转换为传输速率更高的指定协议数据的技术问题。与现有技术相比,本申请提供的数据协议转换装置的有益效果与上述实施例提供的数据协议转换方法的有益效果相同,且所述数据协议转换装置中的其他技术特征与上述实施例方法公开的特征相同,在此不做赘述。The data protocol conversion device provided by the present application adopts the data protocol conversion method in the above embodiment, which can solve the technical problem of how to convert data of different protocol types into designated protocol data with a higher transmission rate. Compared with the prior art, the beneficial effects of the data protocol conversion device provided by the present application are the same as the beneficial effects of the data protocol conversion method provided by the above embodiment, and other technical features in the data protocol conversion device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

本申请提供一种电子设备,电子设备包括:至少一个处理器;以及,与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行上述实施例一中的数据协议转换方法。The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data protocol conversion method in the above-mentioned embodiment 1.

下面参考图7,其示出了适于用来实现本申请实施例的电子设备的结构示意图。本申请实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(Personal Digital Assistant:个人数字助理)、PAD(Portable ApplicationDescription:平板电脑)、PMP(Portable Media Player:便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring to FIG. 7 below, a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application is shown. The electronic device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG. 7 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

如图7所示,电子设备可以包括处理装置1001(例如中央处理器、图形处理器等),其可以根据存储在只读存储器(ROM:Read Only Memory)1002中的程序或者从存储装置1003加载到随机访问存储器(RAM:Random Access Memory)1004中的程序而执行各种适当的动作和处理。在RAM1004中,还存储有电子设备操作所需的各种程序和数据。处理装置1001、ROM1002以及RAM1004通过总线1005彼此相连。输入/输出(I/O)接口1006也连接至总线。通常,以下系统可以连接至I/O接口1006:包括例如触摸屏、触摸板、键盘、鼠标、图像传感器、麦克风、加速度计、陀螺仪等的输入装置1007;包括例如液晶显示器(LCD:LiquidCrystal Display)、扬声器、振动器等的输出装置1008;包括例如磁带、硬盘等的存储装置1003;以及通信装置1009。通信装置1009可以允许电子设备与其他设备进行无线或有线通信以交换数据。虽然图中示出了具有各种系统的电子设备,但是应理解的是,并不要求实施或具备所有示出的系统。可以替代地实施或具备更多或更少的系统。As shown in FIG7 , the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM 1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input/output (I/O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I/O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

特别地,根据本申请公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置从网络上被下载和安装,或者从存储装置1003被安装,或者从ROM1002被安装。在该计算机程序被处理装置1001执行时,执行本申请公开实施例的方法中限定的上述功能。In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

本申请提供的电子设备,采用上述实施例中的数据协议转换方法,能解决如何将不同协议类型的数据转换为传输速率更高的指定协议数据的技术问题。与现有技术相比,本申请提供的电子设备的有益效果与上述实施例提供的数据协议转换方法的有益效果相同,且该电子设备中的其他技术特征与上一实施例方法公开的特征相同,在此不做赘述。The electronic device provided by the present application adopts the data protocol conversion method in the above embodiment, which can solve the technical problem of how to convert data of different protocol types into designated protocol data with a higher transmission rate. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the data protocol conversion method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

应当理解,本申请公开的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式的描述中,具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

本申请提供一种计算机可读存储介质,具有存储在其上的计算机可读程序指令(即计算机程序),计算机可读程序指令用于执行上述实施例中的数据协议转换方法。The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data protocol conversion method in the above-mentioned embodiment.

本申请提供的计算机可读存储介质例如可以是U盘,但不限于电、磁、光、电磁、红外线、或半导体的系统、系统或器件,或者任意以上的组合。计算机可读存储介质的更具体地例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM:Random Access Memory)、只读存储器(ROM:Read Only Memory)、可擦式可编程只读存储器(EPROM:Erasable Programmable Read Only Memory或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM:CD-Read Only Memory)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、系统或者器件使用或者与其结合使用。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(Radio Frequency:射频)等等,或者上述的任意合适的组合。The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

上述计算机可读存储介质可以是电子设备中所包含的;也可以是单独存在,而未装配入电子设备中。The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被电子设备执行时,使得电子设备:接收待转换数据和所述待转换数据的目标协议类型;检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: receives data to be converted and a target protocol type of the data to be converted; detects an actual protocol type of the data to be converted to obtain a detection result, and parses the data to be converted based on the detection result to obtain parsed data; converts the parsed data into target protocol data according to the target protocol type, and outputs the target protocol data; and adjusts the output rate of the target protocol data based on the actual protocol type and the target protocol type.

可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN:Local Area Network)或广域网(WAN:Wide Area Network)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该单元本身的限定。The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

本申请提供的可读存储介质为计算机可读存储介质,所述计算机可读存储介质存储有用于执行上述数据协议转换方法的计算机可读程序指令(即计算机程序),能够解决如何将不同协议类型的数据转换为传输速率更高的指定协议数据的技术问题。与现有技术相比,本申请提供的计算机可读存储介质的有益效果与上述实施例提供的数据协议转换方法的有益效果相同,在此不做赘述。The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data protocol conversion method, and can solve the technical problem of how to convert data of different protocol types into designated protocol data with a higher transmission rate. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the data protocol conversion method provided by the above-mentioned embodiment, and will not be repeated here.

本申请还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述的数据协议转换方法的步骤。The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data protocol conversion method when executed by a processor.

本申请提供的计算机程序产品能够解决如何将不同协议类型的数据转换为传输速率更高的指定协议数据的技术问题。与现有技术相比,本申请提供的计算机程序产品的有益效果与上述实施例提供的数据协议转换方法的有益效果相同,在此不做赘述。The computer program product provided by the present application can solve the technical problem of how to convert data of different protocol types into data of a specified protocol with a higher transmission rate. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the data protocol conversion method provided by the above embodiment, and will not be repeated here.

以上所述仅为本申请的部分实施例,并非因此限制本申请的专利范围,凡是在本申请的技术构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct/indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims (10)

1.一种数据协议转换方法,其特征在于,所述的方法包括:1. A data protocol conversion method, characterized in that the method comprises: 接收待转换数据和所述待转换数据的目标协议类型;Receiving data to be converted and a target protocol type of the data to be converted; 检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;Detecting an actual protocol type of the data to be converted to obtain a detection result, and parsing the data to be converted based on the detection result to obtain parsed data; 根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;Convert the parsed data into target protocol data according to the target protocol type, and output the target protocol data; 基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。Based on the actual protocol type and the target protocol type, an output rate of the target protocol data is adjusted. 2.如权利要求1所述的方法,其特征在于,所述目标协议数据的输出速率由PID控制器进行控制,所述基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率的步骤包括:2. The method according to claim 1, wherein the output rate of the target protocol data is controlled by a PID controller, and the step of adjusting the output rate of the target protocol data based on the actual protocol type and the target protocol type comprises: 基于所述实际协议类型和所述目标协议类型,确定所述PID控制器的控制参数;Determining control parameters of the PID controller based on the actual protocol type and the target protocol type; 基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量;Based on the control parameter and the analysis data, determining an adjustment amount of the control parameter; 根据所述调整量对所述控制参数进行调整,得到目标控制参数,以通过配置有所述目标控制参数的所述控制器调整所述输出速率。The control parameter is adjusted according to the adjustment amount to obtain a target control parameter, so as to adjust the output rate through the controller configured with the target control parameter. 3.如权利要求2所述的方法,其特征在于,所述基于所述控制参数和所述解析数据,确定调整所述控制参数的调整量的步骤包括:3. The method according to claim 2, wherein the step of determining the adjustment amount of the control parameter based on the control parameter and the analytical data comprises: 基于所述控制参数和所述解析数据进行建模,得到PID控制模型;Modeling is performed based on the control parameters and the analytical data to obtain a PID control model; 获取所述PID控制模型中的误差值,并基于所述误差值确定所述调整量。An error value in the PID control model is obtained, and the adjustment amount is determined based on the error value. 4.如权利要求2所述的方法,其特征在于,所述调整量包括第一调整量和第二调整量,所述控制参数包括比例增益系数和积分增益系数,所述目标控制参数包括目标比例增益系数和目标积分增益系数;4. The method according to claim 2, characterized in that the adjustment amount includes a first adjustment amount and a second adjustment amount, the control parameter includes a proportional gain coefficient and an integral gain coefficient, and the target control parameter includes a target proportional gain coefficient and a target integral gain coefficient; 所述根据所述调整量对所述控制参数进行调整,得到目标控制参数的步骤包括:The step of adjusting the control parameter according to the adjustment amount to obtain the target control parameter comprises: 根据所述第一调整量对所述比例增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第一反馈状况;adjusting the proportional gain coefficient according to the first adjustment amount, and monitoring a first feedback condition generated during the output of the target protocol data; 在所述第一反馈状况中未出现错误反馈的情况下,返回执行所述根据所述第一调整量对所述比例增益系数进行调整的步骤;在所述第一反馈状况中出现错误反馈的情况下,根据预设修正量对所述第一调整量进行修正,并基于修正后的第一调整量对所述比例增益系数进行调整,得到所述目标比例增益系数;In the case where no error feedback occurs in the first feedback condition, returning to the step of adjusting the proportional gain coefficient according to the first adjustment amount; in the case where error feedback occurs in the first feedback condition, correcting the first adjustment amount according to a preset correction amount, and adjusting the proportional gain coefficient based on the corrected first adjustment amount to obtain the target proportional gain coefficient; 根据所述第二调整量对所述积分增益系数进行调整,并监测在所述目标协议数据的输出过程中生成的第二反馈状况;adjusting the integral gain coefficient according to the second adjustment amount, and monitoring a second feedback condition generated during the output of the target protocol data; 在所述第二反馈状况中出现错误反馈的情况下,返回执行根据所述第二调整量对所述积分增益系数进行调整的步骤;在所述第二反馈状况中未出现错误反馈的情况下,得到所述目标积分增益系数。In the case where error feedback occurs in the second feedback condition, the step of adjusting the integral gain coefficient according to the second adjustment amount is returned to be executed; in the case where error feedback does not occur in the second feedback condition, the target integral gain coefficient is obtained. 5.如权利要求1所述的方法,其特征在于,所述检测所述待转换数据的实际协议类型,得到检测结果的步骤包括:5. The method according to claim 1, wherein the step of detecting the actual protocol type of the data to be converted and obtaining the detection result comprises: 检测接收所述待转换数据所调用接口的接口类型,并基于所述接口类型确定所述待转换数据的候选实际协议类型;Detecting the interface type of the interface called by receiving the data to be converted, and determining a candidate actual protocol type of the data to be converted based on the interface type; 提取所述待转换数据中头部信息的协议字段,并通过将所述协议字段与多个预设字段进行匹配,确定所述待转换数据的校验实际协议类型;Extracting the protocol field of the header information in the data to be converted, and determining the verification actual protocol type of the data to be converted by matching the protocol field with a plurality of preset fields; 在所述候选实际协议类型和所述校验实际协议类型一致的情况下,将所述候选实际协议类型作为所述实际协议类型,并基于所述实际协议类型对所述待转换数据进行标记,得到所述检测结果。In the case that the candidate actual protocol type is consistent with the verification actual protocol type, the candidate actual protocol type is used as the actual protocol type, and the to-be-converted data is marked based on the actual protocol type to obtain the detection result. 6.如权利要求1所述的方法,其特征在于,所述根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据的步骤包括:6. The method according to claim 1, wherein the step of converting the parsed data into target protocol data according to the target protocol type and outputting the target protocol data comprises: 根据所述目标协议类型确定转换数据协议所用的预设函数;Determining a preset function used for converting a data protocol according to the target protocol type; 基于所述预设函数将所述解析数据转换为所述目标协议数据,并根据所述预设函数确定输出所述目标协议数据的输出接口;Converting the parsed data into the target protocol data based on the preset function, and determining an output interface for outputting the target protocol data according to the preset function; 通过所述输出接口输出所述目标协议数据。The target protocol data is output through the output interface. 7.如权利要求1所述的方法,其特征在于,所述方法还包括:7. The method according to claim 1, characterized in that the method further comprises: 对所述待转换数据进行编号,得到编号数据,并监测所述待转换数据在数据协议转换过程中的转换进度;Numbering the data to be converted to obtain numbered data, and monitoring the conversion progress of the data to be converted during the data protocol conversion process; 将所述编号数据和所述转换进度关联输出。The numbering data and the conversion progress are associated and outputted. 8.一种数据协议转换装置,其特征在于,所述装置包括:8. A data protocol conversion device, characterized in that the device comprises: 接收模块,用于接收待转换数据和所述待转换数据的目标协议类型;A receiving module, used for receiving data to be converted and a target protocol type of the data to be converted; 解析模块,用于检测所述待转换数据的实际协议类型,得到检测结果,并基于所述检测结果对所述待转换数据进行解析,得到解析数据;A parsing module, used for detecting the actual protocol type of the data to be converted, obtaining a detection result, and parsing the data to be converted based on the detection result to obtain parsed data; 转换模块,用于根据所述目标协议类型将所述解析数据转换为目标协议数据,并输出所述目标协议数据;A conversion module, used to convert the parsed data into target protocol data according to the target protocol type, and output the target protocol data; 控制模块,用于基于所述实际协议类型和所述目标协议类型,调整所述目标协议数据的输出速率。A control module is used to adjust the output rate of the target protocol data based on the actual protocol type and the target protocol type. 9.一种电子设备,其特征在于,所述设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序配置为实现如权利要求1至7中任一项所述的数据协议转换方法的步骤。9. An electronic device, characterized in that the device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data protocol conversion method as described in any one of claims 1 to 7. 10.一种存储介质,其特征在于,所述存储介质为计算机可读存储介质,所述存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的数据协议转换方法的步骤。10. A storage medium, characterized in that the storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the data protocol conversion method according to any one of claims 1 to 7 are implemented.
CN202410984394.2A 2024-07-22 2024-07-22 Data protocol conversion method, device, electronic device and storage medium Pending CN118803086A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410984394.2A CN118803086A (en) 2024-07-22 2024-07-22 Data protocol conversion method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410984394.2A CN118803086A (en) 2024-07-22 2024-07-22 Data protocol conversion method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN118803086A true CN118803086A (en) 2024-10-18

Family

ID=93032664

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410984394.2A Pending CN118803086A (en) 2024-07-22 2024-07-22 Data protocol conversion method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN118803086A (en)

Similar Documents

Publication Publication Date Title
US8230128B2 (en) Monitoring host activity using an interrupt
EP3402160B1 (en) Service processing method and apparatus
US20120117429A1 (en) Baseboard management controller and memory error detection method of computing device utilized thereby
US8108365B2 (en) Consistency of a database management system
KR20100104454A (en) Error correcting device, method for error correction thereof and memory device and data processing system including of the same
CN110399267A (en) A server PCIE device monitoring method, system, device and readable storage medium
WO2023284892A1 (en) Configurable data computing method and apparatus, device, and medium
CN107894900B (en) A method and system for MCU upgrade
CN118803086A (en) Data protocol conversion method, device, electronic device and storage medium
KR102089629B1 (en) Method for processing data and an electronic device thereof
CN118672542A (en) Method, device, equipment and storage medium for dynamically adjusting equipment sound effect
WO2020024392A1 (en) Node processing method and apparatus, storage medium and electronic device
US9454381B2 (en) Method for controlling registration of input device in input handler instance, terminal and storage device
CN114063758B (en) A method, device and medium for obtaining current value
WO2023202182A1 (en) Back-end server management method and apparatus, readable medium and electronic device
CN116317826A (en) Motor control method, system, electronic device and readable storage medium
CN115604070A (en) Message transmission method, device, equipment and medium based on MCTP (Multi-function peripheral protocol)
TWI854647B (en) Bus anomaly detection and processing method, apparatus, system, device and media
CN116451178B (en) Sensor abnormality processing method, device, equipment and storage medium
CN118890716A (en) Method, device, equipment, medium and product for integrating wireless Internet of Things devices
US20240378103A1 (en) Bus anomaly detecting methods, processing methods, apparatuses, system, device, and medium
US20250004921A1 (en) System and method for managing a data pipeline using a digital twin
JP2012243141A (en) Information processing device, control method of information processing device, and program
CN111625385B (en) Method, system, terminal equipment and storage medium for adjusting RPM to deal with dead halt
CN118816948A (en) Equipment parameter calibration method, device, equipment 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