CN114422377A - Method and device for generating data forwarding model - Google Patents

Method and device for generating data forwarding model Download PDF

Info

Publication number
CN114422377A
CN114422377A CN202111653645.1A CN202111653645A CN114422377A CN 114422377 A CN114422377 A CN 114422377A CN 202111653645 A CN202111653645 A CN 202111653645A CN 114422377 A CN114422377 A CN 114422377A
Authority
CN
China
Prior art keywords
target
network interface
data type
name
target parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111653645.1A
Other languages
Chinese (zh)
Other versions
CN114422377B (en
Inventor
盛钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Runke General Technology Co Ltd
Original Assignee
Beijing Runke General 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 Beijing Runke General Technology Co Ltd filed Critical Beijing Runke General Technology Co Ltd
Priority to CN202111653645.1A priority Critical patent/CN114422377B/en
Publication of CN114422377A publication Critical patent/CN114422377A/en
Application granted granted Critical
Publication of CN114422377B publication Critical patent/CN114422377B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for generating a data forwarding model, wherein the method comprises the following steps: traversing a mapping relation table of parameters to be transmitted between the first network and the second network; generating an initial data forwarding model corresponding to the mapping relation table; acquiring target parameter information of the same transmission direction in a mapping relation table; adding the target sending network interface information to a sending network interface processing module so that the sending network interface processing module acquires target parameters from a sending network according to the target sending network interface information; adding a target first data type corresponding to the target receiving network interface information to a data type conversion module so as to convert a target parameter acquired by a sending network interface processing module into a target parameter of the target first data type based on the target first data type; the target receive network interface information is added to the receive network interface processing module to write target parameters of the target first data type to the receive network based on the target receive network interface information.

Description

Method and device for generating data forwarding model
Technical Field
The invention relates to the technical field of data transmission, in particular to a method and a device for generating a data forwarding model.
Background
With the development of network technology, not only can communication between the same networks be realized, but also communication between different networks can be realized. Because different networks often cannot communicate directly, a data forwarding model needs to be established, and communication between the two networks is realized through the data forwarding model. In the related art, a data forwarding model is manually built, and technical personnel are required to be familiar with a mapping relationship between two networks, manually create a plurality of modules based on the mapping relationship, and finally connect the modules to generate the data forwarding model. However, manually building a data forwarding model is not only labor-intensive, but also time-consuming. Therefore, how to implement the automatic construction of the data forwarding model is urgently needed to be solved.
Disclosure of Invention
The invention provides a method and a device for generating a data forwarding model, which can automatically generate the data forwarding model and improve the generation efficiency of the data forwarding model.
The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for generating a data forwarding model, where the method includes:
traversing a mapping relation table of parameters to be transmitted between a first network and a second network, wherein the mapping relation table comprises at least one piece of parameter information, each piece of parameter information comprises a parameter name, a transmission direction, sending network interface information and receiving network interface information, when the first network is the sending network, the second network is the receiving network, and when the second network is the sending network, the first network is the receiving network;
generating an initial data forwarding model corresponding to the mapping relation table, wherein the data forwarding model comprises a sending network interface processing module, a data type conversion module and a receiving network interface processing module;
acquiring target parameter information of the same transmission direction in the mapping relation table;
adding target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module can obtain a target parameter corresponding to a target parameter name in the target parameter information from the sending network according to the target sending network interface information;
adding a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and linking the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert a target parameter acquired by the sending network interface processing module into a target parameter of the target first data type based on the target first data type, wherein the first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information;
and adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
In one embodiment, when the sending network is a memory network, the sending network interface information includes a memory reading head address and a second data type, the second data type is a data type defined by the sending network, the sending network interface processing module includes a memory reading sub-module and a first sending network unpacking sub-module,
adding the target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the target sending network interface information, and the method comprises the following steps:
calculating the total data length of the target parameters corresponding to the target parameter names in all the target parameter information;
adding a target memory reading head address and the total data length in the target parameter information to the memory reading submodule so that the memory reading submodule reads the parameter of the total data length from the target memory reading head address of the sending network as the target parameter;
and adding a target second data type in the target parameter information to a first sending network unpacking submodule, and linking the memory reading submodule and the first sending network unpacking submodule according to the target parameter name so that the first sending network unpacking submodule converts the data type of the target parameter read by the memory reading submodule into the target second data type, wherein the target second data type is a second data type corresponding to the target parameter name.
In one embodiment, when the sending network is a network for data transmission based on a predefined interface, the sending network interface information includes a sending network interface identifier, the sending network interface processing module includes a second sending network unpacking submodule, the sending network interface identifier includes an unpacking submodule name and a sending network interface name of the second sending network unpacking submodule,
adding the target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the target sending network interface information, and the method comprises the following steps:
searching a second sending network unpacking submodule corresponding to the name of the target unpacking submodule in the target parameter information in an interface library of the sending network, and adds the name of the target sending network interface in the target parameter information to the searched second sending network unpacking submodule, so that the searched second sending network unpacking submodule obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the sending network interface corresponding to the target sending network interface name, unpacking the acquired target parameters according to the format requirement of the transmitting network interface corresponding to the name of the target transmitting network interface to obtain unpacked target parameters, wherein the name of the target unpacking submodule is the name of the unpacking submodule corresponding to the name of the target parameter, and the target sending network interface name is the sending network interface name corresponding to the target parameter name.
In an embodiment, when the receiving network is a memory network, the parameter information further includes the first data type, and adding the target first data type corresponding to the target receiving network interface information in the target parameter information to the data type conversion module includes:
and adding the target first data type in the target parameter information to the data type conversion module.
In one embodiment, when the receiving network is a network for data transmission based on a predefined interface, the receiving network interface information includes a receiving network interface identifier,
adding the target first data type corresponding to the target receiving network interface information in the target parameter information to a data type conversion module comprises:
and inquiring a target first data type corresponding to a target receiving network interface identifier in the target parameter information in the interface library of the receiving network, and adding the target first data type to the data type conversion module.
In one embodiment, when the receiving network is a memory network, the receiving network interface information includes a memory write header address and a first data type, the receiving network interface processing module includes a memory write submodule and a first receiving network packing submodule,
adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write target parameters of the target first data type into the receiving network based on the target receiving network interface information, including:
adding a target first data type in the target parameter information to the first receiving network packaging submodule, and linking the data type conversion module and the first receiving network packaging submodule according to the target parameter name, so that the first receiving network packaging submodule packages the target parameter of the target first data type according to the target first data type to obtain a packaged target parameter;
and adding a target memory writing initial address in the target parameter information to the memory writing submodule, and linking the first receiving network packaging submodule and the memory writing submodule according to the target parameter name, so that the memory writing submodule starts to write the packaged target parameter from the target memory writing initial address of the receiving network.
In one embodiment, before the first receiving network packing submodule and the memory writing submodule are linked according to the target parameter name, the method further includes:
and under the condition that abnormal target parameter information exists, performing zero padding processing on target parameters corresponding to target parameter names in the abnormal target parameter information, wherein the abnormal target parameter information comprises target parameter information with irregular content description, and/or under the condition that the sending network is a network for performing data transmission based on a predefined interface, sending the target parameter information with a network interface identifier being empty.
In one embodiment, when the receiving network is a network for data transmission based on a predefined interface, the receiving network interface information includes a receiving network interface identifier, the receiving network interface processing module includes a second receiving network packing submodule, the receiving network interface identifier includes a packing submodule name and a receiving network interface name of the second receiving network packing submodule,
adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write target parameters of the target first data type into the receiving network based on the target receiving network interface information, including:
searching a second receiving network packing sub-module corresponding to the name of the target packing sub-module in the target parameter information in an interface library of the receiving network, adding the name of the target receiving network interface in the target parameter information to the searched second receiving network packing sub-module, and linking the data type conversion module and the found second receiving network packaging sub-module according to the target parameter name, so as to pack the target parameter of the target first data type based on the receiving network interface corresponding to the target receiving network interface name and write the packed target parameter into the receiving network, wherein the target packing sub-module name is a packing sub-module name corresponding to the target parameter name, and the target receiving network interface name is a receiving network interface name corresponding to the target parameter name.
In one embodiment, the method further comprises:
adding a default value corresponding to a target vacant receiving network interface name to the searched second receiving network packaging submodule under the condition that the target vacant receiving network interface name exists, wherein the target vacant receiving network interface name is a receiving network interface name which is not stored in the relation mapping table in all receiving network interface names corresponding to the target packaging submodule name, and the default value is a default value defined by the receiving network;
and linking the data type conversion module and the searched second receiving network packing submodule according to the target vacant receiving network interface name so as to pack a default value corresponding to the target vacant receiving network interface name based on the receiving network interface corresponding to the target vacant receiving network interface name, and writing the packed default value into the receiving network.
In a second aspect, an embodiment of the present invention provides a device for generating a data forwarding model, where the device includes:
the device comprises a traversing unit and a receiving unit, wherein the traversing unit is used for traversing a mapping relation table of parameters to be transmitted between a first network and a second network, the mapping relation table comprises at least one piece of parameter information, each piece of parameter information comprises a parameter name, a transmission direction, sending network interface information and receiving network interface information, when the first network is the sending network, the second network is the receiving network, and when the second network is the sending network, the first network is the receiving network;
the generating unit is used for generating an initial data forwarding model corresponding to the mapping relation table, wherein the data forwarding model comprises a sending network interface processing module, a data type conversion module and a receiving network interface processing module;
the acquiring unit is used for acquiring the target parameter information of the same transmission direction in the mapping relation table;
a first adding unit, configured to add target sending network interface information in the target parameter information to the sending network interface processing module, so that the sending network interface processing module obtains, according to the target sending network interface information, a target parameter corresponding to a target parameter name in the target parameter information from the sending network;
a second adding unit, configured to add a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and link the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert a target parameter acquired by the sending network interface processing module into a target parameter of the target first data type based on the target first data type, where the first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information;
a third adding unit, configured to add target receiving network interface information in the target parameter information to the receiving network interface processing module, and link the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
In one embodiment, the first adding unit includes:
the sending network interface processing module comprises a memory reading submodule and a first sending network unpacking submodule and calculates the total data length of target parameters corresponding to target parameter names in all target parameter information;
a first adding module, configured to add a target memory read head address and the total data length in the target parameter information to the memory read submodule, so that the memory read submodule reads a parameter of the total data length from the target memory read head address of the sending network as the target parameter, and adds a target second data type in the target parameter information to a first sending network unpacking submodule;
the first link module is configured to link the memory reading sub-module and the first sending network unpacking sub-module according to the target parameter name, so that the first sending network unpacking sub-module converts the data type of the target parameter read by the memory reading sub-module into the target second data type, where the target second data type is a second data type corresponding to the target parameter name.
In one embodiment, the first adding unit includes:
the first searching module is used for searching a second sending network unpacking submodule corresponding to the name of a target unpacking submodule in the target parameter information in an interface library of the sending network when the sending network is a network for carrying out data transmission based on a predefined interface, the sending network interface information comprises a sending network interface identifier, the sending network interface processing module comprises a second sending network unpacking submodule and the sending network interface identifier comprises the unpacking submodule name of the second sending network unpacking submodule and the sending network interface name;
and the second adding module is used for adding the target sending network interface name in the target parameter information to the found second sending network unpacking submodule so that the found second sending network unpacking submodule obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the sending network interface corresponding to the target sending network interface name, unpacks the obtained target parameter according to the format requirement of the sending network interface corresponding to the target sending network interface name, and obtains the unpacked target parameter, wherein the target unpacking submodule name is the unpacking submodule name corresponding to the target parameter name, and the target sending network interface name is the sending network interface name corresponding to the target parameter name.
In one embodiment, the second adding unit includes:
a third adding module, configured to add a target first data type in the target parameter information to the data type converting module when the receiving network is a memory network and the parameter information further includes the first data type.
In one embodiment, the second adding unit includes:
and the fourth adding module is used for inquiring a target first data type corresponding to the target receiving network interface identifier in the target parameter information in an interface library of the receiving network when the receiving network is a network for performing data transmission based on a predefined interface and the receiving network interface information comprises a receiving network interface identifier, and adding the target first data type to the data type conversion module.
In one embodiment, the third adding unit includes:
a fifth adding module, configured to add, when the receiving network is a memory network, the receiving network interface information includes a memory write-in header address and a first data type, and the receiving network interface processing module includes a memory write-in submodule and a first receiving network packing submodule, a target first data type in the target parameter information to the first receiving network packing submodule;
the second link module is used for linking the data type conversion module and the first receiving network packing submodule according to the target parameter name so that the first receiving network packing submodule packs the target parameter of the target first data type according to the target first data type to obtain the packed target parameter;
the fifth adding module is further configured to add the target memory write-in first address in the target parameter information to the memory write-in submodule;
the second link module is further configured to link the first receiving network packing sub-module and the memory writing sub-module according to the target parameter name, so that the memory writing sub-module starts to write the packed target parameter from the target memory writing start address of the receiving network.
In one embodiment, the third adding unit includes:
and a supplement module, configured to perform zero padding on a target parameter corresponding to a target parameter name in the abnormal target parameter information when the abnormal target parameter information exists before the first receiving network packing sub-module and the memory writing sub-module are linked according to the target parameter name, where the abnormal target parameter information includes target parameter information with irregular content description, and/or send target parameter information with a network interface identifier of null when the sending network is a network for performing data transmission based on a predefined interface.
In one embodiment, the third adding unit includes:
the second searching module is used for searching a second receiving network packing submodule corresponding to the target packing submodule name in the target parameter information in an interface library of the receiving network when the receiving network is a network for carrying out data transmission based on a predefined interface, the receiving network interface information comprises a receiving network interface identifier, the receiving network interface processing module comprises a second receiving network packing submodule and the receiving network interface identifier comprises the packing submodule name and the receiving network interface name of the second receiving network packing submodule, and the target packing submodule name is the packing submodule name corresponding to the target parameter name;
a sixth adding module, configured to add a target receiving network interface name in the target parameter information to the found second receiving network packaging sub-module, where the target receiving network interface name is a receiving network interface name corresponding to the target parameter name;
and the third linking module is used for linking the data type conversion module and the searched second receiving network packing submodule according to the target parameter name so as to pack the target parameter of the target first data type based on the receiving network interface corresponding to the target receiving network interface name and write the packed target parameter into the receiving network.
In an embodiment, the sixth adding module is further configured to, in a case that a target vacant receiving network interface name exists, add a default value corresponding to the target vacant receiving network interface name to the searched second receiving network packing sub-module, so as to pack the default value corresponding to the target vacant receiving network interface name based on the receiving network interface corresponding to the target vacant receiving network interface name, and write the packed default value into the receiving network, where the target vacant receiving network interface name is a receiving network interface name that is not stored in the relationship mapping table in all receiving network interface names corresponding to the target packing sub-module name, and the default value is a default value defined by the receiving network.
In a third aspect, an embodiment of the present invention provides a storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to implement the method described in any of the embodiments of the first aspect.
Fourth, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the first aspects.
As can be seen from the above, the method and apparatus for generating a data forwarding model according to embodiments of the present invention can create a mapping relationship table of parameters to be transmitted between a first network and a second network in advance, traverse each mapping relationship table, generate an initial data forwarding model corresponding to the mapping relationship table, obtain target parameter information in the same transmission direction in the mapping relationship table, add target sending network interface information in the target parameter information to a sending network interface processing module, so that the sending network interface processing module obtains a target parameter corresponding to a target parameter name in the target parameter information from a sending network according to the target sending network interface information, add a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and link the sending network interface processing module and the data type conversion module according to the target parameter name, the target parameter obtained by the sending network interface processing module is converted into the target parameter of the target first data type based on the target first data type, the target receiving network interface information in the target parameter information is added to the receiving network interface processing module, and the data type conversion module and the receiving network interface processing module are linked according to the target parameter name, so that the target parameter of the target first data type is written into the receiving network based on the target receiving network interface information. Therefore, in the embodiment of the invention, only a technician needs to establish the mapping relation table in advance, and then the electronic equipment can automatically generate the data forwarding model according to the mapping relation table without manual participation, so that the generation efficiency of the data forwarding model is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are merely exemplary of some embodiments of the invention. For a person skilled in the art, without inventive effort, further figures can be obtained from these figures.
Fig. 1 is a schematic flowchart of a method for generating a data forwarding model according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a data forwarding model architecture according to an embodiment of the present invention;
fig. 3 is a schematic diagram of another data forwarding model architecture according to an embodiment of the present invention;
fig. 4 is a schematic diagram of another data forwarding model architecture according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for generating a data forwarding model according to an embodiment of the present invention;
fig. 6 is a block diagram of a device for generating a data forwarding model according to an embodiment of the present invention.
Detailed description of the preferred embodiment
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the embodiments and drawings of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
The embodiment of the invention provides a method and a device for generating a data forwarding model, which can automatically generate the data forwarding model and improve the generation efficiency of the data forwarding model. The method provided by the embodiment of the invention can be applied to any electronic equipment with computing capability.
The following provides a detailed description of embodiments of the invention.
Fig. 1 is a schematic flow chart of a method for generating a data forwarding model according to an embodiment of the present invention, where the method may include the following steps:
s110: and traversing the mapping relation table of the parameters to be transmitted between the first network and the second network.
The mapping relation table comprises at least one piece of parameter information, each piece of parameter information comprises a parameter name, a transmission direction, sending network interface information and receiving network interface information, when the first network is a sending network, the second network is a receiving network, and when the second network is a sending network, the first network is a receiving network. The present invention is directed to two types of networks, one being a memory network, such as a reflective memory network, and one being a network that performs data transmission based on a predefined interface, such as the internet. Therefore, the embodiment of the present invention can respectively generate corresponding data forwarding models for three network combinations: the first network and the second network are both memory networks, the first network and the second network are both networks for carrying out data transmission based on a predefined interface, the first network is a memory network, and the second network is a network for carrying out data transmission based on a predefined interface. The mapping relation table has characteristics including, but not limited to, the following points: different data parameters have different names and are unique at the source end, the same source end parameter is regarded as the same data, and the number of data streams to the end can be multiple. When one of the networks is a network for data transmission based on a predefined interface, for example, when one of the networks is the internet, the specific features of the mapping relationship table further include: and filling an ICD packaging/unpacking module and an ICD interface name into a form by the ICD interface corresponding to the parameter, wherein the ICD packaging/unpacking module name has uniqueness, and the ICD interface name has uniqueness in the ICD packaging/unpacking module.
S120: and generating an initial data forwarding model corresponding to the mapping relation table.
The embodiment of the invention can respectively generate the initial data forwarding model corresponding to each mapping relation table by taking the mapping relation table as a unit, and then respectively process each initial data forwarding model to obtain the final data forwarding module.
As shown in fig. 2 to 4, the data forwarding model includes a sending network interface processing module 21, a data type conversion module 22, and a receiving network interface processing module 23. As shown in fig. 2 and fig. 3, when the transmission network is a memory network, the transmission network interface processing module 21 includes a memory reading sub-module 211 and a first transmission network unpacking sub-module 212. As shown in fig. 4, when the transmission network is a network (referred to as an interface network for short in the figure) for performing data transmission based on a predefined interface, the transmission network interface processing module 21 includes a second transmission network unpacking sub-module 213. As shown in fig. 2 and fig. 3, when the receiving network is a memory network, the receiving network interface processing module 23 includes a first receiving network packing sub-module 231 and a memory writing sub-module 232. As shown in fig. 3 and 4, when the receiving network is a network for data transmission based on a predefined interface, the receiving network interface processing module 23 includes a second receiving network packing sub-module 233. It should be noted that, when the first network and the second network are both memory networks, the two memory networks are not the same network, but both of them belong to the memory network, for example, the first network is a reflective memory network, the second network is another memory network, the generation process of the data forwarding module transmitted from one memory network to another memory network is shown in the figure, in the reverse transmission process of the two networks, the data forwarding model is the same, so that there is no repeated drawing, and the first network and the second network are both interface networks and the same reason.
S130: and acquiring target parameter information of the same transmission direction in the mapping relation table.
And traversing the mapping relation table, sequentially acquiring the target parameter information of the same transmission direction in the mapping relation table, namely respectively acquiring the target parameter information of the first network to the second network in the transmission direction and the target parameter information of the second network to the first network in the transmission direction, and then respectively perfecting the data forwarding model aiming at each transmission direction.
S140: and adding the target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module can acquire the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the target sending network interface information.
Different networks have different methods for acquiring target parameters based on the sending network interface processing module, and specific implementation manners of the step are described below for a memory network and a network for data transmission based on a predefined interface respectively:
(A1) when the sending network is a memory network, the sending network interface information comprises a memory reading initial address and a second data type, the second data type is a data type defined by the sending network, and the sending network interface processing module comprises a memory reading submodule and a first sending network unpacking submodule.
The embodiment of the invention can calculate the total data length of the target parameter corresponding to the target parameter name in all the target parameter information, and then add the target memory reading head address and the total data length in the target parameter information to the memory reading submodule, so that the memory reading submodule reads the parameter of the total data length from the target memory reading head address of the sending network as the target parameter; and adding a target second data type in the target parameter information to a first sending network unpacking submodule, and linking the memory reading submodule and the first sending network unpacking submodule according to the target parameter name so that the first sending network unpacking submodule converts the data type of the target parameter read by the memory reading submodule into the target second data type, wherein the target second data type is a second data type corresponding to the target parameter name.
Since one mapping table corresponds to one memory reading head address, that is, the memory reading head addresses corresponding to each target parameter name are the same, in order to save storage space, the memory reading head addresses of all the mapping tables can be extracted and stored in a memory head address table independent of the mapping tables, so that the memory head address table includes the table names of the mapping tables and the memory reading head addresses. For example, the memory first address table may be as shown in table 1:
TABLE 1
Serial number Table name of mapping relation table Memory reading head address Memory write head address
1 table_1 0x10000 0x18000
2 table_2 0x20000 0x28000
3 table_3 0x30000 0x38000
It should be added that, when the first network and the second network are both memory networks, the memory first address tables may be separately established for the two networks.
(A2) When the sending network is a network for data transmission based on a predefined interface, the sending network interface information includes a sending network interface identifier, the sending network interface processing module includes a second sending network unpacking submodule, and the sending network interface identifier includes an unpacking submodule name and a sending network interface name of the second sending network unpacking submodule.
The embodiment of the invention can search the second sending network unpacking submodule corresponding to the name of the target unpacking submodule in the target parameter information in the interface library of the sending network, and adds the name of the target sending network interface in the target parameter information to the searched second sending network unpacking submodule, so that the searched second sending network unpacking submodule obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the sending network interface corresponding to the target sending network interface name, unpacking the acquired target parameters according to the format requirement of the transmitting network interface corresponding to the name of the target transmitting network interface to obtain unpacked target parameters, wherein the name of the target unpacking submodule is the name of the unpacking submodule corresponding to the name of the target parameter, and the target sending network interface name is the sending network interface name corresponding to the target parameter name. The interface library is a database used for storing interface related information predefined by the current network, and comprises information of at least one packing submodule, at least one unpacking submodule, at least one network interface under each packing submodule, at least one network interface under each unpacking submodule and the like of the current network.
In one embodiment, when the transmission network is the internet, the second transmission network unpacking submodule may be an ICD unpacking submodule, and the transmission network interface information includes a name of the ICD unpacking submodule (which may be referred to as an ICD name) and an ICD interface name. The ICD unpacking submodule corresponding to the name of the target ICD unpacking submodule is searched in the interface library according to the name of the target ICD unpacking submodule, then the name of the target ICD interface is added to the searched ICD unpacking submodule, so that the searched ICD unpacking submodule searches the corresponding ICD interface in the interface library according to the name of the ICD interface, obtains the target parameter from the transmission network according to the ICD interface, unpacks the obtained target parameter according to the format requirement of the ICD interface, and obtains the unpacked target parameter.
As can be seen from the above description, when the first network is a reflective memory network and the second network is the internet, the mapping relationship table for extracting the memory first address may be as shown in table 2.
TABLE 2
Serial number Parameter name Direction of transmission Data type ICD name ICD interface name
1 parameter_1 RFMtoInternet double ICD_1 interface_1
2 parameter_2 RFMtoInternet int32 ICD_2 interface_2
3 parameter_3 InternettoRFM boolean ICD_3 interface_3
In Table 2, the parameter name may be the physical meaning of the parameter, influenced by the creation function, and the name has a limit (e.g., ≦ 63) in length; the transmission direction defines the basis of reflecting memory reading and writing or ICD packaging and unpacking for the data forwarding model; the data type is the data type of the data in the reflective memory, and the read-write mode is defaulted to the small-end mode. The data forwarding model calculates the length of reading and writing of the reflective memory according to the data type, sequence and data direction of parameters in the mapping relation table, the read-write offset is overlapped on the basis of the first address definition table of reading and writing of the reflective memory, and corresponding data is analyzed according to the data type. In addition, the forwarding model only carries out read-write operation on the reflection memory address in the parameter definition. The order of the parameter names in the table is consistent with the order in the reflection memory. The parameter data type on the reflecting memory is defined by the mapping relation table, and the data type of the ICD is defined by the interface library.
S150: and adding a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and linking the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert the target parameter acquired by the sending network interface processing module into the target parameter of the target first data type based on the target first data type.
The first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information.
Different networks have different methods for performing data type conversion based on the data type conversion module, and specific implementation manners of the step are described below with respect to a memory network and a network for performing data transmission based on a predefined interface, respectively:
(B1) when the receiving network is a memory network, the parameter information further includes the first data type, and a specific implementation manner of adding the target first data type corresponding to the target receiving network interface information in the target parameter information to the data type conversion module may include: and adding the target first data type in the target parameter information to the data type conversion module.
As shown in table 2, the data type of the memory network is determined according to the mapping relationship table, so when the receiving network is the memory network, the parameter information further includes the first data type.
(B2) When the receiving network is a network for performing data transmission based on a predefined interface, the receiving network interface information includes a receiving network interface identifier, and a specific implementation manner for adding a target first data type corresponding to target receiving network interface information in the target parameter information to the data type conversion module may include: and inquiring a target first data type corresponding to a target receiving network interface identifier in the target parameter information in the interface library of the receiving network, and adding the target first data type to the data type conversion module. As shown in table 2, when the receiving network is the internet, the receiving network interface identifier may include an ICD name and an ICD interface name.
S160: and adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
Different networks have different methods for writing data based on the receiving network interface processing module, and the specific implementation manner of the step is described below for the memory network and the network for data transmission based on the predefined interface respectively:
(C1) when the receiving network is a memory network, the receiving network interface information comprises a memory writing initial address and a first data type, and the receiving network interface processing module comprises a memory writing sub-module and a first receiving network packaging sub-module.
In the embodiment of the present invention, a target first data type in the target parameter information may be added to the first receiving network packing sub-module, and the data type conversion module and the first receiving network packing sub-module are linked according to the target parameter name, so that the first receiving network packing sub-module packs a target parameter of the target first data type according to the target first data type to obtain a packed target parameter; and adding a target memory writing initial address in the target parameter information to the memory writing submodule, and linking the first receiving network packaging submodule and the memory writing submodule according to the target parameter name, so that the memory writing submodule starts to write the packaged target parameter from the target memory writing initial address of the receiving network.
And under the condition that abnormal target parameter information exists, performing zero padding processing on target parameters corresponding to target parameter names in the abnormal target parameter information, wherein the abnormal target parameter information comprises target parameter information with irregular content description, and/or under the condition that the sending network is a network for performing data transmission based on a predefined interface, sending the target parameter information with a network interface identifier being empty. When the sending network is the internet, the sending network interface identifier comprises an ICD name and an ICD interface name, so that the sending network interface identifier is regarded as abnormal target parameter information as long as at least one of the two names is null. The zero padding processing of the target parameter means that the value of the target parameter is set to 0.
(C1) When the receiving network is a network for data transmission based on a predefined interface, the receiving network interface information includes a receiving network interface identifier, the receiving network interface processing module includes a second receiving network packing submodule, and the receiving network interface identifier includes a packing submodule name and a receiving network interface name of the second receiving network packing submodule.
According to the embodiment of the invention, a second receiving network packing sub-module corresponding to the name of a target packing sub-module in the target parameter information can be searched in an interface library of the receiving network, the name of the target receiving network interface in the target parameter information is added to the searched second receiving network packing sub-module, and the data type conversion module and the searched second receiving network packing sub-module are linked according to the name of the target parameter, so that the target parameter of the target first data type is packed based on the receiving network interface corresponding to the name of the target receiving network interface, and the packed target parameter is written into the receiving network. The name of the target packing submodule is the name of the packing submodule corresponding to the name of the target parameter, and the name of the target receiving network interface is the name of the receiving network interface corresponding to the name of the target parameter.
In an embodiment, in the presence of a target vacant receiving network interface name, adding a default value corresponding to the target vacant receiving network interface name to the second found receiving network packing sub-module, so as to pack the default value corresponding to the target vacant receiving network interface name based on the receiving network interface corresponding to the target vacant receiving network interface name, and writing the packed default value into the receiving network, where the target vacant receiving network interface name is a receiving network interface name that is not stored in the relationship mapping table among all receiving network interface names corresponding to the target packing sub-module name, and the default value is a default value defined by the receiving network. For example, assuming that ICD _1 in table 2 corresponds to 3 ICD interface names, but only interface _1 is referred to in the table, 2 ICD interface names that are not referred to may be determined as the target vacant receiving network interface name, and a default value corresponding to the target vacant receiving network interface name is added to the second receiving network packaging sub-module having ICD name ICD _ 1. The default values corresponding to different target vacancy receiving network interface names may be the same or different.
The method for generating a data forwarding model according to the embodiments of the present invention can create a mapping relationship table of parameters to be transmitted between a first network and a second network in advance, traverse each mapping relationship table, generate an initial data forwarding model corresponding to the mapping relationship table, obtain target parameter information in the same transmission direction in the mapping relationship table, add target transmission network interface information in the target parameter information to a transmission network interface processing module, so that the transmission network interface processing module obtains a target parameter corresponding to a target parameter name in the target parameter information from a transmission network according to the target transmission network interface information, add a target first data type corresponding to target reception network interface information in the target parameter information to a data type conversion module, and link the transmission network interface processing module and the data type conversion module according to the target parameter name, the target parameter obtained by the sending network interface processing module is converted into the target parameter of the target first data type based on the target first data type, the target receiving network interface information in the target parameter information is added to the receiving network interface processing module, and the data type conversion module and the receiving network interface processing module are linked according to the target parameter name, so that the target parameter of the target first data type is written into the receiving network based on the target receiving network interface information. Therefore, in the embodiment of the invention, only a technician needs to establish the mapping relation table in advance, and then the electronic equipment can automatically generate the data forwarding model according to the mapping relation table without manual participation, so that the generation efficiency of the data forwarding model is improved.
A specific implementation process for automatically generating a data forwarding model between a first network and a second network is described below by taking the first network as a reflective memory network and the second network as the internet as an example, as shown in fig. 5, the process includes:
s310: and traversing the mapping relation tables, wherein the total number of the mapping relation tables is N, and traversing is started from the first table.
S320: reading the (n + 1) th mapping relation table, wherein n is from 0, and creating an initial data forwarding model by taking one mapping relation table as a unit.
S330: judging the transmission direction, and if the transmission direction is from the reflective memory network to the internet, executing step S340; if the transmission direction is from the internet to the reflective memory network, step S350 is executed.
The following is from the reflective memory network to the internet:
s340: and acquiring all target parameter information of which the transmission direction is from the reflective memory network to the Internet in the mapping relation table, and calculating the total data length of the target parameters corresponding to the target parameter names in all the target parameter information.
S341: and adding a target memory reading initial address and total data length in the target parameter information to a memory reading submodule.
S342: and adding the target second data type in the target parameter information to the first transmitting network unpacking submodule.
S343: and linking the memory reading sub-module and the first sending network unpacking sub-module according to the target parameter name.
S344: and inquiring a target first data type corresponding to the target receiving network interface identification (ICD name + ICD interface name) in the target parameter information in an interface library of the Internet.
S345: the target first data type is added to the data type conversion module.
S346: and linking the first sending network unpacking submodule with the data type conversion module according to the target parameter name.
S347: and adding the target ICD interface name in the target parameter information to a second receiving network packaging submodule corresponding to the target ICD name.
S348: and under the condition that the target vacant receiving network interface name exists, adding a default value corresponding to the target vacant receiving network interface name to the searched second receiving network packaging submodule.
S349: and linking the data type conversion module and the second receiving network packaging submodule according to the target parameter name, and then executing the step S360.
The following are from the internet to the reflective memory network:
s350: and acquiring all target parameter information with the transmission direction from the Internet to the reflective memory network in the mapping relation table, and adding the target ICD interface name in the target parameter information to a second sending network unpacking submodule corresponding to the target ICD name.
S351: and adding the target first data type in the target parameter information to the data type conversion module.
S352: and linking the second sending network unpacking submodule with the data type conversion module according to the target parameter name.
S353: and adding the target first data type in the target parameter information to a first receiving network packaging submodule.
S354: and linking the data type conversion module and the first receiving network packaging submodule according to the target parameter name.
S355: and adding the target memory write-in first address in the target parameter information to a memory write-in submodule.
S356: and under the condition that abnormal target parameter information exists (namely, the target parameter information with irregular content description exists, and/or the name of the ICD unpacking submodule and the name of the ICD interface are empty), zero padding processing is carried out on the corresponding target parameter.
S357: and linking the first receiving network packaging submodule and the memory writing submodule according to the target parameter name, and then executing the step S360.
S360: and saving the processed data forwarding model.
S370: after the data forwarding model is saved, it is determined whether N is less than N, if so, step S380 is executed, otherwise, the execution is ended.
S380: n +1, and returning to step S320 to read the n +1 th mapping relation table.
Corresponding to the foregoing method embodiment, an embodiment of the present invention provides a device for generating a data forwarding model, and as shown in fig. 6, the device includes:
the traversal unit 40 is configured to traverse a mapping relationship table of parameters to be transmitted between a first network and a second network, where the mapping relationship table includes at least one piece of parameter information, and each piece of parameter information includes a parameter name, a transmission direction, sending network interface information, and receiving network interface information, where the second network is a receiving network when the first network is a sending network, and the first network is a receiving network when the second network is a sending network;
a generating unit 42, configured to generate an initial data forwarding model corresponding to the mapping relationship table, where the data forwarding model includes a sending network interface processing module, a data type converting module, and a receiving network interface processing module;
an obtaining unit 44, configured to obtain target parameter information in the same transmission direction in the mapping relationship table;
a first adding unit 46, configured to add the target sending network interface information in the target parameter information to the sending network interface processing module, so that the sending network interface processing module obtains, according to the target sending network interface information, a target parameter corresponding to a target parameter name in the target parameter information from the sending network;
a second adding unit 48, configured to add a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and link the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert the target parameter acquired by the sending network interface processing module into a target parameter of the target first data type based on the target first data type, where the first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information;
a third adding unit 410, configured to add target receiving network interface information in the target parameter information to the receiving network interface processing module, and link the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
In one embodiment, the first adding unit 46 includes:
the sending network interface processing module comprises a memory reading submodule and a first sending network unpacking submodule and calculates the total data length of target parameters corresponding to target parameter names in all target parameter information;
a first adding module, configured to add a target memory read head address and the total data length in the target parameter information to the memory read submodule, so that the memory read submodule reads a parameter of the total data length from the target memory read head address of the sending network as the target parameter, and adds a target second data type in the target parameter information to a first sending network unpacking submodule;
the first link module is configured to link the memory reading sub-module and the first sending network unpacking sub-module according to the target parameter name, so that the first sending network unpacking sub-module converts the data type of the target parameter read by the memory reading sub-module into the target second data type, where the target second data type is a second data type corresponding to the target parameter name.
In one embodiment, the first adding unit 46 includes:
the first searching module is used for searching a second sending network unpacking submodule corresponding to the name of a target unpacking submodule in the target parameter information in an interface library of the sending network when the sending network is a network for carrying out data transmission based on a predefined interface, the sending network interface information comprises a sending network interface identifier, the sending network interface processing module comprises a second sending network unpacking submodule and the sending network interface identifier comprises the unpacking submodule name of the second sending network unpacking submodule and the sending network interface name;
and the second adding module is used for adding the target sending network interface name in the target parameter information to the found second sending network unpacking submodule so that the found second sending network unpacking submodule obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the sending network interface corresponding to the target sending network interface name, unpacks the obtained target parameter according to the format requirement of the sending network interface corresponding to the target sending network interface name, and obtains the unpacked target parameter, wherein the target unpacking submodule name is the unpacking submodule name corresponding to the target parameter name, and the target sending network interface name is the sending network interface name corresponding to the target parameter name.
In one embodiment, the second adding unit 48 includes:
a third adding module, configured to add a target first data type in the target parameter information to the data type converting module when the receiving network is a memory network and the parameter information further includes the first data type.
In one embodiment, the second adding unit includes:
and the fourth adding module is used for inquiring a target first data type corresponding to the target receiving network interface identifier in the target parameter information in an interface library of the receiving network when the receiving network is a network for performing data transmission based on a predefined interface and the receiving network interface information comprises a receiving network interface identifier, and adding the target first data type to the data type conversion module.
In one embodiment, the third adding unit 410 includes:
a fifth adding module, configured to add, when the receiving network is a memory network, the receiving network interface information includes a memory write-in header address and a first data type, and the receiving network interface processing module includes a memory write-in submodule and a first receiving network packing submodule, a target first data type in the target parameter information to the first receiving network packing submodule;
the second link module is used for linking the data type conversion module and the first receiving network packing submodule according to the target parameter name so that the first receiving network packing submodule packs the target parameter of the target first data type according to the target first data type to obtain the packed target parameter;
the fifth adding module is further configured to add the target memory write-in first address in the target parameter information to the memory write-in submodule;
the second link module is further configured to link the first receiving network packing sub-module and the memory writing sub-module according to the target parameter name, so that the memory writing sub-module starts to write the packed target parameter from the target memory writing start address of the receiving network.
In one embodiment, the third adding unit includes:
and a supplementary module, configured to perform zero padding on a target parameter corresponding to a target parameter name in the abnormal target parameter information before linking the first receiving network packing sub-module and the memory writing sub-module according to the target parameter name and under the condition that the abnormal target parameter information exists, where the abnormal target parameter information includes target parameter information with irregular content description, and/or send target parameter information with a network interface identifier of null under the condition that the sending network is a network for performing data transmission based on a predefined interface.
In one embodiment, the third adding unit 410 includes:
the second searching module is used for searching a second receiving network packing submodule corresponding to the target packing submodule name in the target parameter information in an interface library of the receiving network when the receiving network is a network for carrying out data transmission based on a predefined interface, the receiving network interface information comprises a receiving network interface identifier, the receiving network interface processing module comprises a second receiving network packing submodule and the receiving network interface identifier comprises the packing submodule name and the receiving network interface name of the second receiving network packing submodule, and the target packing submodule name is the packing submodule name corresponding to the target parameter name;
a sixth adding module, configured to add a target receiving network interface name in the target parameter information to the found second receiving network packaging sub-module, where the target receiving network interface name is a receiving network interface name corresponding to the target parameter name;
and the third linking module is used for linking the data type conversion module and the searched second receiving network packing submodule according to the target parameter name so as to pack the target parameter of the target first data type based on the receiving network interface corresponding to the target receiving network interface name and write the packed target parameter into the receiving network.
In an embodiment, the sixth adding module is further configured to, in a case that a target vacant receiving network interface name exists, add a default value corresponding to the target vacant receiving network interface name to the searched second receiving network packing sub-module, so as to pack the default value corresponding to the target vacant receiving network interface name based on the receiving network interface corresponding to the target vacant receiving network interface name, and write the packed default value into the receiving network, where the target vacant receiving network interface name is a receiving network interface name that is not stored in the relationship mapping table in all receiving network interface names corresponding to the target packing sub-module name, and the default value is a default value defined by the receiving network.
Based on the above method embodiments, another embodiment of the present invention provides a storage medium having stored thereon executable instructions, which when executed by a processor, cause the processor to implement the method as described above.
Based on the foregoing method embodiment, another embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method as described above.
The system and apparatus embodiments correspond to the method embodiments, and have the same technical effects as the method embodiments, and for the specific description, refer to the method embodiments. The device embodiment is obtained based on the method embodiment, and for specific description, reference may be made to the method embodiment section, which is not described herein again. Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
Those of ordinary skill in the art will understand that: modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, or may be located in one or more devices different from the embodiments with corresponding changes. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Finally, it should be noted that: the above examples are only for illustrating the technical solution of the present invention, not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention.

Claims (10)

1. A method for generating a data forwarding model, the method comprising:
traversing a mapping relation table of parameters to be transmitted between a first network and a second network, wherein the mapping relation table comprises at least one piece of parameter information, each piece of parameter information comprises a parameter name, a transmission direction, sending network interface information and receiving network interface information, when the first network is the sending network, the second network is the receiving network, and when the second network is the sending network, the first network is the receiving network;
generating an initial data forwarding model corresponding to the mapping relation table, wherein the data forwarding model comprises a sending network interface processing module, a data type conversion module and a receiving network interface processing module;
acquiring target parameter information of the same transmission direction in the mapping relation table;
adding target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module can obtain a target parameter corresponding to a target parameter name in the target parameter information from the sending network according to the target sending network interface information;
adding a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and linking the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert a target parameter acquired by the sending network interface processing module into a target parameter of the target first data type based on the target first data type, wherein the first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information;
and adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
2. The method according to claim 1, wherein when the transmitting network is a memory network, the transmitting network interface information includes a memory read header address and a second data type, the second data type is a data type defined by the transmitting network, the transmitting network interface processing module includes a memory read submodule and a first transmitting network unpacking submodule,
adding the target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the target sending network interface information, and the method comprises the following steps:
calculating the total data length of the target parameters corresponding to the target parameter names in all the target parameter information;
adding a target memory reading head address and the total data length in the target parameter information to the memory reading submodule so that the memory reading submodule reads the parameter of the total data length from the target memory reading head address of the sending network as the target parameter;
and adding a target second data type in the target parameter information to a first sending network unpacking submodule, and linking the memory reading submodule and the first sending network unpacking submodule according to the target parameter name so that the first sending network unpacking submodule converts the data type of the target parameter read by the memory reading submodule into the target second data type, wherein the target second data type is a second data type corresponding to the target parameter name.
3. The method according to claim 1, wherein when the transmitting network is a network for data transmission based on a predefined interface, the transmitting network interface information includes a transmitting network interface identifier, the transmitting network interface processing module includes a second transmitting network unpacking submodule, the transmitting network interface identifier includes an unpacking submodule name and a transmitting network interface name of the second transmitting network unpacking submodule,
adding the target sending network interface information in the target parameter information to the sending network interface processing module so that the sending network interface processing module obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the target sending network interface information, and the method comprises the following steps:
searching a second sending network unpacking submodule corresponding to the name of the target unpacking submodule in the target parameter information in an interface library of the sending network, and adds the name of the target sending network interface in the target parameter information to the searched second sending network unpacking submodule, so that the searched second sending network unpacking submodule obtains the target parameter corresponding to the target parameter name in the target parameter information from the sending network according to the sending network interface corresponding to the target sending network interface name, unpacking the acquired target parameters according to the format requirement of the transmitting network interface corresponding to the name of the target transmitting network interface to obtain unpacked target parameters, wherein the name of the target unpacking submodule is the name of the unpacking submodule corresponding to the name of the target parameter, and the target sending network interface name is the sending network interface name corresponding to the target parameter name.
4. The method of claim 1, wherein the parameter information further comprises the first data type when the receiving network is a memory network,
adding the target first data type corresponding to the target receiving network interface information in the target parameter information to a data type conversion module comprises:
and adding the target first data type in the target parameter information to the data type conversion module.
5. The method of claim 1, wherein the receiving network interface information comprises a receiving network interface identification when the receiving network is a network for data transmission based on a predefined interface,
adding the target first data type corresponding to the target receiving network interface information in the target parameter information to a data type conversion module comprises:
and inquiring a target first data type corresponding to a target receiving network interface identifier in the target parameter information in the interface library of the receiving network, and adding the target first data type to the data type conversion module.
6. The method of claim 1, wherein when the receiving network is a memory network, the receiving network interface information includes a memory write header address and a first data type, the receiving network interface processing module includes a memory write submodule and a first receiving network packing submodule,
adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write target parameters of the target first data type into the receiving network based on the target receiving network interface information, including:
adding a target first data type in the target parameter information to the first receiving network packaging submodule, and linking the data type conversion module and the first receiving network packaging submodule according to the target parameter name, so that the first receiving network packaging submodule packages the target parameter of the target first data type according to the target first data type to obtain a packaged target parameter;
and adding a target memory writing initial address in the target parameter information to the memory writing submodule, and linking the first receiving network packaging submodule and the memory writing submodule according to the target parameter name, so that the memory writing submodule starts to write the packaged target parameter from the target memory writing initial address of the receiving network.
7. The method of claim 6, wherein prior to linking the first receiving network packing submodule and the memory write submodule according to the target parameter name, the method further comprises:
and under the condition that abnormal target parameter information exists, performing zero padding processing on target parameters corresponding to target parameter names in the abnormal target parameter information, wherein the abnormal target parameter information comprises target parameter information with irregular content description, and/or under the condition that the sending network is a network for performing data transmission based on a predefined interface, sending the target parameter information with a network interface identifier being empty.
8. The method according to any one of claims 1 to 7, wherein when the receiving network is a network for data transmission based on a predefined interface, the receiving network interface information includes a receiving network interface identifier, the receiving network interface processing module includes a second receiving network packing submodule, the receiving network interface identifier includes a packing submodule name and a receiving network interface name of the second receiving network packing submodule,
adding target receiving network interface information in the target parameter information to the receiving network interface processing module, and linking the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write target parameters of the target first data type into the receiving network based on the target receiving network interface information, including:
searching a second receiving network packing sub-module corresponding to the name of the target packing sub-module in the target parameter information in an interface library of the receiving network, adding the name of the target receiving network interface in the target parameter information to the searched second receiving network packing sub-module, and linking the data type conversion module and the found second receiving network packaging sub-module according to the target parameter name, so as to pack the target parameter of the target first data type based on the receiving network interface corresponding to the target receiving network interface name and write the packed target parameter into the receiving network, wherein the target packing sub-module name is a packing sub-module name corresponding to the target parameter name, and the target receiving network interface name is a receiving network interface name corresponding to the target parameter name.
9. The method of claim 8, further comprising:
and under the condition that a target vacant receiving network interface name exists, adding a default value corresponding to the target vacant receiving network interface name to the searched second receiving network packing submodule so as to pack the default value corresponding to the target vacant receiving network interface name based on the receiving network interface corresponding to the target vacant receiving network interface name, and writing the packed default value into the receiving network, wherein the target vacant receiving network interface name is a receiving network interface name which is not stored in the relation mapping table in all receiving network interface names corresponding to the target packing submodule name, and the default value is a default value defined by the receiving network.
10. An apparatus for generating a data forwarding model, the apparatus comprising:
the device comprises a traversing unit and a receiving unit, wherein the traversing unit is used for traversing a mapping relation table of parameters to be transmitted between a first network and a second network, the mapping relation table comprises at least one piece of parameter information, each piece of parameter information comprises a parameter name, a transmission direction, sending network interface information and receiving network interface information, when the first network is the sending network, the second network is the receiving network, and when the second network is the sending network, the first network is the receiving network;
the generating unit is used for generating an initial data forwarding model corresponding to the mapping relation table, wherein the data forwarding model comprises a sending network interface processing module, a data type conversion module and a receiving network interface processing module;
the acquiring unit is used for acquiring the target parameter information of the same transmission direction in the mapping relation table;
a first adding unit, configured to add target sending network interface information in the target parameter information to the sending network interface processing module, so that the sending network interface processing module obtains, according to the target sending network interface information, a target parameter corresponding to a target parameter name in the target parameter information from the sending network;
a second adding unit, configured to add a target first data type corresponding to target receiving network interface information in the target parameter information to a data type conversion module, and link the sending network interface processing module and the data type conversion module according to the target parameter name, so as to convert a target parameter acquired by the sending network interface processing module into a target parameter of the target first data type based on the target first data type, where the first data type is a data type defined by the receiving network, and the target first data type is a first data type corresponding to the target receiving network interface information;
a third adding unit, configured to add target receiving network interface information in the target parameter information to the receiving network interface processing module, and link the data type conversion module and the receiving network interface processing module according to the target parameter name, so as to write the target parameter of the target first data type into the receiving network based on the target receiving network interface information.
CN202111653645.1A 2021-12-30 2021-12-30 Method and device for generating data forwarding model Active CN114422377B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111653645.1A CN114422377B (en) 2021-12-30 2021-12-30 Method and device for generating data forwarding model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111653645.1A CN114422377B (en) 2021-12-30 2021-12-30 Method and device for generating data forwarding model

Publications (2)

Publication Number Publication Date
CN114422377A true CN114422377A (en) 2022-04-29
CN114422377B CN114422377B (en) 2023-09-22

Family

ID=81269614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111653645.1A Active CN114422377B (en) 2021-12-30 2021-12-30 Method and device for generating data forwarding model

Country Status (1)

Country Link
CN (1) CN114422377B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739452A (en) * 2009-12-17 2010-06-16 中国电力科学研究院 Data exchange interface and realizing method thereof
US20130034022A1 (en) * 2011-08-07 2013-02-07 Chia-Wei Yen Method of Unified Parameter Mapping
EP2747341A1 (en) * 2012-12-21 2014-06-25 Sap Ag Connecting computer management systems via cellular digital telecommunication networks
WO2016173428A1 (en) * 2015-04-26 2016-11-03 阿里巴巴集团控股有限公司 Data transmission method and apparatus
CN106549917A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 The method and apparatus of distinct interface protocol massages conversion processing
CN108521378A (en) * 2018-04-23 2018-09-11 天津芯海创科技有限公司 Retransmission method, device and the network switching equipment of heterogeneous protocol message
CN109474678A (en) * 2018-10-31 2019-03-15 新华三信息安全技术有限公司 A kind of information transferring method and device
CN111600909A (en) * 2020-06-24 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device, protocol conversion equipment and storage medium
CN111628956A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Format conversion method, device and system for network request transmission data
CN111917825A (en) * 2020-06-23 2020-11-10 中国建设银行股份有限公司 Heterogeneous system data interaction method and device
CN112055078A (en) * 2020-09-02 2020-12-08 数字广东网络建设有限公司 Data transmission method and device, computer equipment and storage medium
CN113259425A (en) * 2021-04-30 2021-08-13 广东顺畅科技有限公司 61850 standard-based data conversion method, transformer substation gateway and storage medium
CN113300892A (en) * 2021-05-25 2021-08-24 西北工业大学 Real-time communication network system with shared memory
CN113612725A (en) * 2021-06-18 2021-11-05 北京旷视科技有限公司 Data conversion method and device, electronic equipment and readable storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739452A (en) * 2009-12-17 2010-06-16 中国电力科学研究院 Data exchange interface and realizing method thereof
US20130034022A1 (en) * 2011-08-07 2013-02-07 Chia-Wei Yen Method of Unified Parameter Mapping
EP2747341A1 (en) * 2012-12-21 2014-06-25 Sap Ag Connecting computer management systems via cellular digital telecommunication networks
WO2016173428A1 (en) * 2015-04-26 2016-11-03 阿里巴巴集团控股有限公司 Data transmission method and apparatus
CN106549917A (en) * 2015-09-21 2017-03-29 中兴通讯股份有限公司 The method and apparatus of distinct interface protocol massages conversion processing
US20190327345A1 (en) * 2018-04-23 2019-10-24 Tianjin Chip Sea Innovation Technology Co. Ltd. Method and apparatus for forwarding heterogeneous protocol message and network switching device
CN108521378A (en) * 2018-04-23 2018-09-11 天津芯海创科技有限公司 Retransmission method, device and the network switching equipment of heterogeneous protocol message
CN109474678A (en) * 2018-10-31 2019-03-15 新华三信息安全技术有限公司 A kind of information transferring method and device
CN111628956A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Format conversion method, device and system for network request transmission data
CN111917825A (en) * 2020-06-23 2020-11-10 中国建设银行股份有限公司 Heterogeneous system data interaction method and device
CN111600909A (en) * 2020-06-24 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device, protocol conversion equipment and storage medium
CN112055078A (en) * 2020-09-02 2020-12-08 数字广东网络建设有限公司 Data transmission method and device, computer equipment and storage medium
CN113259425A (en) * 2021-04-30 2021-08-13 广东顺畅科技有限公司 61850 standard-based data conversion method, transformer substation gateway and storage medium
CN113300892A (en) * 2021-05-25 2021-08-24 西北工业大学 Real-time communication network system with shared memory
CN113612725A (en) * 2021-06-18 2021-11-05 北京旷视科技有限公司 Data conversion method and device, electronic equipment and readable storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JIANGMIAO XIE等: "Design and Implementation of Embedded Protocol Conversion Gateway for Intelligent Buildings", 《2019 IEEE 10TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING AND SERVICE SCIENCE (ICSESS)》 *
李继蕊等: "物联网环境下数据转发模型研究", Retrieved from the Internet <URL:https://www.fx361.com/page/2018/0810/16696349.shtml> *
汪迅宝;刘超;张程;陈付龙;: "一种基于IPv6的互转网关体系结构", 安徽工业大学学报(自然科学版), no. 02 *

Also Published As

Publication number Publication date
CN114422377B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
CN108881251B (en) System and method for access analysis and standardization of any binary equipment
CN113079198B (en) Method and device for converting cloud platform interface protocol
CN112817602A (en) JSON format data sending and receiving method, device and medium
CN114422377B (en) Method and device for generating data forwarding model
CN112416557B (en) Method and device for determining call relation, storage medium and electronic device
CN109687939A (en) Engineering mechanical device communication means, system and carrying communication protocol
CN106878171B (en) Streaming data processing method and device for multiple data sources
CN115134361B (en) Cross-platform communication method and device for automatic driving software platform
CN114760077B (en) Abnormal data detection method and device based on block chain, storage medium and gateway
CN114385136B (en) Flow decomposition method and device for running ETL (extract transform load) by Flink framework
CN113364790B (en) Data transmission method and device
CN112491723B (en) Gateway message forwarding method, device, storage medium and gateway
CN114301813A (en) Time delay measuring method and device for PING detection
CN115225654A (en) Communication method and device based on configurable communication protocol
CN111181846B (en) Message transmission method and device and storage medium
EP1720285B1 (en) Apparatus and method for processing messages in a network management system
CN114385140B (en) Method and device for processing multiple different outputs of ETL flow assembly based on flink framework
CN114385138B (en) Flow joint assembly method and device for running ETL (extract transform load) by Flink framework
CN111193574B (en) Data transmission method and data transmission system
CN117499512A (en) Message processing method and device and electronic equipment
CN115080564A (en) Method and equipment for synchronizing merkel directed acyclic graph
CN117336389A (en) Data analysis method, device, equipment and storage medium
CN116303112A (en) Data acquisition method
CN115473906A (en) Data acquisition method and digital twin network
KR100367090B1 (en) Method of split of transition caused by signal reception in SDL

Legal Events

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