WO2020207105A1 - 目的报文的确定方法及装置、存储介质、电子装置 - Google Patents

目的报文的确定方法及装置、存储介质、电子装置 Download PDF

Info

Publication number
WO2020207105A1
WO2020207105A1 PCT/CN2020/074225 CN2020074225W WO2020207105A1 WO 2020207105 A1 WO2020207105 A1 WO 2020207105A1 CN 2020074225 W CN2020074225 W CN 2020074225W WO 2020207105 A1 WO2020207105 A1 WO 2020207105A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
conversion
data model
conversion template
general data
Prior art date
Application number
PCT/CN2020/074225
Other languages
English (en)
French (fr)
Inventor
范书田
刘万慧
丁柏
齐进
朱建勋
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020207105A1 publication Critical patent/WO2020207105A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Definitions

  • the present disclosure relates to the field of computers, and in particular to a method and device for determining a target message, a storage medium, and an electronic device.
  • SDN Software Defined Network
  • the core component is the controller.
  • the controllers are developed by different manufacturers, and network technology is also evolving improperly.
  • the message conversion is completely implemented by hard coding at the service level, which leads to a large workload and can only be applied in a small range. There is no effective solution at present.
  • the embodiments of the present disclosure provide a method and device for determining a target message, a storage medium, and an electronic device to solve the problem that the message conversion in the related technology is completely implemented by hard coding at the service level, which results in a large workload and can only be applied in a small range And other issues.
  • a method for determining a destination message including: obtaining a data message of business data, and parsing the data message into a general data model; and according to the data message to be converted Select the conversion template corresponding to the destination message; process the general data model according to the conversion template to obtain the destination message.
  • a controller including: an acquisition module configured to acquire a data message of service data; an analysis module configured to parse the data message into a general data model; selection The module is set to select the conversion template corresponding to the destination message according to the destination message to be converted by the data message; the determining module is set to process the general data model according to the conversion template to obtain the The stated message.
  • a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
  • an electronic device including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute any one of the foregoing Steps in the method embodiment.
  • the acquired data message can be parsed into a general data model, and the general data model can be processed according to the conversion template corresponding to the target message to obtain the target message.
  • the above technical solution is adopted to solve the related technology.
  • the message conversion is completely implemented by hard coding at the service level, which leads to problems such as a large workload and can only be applied in a small range.
  • the embodiments of the present disclosure provide a simple message conversion method with a simple process and a small workload in the conversion process.
  • FIG. 1 is a hardware structure block diagram of a controller of a method for determining a destination message according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a method for determining a destination message according to an embodiment of the present disclosure
  • Fig. 3 is a structural block diagram of a controller according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of processing of an SDN controller according to an embodiment of the present disclosure.
  • Fig. 5 is a schematic diagram of processing of message conversion according to an embodiment of the present disclosure.
  • FIG. 1 is a hardware structure block diagram of a controller of a method for determining a destination message in an embodiment of the present disclosure.
  • the controller 10 may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. ) And a memory 104 for storing data.
  • the aforementioned terminal may also include a transmission device 106 and an input/output device 108 for communication functions.
  • the structure shown in FIG. 1 is only for illustration, and does not limit the structure of the foregoing terminal.
  • the controller 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration with equivalent functions or more functions than those shown in FIG. 1.
  • the memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the navigation method of online car-hailing in the embodiments of the present disclosure.
  • the processor 102 runs the computer programs stored in the memory 104, Thereby, various functional applications and data processing are executed, that is, the above-mentioned method is realized.
  • the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the controller 10 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is used to receive or send data via a network.
  • the aforementioned specific example of the network may include a wireless network provided by the communication provider of the controller 10.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • FIG. 2 is a flowchart of the method for determining a target message according to an embodiment of the present disclosure. As shown in FIG. 2, the process includes the following step:
  • Step S202 Obtain a data message of business data, and parse the data message into a general data model
  • Step S204 selecting a conversion template corresponding to the destination message according to the destination message to be converted in the data message
  • the conversion template includes at least one of the following grammars: conversion grammar, loop grammar, and conditional derivation grammar.
  • Step S206 Process the general data model according to the conversion template to obtain the destination message.
  • the obtained data message can be parsed into a general data model, and the general data model can be processed according to the conversion template corresponding to the target message to obtain the target message.
  • the above technical solution is adopted to solve the problem in related technologies.
  • the message conversion is completely implemented by hard coding at the service level, which leads to problems such as heavy workload and limited application in a small range.
  • the embodiments of the present disclosure provide a simple message conversion method, the process is simple, and the workload of the conversion process is small. .
  • the following technical solution is provided: calling the function set in the conversion template, and processing the general data model according to the called function to obtain The destination message also uses a function to execute the above conversion template processing process, which speeds up the conversion.
  • the specific implementation process of S206 may be: replacing the placeholders in the conversion template with the data of the general data model Analyze and process the conversion template containing the general data model to obtain the target message, which is not limited in the embodiment of the present disclosure.
  • the method further includes: verifying the selected conversion template, wherein, after the verification is passed, according to The conversion template processes the general data model to obtain the destination message.
  • a simple method for converting templates is provided, and the conversion between different message protocols can be quickly realized with minimal intrusion to the original system, and the development workload of the conversion is small.
  • the process is simple, and in actual projects, whether it is an old system or a newly developed system, the black box of the module can be realized, which solves the problem of system protocol compatibility.
  • the implementation module applying the above method for determining the objective message may be deployed at the northbound entrance or the southbound exit of the controller.
  • the message is processed first, and then a suitable conversion template is selected according to the target.
  • the data equivalent to the data message obtained in step S202 of the foregoing embodiment
  • the conversion template the message protocol can be converted.
  • Step 1 Intercept the message receiving and sending points of the original system, analyze the message structure, and enable the message parsing module. If it is Xml, enable the Xml parsing module, if it is Json, enable the Json parsing module, if it is Yaml, enable the Yaml parsing module, as shown in Figure 5.
  • Step 2 After parsing the above message, no matter which format it is, it will be parsed into a general data model. And call the data processing module to process the data: reconstruct existing data, delete unnecessary data, and supplement insufficient data. The data from the source of the shareholding is sufficient, and the data processing process of step 2 is not necessary.
  • Step 3 Select the corresponding conversion template according to the message target and message type. If there is no syntax error after the conversion template is verified, the conversion can be performed in combination with the data. During the conversion, the control statement of the conversion template is analyzed and processed.
  • Step 4 After completing the control analysis of the conversion template, replace the placeholders in the conversion template with the data in the general data model, and export the target message as the final result message. Send the result message to the target system.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to enable a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present disclosure.
  • a controller is also provided, and the controller is used to implement the above-mentioned embodiments and preferred implementation manners, and what has been described will not be repeated.
  • the term "module” can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, hardware or a combination of software and hardware is also possible and conceived.
  • Fig. 3 is a structural block diagram of a controller according to an embodiment of the present disclosure, as shown in Fig. 3, including:
  • the obtaining module 30 is set to obtain a data message of business data
  • the parsing module 32 is configured to parse the data message into a general data model
  • the selection module 34 is configured to select a conversion template corresponding to the destination message according to the destination message to be converted in the data message;
  • the determining module 36 is configured to process the general data model according to the conversion template to obtain the destination message.
  • the obtained data message can be parsed into a general data model, and the general data model can be processed according to the conversion template corresponding to the target message to obtain the target message.
  • the above technical solution is adopted to solve the problem in related technologies.
  • the message conversion is completely implemented by hard coding at the service level, which leads to problems such as heavy workload and limited application in a small range.
  • the embodiments of the present disclosure provide a simple message conversion method, the process is simple, and the workload of the conversion process is small. .
  • the conversion template includes at least one of the following grammars: conversion grammar, loop grammar, and conditional derivation grammar.
  • the determining module 36 is further configured to call a function set in the conversion template, and process the general data model according to the called function to obtain the target message.
  • FIG. 4 is a processing schematic diagram of the SDN controller according to an embodiment of the present disclosure. Based on FIG. 4, the following technical solutions are also provided in the embodiment of the present disclosure.
  • the source message It is the collection point that receives the source message data, because the format of the source message may be: xml, json, Yaml, or even Java Bean. After receiving the above messages, they are all converted into a general data model, that is, a tree-like structure model, or other structure models. The embodiment of the present disclosure does not limit this, and this model structure can fully express the meaning of the original business data .
  • the source message may be in the following format:
  • Data Process Manager It is a sub-process of data processing customized by the business module and optimized based on the data module (Data Module). This module does not have to be provided. Only when the source protocol data model and the target model are significantly different, manual coding is required for processing. During development, plug-ins should be developed in accordance with the specifications of this disclosure, and the system of this disclosure can automatically manage and schedule data processing modules. After the above source message is processed, the general data model structure is as follows:
  • Template Manager It is equivalent to the core component in Figure 4. Template management is the core processing component that implements the conversion of different protocols. Use text editing to directly edit the target format to be converted, which can be xml, json or Yaml. Use placeholders to replace key data output positions, like the following:
  • $ ⁇ ... ⁇ is a placeholder for data variables
  • $ ⁇ pseudowire.name ⁇ is the PW:HL5_HL4-1 in the tree model above.
  • ⁇ #...> is the conversion syntax
  • ⁇ #list...> is the loop, which can be used to export the data of the loop structure.
  • ⁇ #if...> is a conditional export, which supports export according to certain conditions.
  • ⁇ #include...> is a nested template, which can better manage templates.
  • Function Manager In order to better support template conversion, the present disclosure supports calling functions during template conversion. To make more complex format conversion simple, the function in the template is similar to the $ ⁇ to_service_endpoint() ⁇ in the above example, which functionalizes the complex conversion process and simplifies the template design.
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented in the following manner, but not limited to this: the above modules are all located in the same processor; or, the above modules are combined in any combination The forms are located in different processors.
  • the embodiment of the present disclosure also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any of the foregoing method embodiments when running.
  • the foregoing storage medium may be configured to store a computer program for executing the following steps:
  • S3 Process the general data model according to the conversion template to obtain the destination message.
  • the foregoing storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as mobile hard disks, magnetic disks, or optical disks.
  • An embodiment of the present disclosure also provides an electronic device, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the foregoing method embodiments.
  • the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
  • the foregoing processor may be configured to execute the following steps through a computer program:
  • S5 Select a conversion template corresponding to the destination packet according to the destination packet to be converted in the data packet;
  • modules or steps of the present disclosure can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.
  • the obtained data message can be parsed into a general data model, and the general data model can be processed according to the conversion template corresponding to the target message to obtain the target message.
  • the above technical solution is adopted to solve the problem in related technologies.
  • the message conversion is completely implemented by hard coding at the service level, which leads to problems such as heavy workload and limited application in a small range.
  • the embodiments of the present disclosure provide a simple message conversion method, the process is simple, and the workload of the conversion process is small. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种目的报文的确定方法及装置、存储介质、电子装置,其中该方法包括:获取业务数据的数据报文,并将所述数据报文解析为通用数据模型(S202);根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板(S204);根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文(S206)。上述方法解决了相关技术中报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题。

Description

目的报文的确定方法及装置、存储介质、电子装置 技术领域
本公开涉及计算机领域,具体而言,涉及一种目的报文的确定方法及装置、存储介质、电子装置。
背景技术
软件定义网络(Software Defined Network,简称为SDN)技术是利用软件定义网络的新兴技术,核心组件就是控制器。但控制器是不同厂商开发的,加上网络技术也在不端演进,不同控制器之间兼容性就存在很大的问题:与设备的交互无论是格式、字段名称还是数据结构都存在严重分歧。也就是每个厂商的控制器只能对接自己的设备,这违背了SDN概念的设计初衷,也与运营商的战略目标不一致。
此外,由于不同协议融合复杂性很难控制,以前的做法是完全由业务层面硬编码实现。这样的方案虽然能解决问题,但工作量非常大,对业务层面的冲击很大,而且无法适应需求变化的速度。只能在小范围应用,不能大范围推广。
针对相关技术中,报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题,目前尚未存在有效的解决方案。
发明内容
本公开实施例提供了一种目的报文的确定方法及装置、存储介质、电子装置,以解决相关技术中报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题。
根据本公开的一个实施例,提供了一种目的报文的确定方法,包括:获取业务数据的数据报文,并将所述数据报文解析为通用数据模型;根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
根据本公开的另一个实施例,还提供了一种控制器,包括:获取模块,设置为获取业务数据的数据报文;解析模块,设置为将所述数据报文解析为通用数据模型;选择模块,设置为根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;确定模块,设置为根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
根据本公开的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
通过本公开,能够将获取到的数据报文解析为通用数据模型,根据与目的报文对应的转换模板对通用数据模型进行处理,得到目的报文,采用上述技术方案,解决了相关技术中,报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题,本公开实施例提供了一种简易的报文转换方法,过程简单,转换过程的工作量小。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是本公开实施例的一种目的报文的确定方法的控制器的硬件结构框图;
图2是根据本公开实施例的目的报文的确定方法的流程图;
图3为根据本公开实施例的控制器的结构框图;
图4为根据本公开的实施例的SDN控制器的处理示意图;
图5为根据本公开的实施例的报文转换的处理示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本申请实施例所提供的方法实施例可以在控制器、终端、计算机终端或者类似的运算装置中执行。以运行在终端上为例,图1是本公开实施例的一种目的报文的确定方法的控制器的硬件结构框图。如图1所示,控制器10可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述终端的结构造成限定。例如,控制器10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示等同功能或比图1所示功能更多的不同的配置。
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的网约车的导航方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至控制器10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括控制器10的通信供应商提供的无线网络。在一个实例中,传 输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种运行于控制器的目的报文的确定方法,图2是根据本公开实施例的目的报文的确定方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,获取业务数据的数据报文,并将所述数据报文解析为通用数据模型;
步骤S204,根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
其中,转换模板至少包括以下之一语法:转换语法,循环语法,条件导出语法。
步骤S206,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
通过上述技术方案,能够将获取到的数据报文解析为通用数据模型,根据与目的报文对应的转换模板对通用数据模型进行处理,得到目的报文,采用上述技术方案,解决了相关技术中,报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题,本公开实施例提供了一种简易的报文转换方法,过程简单,转换过程的工作量小。
为了提高上述步骤S206中得到目的报文的效率,在本公开实施例中,提供了以下技术方案:调用所述转换模板中设置的函数,根据调用的函数对所述通用数据模型进行处理,得到所述目的报文,即还利用了函数执行上述转换模板的处理过程,加快了转换速度,具体S206的实现过程可以是:将所述通用数据模型的数据替代所述转换模板中的占位符;对包含了通用数据模型的转换模板进行分析处理,得到所述目的报文,本公开实施例对此不作限定。
可选地,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文之前,所述方法还包括:对选择的转换模板进行校验,其中,在校验通过后,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
综上,通过本公开实施例的技术方案,提供了一种转换模板的简易方法,在对原***侵入最小的情况下,快速实现不同报文协议之间的转换,而且转换的开发工作量小、过程简单,并且在实际项目中应用中,无论是旧***还是新开发的***,都能够实现模块的黑盒化,很好地解决了***协议兼容问题。
以下结合一示例对上述目的报文的确定过程进行解释说明,但不用于限定本公开实施例的技术方案。
在本公开的可选示例中,应用上述目的报文的确定方法的实现模块可以部署在控制器的北向入口,也可以部署在南向出口。在收到或者拦截发出报文时,先对报文进行数据处理,再根据目标选择合适的转换模板。有了数据(相当于上述实施例步骤S202获取到的数据报文)和转换模板,就能进行报文协议的转换。具体的执行步骤如下:
步骤一:拦截原***的报文接收和发送点,分析报文结构,启用报文解析模块。如果是Xml,就启用Xml解析模块,如果是Json就启用Json解析模块,如果是Yaml就启用Yaml解析模块,具体如图5所示。
步骤二:解析完上述报文后,无论是哪种格式都解析成通用数据模型。并调用数据处理模块对数据进行处理:重构已有的数据,删除不必要的数据,补充不足的数据。入股来源的数据是充分的,步骤二的数据处理过程就不是必须的。
步骤三:根据报文目标、报文类型选择相应的转换模板。如果转换模板校验后没有语法错误就可以和数据结合执行转换。转换的同时对转换模板的控制语句进行分析处理。
步骤四:完成转换模板的控制分析后,用通用数据模型中的数据替代 转换模板中的占位符,导出目标报文为最终的结果报文。将结果报文发送给目标***。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
在本实施例中还提供了一种控制器,该控制器用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图3为根据本公开实施例的控制器的结构框图,如图3所示,包括:
获取模块30,设置为获取业务数据的数据报文;
解析模块32,设置为将所述数据报文解析为通用数据模型;
选择模块34,设置为根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
确定模块36,设置为根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
通过上述技术方案,能够将获取到的数据报文解析为通用数据模型,根据与目的报文对应的转换模板对通用数据模型进行处理,得到目的报文,采用上述技术方案,解决了相关技术中,报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题,本公开实施例提供了一种简易的报文转换方法,过程简单,转换过程的工作量小。
可选地,所述转换模板至少包括以下之一语法:转换语法,循环语法,条件导出语法。
在本公开实施例中,确定模块36,还设置为调用所述转换模板中设置的函数,根据调用的函数对所述通用数据模型进行处理,得到所述目的报文。
针对上述控制器的结构,图4为根据本公开的实施例的SDN控制器的处理示意图,基于图4,本公开实施例中还提供了以下技术方案。
数据模块(Data Module):是接受来源报文数据的采集点,由于来源报文的格式可能会是:xml、json、Yaml,甚至可以是Java Bean。接收到上述报文后一律转换成通用的数据模型,也就是树状的结构模型,也可以是其他结构模型,本公开实施例对此不作限定,这种模型结构能够充分表达原业务数据的含义。比如,来源报文可能是如下格式:
Figure PCTCN2020074225-appb-000001
Figure PCTCN2020074225-appb-000002
数据处理管理(Data Process Manager):是由业务模块自定义的数据处理,基于数据模块(Data Module)进行优化处理的子处理过程。这个模块不是必须要提供,只有当来源协议数据模型跟目标模型存在较大分歧时,才需要手动编码进行处理。开发时要按照本公开规范要求开发插件,本公开的***能自动对数据处理的模块进行管理和调度。上面来源报文经过处理后,产生通用的数据模型结构如下:
Figure PCTCN2020074225-appb-000003
模板管理(Template Manager):相当于图4中的核心组件,模板管理是实现不同协议转换的核心处理部件。采用文本编辑方式直接编辑要转换的目标格式,可以是xml、json或者Yaml。在关键的数据输出位置用占位符替代,就像下面这样:
其中${...}为数据变量占位符,${pseudowire.name}就是上面树形模型里的PW:HL5_HL4-1。<#...>为转换语法,<#list...>是循环,可以用来导出循环结构的数据。<#if...>是条件导出,支持按照一定条件导出。<#include...>是嵌套模板,可以更好地管理模板。
在正式转换时,生成通用数据模型后,载入目标模板,进行转换。用数据模型中的实际内容替代占位符。同时根据转换语法实现循环、条件转换。结果就类似这样:
Figure PCTCN2020074225-appb-000004
Figure PCTCN2020074225-appb-000005
函数管理(Function Manager):为了更好地支持模板转换,本公开支持在模板转换时调用函数。让更复杂的格式转换变得简单,函数在模板中就类似上面范例的${to_service_endpoint()},把复杂的转换过程函数化,简化模板的设计。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本公开的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取业务数据的数据报文,并将所述数据报文解析为通用数据模型;
S2,根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
S3,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只 读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S4,获取业务数据的数据报文,并将所述数据报文解析为通用数据模型;
S5,根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
S6,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。
工业实用性
通过上述技术方案,能够将获取到的数据报文解析为通用数据模型,根据与目的报文对应的转换模板对通用数据模型进行处理,得到目的报文,采用上述技术方案,解决了相关技术中,报文转换由于完全由业务层面硬编码实现进而导致工作量大,只能小范围应用等问题,本公开实施例提供了一种简易的报文转换方法,过程简单,转换过程的工作量小。

Claims (10)

  1. 一种目的报文的确定方法,包括:
    获取业务数据的数据报文,并将所述数据报文解析为通用数据模型;
    根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
    根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
  2. 根据权利要求1所述的方法,其中,所述转换模板至少包括以下之一语法:转换语法,循环语法,条件导出语法。
  3. 根据权利要求1所述的方法,其中,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文,包括:
    调用所述转换模板中设置的函数,根据调用的函数对所述通用数据模型进行处理,得到所述目的报文。
  4. 根据权利要求1所述的方法,其中,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文之前,所述方法还包括:
    对选择的转换模板进行校验,其中,在校验通过后,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
  5. 根据权利要求1所述的方法,其中,根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文,包括:
    将所述通用数据模型的数据替代所述转换模板中的占位符;
    对包含了通用数据模型的转换模板进行分析处理,得到所述目的报文。
  6. 一种控制器,包括:
    获取模块,设置为获取业务数据的数据报文;
    解析模块,设置为将所述数据报文解析为通用数据模型;
    选择模块,设置为根据所述数据报文待转换的目的报文,选择与所述目的报文对应的转换模板;
    确定模块,设置为根据所述转换模板对所述通用数据模型进行处理,得到所述目的报文。
  7. 根据权利要求6所述的控制器,其中,所述转换模板至少包括以下之一语法:转换语法,循环语法,条件导出语法。
  8. 根据权利要求6所述的控制器,其中,所述确定模块,还设置为调用所述转换模板中设置的函数,根据调用的函数对所述通用数据模型进行处理,得到所述目的报文。
  9. 一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至5中任一项中所述的方法。
  10. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至5中任一项中所述的方法。
PCT/CN2020/074225 2019-04-10 2020-02-03 目的报文的确定方法及装置、存储介质、电子装置 WO2020207105A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910286488.1 2019-04-10
CN201910286488.1A CN111832273A (zh) 2019-04-10 2019-04-10 目的报文的确定方法及装置、存储介质、电子装置

Publications (1)

Publication Number Publication Date
WO2020207105A1 true WO2020207105A1 (zh) 2020-10-15

Family

ID=72750597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/074225 WO2020207105A1 (zh) 2019-04-10 2020-02-03 目的报文的确定方法及装置、存储介质、电子装置

Country Status (2)

Country Link
CN (1) CN111832273A (zh)
WO (1) WO2020207105A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612862B (zh) * 2021-10-09 2021-12-21 树根互联股份有限公司 物联网数据报文的转换方法、装置和电子设备
CN114741082A (zh) * 2022-04-21 2022-07-12 光大科技有限公司 Yaml文件的转换方法及装置
CN115103034A (zh) * 2022-06-27 2022-09-23 京东科技信息技术有限公司 一种报文协议转换的方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378298A (zh) * 2013-08-16 2015-02-25 中兴通讯股份有限公司 一种流表条目生成方法及相应设备
CN105516196A (zh) * 2016-01-19 2016-04-20 国家计算机网络与信息安全管理中心江苏分中心 基于http报文数据的并行化网络异常检测方法与***
CN106068628A (zh) * 2014-03-17 2016-11-02 华为技术有限公司 用于管理用于配置网络的策略和/或资源的装置和方法
CN106100996A (zh) * 2016-05-30 2016-11-09 上海斐讯数据通信技术有限公司 基于软件定义网络的交换机、控制器及检查***
CN107453884A (zh) * 2016-05-30 2017-12-08 华为技术有限公司 一种网络设备的服务质量检测方法和装置
CN108989066A (zh) * 2017-05-31 2018-12-11 中兴通讯股份有限公司 设备管理方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378298A (zh) * 2013-08-16 2015-02-25 中兴通讯股份有限公司 一种流表条目生成方法及相应设备
CN106068628A (zh) * 2014-03-17 2016-11-02 华为技术有限公司 用于管理用于配置网络的策略和/或资源的装置和方法
CN105516196A (zh) * 2016-01-19 2016-04-20 国家计算机网络与信息安全管理中心江苏分中心 基于http报文数据的并行化网络异常检测方法与***
CN106100996A (zh) * 2016-05-30 2016-11-09 上海斐讯数据通信技术有限公司 基于软件定义网络的交换机、控制器及检查***
CN107453884A (zh) * 2016-05-30 2017-12-08 华为技术有限公司 一种网络设备的服务质量检测方法和装置
CN108989066A (zh) * 2017-05-31 2018-12-11 中兴通讯股份有限公司 设备管理方法及装置

Also Published As

Publication number Publication date
CN111832273A (zh) 2020-10-27

Similar Documents

Publication Publication Date Title
WO2020207105A1 (zh) 目的报文的确定方法及装置、存储介质、电子装置
EP3595244B1 (en) Network slice management method, unit and system
WO2018006789A1 (zh) 一种参数校验方法和装置、以及网管服务器和计算机存储介质
CN111158891B (zh) 基于Flink技术的分析任务处理方法、装置及存储介质
US20150128103A1 (en) System and method for automating application programming interface integration
CN110474794B (zh) 一种sdn架构的信息转换方法和***
CN107222324B (zh) 网络服务的业务配置方法和装置
US10187272B2 (en) Interface management service entity, function service entity, and element management method
EP3379771B1 (en) Message processing method, device and system
CN108833565B (zh) 一种监控服务器的方法、装置、服务器和存储介质
US11824715B2 (en) Configuration method, related apparatus, and system
CN113342503B (zh) 实时进度反馈方法、装置、设备及存储介质
WO2017016386A1 (zh) 一种实现射频拉远单元故障分析的方法和装置
EP4142238A1 (en) Pico base station configuration method and apparatus, and storage medium and electronic apparatus
CN113938391A (zh) 一种网关设备配网方法、***和电子设备
RU2604983C2 (ru) Способ синтаксического анализа сервиса, гибко адаптированный к тегу ims системы
CN106130787B (zh) 一种基于软件定义网络的业务处理***
WO2020048504A1 (zh) 网络功能所需资源的部署方法、装置、存储介质及电子装置
US9578090B1 (en) Methods for provisioning application delivery service and devices thereof
CN113824587A (zh) 一种多通信协议设备管理方法及***
CN115599881A (zh) 工作流创建方法、***、电子设备和计算机可读存储介质
CN107784006B (zh) 数据处理方法及装置
CN110647546A (zh) 第三方规则引擎生成方法及装置
CN110602194A (zh) Iot消息的订阅方法、装置及计算机可读存储介质
WO2022001830A1 (zh) 一种配置方法、终端、服务端、配置***

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20787748

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.03.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20787748

Country of ref document: EP

Kind code of ref document: A1