CN113612862B - Internet of things data message conversion method and device and electronic equipment - Google Patents

Internet of things data message conversion method and device and electronic equipment Download PDF

Info

Publication number
CN113612862B
CN113612862B CN202111173787.8A CN202111173787A CN113612862B CN 113612862 B CN113612862 B CN 113612862B CN 202111173787 A CN202111173787 A CN 202111173787A CN 113612862 B CN113612862 B CN 113612862B
Authority
CN
China
Prior art keywords
message
northbound
message template
data
key data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111173787.8A
Other languages
Chinese (zh)
Other versions
CN113612862A (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.)
Rootcloud Technology Co Ltd
Original Assignee
Rootcloud 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 Rootcloud Technology Co Ltd filed Critical Rootcloud Technology Co Ltd
Priority to CN202111173787.8A priority Critical patent/CN113612862B/en
Publication of CN113612862A publication Critical patent/CN113612862A/en
Application granted granted Critical
Publication of CN113612862B publication Critical patent/CN113612862B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y30/00IoT infrastructure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for converting data messages of an Internet of things and electronic equipment, wherein the method comprises the following steps: acquiring a preset southbound message template; extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result; acquiring a preset northbound message template; summarizing the key data combination result according to the second nesting relation to obtain a key data combination result conforming to the second nesting relation; and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message. The method can automatically convert the south message to be converted in any format into the converted target north message in any format, is convenient and quick, does not need to customize and develop the message, has low requirement on technical personnel, and reduces the workload of generating the message.

Description

Internet of things data message conversion method and device and electronic equipment
Technical Field
The invention relates to the technical field of message conversion, in particular to a method and a device for converting data messages of an internet of things and electronic equipment.
Background
In the scene of the internet of things, the message format types are generally divided into a south direction and a north direction. The southward direction refers to a lower-layer equipment end, and is used for collecting data and reporting the data to a message format of the Internet of things platform; the north direction is a message format of an upper application end for receiving collected data sent by the Internet of things platform.
Under the actual application scene of the current internet of things, the message formats of the southbound and northbound messages are basically different according to different manufacturers, so that the collected data needs to be customized and developed from the collection side of the manufacturer A to the platform or the application layer of the manufacturer B. The customized development is strongly dependent on the technical level of a developer, the customized development needs to take a long time, and if the format is changed, the customized development needs to be performed again, so that the workload is high.
In summary, the existing method for generating the data message of the internet of things has the technical problems of long time consumption, high requirement on technical personnel and large workload.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for converting an internet of things data packet, and an electronic device, so as to alleviate the technical problems of long time consumption, high requirement on technical staff, and large workload of the existing method for generating an internet of things data packet.
In a first aspect, an embodiment of the present invention provides a method for converting data packets of an internet of things, where the method includes:
acquiring a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
acquiring a preset northbound message template, wherein a second data expression is adopted in the northbound message template to represent position information of data to be replaced in a target northbound message, and a second nesting relationship in the northbound message template is the same as that in the target northbound message;
summarizing the key data combination result according to the second nesting relationship to obtain a key data combination result conforming to the second nesting relationship;
and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain a converted target northbound message.
Further, after acquiring a preset southbound message template, before extracting corresponding key data from the southbound message to be converted according to a first data expression in the southbound message template, the method further comprises:
and analyzing the southbound message template to obtain the first data expression and the first nesting relation.
Further, after acquiring a preset northbound message template, before summarizing the key data combination result according to the second nesting relationship, the method further includes:
and analyzing the northbound message template to obtain the second data expression and the second nesting relationship.
Further, matching and replacing the key data combination result conforming to the second nesting relationship with the northbound message template includes:
and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template based on the second data expression to obtain the converted target northbound message.
Further, the formats of the first data expression and the second data expression are as follows: position information: and $ variable field, wherein the variable field is any field and is unique in the same message template.
Further, the northbound message template also includes other necessary fields.
Further, the southbound message to be converted is a southbound message in any format, and the target northbound message is a northbound message in any format.
In a second aspect, an embodiment of the present invention further provides a device for converting data packets of an internet of things, where the device includes:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a preset southbound message template, the southbound message template adopts a first data expression to represent the position information of key data in a southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
the data extraction and combination unit is used for extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
the second obtaining unit is used for obtaining a preset northbound message template, wherein the northbound message template adopts a second data expression to represent position information of data to be replaced in a target northbound message, and a second nesting relationship in the northbound message template is the same as that in the target northbound message;
the summarizing unit is used for summarizing the key data combination result according to the second nesting relationship to obtain a key data combination result conforming to the second nesting relationship;
and the matching and replacing unit is used for matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message.
In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to any one of the above first aspects when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing machine executable instructions, which when invoked and executed by a processor, cause the processor to perform the method of any of the first aspect.
In an embodiment of the present invention, a method for converting data packets of an internet of things is provided, including: acquiring a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted; extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result; then obtaining a preset northbound message template, wherein the position information of the data to be replaced in the target northbound message is represented by a second data expression in the northbound message template, and the second nesting relationship in the northbound message template is the same as the nesting relationship in the target northbound message; then, summarizing the key data combination result according to a second nesting relation to obtain a key data combination result conforming to the second nesting relation; and finally, matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message. According to the Internet of things data message conversion method, the south message to be converted in any format can be automatically converted into the converted target north message in any format, convenience and rapidness are achieved, customized development of the message is not needed, the requirement on technical personnel is low, the workload of message generation is reduced, and the technical problems that the existing Internet of things data message generation method is long in time consumption, high in requirement on the technical personnel and large in workload are solved.
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, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for converting data packets of an internet of things according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a device for converting data packets of the internet of things according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, each time the collected data is from the collection side of different manufacturers to the platform or application layer of different manufacturers, customized development is required. The customized development is strongly dependent on the technical level of a developer, the customized development needs to take a long time, and if the format is changed, the customized development needs to be performed again, so that the workload is high.
Based on this, the embodiment provides a method for converting data messages of the internet of things, and the method can automatically convert the south messages to be converted in any format into the converted target north messages in any format, is convenient and fast, does not need to perform customized development of the messages, has low requirements on technical staff, and reduces the workload of message generation.
To facilitate understanding of the embodiment, a detailed description is first given to a method for converting data packets of the internet of things disclosed in the embodiment of the present invention.
The first embodiment is as follows:
in accordance with an embodiment of the present invention, there is provided an embodiment of a method for converting internet-of-things data packets, where the steps illustrated in the flowchart of the drawings may be executed in a computer system such as a set of computer-executable instructions, and although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be executed in an order different from that shown.
Fig. 1 is a flowchart of a method for converting data packets of the internet of things according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step S102, a preset southbound message template is obtained, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
the format of the first data expression is as follows: position information: and $ variable field, wherein the variable field is any field and is unique in the same message template. The southbound message to be converted is a southbound message in any format.
In a complete south-oriented message to be converted, besides key data, a plurality of auxiliary information fields are available, and in order to distinguish the key data from the key data, the first data expression is adopted for identification distinguishing in the embodiment.
It should be noted that: the preset southbound message template is an artificially defined message template, and the key data represented in the first data expression is artificially specified key data.
The following illustrates a specific example of a southbound message to be converted and a preset southbound message template:
the south message to be converted:
{
"cmdId":103,
"type":0,
"devList":[
{
"devSn":"test_1",
"devSort":"meter",
"ts":1614049402460,
"varList":{
"s2":"123",
"f1":234
}
},
{
"devSn":"test_1",
"devSort":"meter",
"ts":"1614049402459",
"varList":{
"s2":"234",
"f1":345
}
}
],
"ver":"0.0.1.0",
"seq":"81100000111111",
"time":1614049402460
}
a preset southbound message template corresponding to the southbound message to be converted:
{
"devList":[
{
"devSn":${deviceKey},
"ts":${collectTime},
"varList":{
"s2":${s2},
"f1":${s1}
}
},
],
"time":${reportTime}
}
several rules for artificially defining a southbound message template according to the southbound message are explained below: (1) fields for non-critical data (no data expression need be defined) may not be defined in the southbound message template, such as "cmdId":103 and "type":0, as described above; (2) if the south message has nested structures such as objects or arrays and a data expression is in the objects or the arrays, the nested structures of the objects or the arrays need to be defined in the template; (3) if the data expression is in the nested structure such as an array or an object, the inner data inherits the outer data according to the nested relation of the message structure; (4) if the data expression is in the array, the array of the key data combination result is extracted.
Step S104, extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
the target northbound message is a northbound message with any format.
As in the above example of step S102, the corresponding key data combination result is:
[
{
"reportTime":1614049402460,
"deviceKey":"test_1",
"collectTime":1614049402460,
"s2":"123",
"f1":234
},
{
"reportTime":1614049402460,
"deviceKey":"test_1",
"collectTime":1614049402459,
"s2":"234",
"f1":345
}
]
step S106, a preset northbound message template is obtained, wherein the position information of the data to be replaced in the target northbound message is represented by a second data expression in the northbound message template, and the second nesting relationship in the northbound message template is the same as the nesting relationship in the target northbound message;
the format of the second data expression is as follows: position information: and $ variable field, wherein the variable field is any field and is unique in the same message template.
It should be noted that: the preset northbound message template is an artificially defined message template, and the data to be replaced represented in the second data expression is artificially specified data.
The following illustrates a target northbound message and a preset northbound message template by using a specific example:
target northbound message:
{
"body":{
"id":"zy_test_1",
"thingType":"Device",
"items":[
{
"qBad":[],
"ts":"1613617047827",
"properties":{
"string":"234",
"int":345
}
}
]
}
}
a preset northbound message template corresponding to the target northbound message:
{
"body":{
"id":${deviceKey},
"thingType":"Device",
"items":[
{
"qBad":[],
"ts":${collectTime},
"properties":{
"string":${s2},
"int":${f1}
}
}
]
}
}
several rules for artificially defining a northbound message template according to the northbound message are explained below: (1) the required fields in the northbound message need to be defined in the template, i.e. the northbound message template also includes other required fields, such as: "thingType": Device "; (2) if the necessary fields are not replaced, the fixed value or null should be filled according to the rule of the northbound message, such as the fixed value: a Device; (3) and (4) automatically summarizing and merging key data combination results extracted from the southbound messages according to the nesting relation of the northbound messages, and if a first data expression in the southbound messages is empty, using null for replacement during matching, wherein in the northbound part template, if the data expression about $ { f1} in the southbound messages is empty, the final result is int:null.
Step S108, summarizing the key data combination result according to a second nesting relation to obtain a key data combination result conforming to the second nesting relation;
summarizing the key data combination result in the step S104 according to the second nesting relationship in the step S106, and obtaining a key data combination result conforming to the second nesting relationship as follows:
[
{
"deviceKey":"test_1",
"data@":[
{
"collectTime":1614049402459,
"data@":[
{
"s2":"234",
"f1":345
}
]
},
{
"collectTime":1614049402460,
"data@":[
{
"s2":"123",
"f1":234
}
]
}
]
}
]
and step S110, matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message.
Specifically, the key data combination result conforming to the second nesting relationship is matched and replaced with the northbound message template based on the second data expression, so that the converted target northbound message is obtained.
The converted target northbound message obtained by the above example in the embodiment of the present invention is:
{
"body":{
"id":"test_1",
"thingType":"Device",
"items":[
{
"qBad":[],
"ts":1614049402460,
"properties":{
"string":"123",
"int":234
}
},
{
"qBad":[],
"ts":1614049402459,
"properties":{
"string":"234",
"int":345
}
}
]
}
}
in an embodiment of the present invention, a method for converting data packets of an internet of things is provided, including: acquiring a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted; extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result; then obtaining a preset northbound message template, wherein the position information of the data to be replaced in the target northbound message is represented by a second data expression in the northbound message template, and the second nesting relationship in the northbound message template is the same as the nesting relationship in the target northbound message; then, summarizing the key data combination result according to a second nesting relation to obtain a key data combination result conforming to the second nesting relation; and finally, matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message. According to the Internet of things data message conversion method, the south message to be converted in any format can be automatically converted into the converted target north message in any format, convenience and rapidness are achieved, customized development of the message is not needed, the requirement on technical personnel is low, the workload of message generation is reduced, and the technical problems that the existing Internet of things data message generation method is long in time consumption, high in requirement on the technical personnel and large in workload are solved.
In an optional embodiment of the present invention, after acquiring the preset southbound message template, before extracting corresponding key data from the southbound message to be converted according to the first data expression in the southbound message template, the method further includes:
and analyzing the southbound message template to obtain a first data expression and a first nesting relation.
In an optional embodiment of the present invention, after obtaining the preset northbound message template, before summarizing the key data combination result according to the second nesting relationship, the method further includes:
and analyzing the northbound message template to obtain a second data expression and a second nesting relation.
The method for converting the data message of the Internet of things reduces the technical threshold, does not need professional developers, only needs to manually define the template, is simple and quick, and does not need to modify the template if the format of the southbound message or the northbound message is changed and the key field is not changed; if the key field is changed, the format conversion of the message is automatically realized only by modifying the template of the corresponding part, which is convenient and fast, and reduces the workload of generating the message.
Example two:
the embodiment of the invention also provides a device for converting the data message of the internet of things, which is mainly used for executing the method for converting the data message of the internet of things provided by the first embodiment of the invention, and the device for converting the data message of the internet of things provided by the embodiment of the invention is specifically described below.
Fig. 2 is a schematic diagram of a device for converting data packets of the internet of things according to an embodiment of the present invention, and as shown in fig. 2, the device mainly includes: a first acquisition unit 10, a data extraction and combination unit 20, a second acquisition unit 30, a summarization unit 40 and a matching replacement unit 50, wherein:
the first obtaining unit is used for obtaining a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
the data extraction and combination unit is used for extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
the second obtaining unit is used for obtaining a preset northbound message template, wherein the position information of the data to be replaced in the target northbound message is represented by a second data expression in the northbound message template, and a second nesting relation in the northbound message template is the same as that in the target northbound message;
the summarizing unit is used for summarizing the key data combination result according to the second nesting relationship to obtain a key data combination result conforming to the second nesting relationship;
and the matching replacement unit is used for matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message.
In an embodiment of the present invention, a device for converting data packets of an internet of things is provided, including: acquiring a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted; extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result; then obtaining a preset northbound message template, wherein the position information of the data to be replaced in the target northbound message is represented by a second data expression in the northbound message template, and the second nesting relationship in the northbound message template is the same as the nesting relationship in the target northbound message; then, summarizing the key data combination result according to a second nesting relation to obtain a key data combination result conforming to the second nesting relation; and finally, matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message. According to the internet of things data message conversion device, the south message to be converted in any format can be automatically converted into the converted target north message in any format, convenience and rapidness are achieved, customized development of the message is not needed, the requirement on technical personnel is low, the workload of message generation is reduced, and the technical problems that the existing internet of things data message generation method is long in time consumption, high in requirement on the technical personnel and large in workload are solved.
Optionally, the apparatus is further configured to: and analyzing the southbound message template to obtain a first data expression and a first nesting relation.
Optionally, the apparatus is further configured to: and analyzing the northbound message template to obtain a second data expression and a second nesting relation.
Optionally, the matching replacement unit is further configured to: and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template based on the second data expression to obtain the converted target northbound message.
Optionally, the format of the first data expression and the second data expression is: position information: and $ variable field, wherein the variable field is any field and is unique in the same message template.
Optionally, other necessary fields are also included in the northbound message template.
Optionally, the south-bound message to be converted is a south-bound message in any format, and the target north-bound message is a north-bound message in any format.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
As shown in fig. 3, an electronic device 600 provided in an embodiment of the present application includes: the internet of things data message conversion method comprises a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601, when an electronic device runs, the processor 601 and the memory 602 communicate through the bus, and the processor 601 executes the machine-readable instructions to execute the steps of the internet of things data message conversion method.
Specifically, the memory 602 and the processor 601 can be general memories and processors, which are not limited in particular, and when the processor 601 runs a computer program stored in the memory 602, the method for converting the internet of things data message can be executed.
The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 601. The Processor 601 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the method in combination with the hardware thereof.
Corresponding to the method for converting the data message of the internet of things, an embodiment of the present application further provides a computer-readable storage medium, where a machine executable instruction is stored in the computer-readable storage medium, and when the computer executable instruction is called and executed by a processor, the computer executable instruction causes the processor to execute the step of the method for converting the data message of the internet of things.
The internet of things data message conversion device provided by the embodiment of the application can be specific hardware on equipment or software or firmware installed on the equipment. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
For another example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the vehicle marking method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the scope of the embodiments of the present application. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method for converting data messages of the Internet of things is characterized by comprising the following steps:
acquiring a preset southbound message template, wherein the southbound message template adopts a first data expression to represent the position information of key data in the southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
analyzing the southbound message template to obtain the first data expression and the first nesting relation;
extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
acquiring a preset northbound message template, wherein a second data expression is adopted in the northbound message template to represent position information of data to be replaced in a target northbound message, and a second nesting relationship in the northbound message template is the same as that in the target northbound message;
summarizing the key data combination result according to the second nesting relationship to obtain a key data combination result conforming to the second nesting relationship;
and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain a converted target northbound message.
2. The conversion method according to claim 1, wherein after obtaining the preset northbound message template, before summarizing the key data combination results according to the second nesting relationship, the method further comprises:
and analyzing the northbound message template to obtain the second data expression and the second nesting relationship.
3. The conversion method according to claim 1, wherein matching and replacing the key data combination result conforming to the second nesting relationship with the northbound message template comprises:
and matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template based on the second data expression to obtain the converted target northbound message.
4. The conversion method of claim 1, wherein the first data expression and the second data expression are in the format of: position information: and $ variable field, wherein the variable field is any field and is unique in the same message template.
5. The translation method according to claim 1, wherein other necessary fields are included in the northbound message template.
6. The conversion method according to claim 1, wherein the southbound packet to be converted is a southbound packet of any format, and the target northbound packet is a northbound packet of any format.
7. A conversion device for data messages of the Internet of things is characterized in that the device comprises:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a preset southbound message template, the southbound message template adopts a first data expression to represent the position information of key data in a southbound message to be converted, and the first nesting relationship in the southbound message template is the same as the nesting relationship in the southbound message to be converted;
the apparatus is further configured to: analyzing the southbound message template to obtain the first data expression and the first nesting relation;
the data extraction and combination unit is used for extracting corresponding key data from the south message to be converted according to a first data expression in the south message template, and combining the key data according to a first nesting relation in the south message template to obtain a key data combination result;
the second obtaining unit is used for obtaining a preset northbound message template, wherein the northbound message template adopts a second data expression to represent position information of data to be replaced in a target northbound message, and a second nesting relationship in the northbound message template is the same as that in the target northbound message;
the summarizing unit is used for summarizing the key data combination result according to the second nesting relationship to obtain a key data combination result conforming to the second nesting relationship;
and the matching and replacing unit is used for matching and replacing the key data combination result conforming to the second nesting relation with the northbound message template to obtain the converted target northbound message.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of any of the preceding claims 1 to 6 are implemented when the computer program is executed by the processor.
9. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to perform the method of any of claims 1 to 6.
CN202111173787.8A 2021-10-09 2021-10-09 Internet of things data message conversion method and device and electronic equipment Active CN113612862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111173787.8A CN113612862B (en) 2021-10-09 2021-10-09 Internet of things data message conversion method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111173787.8A CN113612862B (en) 2021-10-09 2021-10-09 Internet of things data message conversion method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113612862A CN113612862A (en) 2021-11-05
CN113612862B true CN113612862B (en) 2021-12-21

Family

ID=78343370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111173787.8A Active CN113612862B (en) 2021-10-09 2021-10-09 Internet of things data message conversion method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113612862B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830275A (en) * 2018-08-08 2020-02-21 中兴通讯股份有限公司 Transponder configuration method, device, equipment and readable storage medium
CN111832273A (en) * 2019-04-10 2020-10-27 中兴通讯股份有限公司 Method and device for determining destination message, storage medium and electronic device
CN112104664A (en) * 2020-11-02 2020-12-18 长沙树根互联技术有限公司 Protocol conversion method, device and equipment for data of Internet of things
CN113422717A (en) * 2021-06-18 2021-09-21 河南力安测控科技有限公司 Gateway of self-adaptive intelligent terminal equipment protocol and use method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708475A (en) * 2015-07-16 2017-05-24 中兴通讯股份有限公司 Northbound data conversion method and apparatus
CN109617646B (en) * 2018-10-22 2022-10-25 中国平安财产保险股份有限公司 Message conversion method and device, computer equipment and computer readable storage medium
CN110933146B (en) * 2019-11-14 2022-09-16 厦门网宿有限公司 Data conversion method and device and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830275A (en) * 2018-08-08 2020-02-21 中兴通讯股份有限公司 Transponder configuration method, device, equipment and readable storage medium
CN111832273A (en) * 2019-04-10 2020-10-27 中兴通讯股份有限公司 Method and device for determining destination message, storage medium and electronic device
CN112104664A (en) * 2020-11-02 2020-12-18 长沙树根互联技术有限公司 Protocol conversion method, device and equipment for data of Internet of things
CN113422717A (en) * 2021-06-18 2021-09-21 河南力安测控科技有限公司 Gateway of self-adaptive intelligent terminal equipment protocol and use method

Also Published As

Publication number Publication date
CN113612862A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN109325009B (en) Log analysis method and device
CN109460220B (en) Message predefined code generation method and device, electronic equipment and storage medium
US20180232427A1 (en) Data structure endian conversion system
CN108334609B (en) Method, device, equipment and storage medium for realizing JSON format data access in Oracle
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN110708307B (en) Transcoder generation method and apparatus, electronic device, and storage medium
CN112149390A (en) Report generation method, system, computer device and computer-readable storage medium
WO2023124425A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN111611441B (en) Heterogeneous data processing method and device and computer equipment
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN112506910A (en) Multi-source data acquisition method and device, electronic equipment and storage medium
CN107368500B (en) Data extraction method and system
CN113987815A (en) Method and system for checking converter station model
CN113612862B (en) Internet of things data message conversion method and device and electronic equipment
CN113485939A (en) Software system error code management method and device, electronic equipment and storage medium
CN113076094A (en) Front end component construction method and device and electronic equipment
CN114124913B (en) Method and device for monitoring network asset change and electronic equipment
CN112882707B (en) Rendering method and device, storage medium and electronic equipment
CN114896161A (en) File construction method and device based on artificial intelligence, computer equipment and medium
CN111813474A (en) Multi-language display method and device and electronic equipment
CN113343663A (en) Bill structuring method and device
CN112261139A (en) Service data acquisition method and device and electronic equipment
CN106933852B (en) Webpage updating request generation method and device and response method and device thereof
CN113672483B (en) Device log storage method and device, electronic device and medium
CN117668090B (en) Data exchange method, data exchange device, electronic equipment and computer readable storage medium

Legal Events

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