CN113518087A - IOT protocol reverse docking method and device - Google Patents
IOT protocol reverse docking method and device Download PDFInfo
- Publication number
- CN113518087A CN113518087A CN202110782857.3A CN202110782857A CN113518087A CN 113518087 A CN113518087 A CN 113518087A CN 202110782857 A CN202110782857 A CN 202110782857A CN 113518087 A CN113518087 A CN 113518087A
- Authority
- CN
- China
- Prior art keywords
- data
- instruction
- protocol
- content
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000003032 molecular docking Methods 0.000 title claims abstract description 45
- 238000006243 chemical reaction Methods 0.000 claims abstract description 25
- 230000008569 process Effects 0.000 claims abstract description 16
- 230000003044 adaptive effect Effects 0.000 claims abstract description 4
- 238000012545 processing Methods 0.000 claims description 14
- 230000001502 supplementing effect Effects 0.000 claims description 5
- 238000004026 adhesive bonding Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 8
- 230000003993 interaction Effects 0.000 abstract description 2
- 230000015654 memory Effects 0.000 description 13
- 230000005540 biological transmission Effects 0.000 description 9
- 101001072091 Homo sapiens ProSAAS Proteins 0.000 description 7
- 102100036366 ProSAAS Human genes 0.000 description 7
- 238000004891 communication Methods 0.000 description 7
- 238000011161 development Methods 0.000 description 7
- 230000004044 response Effects 0.000 description 7
- 238000003860 storage Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 210000001503 joint Anatomy 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000002035 prolonged effect Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer And Data Communications (AREA)
- Communication Control (AREA)
Abstract
The invention discloses a method and a device for I OT protocol reverse docking, wherein the method for IOT protocol reverse docking comprises the following steps: receiving source protocol instruction data sent by a source execution main body, and extracting data content and an instruction identification bit; analyzing the data content by matching the extracted instruction identification bits with specific protocol commands; according to the target protocol requirement, data conversion is carried out on the analyzed data content, so that the data are adaptive to the target protocol instruction data; and assembling the converted data to enable the data to become instruction content data meeting the requirements of the target protocol, and sending the instruction content data to the target execution main body. The invention can use a uniform protocol conversion technology to uniformly process different execution subject protocols of different hardware providers, can adapt to most execution subject protocols in the market, enables hardware equipment to be quickly accessed to a platform, enables the whole instruction interaction to be uniform, accelerates the docking efficiency and improves the maintainability of the system.
Description
Technical Field
The invention belongs to the field of communication of the Internet of things, and particularly relates to a reverse docking method and device for an IOT protocol.
Background
With the continuous development of communication technology, computer technology and electronic technology, mobile communication is developing from Human-to-Human (Human-to-Human, H2H) to Human-to-animal (Human-to-Machine, H2M) and object-to-object (Machine-to-Machine, M2M) communication, and the interconnection of everything becomes a necessary trend of mobile communication development. The Internet of Things (IOT) is a forthcoming feature in this context, which is considered to be the third wave of the world information industry after the computer and Internet. The Internet of things adopts an information technology means, promotes the comprehensive upgrade of human life and production service, and has wide application and development prospect and strong industry driving capability. The European and American countries have brought development of the Internet of things into the whole information strategy, and China has also brought the Internet of things into the national middle and long-term scientific and technical development plans (2006-2020) and the 2050 national industry roadmap. In 1999, the automatic Identification center (Auto-ID Labs) of MIT (massachusetts institute of technology) first proposed the concept of the internet of things, which means that all articles are connected to the internet through Radio Frequency Identification (RFID) and other information sensing devices to realize intelligent Identification and manageable network.
When the intelligent equipment needs to access the cloud SAAS service in the Internet of things, the equipment needs to be ensured to be normally connected to the cloud server, and the equipment can normally communicate with the cloud server. For the networking problem, only an over-stable networking module needs to be provided, but the device and the cloud server need to have a uniform communication protocol when the device needs to communicate with the cloud server. For the intelligent device protocol, no special organization exists to customize the protocols (such as the international standards of TCP protocol and HTTP protocol). So the current protocols are mainly provided by SAAS service providers or smart device providers. If one of the SAAS service provider or the intelligent equipment provider has a mature protocol, the other party only needs to cooperate with the protocol to develop and interface. However, when both the SAAS service provider and the smart device provider have their own mature communication protocols, a conflict occurs, and both hopes that the other party adopts their own protocols. At this time, a completely new docking mode is required to adapt to the situation.
As a platform-type SAAS service provider, it is necessary to adapt to a motherboard protocol customized by each smart device provider. If each mainboard manufacturer needs a specially customized protocol conversion service, the whole system becomes large and bloated, the later maintenance cost becomes large, and a corresponding server is needed to be deployed, so that the cost of the machine is increased. Because the steps of protocol understanding, development, testing, deployment and the like are required before each protocol conversion service is online, the whole docking period is prolonged, the docking cost is increased, and the online risk is increased. In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an IOT protocol reverse docking method, which is a special protocol analysis technology for reverse docking. By the technology, the SAAS service platform can be adapted to most mainboard protocols with custom formats in the market at the same time. The docking personnel only need to know the protocol and configure corresponding protocol content in the system according to the corresponding protocol, so that the whole docking process is simplified, the whole docking period is shortened, risks caused by steps of opening, testing, deploying and the like are reduced, and the machine cost for deploying other services is reduced.
According to an aspect of an embodiment of the present invention, an IOT protocol reverse docking method includes:
receiving source protocol instruction data sent by a source execution main body, and extracting data content and an instruction identification bit; analyzing the data content by matching the extracted instruction identification bits with specific protocol commands; according to the target protocol requirement, data conversion is carried out on the analyzed data content, so that the data are adaptive to the target protocol instruction data; and assembling the converted data to enable the data to become instruction data meeting the requirements of the target protocol, and sending the instruction data to the target execution main body.
As an optional implementation manner, when the source execution main body is a terminal device, and the target execution main body is a server, the source execution main body instruction data is byte stream format data, and the target execution main body instruction data is JSON format data.
As an optional implementation manner, the receiving source protocol instruction data sent by the source execution main body, and extracting data content and instruction identification bits, includes: receiving source protocol instruction data sent by a source execution main body, and checking the validity of the data; processing illegal data to make the data legal; when the instruction data is legal, the data content and the instruction identification bit are extracted.
As an optional implementation, the verifying the validity of the data and processing the illegal data to validate the data includes: checking whether the frame head, the frame tail, the length bit and the check bit data of the instruction content data are normal or not; and forwarding the illegal data content to a package unpacking and gluing service for package unpacking and gluing.
As an optional implementation manner, the performing data conversion on the analyzed data content according to the target protocol requirement to make the data adapt to the target protocol instruction data, and assembling the converted data to make the converted data become the instruction data meeting the target protocol requirement includes: based on the difference of the expression meanings of the data in the instruction, converting the data according to the instruction meaning of the target execution main body requirement in the process of reassembling the instruction; and based on the converted data content, assembling according to a data format defined by the JSON instruction, filling corresponding data content, and reassembling the original instruction content into instruction data meeting the requirements of a target protocol.
As an optional implementation manner, when the source execution main body is a server and the target execution main body is a terminal device, the instruction data of the source execution main body is JSON format data, and the instruction data of the target execution main body is byte stream format data.
As an optional implementation manner, the data content analyzed is subjected to data conversion according to the target protocol requirement, so that the data is adapted to the target protocol instruction data; the converted data is assembled to be the instruction data meeting the requirements of the target protocol, and the method comprises the following steps: based on the difference of the expression meanings of the data in the instruction, converting the data according to the instruction meaning of the target execution main body requirement in the process of reassembling the instruction; based on the converted data content, filling the corresponding data content according to the format of the target protocol; including but not limited to adding the content of the frame head and the frame tail, calculating length bit and check bit data, and supplementing new instructions; and reassembling the original instruction content into target protocol instruction data.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for IOT protocol reverse docking, including:
and the receiving and analyzing unit is configured to analyze the data content after receiving the source protocol instruction content data sent by the source execution main body.
And the data conversion unit is configured to perform data conversion on the analyzed data content according to the target protocol requirement so that the data is adapted to the target protocol instruction data.
And the assembly sending unit is configured to assemble the data according to the converted data to enable the data to become instruction content data meeting the requirements of the target protocol, and sends the instruction content data to the target execution main body.
As an optional implementation, the receiving and parsing unit is further configured to: when the received source protocol instruction data is byte stream format data, verifying the data validity; processing illegal data to make the data legal; when the instruction content data is legal, extracting the data content and the instruction identification bit; and analyzing the data content by matching the extracted instruction identification bits with specific protocol commands.
As an optional embodiment, the assembly sending unit is further configured to: filling corresponding data content according to a byte stream format when the received source protocol instruction data is JSON format data; including but not limited to adding the content of the frame head and the frame tail, calculating length bit and check bit data, and supplementing new instructions; and reassembling the original instruction content into target protocol instruction data.
The invention has the beneficial effects that:
1. the invention directly aims at the processing on the protocol, has no relation with the characteristics of the type, model, industry and the like of specific equipment, can efficiently and quickly butt joint hardware equipment, and further improves the market share of products of a company, thereby having great advantage for the duration of developing new equipment types by the company;
2. the butt joint process of the invention uses the same standard for processing, thus reducing the possibility of error, making the whole butt joint process more controllable and easier to maintain;
3. the docking mode of the invention is directly the docking of the data level, does not need to modify specific codes, reduces BUG caused by opening, testing, deployment and the like, provides the stability of the whole system, can be directly effective after the docking is finished, and can more quickly verify the docking effect;
drawings
FIG. 1 is a system exchange diagram for the IOT protocol reverse docking method of the present invention;
FIG. 2 is a flow chart of a first mode of an embodiment of the invention;
FIG. 3 is a flow chart of a second mode of an embodiment of the present invention;
FIG. 4 is a flow chart of byte stream formatted data in protocol parsing and protocol assembly components of the present invention;
FIG. 5 is a flow chart of JSON format data in protocol parsing and protocol assembling parts according to the present invention;
fig. 6 is a schematic structural diagram of an alternative apparatus for docking an IOT protocol backwards according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an alternative system for docking an IOT protocol backwards according to an embodiment of the present invention.
In the figure:
a reception analysis unit 301, a data conversion unit 302, an assembly transmission unit 303, a memory 402, a processor 404, a transmission device 406, and a connection bus 410.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to fig. 1 to 7 in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. 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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As a platform-type SAAS service provider, it is necessary to adapt to a motherboard protocol customized by each smart device provider. If each mainboard manufacturer needs a specially customized protocol conversion service, the whole system becomes large and bloated, the later maintenance cost becomes large, and a corresponding server is needed to be deployed, so that the cost of the machine is increased. Because the steps of protocol understanding, development, testing, deployment and the like are required before each protocol conversion service is online, the whole docking period is prolonged, the docking cost is increased, and the online risk is increased. As shown in fig. 1, the present invention thus provides a specialized reverse docking protocol resolution technique. Through the technology, the platform can be adapted to most mainboard protocols with custom formats in the market at the same time. The docking personnel only need to know the protocol and configure corresponding protocol content in the system according to the corresponding protocol, so that the whole docking process is simplified, the whole docking period is shortened, risks caused by steps of opening, testing, deploying and the like are reduced, and the machine cost for deploying other services is reduced.
By analyzing the protocols provided by main intelligent equipment providers in the market, the main format of the protocol in the market at present is byte stream, and byte contents in the format of the byte stream mainly comprise a frame head, a frame tail, length bits, check bits, specific data contents, instruction identification bits and the like. Byte stream format data refers to continuous stream data that does not contain boundary data, and the data content is composed of bytes. The byte content mainly comprises a frame head, a frame tail, length bits, check bits, specific data content, instruction identification bits and the like. The frame header is one or several fixed data contents for transmitting the beginning of a section of byte data and is used for indicating the beginning of the data. The end of frame is one or several fixed data contents for transmitting the end of a section of byte data and is used for indicating the end of data. The length bit is specially used for representing the length content of byte data and is mainly used for truncating the data content of a section of byte stream. The check bits are specially used for checking byte stream data, and data errors caused by interference of the data in a network transmission process are prevented. The instruction identification bit is mainly used to identify which specific command the instruction belongs to, and as shown in fig. 4, is a flow chart of parts of byte stream format data in protocol parsing and protocol assembling according to the present invention.
However, in data docking, because the data expression process of the byte stream is not clear enough, the meaning expressed by the byte stream cannot be directly known, and actually, in the interaction of the current server, the environment of the whole internet is relatively stable, the contents such as flow and verification do not need to be considered basically, and the problem needs to be treated in a simpler mode. Therefore, the JSON format character string data is adopted in the process of exchanging with the server, and general technicians can see the meaning expressed by the corresponding instruction through the data, so that the processing flow of the server is simplified. In the data in JSON format, the byte content mainly consists of an instruction identification bit and specific data content, as shown in fig. 5, which is a flow chart of each part of the JSON format data in protocol parsing and protocol assembly.
Based on the above situation, as shown in fig. 1, an embodiment of the present invention provides an IOT protocol reverse docking method, which includes two modes:
as shown in fig. 2, the first mode is that a terminal device between different protocols sends an instruction to a server, in this mode embodiment, a source control main body is the terminal device, a target control main body is the server, terminal device instruction content data is data in a byte stream format, and server instruction content data is data in a JSON format. The method comprises the following specific steps:
s101, receiving source protocol instruction content data sent by a source control main body, and checking data validity;
and receiving source protocol instruction content data sent by a source execution main body (namely the terminal equipment), and checking the validity of the data.
Further, the checking the validity of the instruction content data includes: and checking whether the head, tail, length bit and check bit data of the instruction content data are legal or not.
S102, illegal data in the instruction content data are processed to be legal.
In the embodiment of the present invention, if the result of verifying the data is illegal, basically, a sticky packet is removed, and sticky packets are two cases caused by the fact that the data content is inconsistent with the cache size on the network card of the sender or the receiver in the data transmission process: one situation is unpacking, i.e. a data content may be sent out in several packets; another case is sticky-packaging, i.e. a data packet is sent out that contains several data contents.
In the embodiment of the invention, the step of processing the illegal data in the instruction content data to be legal refers to the step of forwarding the illegal data content to a de-bonding package service to be de-bonded and bonded so as to be legal.
S103, when the instruction content data is legal, extracting the data content and the instruction identification bit.
In the embodiment of the invention, based on the verification of the frame head, the frame tail, the length bit and the check bit data of the instruction content data, when the instruction content data is legal, the data content and the instruction identification bit are extracted, wherein the instruction identification bit is mainly used for identifying which specific command the instruction belongs to.
S104, analyzing data content by matching the extracted instruction identification bits with specific protocol commands;
in the embodiment of the invention, the specific protocol command is matched based on the extracted specific data content and the instruction identification bit, and then the specific data content is analyzed.
S105, according to the target protocol requirement, performing data conversion on the analyzed data content to enable the data to be matched with the target protocol instruction data;
in the embodiment of the invention, based on the difference of the expression meanings of the data in the source protocol instruction and the target protocol instruction, the data needs to be converted according to the instruction meaning required by the target protocol before the instruction is reassembled.
In the process of reassembling the instruction, because the meaning of some data expressed in different instructions is different, for example, the motherboard startup result 0 indicates success, and 1 indicates failure, but the server side startup result 1 indicates success, and 0 indicates failure, based on which the motherboard startup result should be converted from 0 to 1, and 1 to 0, and then the result should be transmitted to the server side, therefore, some data conversion should be performed before assembling the instruction.
And S106, assembling the converted data to enable the converted data to become instruction content data meeting the requirements of the target protocol, and sending the instruction content data to the target execution main body.
In the embodiment of the invention, based on the converted data content, the data is assembled according to the data format defined by the JSON instruction, the corresponding data content is filled, the original instruction content is reassembled into a target protocol instruction content, and the target protocol instruction content is sent to a target execution main body (server).
As shown in fig. 3, the second mode is that a server between different protocols sends an instruction to a terminal device, in this mode embodiment, a source control main body is the server, a target control main body is the terminal device, terminal device instruction content data is data in a byte stream format, and server instruction content data is data in a JSON format. The method comprises the following specific steps:
s201, receiving source protocol instruction content data sent by a source control main body, and extracting data content and an instruction identification bit;
in the embodiment of the invention, the source protocol instruction data sent by the source execution main body (namely the server) is received, and the data content and the instruction identification bit are directly extracted without checking the data validity and processing illegal data in the instruction data because the server instruction content data is JSON (Java Server connection) format data.
S202, analyzing data content by matching the extracted instruction identification bits with specific protocol commands;
in the embodiment of the invention, the specific protocol command is matched based on the extracted specific data content and the instruction identification bit, and then the specific data content is analyzed.
S203, according to the target protocol requirement, data conversion is carried out on the analyzed data content, and the data are made to be adaptive to the target protocol instruction data;
in the embodiment of the invention, based on the difference of the expression meanings of the data in the source protocol instruction and the target protocol instruction, the data needs to be converted according to the instruction meaning required by the target protocol before the instruction is reassembled.
In the process of reassembling the instruction, because the meaning of some data expressed in different instructions is different, for example, the motherboard startup result 0 indicates success and 1 indicates failure, but the server side startup result 1 indicates success and 0 indicates failure, some data conversion should be performed before assembling the instruction.
S204, the converted data is assembled to form instruction content data meeting the requirements of the target protocol;
in the embodiment of the invention, based on the converted data content, filling the corresponding data content according to the byte stream format of the target protocol; then increasing the contents of a frame head and a frame tail; calculating length bit data and check bit data; and filling each item into a new instruction; and the reassembly of the source protocol instruction content into target protocol instruction data is completed.
And S205, after the data are assembled, sending the data to a target execution body.
In the embodiment of the invention, the assembled target protocol instruction data is sent to a target execution main body (terminal equipment).
The following is an example of a specific implementation: the terminal equipment sends a content instruction for finishing reporting the instruction to the server, and simultaneously after the terminal equipment reports the instruction, the server sends a response instruction to the terminal equipment, and the operation process is as follows:
receiving a byte stream format instruction reported by the terminal equipment:
aa152c01010000000a00000000001e00000400000f3f19
checking whether the frame head, the length bit and the check bit data are legal or not, and extracting and processing the data content after the validity is confirmed as follows:
aa2c01010000000a00000000001e00000400000f3f
and recognizing the instruction as a charge ending state (background starting) instruction according to the instruction identification bit.
According to the format defined by the submit charge end state (background start) instruction, the contents are extracted as follows:
{"result":[1],"head":[-86],"PORT":[1],"ELEC":[0,10],"CARD_TYPE":[0],"CARD_ID":[0,0,0,0],"TIME":[0,0],"cmd":[44],"SESSION_ID":[0,0,15,63],"REASON":[4],"CARD_OPE":[0],"CARD_CST":[0,30]}。
and judging whether an instruction needs to be sent to the server side or not, and knowing that the instruction needs to send a CHARGING END related instruction (the corresponding instruction code is CDZ _ AK _ CHARGING _ END) to the server side according to the configuration.
And converting the extracted content into data content which needs to be sent to a server, and sending JSON instruction data out. And if the information needs to be responded to the main board, the information is converted again according to the content extracted before, and then the information is assembled into a new direct instruction to be issued again.
Part of log information is as follows:
1. receiving a byte stream instruction of 10: 51.604-equipment: 0000000092001609, transparent transmission protocol decode- > aa152c01010000000a00000000001e00000400000f3f 19;
2. identifying the specific instruction content of 10: 51.714-ByteHDecode: aa2c01010000000a00000000001e00000400000f3f instruction matching format submission charging end state (background starting);
3. the specific data instruction of 10: 51.716-equipment number of 0000000092001609 is analyzed, and the data needing response is obtained
json-->{"result":[1],"head":[-86],"PORT":[1],"ELEC":[0,10],"CARD_TYPE″:[0],"CARD_ID":[0,0,0,0],"TIME":[0,0],"cmd":[44],"SESSION_ID":[0,0,15,63],"REASON":[4],"CARD_OPE":[0],"CARD_CST":[0,30]};
4. Conversion data 10: 51.720-exchangeable bytes, value:1, type: int
10:51.720-exchangeBytes,value:3,type:int
51.720-exchange bytes, value: remote power-off, type: string
10:51.720-exchangeBytes,value:0,type:int
10:51.721-exchangeBytes,value:10,type:float_0.01
10:51.721-exchangeBytes,value:0.10,type:string;
5. Assembling a specific transmission instruction, and transmitting 10: 51.723-sendteosaas: response data- > device number 0000000092001609, response message SaasMsg (uniqueCode ═ 0000000092001609, fn ═ CDZ _ AK _ CHARGING _ END, sign ═ null, no ═ b7e375 edaa24a07a505c43ed39d2, data { "replay": remote power off {, "code":3, "num":1, "time":0, "replay elec:0.1 }, time out ═ null, gtype ═ AK _ CHARGING _ END, businessExchange ═ null, businequeuequuequuenu);
6. the content of the issued main board command is 10: 51.725-equipment number 0000000092001609, and the data needing response
json-->{"result":[1],"head":[-86],"PORT":[1],"ELEC":[0,10],"CARD_TYPE″:[0],"CARD_ID":[0,0,0,0],"TIME":[0,0],"cmd":[44],"SESSION_ID":[0,0,15,63],"REASON":[4],"CARD_OPE":[0],"CARD_CST":[0,30]};
7. Data should need to be converted, but this instruction has no conversion rules, no conversion is needed 10: 51.727-device 0000000092001609;
8. assemble the instruction to issue the motherboard and issue 10:51.727-sendtofactor response data > device number 0000000092001609, response message aa082c010100000f3f 14.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
As shown in fig. 6, according to another aspect of the embodiment of the present invention, there is also provided an apparatus for IOT protocol reverse docking, including:
the receiving and analyzing unit is configured to analyze the data content after receiving the source protocol instruction content data sent by the source execution main body;
the data conversion unit is configured to perform data conversion on the analyzed data content according to the target protocol requirement so that the data are adapted to the target protocol instruction data;
and the assembly sending unit is configured to assemble the data according to the converted data to enable the data to become instruction content data meeting the requirement of the target protocol, and sends the instruction content data to the server side.
As an optional implementation manner, the receiving and parsing unit is further configured to: when the received source protocol instruction data is byte stream format data, verifying the data validity; processing illegal data to make the data legal; when the instruction content data is legal, extracting the data content and the instruction identification bit; and analyzing the data content by matching the extracted instruction identification bits with specific protocol commands.
As an optional implementation, the assembly sending unit is further configured to: filling corresponding data content according to a byte stream format when the received source protocol instruction data is JSON format data; including but not limited to adding the content of the frame head and the frame tail, calculating length bit and check bit data, and supplementing new instructions; and the original instruction content is reassembled into the instruction content of the target protocol.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, or network devices) to execute all or part of the steps of the method according to the embodiments of the present invention.
Alternatively, as will be understood by those skilled in the art, the memory 402 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for IOT protocol reverse docking in the embodiment of the present invention, and the processor 404 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402, so as to implement the above-mentioned method for IOT protocol reverse docking. The memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 402 may further include memory located remotely from the processor 404, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 402 may be used for storing information such as operation instructions, but is not limited thereto. As an example, as shown in fig. 7, the memory 402 may include, but is not limited to, the reception parsing unit 301, the data conversion unit 302, and the assembly sending unit 303 used in the IOT protocol reverse direction device. In addition, other module units used in the IOT protocol reverse docking device may also be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 406 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 406 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 406 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the above system for docking in reverse direction of IOT protocol further includes: a connection bus 410 for connecting the above-mentioned various module components used in the IOT protocol reverse docking apparatus.
As an optional implementation, the main parsing scheme of the embodiment of the present invention is on the cloud server, and in another implementation, the parsing scheme may be put into a module for parsing.
According to a further aspect of embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed solution can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, 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 through some interfaces, units or modules, and may be in an electrical or other form.
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.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.
Claims (10)
1. An IOT protocol reverse docking method, comprising:
receiving source protocol instruction data sent by a source execution main body, and extracting data content and an instruction identification bit;
analyzing the data content by matching the extracted instruction identification bits with specific protocol commands;
according to the target protocol requirement, data conversion is carried out on the analyzed data content, so that the data are adaptive to the target protocol instruction data;
and assembling the converted data to enable the data to become instruction data meeting the requirements of the target protocol, and sending the instruction data to the target execution main body.
2. The IOT protocol reverse docking method according to claim 1, wherein the source execution body is a terminal device, when the target execution body is a server, the source execution body instruction data is byte stream format data, and the target execution body instruction data is JSON format data.
3. The IOT protocol reverse docking method of claim 2, wherein the receiving of the source protocol command data sent by the source execution agent, extracting the data content and the command identification bit, comprises:
receiving source protocol instruction data sent by a source execution main body, and checking the validity of the data;
processing illegal data to make the data legal;
when the instruction data is legal, the data content and the instruction identification bit are extracted.
4. The IOT protocol reverse docking method of claim 3, wherein the verifying the validity of the data and processing the invalid data to validate the invalid data comprises:
checking whether the frame head, the frame tail, the length bit and the check bit data of the instruction content data are normal or not;
and forwarding the illegal data content to a package unpacking and gluing service for package unpacking and gluing.
5. The IOT protocol reverse docking method of claim 4, wherein the step of converting the parsed data content into data adapted to the target protocol command data according to the target protocol requirement, and assembling the converted data into command data meeting the target protocol requirement comprises:
based on the difference of the expression meanings of the data in the instruction, converting the data according to the instruction meaning of the target execution main body requirement in the process of reassembling the instruction;
and based on the converted data content, assembling according to a data format defined by the JSON instruction, filling corresponding data content, and reassembling the original instruction content into instruction data meeting the requirements of a target protocol.
6. The IOT protocol reverse docking method according to claim 1, wherein the source execution body is a server, and when the target execution body is a terminal device, the source execution body instruction data is JSON format data, and the target execution body instruction data is byte stream format data.
7. The IOT protocol reverse docking method according to claim 6, wherein the parsed data content is converted to data according to the target protocol requirement, so that the data is adapted to the target protocol instruction data; the converted data is assembled to be the instruction data meeting the requirements of the target protocol, and the method comprises the following steps:
based on the difference of the expression meanings of the data in the instruction, converting the data according to the instruction meaning of the target execution main body requirement in the process of reassembling the instruction;
based on the converted data content, filling the corresponding data content according to the format of the target protocol;
including but not limited to adding the content of the frame head and the frame tail, calculating length bit and check bit data, and supplementing new instructions;
and reassembling the original instruction content into target protocol instruction data.
8. An apparatus for IOT protocol reverse docking, comprising:
the receiving and analyzing unit is configured to analyze the data content after receiving the source protocol instruction content data sent by the source execution main body;
the data conversion unit is configured to perform data conversion on the analyzed data content according to the target protocol requirement so that the data are adapted to the target protocol instruction data;
and the assembly sending unit is configured to assemble the data according to the converted data to enable the data to become instruction content data meeting the requirements of the target protocol, and sends the instruction content data to the target execution main body.
9. The apparatus of claim 8, wherein the receive parsing unit is further configured to:
when the received source protocol instruction data is byte stream format data, verifying the data validity; processing illegal data to make the data legal;
when the instruction content data is legal, extracting the data content and the instruction identification bit;
and analyzing the data content by matching the extracted instruction identification bits with specific protocol commands.
10. The apparatus of claim 8, wherein the assembly sending unit is further configured to:
filling corresponding data content according to a byte stream format when the received source protocol instruction data is JSON format data;
including but not limited to adding the content of the frame head and the frame tail, calculating length bit and check bit data, and supplementing new instructions;
and reassembling the original instruction content into target protocol instruction data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110782857.3A CN113518087A (en) | 2021-07-12 | 2021-07-12 | IOT protocol reverse docking method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110782857.3A CN113518087A (en) | 2021-07-12 | 2021-07-12 | IOT protocol reverse docking method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113518087A true CN113518087A (en) | 2021-10-19 |
Family
ID=78066621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110782857.3A Pending CN113518087A (en) | 2021-07-12 | 2021-07-12 | IOT protocol reverse docking method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113518087A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116346531A (en) * | 2023-05-26 | 2023-06-27 | 云南自由贸易试验区苇航智能科技有限责任公司 | Adaptation method based on CANBUS communication protocol |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106647666A (en) * | 2016-12-28 | 2017-05-10 | 合肥城市云数据中心股份有限公司 | Data collection method based on online identification assembling device object protocol library |
CN107040549A (en) * | 2017-06-08 | 2017-08-11 | 山大鲁能信息科技有限公司 | A kind of TCP packet splicings processing method, server and system |
CN108924773A (en) * | 2018-06-04 | 2018-11-30 | 北京百悟科技有限公司 | Message treatment method and device |
CN110933146A (en) * | 2019-11-14 | 2020-03-27 | 厦门网宿有限公司 | Data conversion method and device and server |
CN111835786A (en) * | 2020-07-23 | 2020-10-27 | 杨承 | System for data acquisition and equipment control of multi-protocol equipment and implementation method |
CN112565443A (en) * | 2020-12-08 | 2021-03-26 | 中煤航测遥感集团有限公司 | Internet of things data analysis method, device, equipment and storage medium |
US20210168224A1 (en) * | 2019-11-30 | 2021-06-03 | Verizon Patent And Licensing Inc. | Systems and methods for binary message transformation using custom descriptors |
-
2021
- 2021-07-12 CN CN202110782857.3A patent/CN113518087A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106647666A (en) * | 2016-12-28 | 2017-05-10 | 合肥城市云数据中心股份有限公司 | Data collection method based on online identification assembling device object protocol library |
CN107040549A (en) * | 2017-06-08 | 2017-08-11 | 山大鲁能信息科技有限公司 | A kind of TCP packet splicings processing method, server and system |
CN108924773A (en) * | 2018-06-04 | 2018-11-30 | 北京百悟科技有限公司 | Message treatment method and device |
CN110933146A (en) * | 2019-11-14 | 2020-03-27 | 厦门网宿有限公司 | Data conversion method and device and server |
US20210168224A1 (en) * | 2019-11-30 | 2021-06-03 | Verizon Patent And Licensing Inc. | Systems and methods for binary message transformation using custom descriptors |
CN111835786A (en) * | 2020-07-23 | 2020-10-27 | 杨承 | System for data acquisition and equipment control of multi-protocol equipment and implementation method |
CN112565443A (en) * | 2020-12-08 | 2021-03-26 | 中煤航测遥感集团有限公司 | Internet of things data analysis method, device, equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116346531A (en) * | 2023-05-26 | 2023-06-27 | 云南自由贸易试验区苇航智能科技有限责任公司 | Adaptation method based on CANBUS communication protocol |
CN116346531B (en) * | 2023-05-26 | 2023-09-22 | 云南自由贸易试验区苇航智能科技有限责任公司 | Adaptation method based on CANBUS communication protocol |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108062230B (en) | Serial ports transparent transmission and program updating system and its method in a kind of Internet wide | |
CN109768970B (en) | Configurable universal protocol generation method | |
US20180157562A1 (en) | Virtual machine-based data transmission method, apparatus and system | |
CN106411907A (en) | Data transmission method and system | |
CN111083161A (en) | Data transmission processing method and device and Internet of things equipment | |
CN107179697A (en) | A kind of intelligent home equipment control method, apparatus and system | |
CN111294235B (en) | Data processing method, device, gateway and readable storage medium | |
CN111506335A (en) | DSP + FPGA-based program online upgrading method and system | |
CN107426770A (en) | Data communication method, data terminal and system based on data link layer | |
CN105335316A (en) | Motor assembling line serial port server based on cloud computation | |
CN107508828B (en) | A kind of very-long-range data interaction system and method | |
CN111752579A (en) | Bluetooth terminal upgrading method and device, storage medium and electronic equipment | |
CN113518087A (en) | IOT protocol reverse docking method and device | |
CN103838587A (en) | Control system remote upgrading method and device based on GPRS | |
CN112399446A (en) | Edge gateway communication method, device, computer equipment and storage medium | |
CN110704080B (en) | Method for upgrading Bluetooth module through Wi-Fi module | |
CN103685552B (en) | A kind of method for upgrading software of small memory device | |
CN113746850B (en) | Multichannel data acquisition method for Internet of things | |
CN111147597A (en) | File transmission method, terminal, electronic device and storage medium | |
CN106102101A (en) | Processing method that a kind of WAP is connected with Radio Access Controller and system | |
US20130013722A1 (en) | Method for a mobile email client to access to a server, and mobile terminal thereof | |
CN115543755B (en) | Performance supervision method, device, system, equipment and medium | |
CN114827188B (en) | Platform equipment management method, system, terminal and storage medium | |
CN117639906B (en) | Method, device and system for testing performance of gateway station under high-orbit satellite broadband | |
CN104468128B (en) | Type of network interface extensively adapter system for Embedded Network Processor |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211019 |
|
RJ01 | Rejection of invention patent application after publication |