CN113489686A - Data conversion method and system based on knx protocol - Google Patents

Data conversion method and system based on knx protocol Download PDF

Info

Publication number
CN113489686A
CN113489686A CN202110668018.9A CN202110668018A CN113489686A CN 113489686 A CN113489686 A CN 113489686A CN 202110668018 A CN202110668018 A CN 202110668018A CN 113489686 A CN113489686 A CN 113489686A
Authority
CN
China
Prior art keywords
protocol
data
conversion
knx
index
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
CN202110668018.9A
Other languages
Chinese (zh)
Other versions
CN113489686B (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.)
Hangzhou Shendu Technology Co ltd
Original Assignee
Hangzhou Shendu 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 Hangzhou Shendu Technology Co ltd filed Critical Hangzhou Shendu Technology Co ltd
Priority to CN202110668018.9A priority Critical patent/CN113489686B/en
Publication of CN113489686A publication Critical patent/CN113489686A/en
Application granted granted Critical
Publication of CN113489686B publication Critical patent/CN113489686B/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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a data conversion method and a system based on knx protocol, wherein the method comprises the following steps: the method comprises the steps of respectively acquiring knx protocol addresses and protocol data of a protocol and a target protocol, carrying out preset configuration of data conversion rules between the knx protocol and the target protocol, generating conversion configuration information of data conversion, establishing preset indexes between the protocol addresses, the protocol data and the conversion configuration information, acquiring knx protocol addresses and the protocol data of the target protocol, inquiring the preset indexes according to the protocol addresses and the protocol data, returning a conversion rule list according to the preset indexes, and carrying out data conversion between the knx protocol and the target protocol. By the method and the device, the problem of low efficiency of data conversion based on knx protocol is solved, the self-definition of data conversion rules from third-party protocol to knx protocol is realized, and the index mapping table is established to quickly index the conversion rule list by taking address and data as unique keys.

Description

Data conversion method and system based on knx protocol
Technical Field
The present application relates to the field of data communication, and in particular, to a data conversion method and system based on knx protocol.
Background
The device data processing often encounters conversion of data between different protocols or different addresses, for example, a protocol used by a depssmart system is an knx protocol, but a plurality of devices with other protocols are accessed, a device a is accessed by a modbus protocol and needs to convert data of an address to a knx address according to a certain rule, the conversion rule includes a plurality of rules, and may include addition, subtraction, multiplication and division of data, or operation of some bits, and other scenarios may exist where a single address of a protocol corresponds to a plurality of addresses of a knx protocol, various conversions are inefficient if each time encoding is performed, and a conversion relationship is configured by a configuration file in practical application.
At present, an effective solution has not been proposed for the problem of low efficiency of data conversion based on the knx protocol in the related art.
Disclosure of Invention
The embodiment of the application provides a data conversion method and a data conversion system based on knx protocol, so as to at least solve the problem of low efficiency of data conversion based on knx protocol in the related art.
In a first aspect, an embodiment of the present application provides a data conversion method based on an knx protocol, where the method includes:
respectively acquiring knx protocol addresses and protocol data of a protocol and a target protocol, performing preset configuration of a data conversion rule between the knx protocol and the target protocol, and generating conversion configuration information of data conversion;
establishing a preset index among the protocol address, the protocol data and the conversion configuration information;
acquiring knx protocol address and protocol data of the protocol and the target protocol, inquiring the preset index according to the protocol address and the protocol data, and returning to a conversion rule list according to the preset index;
and completing data conversion between the knx protocol and the target protocol according to the conversion rule list.
In some embodiments, performing knx a preset configuration of a data conversion rule between the protocol and the target protocol, and generating conversion configuration information for data conversion includes:
configuring a one-to-many rule for data conversion between the knx protocol and the target protocol, and generating one-to-many configuration information, wherein the one-to-many rule is implemented by a plurality of preset configurations.
In some embodiments, performing knx a preset configuration of a data conversion rule between the protocol and the target protocol, and generating conversion configuration information for data conversion further includes:
and configuring a bit operation rule of data conversion between the knx protocol and the target protocol, and generating bit operation configuration information.
In some of these embodiments, configuring the data conversion rules between the knx protocol and the target protocol, generating conversion configuration information for the data conversion includes:
configuring a data conversion rule between the knx protocol and the target protocol, and generating conversion configuration information of data conversion, wherein the data types of the protocol data of the knx protocol comprise a number type, an expression variable type, a pure variable type and an expression type, and the data types of the protocol data of the target protocol comprise a number type, an expression variable type, a pure variable type, an expression type, an ASCII code type and an HEX hexadecimal type.
In some embodiments, establishing the preset index between the protocol address, the protocol data, and the conversion configuration information includes:
and establishing a fixed data index among the protocol address, the protocol data and the conversion configuration information by taking the HEX hexadecimal number of the protocol address and the protocol data as key parameters.
In some embodiments, establishing the preset index between the protocol address, the protocol data, and the conversion configuration information further comprises:
and establishing a variable data index between the protocol address and the conversion configuration information by taking the protocol address as a key parameter.
In some embodiments, establishing the preset index between the protocol address, the protocol data, and the conversion configuration information further comprises:
and establishing a bit group data index between the protocol address and a bit group list by taking the protocol address as a key parameter, and further establishing a bit data index between the bit group list and the conversion configuration information.
In some embodiments, querying the preset index according to the protocol address and the protocol data, and returning the conversion rule list according to the preset index includes:
inquiring a fixed data index according to the protocol address and the protocol data, and returning a fixed data rule list according to the fixed data index;
and inquiring a variable data index according to the protocol address, and returning a corresponding variable data rule list according to the variable data index.
In some embodiments, querying the preset index according to the protocol address and the protocol data, and returning the conversion rule list according to the preset index further includes:
according to the protocol address, inquiring whether the data is a bit group data index, and returning a bit group list according to the bit group data index;
and inquiring a bit data index according to the bit group list, and returning a corresponding bit rule list according to the bit data index.
In a second aspect, the present application provides a data conversion system based on the knx protocol, the system including a processor and a memory;
the processor respectively obtains knx protocol address and protocol data of a protocol and a target protocol, configures data conversion rules between the knx protocol and the target protocol, and generates conversion configuration information of data conversion;
the processor establishes a preset index among the protocol address, the protocol data and the conversion configuration information;
the conversion configuration information of data conversion and the preset index among the protocol address, the protocol data and the conversion configuration information are stored in the memory;
the processor acquires knx protocol, protocol address and protocol data of a target protocol, queries the preset index according to the protocol address and the protocol data, and returns a conversion rule list according to the preset index;
the processor completes the data conversion between the knx protocol and the target protocol according to the conversion rule list.
Compared with the related art, the knx protocol-based data conversion method and system provided by the embodiment of the application perform the preset configuration of the data conversion rule between the knx protocol and the target protocol by respectively obtaining the protocol address and the protocol data of the knx protocol and the target protocol, generate the conversion configuration information of the data conversion, establish the preset index between the protocol address, the protocol data and the conversion configuration information, then obtain the protocol address and the protocol data of the knx protocol and the target protocol, query the preset index according to the protocol address and the protocol data, return to the conversion rule list according to the preset index, and complete the data conversion between the knx protocol and the target protocol according to the conversion rule list, thereby solving the problem of low efficiency of the knx protocol-based data conversion, realizing the self-definition of the data conversion rule from the third-party protocol to the knx protocol, and establishing a quick index of the index mapping table to the conversion rule list by using the address and the data as a unique key.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a data conversion system based on the knx protocol according to an embodiment of the present application;
FIG. 2 is a flow chart of the steps of a data conversion method based on the knx protocol according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating the steps of a data conversion method based on the knx protocol according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a data index query method according to an embodiment of the present application;
fig. 5 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Description of the drawings: 11. a processor; 12. a memory.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application.
It is obvious that the drawings in the following description are only examples or embodiments of the present application, and that it is also possible for a person skilled in the art to apply the present application to other similar contexts on the basis of these drawings without inventive effort. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as referred to herein means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The present application provides an knx protocol-based data conversion system, fig. 1 is a block diagram of a knx protocol-based data conversion system according to an embodiment of the present application, and as shown in fig. 1, the system includes a processor 11 and a memory 12;
the processor 11 respectively obtains knx protocol address and protocol data of the protocol and the target protocol, configures knx data conversion rules between the protocol and the target protocol, and generates conversion configuration information of data conversion;
the processor 11 establishes a preset index among the protocol address, the protocol data and the conversion configuration information;
the memory 12 stores the conversion configuration information of data conversion and the preset index among the protocol address, the protocol data and the conversion configuration information;
the processor 11 acquires knx the protocol address and the protocol data of the protocol and the target protocol, inquires the preset index according to the protocol address and the protocol data, and returns the conversion rule list according to the preset index;
the processor 11 completes knx the data conversion between the protocol and the target protocol according to the conversion rule list.
According to the embodiment of the application, knx protocol addresses and protocol data of a protocol and a target protocol are respectively obtained, preset configuration of a data conversion rule between knx protocol and the target protocol is carried out, conversion configuration information of data conversion is generated, a preset index between the protocol address, the protocol data and the conversion configuration information is established, knx protocol address and protocol data of the target protocol are obtained, the preset index is inquired according to the protocol address and the protocol data, a conversion rule list is returned according to the preset index, data conversion between knx protocol and the target protocol is completed according to the conversion rule list, the problem that efficiency is low in data conversion based on knx protocol is solved, self-definition of the data conversion rule from a third party protocol to knx protocol is realized, and a quick index of the conversion rule list is established by using the address and the data as a unique key to establish an index mapping table, the efficiency of data conversion based on the knx protocol is improved.
An embodiment of the present application provides a data conversion method based on knx protocol, and fig. 2 is a flowchart of steps of the data conversion method based on knx protocol according to the embodiment of the present application, as shown in fig. 2, the method includes the following steps:
s202, respectively acquiring knx protocol addresses and protocol data of the protocol and the target protocol, performing preset configuration of data conversion rules between knx protocol and the target protocol, and generating conversion configuration information of data conversion;
s204, establishing a preset index among the protocol address, the protocol data and the conversion configuration information;
s206, acquiring knx protocol address and protocol data of the protocol and the target protocol, inquiring a preset index according to the protocol address and the protocol data, and returning to a conversion rule list according to the preset index;
and S208, completing knx data conversion between the protocol and the target protocol according to the conversion rule list.
Through the steps S202 to S208 in the embodiment of the application, the problem of low efficiency of data conversion based on knx protocol is solved, the self-definition of data conversion rules from third-party protocol to knx protocol is realized, the index mapping table is established by taking address and data as unique keys to quickly index the conversion rule list, and the efficiency of data conversion based on knx protocol is improved.
In some embodiments, the acquiring knx protocol address and protocol data of the protocol and the target protocol, respectively, and performing knx preset configuration of data conversion rules between the protocol and the target protocol, and the generating conversion configuration information of the data conversion includes:
table 1 is a conversion configuration information list of data conversion rules according to the present embodiment, as shown in table 1, the conversion protocol of data is implemented by an expression, an additional way is added to indicate the direction of data conversion, and a description of format is added to the data, and one line is used to represent a conversion relation, and for one-to-many or many-to-many cases, the conversion configuration information of data conversion is generated by configuring multiple lines, that is, each line in table 1 represents a preset configuration based on the data conversion rules between knx protocol and target protocol, and the conversion configuration information list represents six conversion configuration information in total.
TABLE 1
Figure BDA0003118066730000061
It should be noted that knx address in table 1, referred to as address in the depssmart system in this embodiment, knx data refers to knx data value, there are multiple types, wherein,
the numeric type, such as 1, indicates that the value of this address is a translation of a particular value;
a variable x, this representation being a possible value for the address (may be 1, may be 2);
the difference between the variable a, which also represents a possible value of the address, and x is that a represents a variable in the expression, and x represents a pure variable;
the specific expression is an expression with a, and the supported types are +, -,/, >, <, &, |, < lambda >,%, @, sin, cos, log, exp, ln and sqrt, wherein @ is a bit symbol, a @1 means the first bit of the bit of a (starting from zero), the expression means knx data is a, and the data is the value of the expression after the target address is converted.
The data direction in table 1 indicates whether the relationship is transitioning from knx to the target protocol or the target protocol to knx, specifically, > > indicates knx to the target protocol; < < denotes target protocol transfer knx; and < > denotes support interconversion.
The target address in table 1 refers to a data address of a target protocol; the target protocol data refers to data corresponding to a target protocol address, is consistent with the rule of the former knx data, and only means that the data of the target protocol is a, the value of the expression represents the value converted into the knx protocol, and in addition, because the target protocol is unknown, the target protocol also supports ASC and HEX special marks, which respectively represent that the latter data are ACSII code and hexadecimal data.
Table 2 is a one-to-many configuration information list of the one-to-many rule according to the present embodiment, and as shown in table 2, the one-to-many rule for data conversion between the protocol and the target protocol is configured knx, and the one-to-many configuration information is generated, wherein the one-to-many rule is implemented by a plurality of preset configurations, and the one-to-many configuration information list indicates one-to-many configuration information.
TABLE 2
knx Address knx data Data direction Target address Target protocol data
12 1 >> 14 2
12 x >> 15 ASC 13 24 45
12 a >> 16 10+(a*2)
Specifically, the one-to-many rule is implemented by a plurality of configurations, for example, when knx data is changed and knx data is converted into target protocol data based on the one-to-many rule, the data needs to be sent to a plurality of addresses,
val=1--->14(2)
--->15(ASC 13 24 45)
--->16(10+1*2=12)
data is sent to 3 addresses;
val!=1--->15(ASC 13 24 45)
--->16(10+val*2)
data is sent to both addresses.
In some embodiments, the obtaining knx of the protocol, the protocol address of the target protocol, and the protocol data, respectively, and performing knx preset configuration of the data conversion rule between the protocol and the target protocol, and the generating the conversion configuration information of the data conversion further includes:
table 3 is a bit operation configuration information list according to the bit operation rule of this embodiment, and as shown in table 3, the bit operation rule of data conversion between the knx protocol and the target protocol is configured to generate bit operation configuration information, and the bit operation configuration information list indicates five bit operation configuration information.
TABLE 3
knx Address knx data Data direction Target address Target protocol data
12 a>>1 <> 14 a@1
13 a>>2 <> 14 a@2
12 a>>1 <> 16 a@1
12 a>>2 <> 17 a@2
12 a&3 <> 17 a@1|((a@2)<<1)
The rules for the first and second rows in Table 3 are that the target protocol address 14(dst-14) maps to knx for two addresses, the data for bit1 for the value of dst-14 corresponds to knx-12 and bit2 for the value of dst-14 corresponds to knx-13;
the rules for the third and fourth rows in Table 3 are that knx Address 12(knx-12) maps to two addresses of the target protocol, data for bit1 for the value of knx-12 corresponds to dst-16, and bit2 for the value of knx-12 corresponds to dat-17;
the rule in the fifth row of table 3 defines the case where a plurality of bits correspond to an address, and this rule defines the values of bit1 and bit2 of the target address 17 corresponding to the values of knx-12.
In some of these embodiments, configuring knx a data transformation rule between the protocol and the target protocol, generating transformation configuration information for the data transformation includes:
configuring knx a data conversion rule between the protocol and the target protocol, and generating conversion configuration information of the data conversion, wherein the data types of the protocol data of knx protocol comprise a number type, an expression variable type, a pure variable type and an expression type, and the data types of the protocol data of the target protocol comprise a number type, an expression variable type, a pure variable type, an expression type, an ASCII code type and an HEX hexadecimal type.
In some embodiments, establishing the predetermined index between the protocol address, the protocol data, and the conversion configuration information includes:
taking the HEX hexadecimal number of the protocol address and the protocol data as key parameters, and establishing a fixed data index among the protocol address, the protocol data and the conversion configuration information, wherein the fixed data index is as follows: the HEX of the protocol address + protocol data is used as a key establishment index (addr + data- > list data).
In some embodiments, establishing the preset index between the protocol address, the protocol data, and the conversion configuration information further comprises:
taking the protocol address as a key parameter, and establishing a variable data index between the protocol address and the conversion configuration information, wherein the variable data index is as follows: the HEX of the protocol address is used as a key to establish an index (addr- > list data).
In some embodiments, establishing the preset index between the protocol address, the protocol data, and the conversion configuration information further comprises:
the protocol address is used as a key parameter, a bit group data index of the protocol address and the bit group list is established, and then a bit data index between the bit group list and the conversion configuration information is established, wherein the bit group data index comprises the following steps: the HEX of the protocol address is used as a key to establish an index (addr- > address- > bit combination 1 and bit combination 2.), and the bit data index is as follows: on the basis of the bit group data index, an index (bit combination- > list data) between a bit group list and conversion configuration information is established.
In some embodiments, the predetermined index is queried according to the protocol address and the protocol data, and the conversion rule list is returned according to the predetermined index, that is, when the data is received, whether a mapping relationship exists needs to be demarked, and in this embodiment, matching of two mapping relationships (querying of the predetermined index) is provided:
inquiring a fixed data index according to the protocol address and the protocol data, and returning a fixed data rule list according to the fixed data index;
and inquiring the variable data index according to the protocol address, and returning a corresponding variable data rule list according to the variable data index.
In some embodiments, the predetermined index is queried according to the protocol address and the protocol data, and the conversion rule list is returned according to the predetermined index, that is, when the data is received, it is necessary to match whether a mapping relationship exists, and in this embodiment, a mapping relationship matching (query of the predetermined index) is provided:
according to the protocol address, inquiring whether the data index is bit group data index, and returning a bit group list according to the bit group data index;
and inquiring the bit data index according to the bit group list, and returning a corresponding bit rule list according to the bit data index.
A data conversion method based on knx protocol is provided in the embodiments of the present application, and fig. 3 is a flowchart of steps of a data conversion method based on knx protocol according to the embodiments of the present application, as shown in fig. 3, the method includes the following steps:
s310, respectively acquiring knx protocol addresses and protocol data of the protocol and the target protocol;
carrying out preset configuration of data conversion rules:
s322, carrying out knx preset configuration of data conversion rules between the protocols and the target protocol, and generating conversion configuration information of data conversion;
s324, configuring knx a one-to-many rule of data conversion between the protocol and the target protocol, and generating one-to-many configuration information, wherein the one-to-many rule is realized through a plurality of preset configurations;
s326, configuring knx bit operation rule of data conversion between protocol and target protocol, and generating bit operation configuration information;
establishing a preset index among the protocol address, the protocol data and the conversion configuration information:
s332, establishing fixed data indexes among the protocol address, the protocol data and the conversion configuration information by taking the HEX hexadecimal number of the protocol address and the protocol data as key parameters;
s334, taking the protocol address as a key parameter, and establishing a variable data index between the protocol address and the conversion configuration information;
s336, the protocol address is used as a key parameter, a bit group data index of the protocol address and the bit group list is established, and then a bit data index between the bit group list and the conversion configuration information is established;
inquiring the preset index, and returning a conversion rule list according to the preset index:
s342, inquiring a fixed data index according to the protocol address and the protocol data, and returning a fixed data rule list according to the fixed data index;
s344, inquiring the variable data index according to the protocol address, and returning a corresponding variable data rule list according to the variable data index;
s346, inquiring whether the protocol address is a bit group data index, returning a bit group list according to the bit group data index, inquiring a bit data index according to the bit group list, and returning a corresponding bit rule list according to the bit data index;
and S350, completing knx data conversion between the protocol and the target protocol according to the fixed data rule list, the variable data rule list and the bit rule list.
Through steps S310 to S250 in the embodiment of the application, the protocol address and the protocol data of the knx protocol and the target protocol are respectively obtained, the preset configuration of the data conversion rule is carried out, the preset indexes among the protocol address, the protocol data and the conversion configuration information are established, the preset indexes are inquired, the conversion rule list is returned according to the preset indexes, the data conversion between the knx protocol and the target protocol is completed according to the fixed data rule list, the variable data rule list and the bit rule list, the problem of low efficiency of the data conversion based on the knx protocol is solved, the self-definition of the data conversion rule from the third-party protocol to the knx protocol is realized, and the quick index of the conversion rule list is established by taking the address and the data as the unique key.
A specific embodiment of the present application provides a data conversion method based on knx protocol, and fig. 4 is a schematic flow chart of a data index query method according to the specific embodiment of the present application, as shown in fig. 4, the method includes the following steps:
and querying the fixed data index according to the protocol address (addr) and the protocol data (data), and returning a fixed data rule list according to the fixed data index.
And inquiring the variable data index according to the protocol address (addr), and returning a corresponding variable data rule list according to the variable data index.
Inquiring whether the data is a bit group data index according to a protocol address (addr), and returning a bit group list (result list) according to the bit group data index;
and inquiring the bit data index according to the bit group list (bit group), and returning a corresponding bit rule list according to the bit data index.
According to the specific embodiment of the application, the protocol address and the protocol data are used as the unique key to respectively establish a plurality of index mapping tables with the conversion rule list, so that the rapid index of the conversion rule list is realized.
In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data conversion method based on the knx protocol. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, fig. 5 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application, and as shown in fig. 5, an electronic device is provided, where the electronic device may be a server, and the internal structure diagram may be as shown in fig. 5. The electronic device comprises a processor, a network interface, an internal memory and a non-volatile memory connected by an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used for providing calculation and control capability, the network interface is used for communicating with an external terminal through a network connection, the internal memory is used for providing an environment for an operating system and the running of a computer program, the computer program is executed by the processor to realize a data conversion method based on knx protocol, and the database is used for storing data.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is a block diagram of only a portion of the configuration associated with the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or may combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A data conversion method based on knx protocol, characterized in that the method comprises:
respectively acquiring knx protocol addresses and protocol data of a protocol and a target protocol, performing preset configuration of a data conversion rule between the knx protocol and the target protocol, and generating conversion configuration information of data conversion;
establishing a preset index among the protocol address, the protocol data and the conversion configuration information;
acquiring knx protocol address and protocol data of the protocol and the target protocol, inquiring the preset index according to the protocol address and the protocol data, and returning to a conversion rule list according to the preset index;
and completing data conversion between the knx protocol and the target protocol according to the conversion rule list.
2. The method of claim 1, wherein preset configuration of data conversion rules between the knx protocol and the target protocol is performed, and generating conversion configuration information for data conversion comprises:
configuring a one-to-many rule for data conversion between the knx protocol and the target protocol, and generating one-to-many configuration information, wherein the one-to-many rule is implemented by a plurality of preset configurations.
3. The method of claim 1, wherein preset configuration of data conversion rules between the knx protocol and the target protocol is performed, and generating conversion configuration information for data conversion further comprises:
and configuring a bit operation rule of data conversion between the knx protocol and the target protocol, and generating bit operation configuration information.
4. The method of claim 1, wherein configuring data conversion rules between the knx protocol and the target protocol, and wherein generating conversion configuration information for data conversion comprises:
configuring a data conversion rule between the knx protocol and the target protocol, and generating conversion configuration information of data conversion, wherein the data types of the protocol data of the knx protocol comprise a number type, an expression variable type, a pure variable type and an expression type, and the data types of the protocol data of the target protocol comprise a number type, an expression variable type, a pure variable type, an expression type, an ASCII code type and an HEX hexadecimal type.
5. The method of claim 1, wherein establishing the preset index between the protocol address, the protocol data, and the conversion configuration information comprises:
and establishing a fixed data index among the protocol address, the protocol data and the conversion configuration information by taking the HEX hexadecimal number of the protocol address and the protocol data as key parameters.
6. The method of claim 1, wherein establishing the predetermined index between the protocol address, the protocol data, and the translation configuration information further comprises:
and establishing a variable data index between the protocol address and the conversion configuration information by taking the protocol address as a key parameter.
7. The method of claim 1, wherein establishing the predetermined index between the protocol address, the protocol data, and the translation configuration information further comprises:
and establishing a bit group data index between the protocol address and a bit group list by taking the protocol address as a key parameter, and further establishing a bit data index between the bit group list and the conversion configuration information.
8. The method of claim 1, wherein querying the pre-defined index according to the protocol address and protocol data, and returning the conversion rule list according to the pre-defined index comprises:
inquiring a fixed data index according to the protocol address and the protocol data, and returning a fixed data rule list according to the fixed data index;
and inquiring a variable data index according to the protocol address, and returning a corresponding variable data rule list according to the variable data index.
9. The method of claim 1, wherein querying the pre-defined index according to the protocol address and protocol data, and returning the conversion rule list according to the pre-defined index further comprises:
according to the protocol address, inquiring whether the data is a bit group data index, and returning a bit group list according to the bit group data index;
and inquiring a bit data index according to the bit group list, and returning a corresponding bit rule list according to the bit data index.
10. A data conversion system based on the knx protocol, the system comprising a processor and a memory;
the processor respectively obtains knx protocol address and protocol data of a protocol and a target protocol, configures data conversion rules between the knx protocol and the target protocol, and generates conversion configuration information of data conversion;
the processor establishes a preset index among the protocol address, the protocol data and the conversion configuration information;
the conversion configuration information of data conversion and the preset index among the protocol address, the protocol data and the conversion configuration information are stored in the memory;
the processor acquires knx protocol, protocol address and protocol data of a target protocol, queries the preset index according to the protocol address and the protocol data, and returns a conversion rule list according to the preset index;
the processor completes the data conversion between the knx protocol and the target protocol according to the conversion rule list.
CN202110668018.9A 2021-06-16 2021-06-16 Data conversion method and system based on knx protocol Active CN113489686B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110668018.9A CN113489686B (en) 2021-06-16 2021-06-16 Data conversion method and system based on knx protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110668018.9A CN113489686B (en) 2021-06-16 2021-06-16 Data conversion method and system based on knx protocol

Publications (2)

Publication Number Publication Date
CN113489686A true CN113489686A (en) 2021-10-08
CN113489686B CN113489686B (en) 2023-01-10

Family

ID=77935361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110668018.9A Active CN113489686B (en) 2021-06-16 2021-06-16 Data conversion method and system based on knx protocol

Country Status (1)

Country Link
CN (1) CN113489686B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218301A (en) * 2018-09-05 2019-01-15 天津市滨海新区信息技术创新中心 The method and apparatus of the frame head mapping of software definition between multi-protocols
CN110008266A (en) * 2019-03-13 2019-07-12 平安信托有限责任公司 Data interchange file analysis method and device
CN110166431A (en) * 2019-04-16 2019-08-23 中国平安人寿保险股份有限公司 Multi-protocol data conversion method, device and computer equipment
CN111064716A (en) * 2019-12-05 2020-04-24 深圳猛犸电动科技有限公司 Message conversion method, device, storage medium and server
CN112671638A (en) * 2021-01-13 2021-04-16 北京方正数码有限公司 Gateway structure for multi-protocol conversion

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218301A (en) * 2018-09-05 2019-01-15 天津市滨海新区信息技术创新中心 The method and apparatus of the frame head mapping of software definition between multi-protocols
CN110008266A (en) * 2019-03-13 2019-07-12 平安信托有限责任公司 Data interchange file analysis method and device
CN110166431A (en) * 2019-04-16 2019-08-23 中国平安人寿保险股份有限公司 Multi-protocol data conversion method, device and computer equipment
CN111064716A (en) * 2019-12-05 2020-04-24 深圳猛犸电动科技有限公司 Message conversion method, device, storage medium and server
CN112671638A (en) * 2021-01-13 2021-04-16 北京方正数码有限公司 Gateway structure for multi-protocol conversion

Also Published As

Publication number Publication date
CN113489686B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN109617927B (en) Method and device for matching security policy
CN109218301B (en) Method and device for mapping frame header defined by software between multiple protocols
CN107818151B (en) Data searching method and device, computer equipment and storage medium
CN107562743B (en) Data storage method and device, and data search request processing method and device
CN109246235B (en) Method and device for receiving monitoring data and data monitoring system
CN107659473A (en) Connection control method, system, routing server and computer-readable recording medium
CN112887451B (en) Domain name resolution method and device and computer equipment
CN113282941A (en) Method and device for acquiring object identification, electronic equipment and storage medium
CN101848248A (en) Rule searching method and device
CN111522811B (en) Database processing method and device, storage medium and terminal
CN113489686B (en) Data conversion method and system based on knx protocol
CN117221224B (en) Table item construction and search method and device, network equipment and storage medium
CN106878185B (en) Message IP address matching circuit and method
CN112256704A (en) Quick join method, storage medium and computer
CN116628285A (en) Block chain transaction data query method and device
CN109241371B (en) Map data storage method, map data loading method, map data storage device, map data loading device and computer equipment
CN109039911B (en) Method and system for sharing RAM based on HASH searching mode
CN116405578A (en) Asset identification method and device
CN112491723B (en) Gateway message forwarding method, device, storage medium and gateway
WO2021114621A1 (en) Artificial intelligence-based data replacement method, apparatus, computer device, and medium
CN110661895A (en) Network address mapping method and network address mapping equipment of server
CN114268608A (en) Address segment retrieval method and device, electronic equipment and storage medium
CN112269806B (en) Data query method, device, equipment and computer storage medium
CN115659941B (en) File generation method and device suitable for multiple types of interfaces
CN112637070B (en) Method and equipment for searching table item

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