CN108881251B - System and method for access analysis and standardization of any binary equipment - Google Patents

System and method for access analysis and standardization of any binary equipment Download PDF

Info

Publication number
CN108881251B
CN108881251B CN201810688524.2A CN201810688524A CN108881251B CN 108881251 B CN108881251 B CN 108881251B CN 201810688524 A CN201810688524 A CN 201810688524A CN 108881251 B CN108881251 B CN 108881251B
Authority
CN
China
Prior art keywords
attribute
definition
attribute set
original
message
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
CN201810688524.2A
Other languages
Chinese (zh)
Other versions
CN108881251A (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.)
Guangzhou University
Original Assignee
Guangzhou University
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 Guangzhou University filed Critical Guangzhou University
Priority to CN201810688524.2A priority Critical patent/CN108881251B/en
Publication of CN108881251A publication Critical patent/CN108881251A/en
Application granted granted Critical
Publication of CN108881251B publication Critical patent/CN108881251B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 

Landscapes

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

Abstract

The invention discloses a system for access analysis and standardization of any binary equipment, which comprises: the access unit reads protocol data of the accessed binary equipment, and finishes the segmentation and the escape of the binary data stream through a predefined message segmentation rule to obtain original message data; the analysis unit receives the original message data and analyzes the protocol message data into an original attribute set according to the preset original attribute set definition; and the standardization unit correspondingly fills the data in the original attribute set into the standard attribute set according to the standard attribute set definition to complete the standard attribute set construction. The access unit and the analysis unit are used for realizing the access and analysis of any binary equipment, the standard attribute set which can be read by a third-party platform is obtained through the standardization unit, the access analysis and standardization of any binary equipment are realized, and the problem that the existing access method has defects is solved.

Description

System and method for access analysis and standardization of any binary equipment
Technical Field
The present invention relates to a data analysis system and method, and more particularly, to an analysis and standardization system and method suitable for any binary device access.
Background
The internet of things field has a large amount of equipment applied to different manufacturers in the same scene, and because the internet of things industry has high development speed and wide application range, and many fields have no standard protocol format, the problems of inconsistent data types and inconsistent data formats exist when the same system or platform is connected with the equipment of different manufacturers, even when the same system or platform is connected with the equipment of the same manufacturer in different periods.
In order to solve the above problems, the currently adopted solutions are mainly divided into two types, one is to dock only one type or one type of device during platform construction, and the code structure needs to be continuously adjusted for the docking of multiple types of devices. Secondly, a description Protocol similar to a Google Protocol buffer is adopted, and Protocol Buffers are a light and efficient structured data storage format, can be used for structured data serialization or serialization, are suitable for data storage or RPC data exchange format, and can be used for language-independent, platform-independent and extensible serialized structured data formats in the fields of communication protocols, data storage and the like. However, there are still many problems in google proto Buffer when it is applied in the field of internet of things. Firstly, Google Proto Buffer is a custom protocol, which cannot effectively describe the well-defined protocol format, and secondly, Google Proto Buffer does not support bit operation and conditional operation, nor does it support standardized functions.
Specifically, when the internet of things field equipment is used for communication, a bit-defining mode is adopted to transmit data in many times in order to reduce bandwidth requirements, a bit-defining mode is also adopted to define conditions sometimes, if yes, the following data is read, otherwise, the data does not exist, and the Google Proto Buffer is mainly designed for inter-platform communication, does not operate on bits, and does not provide such conditional operation. Moreover, the Google Proto Buffer is only a protocol definition and analysis tool, and does not support the protocol standardization function.
For accessing binary equipment (equipment using binary communication) with inconsistent data types and inconsistent data formats to the same platform, the existing access methods have certain limitations, cannot support the access of any binary equipment, cannot standardize the accessed equipment, and are convenient for platform reading.
Disclosure of Invention
The invention provides a system and a method for access analysis and standardization of any binary equipment, and aims to solve the problems that the existing access method is limited, cannot support the access of any binary equipment, and cannot standardize the accessed equipment.
In order to achieve the above object, the present invention provides a system for analyzing and standardizing any binary device access, comprising:
the access unit reads protocol data of the accessed binary equipment, and completes the segmentation and the escape of the binary data stream through a predefined message segmentation rule to obtain original message data, wherein the predefined message segmentation rule comprises the following steps: defining byte order rules, defining a message segmentation method and defining escape rules;
the analysis unit receives original message data and analyzes the protocol message data into an original attribute set according to a preset original attribute set definition, wherein the original attribute set definition comprises an attribute analysis definition, an attribute analysis sequence and a reading condition definition;
and the standardization unit correspondingly fills the data in the original attribute set into the standard attribute set according to the standard attribute set definition to finish the standard attribute set construction, wherein the standard attribute set definition comprises attribute mapping rule definition and attribute set finishing condition definition.
Compared with the prior art, the system for any binary equipment access analysis and standardization, disclosed by the invention, has the advantages that the access unit is used for segmenting and escaping binary data streams with any structures to obtain original data messages, the analysis unit is used for analyzing the original data messages into original attribute sets, the standardization unit is used for generating the standardized attribute sets through the original attribute sets, and the standardized attribute sets can be classified into third-party platforms (namely, the same platform or system of a plurality of equipment can be accessed as mentioned in the background technology). The access unit in the invention can predefine message division rules, and the definition of the message division rules is binary data stream protocol rule definition based on XML, so that the system supports bit operation and conditional operation. The system can divide and escape binary data streams constructed at random to obtain original data messages by predefining message division rules in the access unit, and can analyze the original data messages by predefining original attribute set definitions in the analysis unit, so that the system realizes access analysis of any binary equipment, and solves the limitation that only one type or one type of equipment is connected during platform construction at present. The standard attribute set is predefined in the standardization unit according to the requirements of a third-party platform, and the original attribute set obtained by analysis can be mapped to obtain the standard attribute set, so that the standard attribute set is convenient to read by the third-party platform, and the problem that the Google protocol buffer does not support a protocol standardization function is solved. And because the message segmentation rule, the original attribute set definition and the standardized attribute set definition are configured on the system, the binary equipment is not required to send the protocol rule in a data stream mode, the accessed binary equipment only sends the data content without sending the protocol content, the separation of the data content and the protocol rule is realized, and the transmission pressure of the binary equipment is greatly reduced. The access unit and the analysis unit are used for realizing the access and analysis of any binary equipment, the standard attribute set which can be read by a third-party platform is obtained through the standardization unit, the access analysis and standardization of any binary equipment are realized, and the problem that the existing access method has certain limitation when the binary equipment with inconsistent data types and inconsistent data formats is accessed to the same platform is solved.
In order to achieve the above object, the present invention provides a method for analyzing and standardizing any binary device access, which is characterized by comprising the following steps:
s1, predefining rules of any binary equipment access analysis system; wherein the predefining comprises defining a message segmentation rule, defining an original attribute set and defining a standard attribute set; the definition of the message segmentation rule comprises byte order rule definition, message segmentation method definition and escape rule definition; the definition of the original attribute set comprises attribute analysis definition, attribute analysis sequence and reading condition definition; the standard attribute set definition comprises attribute mapping rule definition and attribute set completion condition definition;
s2, receiving the binary data stream sent by the accessed binary equipment, and segmenting and escaping the received binary data stream to obtain the original message data;
s3, analyzing the original message data, filling corresponding attribute values in predefined original attributes to obtain an original attribute set;
and S4, filling the attribute values mapped by the original attribute set into the predefined standard attribute set to form a standard attribute set.
Compared with the prior art, the method for any binary equipment access analysis and standardization, disclosed by the invention, completes rule predefinition in the message segmentation rule definition module, the original attribute definition module and the standard attribute set definition module through the rule predefinition step. The predefined message splitting rule in the invention is defined by binary data stream protocol rule based on XML, so the method can support bit operation and conditional operation. Because the message segmentation rule is predefined, the binary data stream with any structure can be segmented and transferred according to the predefined rule to obtain the original data message, and because the original attribute set is predefined, the original data message can be analyzed into the original attribute set, so that the system realizes the access analysis of any binary equipment, and solves the limitation that only one or one type of equipment is connected during the platform construction at present. The standard attribute set is predefined according to the requirements of a third-party platform, and the original attribute set obtained by analysis can be mapped to obtain the standard attribute set, so that the standard attribute set can be conveniently read by the third-party platform, and the problem that the Google Proto Buffer does not support a protocol standardization function is solved. Moreover, because the message segmentation rule, the original attribute set definition and the standardized attribute set definition are all completed in the rule definition step (step S1) and are not completed together with the protocol data transmission, the accessed binary equipment only needs to send the data content without sending the protocol content, the separation of the data content and the protocol rule is realized, and the transmission pressure of the binary equipment is greatly reduced. The invention realizes the access and analysis of any binary equipment by predefining the message segmentation rule definition and the original attribute definition, obtains the standard attribute set which can be read by a third party platform by predefining the standardized attribute set, realizes the access analysis and standardization of any binary equipment, and solves the problem that the prior access method has certain limitation when the binary equipment with inconsistent data types and data formats is accessed to the same platform.
Drawings
FIG. 1 is a block diagram of a system for arbitrary binary device access resolution and standardization;
FIG. 2 is a flow diagram of a method for arbitrary binary device access resolution and normalization;
fig. 3 is a flowchart of step S1 of a method for arbitrary binary device access parsing and normalization;
FIG. 4 is a flowchart of step S2 of a method for arbitrary binary device access resolution and normalization;
FIG. 5 is a flowchart of step S3 of a method for arbitrary binary device access resolution and normalization;
FIG. 6 is a flowchart of step S4 of a method for arbitrary binary device access resolution and normalization;
fig. 7 is a flow diagram of one embodiment of a method for arbitrary binary device access resolution and normalization.
Detailed Description
As shown in fig. 1, a system for analyzing and standardizing access of any binary device includes: the access unit reads protocol data of the accessed binary equipment, and finishes the segmentation and the escape of the binary data stream through a predefined message segmentation rule to obtain original message data; the analysis unit receives the original message data and analyzes the protocol message data into an original attribute set according to the preset original attribute set definition; and the standardization unit correspondingly fills the data in the original attribute set into the standard attribute set according to the standard attribute set definition to complete the standard attribute set construction. The access unit and the analysis unit are used for realizing the access and analysis of any binary equipment, the standard attribute set which can be read by a third-party platform is obtained through the standardization unit, the access analysis and standardization of any binary equipment are realized, and the problem that the existing access method has certain limitation when the binary equipment with inconsistent data types and inconsistent data formats is accessed to the same platform is solved.
As shown in fig. 1, the access unit includes: the message segmentation rule definition module receives the predefinition of a user and stores the user operation in the message segmentation rule definition module to form a message segmentation rule predefined by the user; the data segmentation module is used for receiving the protocol data and segmenting the protocol data by using the message segmentation rule stored in the message segmentation rule definition module to obtain a data message containing the escape character; and the escape processing module is used for escaping the data message forwarded by the data segmentation module to obtain the original message data. The access module completes the access and division of the device protocol data, and the access module completes the division algorithm of the binary data stream through the predefined message division rule. In one embodiment of the invention, the message segmentation rule comprises three parts of binary basic information, a message segmentation method and a transfer processing method. Specifically, binary basic information: the endian processing mode of the binary stream is indicated. The message segmentation method comprises the following steps: the general internet of things message can be divided into two major types of messages of fixed length type and variable length type, the fixed length type message generally starts with a message start mark (special character or character string), the definition of protocol length is followed, and the message division is completed by the byte number of the message start mark plus the protocol length; the variable length class means that the message has no fixed length, and the division of the message is realized by the length marked by the start mark and the end mark or the length field. The escape processing method comprises the following steps: because the data with the same value as the start mark or the end mark in the message body needs to be transmitted by using an escape mode, the data access module needs to complete the processing of escape data according to a predefined escape rule, thereby forming independent protocol message data. The message segmentation rule containing the content is predefined in an access unit of the arbitrary binary equipment access analysis and standardization system, so that the arbitrary binary message is segmented, and the original message data is obtained.
As shown in fig. 1, the parsing unit includes: the original attribute set definition module receives user operation and defines all original attribute sets according to the protocol description of the binary equipment before the binary equipment is accessed; the attribute analysis module reads values from the original message data, analyzes the values to obtain attribute values corresponding to the configured attributes, and completes an original attribute set; and the attribute value conversion module is used for converting the attribute value for the specific attribute value. In an embodiment of the present invention, the original attribute set definition includes definitions (attribute resolution definitions) of attribute resolution modules corresponding to all attributes included in the protocol message, and definitions of the order and reading conditions of the attribute resolution modules. The original attribute set definition is generally completed before accessing the internet of things device according to a protocol description of the internet of things device. The attribute analysis module can be an attribute analyzer which finishes reading values from the binary stream and forms the work of attributes according to configured attribute names, and the definition (attribute analysis definition) of the attribute analysis module comprises information such as attribute names, data types, protocol reading lengths, protocol reading modes, protocol reading conditions, an attribute value conversion module and the like. In this embodiment, the set of attribute resolvers pre-prepared by the arbitrary binary device access resolution and standardization system include attribute resolvers of common data, such as a boolean attribute resolver, a string attribute resolver, an integer attribute resolver, and a floating point attribute resolver. The attribute value conversion module may be an attribute value converter, and the attribute value converter performs specific attribute value conversion, for example, in order to ensure data precision, floating point numbers are transmitted in an integer manner in data transmission, and then after reading the attribute values, the attribute values need to be restored to the original attribute values through the attribute value converter. In this embodiment, the arbitrary binary device is accessed into the analysis and standardization system to prepare a four-element operation expression type attribute value converter.
As shown in fig. 1, the standardization unit includes a standard attribute set definition module, which defines a standard attribute set according to the requirements of a third-party platform; the attribute mapping rule module corresponds the attributes in the original attribute set with the attributes in the standard attribute set according to the mapping rule in the standard attribute set definition; and the standardized attribute set filling module is used for filling corresponding attribute values into the attributes in the standardized attribute set. The standardization unit completes the work of realizing the standard attribute set construction according to the standard attribute set definition. Specifically, the attribute mapping rule: and finishing the mapping rule of the attribute names in the original attribute set and the attribute names in the standard attribute set by adopting a mode of specifying the original attribute names, and finishing the mapping by adopting a same-name mode by default. Attribute set completion conditions: because the internet of things devices are numerous and the attributes of the same type of devices are different, the attribute set completion condition indicates that the attributes must have values, and after the attributes are assigned, the standardized attribute set has the use condition of the third-party internet of things application platform. In this embodiment, the standard attribute set definition is provided by a third-party internet of things application platform. Based on the method, after the internet of things device protocol data is processed by the random binary device access analysis and standardization system, a standard attribute set which can be used by a third-party internet of things application platform is formed, so that the application platform and the internet of things device are completely decoupled.
As shown in FIG. 2, a method for analyzing and standardizing any binary equipment access comprises the following steps of S1, performing rule predefining on any binary equipment access analysis system; s2, receiving the binary data stream sent by the accessed binary equipment, and segmenting and escaping the received binary data stream to obtain the original message data; s3, analyzing the original message data, filling corresponding attribute values in predefined original attributes to obtain an original attribute set; and S4, filling the attribute values mapped by the original attribute set into the predefined standard attribute set to form a standard attribute set. The invention realizes the access and analysis of any binary equipment by predefining the message segmentation rule definition and the original attribute definition, obtains the standard attribute set which can be read by a third party platform by predefining the standardized attribute set, realizes the access analysis and standardization of any binary equipment, and solves the problem that the prior access method has certain limitation when the binary equipment with inconsistent data types and data formats is accessed to the same platform.
As shown in fig. 3, the step S1 includes the following steps: s11, defining the message segmentation rule, wherein the predefined message segmentation rule is stored in the message segmentation rule definition module; s12, defining an original attribute set, wherein the predefined original attribute set is stored in an original attribute definition module; and S13, defining the standard attribute set, wherein the predefined standard attribute set is stored in the standard attribute set definition module. The invention completes the message division rule definition, the original attribute set definition and the standardized attribute set definition in advance through the rule definition step (step S1), so that the rule content is not completed together with the protocol data transmission, the accessed binary equipment only sends the data content without sending the protocol content, the separation of the data content and the protocol rule is realized, and the transmission pressure of the binary equipment is greatly reduced. And moreover, the rule definition is realized by adopting an XML mode, the operation and the conditional operation are guaranteed, and the defects of using the Google Proto Buffer are overcome. In one embodiment of the invention, the message segmentation rule definition comprises three parts of byte order rule definition (binary basic information), message segmentation method definition and escape rule definition (escape processing method), the original attribute set definition comprises attribute resolution definition and definition of attribute resolution sequence and reading condition, and the standard attribute set definition comprises two parts of attribute mapping rule definition and attribute set completion condition definition.
Specifically, in this embodiment, the endian rule definition value may be BIG or LITTLE, and respectively represents BIG-end and small-end endianness. The message segmentation method definition comprises the following parameters: the starting character takes the value of 16 bytes or byte arrays, and is in the form of: 0xFF, used to identify the start of the protocol message. The ending character takes the value of 16 bytes or byte arrays, and the form is as follows: 0xFF, used to identify the end of the protocol message. If no ending character is marked, the end position of the fixed-length type message is calculated by searching the attribute name of the message length. The escape rule comprises a plurality of attributes, the name of each attribute is a character needing escape, and the value of each attribute is the definition of escape. The original attribute set definition includes the following parameters: defining a message Id for the set of attributes to represent different messages in the protocol; the message length of the protocol is marked aiming at the fixed length protocol; all attributes in the set of attributes are defined. The definition of the attributes in the defined set of attributes includes the following parameters: defining a name for the attribute, the name being unique within the attribute set; the attribute resolver type, the data type corresponds to the attribute resolver prefabricated in the system; defining the reading length of an attribute analyzer, wherein the attribute analyzer of a standard data type does not need to indicate the length, a non-standard length data type and a custom type need to indicate length values, and the length values are represented by NB/Nb and respectively represent N bytes or N bits; the attribute value converter is used for defining a four-rule operation to realize the conversion of the attribute value, and if the four-rule operation is not set, the conversion is not carried out; defining a bootean expression as a trigger condition of the attribute parser, and if the bootean expression is not set, defaulting to true; the resolution order is defined. The standardized attribute set definition is defined by adopting an XML format, and because the standardized attribute set is generally transmitted by adopting a self-description type protocol, the type and the length are not defined any more. Only the attribute name, the original attribute name, which must match the attribute name in the message format rule definition, and whether three fields are necessary. The attribute name is any character string with a length not equal to 0, and can not be repeated in a standard attribute set, and the attribute name must be matched with the attribute name in the original attribute set. If not, default to the name attribute value. Whether it must be judged by the value true or false, if this attribute is not set, false is defaulted.
As shown in fig. 4, the step S2 includes the following steps: s21, reading protocol data; s22, judging whether the protocol message starts or ends, discarding the current byte if the protocol message does not start, returning to S21, if the protocol message ends, entering S23; s23, segmenting the protocol data by using the message segmentation rule stored in the message segmentation rule definition module, entering the step S24 if the protocol data can be segmented, and returning to the step S21 if the protocol data cannot be segmented; and S24, performing escaping on the data message forwarded by the data segmentation module through the escaping processing module to obtain the original message data. The step completes two tasks of message segmentation and escape processing of the received binary stream data. In an embodiment of the present invention, the matching start identifier is configured by a system in which the arbitrary binary device accesses, parses and standardizes according to a protocol rule, and discards the data received before the matching start identifier. And finding the end position according to the end identifier or the message length configured by the protocol rule. And cutting the data segment to form a byte array containing the escape character. Scanning the byte array, and performing necessary replacement of the character to be escape with the escape character according to the definition of the protocol rule. Forming a complete array of bytes of the original message.
As shown in fig. 5, the step S3 includes the following steps: s31, according to the message ID of the original message data, obtaining the corresponding original attribute set definition through the original attribute definition module; s32, traversing the attribute analysis definition in the original attribute set definition in sequence, creating an attribute reader according to the attribute analysis definition, and determining the reading length; s33, judging whether the attribute analysis condition is satisfied, if so, reading the attribute value of the attribute, if not, returning to the step S32; s34, judging whether the attribute value of the attribute needs to be converted, if so, converting the attribute value and then putting the converted attribute value into an original attribute set, and if not, directly putting the converted attribute value into the original attribute set; s35, judging whether all the attributes in the original attribute set traverse, if yes, going to step S4, if not, returning to step S32. In one embodiment of the invention, all attributes in the original attribute set definition are traversed and a corresponding attribute parser is used to read the msgId value. The corresponding original attribute set definition is found by the read msgId value. All attributes in the corresponding original attribute set definition are traversed. And checking the reading condition of the attribute, if the condition meets the requirement, matching the original message byte array by using an attribute resolver defined by the attribute, and otherwise, ignoring the attribute. And completing the attribute value conversion according to the attribute value converter defined by the protocol. And forming an original message attribute set according to the attribute names in the original attribute set definition rule and the attribute values matched by the attribute resolver.
As shown in fig. 6, the step S4 includes the following steps: s41, traversing all attributes in the original attribute set; s42, traversing all the defined standard attribute sets; s43, assigning values to the attributes in the standard attribute set; and S44, detecting whether the attribute of the standard attribute set is completely assigned, if so, ending the step, otherwise, returning to the step S2. In one embodiment of the invention, the unified access engine selects a corresponding target standard attribute set definition according to the message type of the original message attribute set. And the unified access engine creates a standard attribute set instance and fills the attributes with the same name in the original message attribute set into the standard attribute set. And checking the completion condition described by the standard attribute set definition, if the completion condition is finished, sending the standard attribute set instance to a downstream platform, otherwise, waiting for a subsequent original message attribute set, and continuously filling other required attributes until the requirements are met.
A specific embodiment of the present invention is described below, and the flow is shown in fig. 7.
Rule pre-definition is performed. The method comprises the steps that certain IOT equipment reports the state of the IOT equipment periodically, wherein the state comprises equipment ID, electric quantity and alarm, and if the alarm is contained, a corresponding alarm state value is added in a message. Device ID: a 10 byte long string. Electric quantity: reporting the battery voltage of the equipment with the unit of mv, but displaying the service system in the form of electric quantity percentage, wherein the electric quantity is 5000mv when the electric quantity is full, and the equipment cannot work when the electric quantity is lower than 4000 mv. And (4) alarming: the first bit of a 32-bit integer indicates whether there is a temperature alarm, the second bit indicates whether there is a speed alarm, and the other 30 bits are reserved for expansion. If the temperature alarm exists, 4 bytes are added in the protocol for explaining the temperature value during the alarm, the integer type and the unit of degree. If there is a speed alarm, 4 bytes are added in the message to explain the speed value at the time of alarm, the unit is kilometer/hour, and there is a decimal part.
And receiving the binary data stream transmitted by the accessed binary equipment, and segmenting and escaping. The unified access engine scans each byte received one by one, marks the message split complete if the byte is equal to the end identifier 0xFF and the start identifier 0xFF has been read, otherwise continues reading bytes. Another 0xFF is encountered and a message ends. 0001303132333435363738390000119401000000FE01 was obtained. Acquiring message data from a message buffer, replacing 0xFE01 with 0xFF and 0xFE02 with 0xFE by using defined escape rules of 0xFF ═ 0xFE01 and 0xFE ═ 0xFE02, completing escape, and acquiring the message data: 0001303132333435363738390000119401000000 FF.
And analyzing the original message data to obtain an original attribute set. Using the first attribute definition, a HexString type attribute parser is created for matching, and the attribute id is 0x 0001. Get the original attribute set definition with msgId 0x 0001. And (3) creating a character string type attribute resolver by using the first attribute definition of the original attribute set for matching, and obtaining the attribute deviceId which is 0123456789. And creating an integer attribute resolver for matching by using the second attribute definition of the original attribute set, and obtaining the attribute basic as 0x00001194 (4500). Using the value converter definition ($ { basic } -4000)/(5000-. And using the third attribute definition to create an integer attribute parser, setting the read length to be 1b, and then matching to obtain an attribute value alarm _ temp which is 1. And using the fourth attribute definition to create an integer attribute parser, setting the read length to be 1b, and then matching to obtain an attribute value alarm _ speed equal to 0. And using the fifth attribute definition to create an integer attribute resolver, setting the read length to be 30b, and then matching to obtain an attribute value reserved which is 0. And checking whether the sixth attribute condition is satisfied, comparing the value of acquired alarm _ temp with 1, and using the sixth attribute to define matching to obtain the attribute temp which is 255. And (4) checking whether the seventh attribute condition is satisfied, comparing the value of the alam _ speed with 1, and not defining matching by using the 7 th attribute if the condition is not satisfied. The analysis is completed, and the original attribute set { deviceId ═ 0123456789, battery ═ 50, alam _ temp ═ 1, alam _ speed ═ 0, temp ═ 255} is obtained.
And mapping to obtain a standard attribute set. And filling the standard attribute set 1 with the original attribute set to obtain a standard attribute set 1{ deviceId 0123456789, basic 50}, wherein all mandatory items are filled and sent to a downstream system. The original attribute set fills the standard attribute set 2 to obtain a standard attribute set 2{ deviceId ═ 0123456789, alarm _ temp ═ 1, temp ═ 255}, and all mandatory items are filled and sent to the downstream system. And filling the standard attribute set 3 with the original attribute set to obtain a standard attribute set 3{ deviceId ═ 0123456789, and alarm _ speed ═ 0speed ═ NULL }, wherein the mandatory speed cannot be filled, and waiting for the next message.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (9)

1. A system for arbitrary binary device access resolution and standardization, comprising: the access unit reads protocol data of the accessed binary equipment, and completes the segmentation and the escape of the binary data stream through a predefined message segmentation rule to obtain original message data, wherein the predefined message segmentation rule comprises the following steps: defining byte order rules, defining a message segmentation method and defining escape rules;
the analysis unit receives original message data and analyzes the protocol message data into an original attribute set according to a preset original attribute set definition, wherein the original attribute set definition comprises an attribute analysis definition, an attribute analysis sequence and a reading condition definition;
and the standardization unit correspondingly fills the data in the original attribute set into the standard attribute set according to the standard attribute set definition to finish the standard attribute set construction, wherein the standard attribute set definition comprises attribute mapping rule definition and attribute set finishing condition definition.
2. The system for arbitrary binary device access resolution and standardization according to claim 1, wherein the access unit includes:
the message segmentation rule definition module receives the predefinition of a user and stores the user operation in the message segmentation rule definition module to form a message segmentation rule predefined by the user;
the data segmentation module is used for receiving the protocol data and segmenting the protocol data by using the message segmentation rule stored in the message segmentation rule definition module to obtain a data message containing the escape character;
and the escape processing module is used for escaping the data message forwarded by the data segmentation module to obtain the original message data.
3. The system for arbitrary binary device access parsing and standardization according to claim 1, wherein the parsing unit includes:
the original attribute set definition module receives user operation and defines all original attribute sets according to the protocol description of the binary equipment before the binary equipment is accessed;
the attribute analysis module reads values from the original message data, analyzes the values to obtain attribute values corresponding to the configured attributes, and completes an original attribute set;
and the attribute value conversion module is used for converting the attribute value for the specific attribute value.
4. The system for arbitrary binary device access resolution and standardization according to claim 1, wherein the standardization unit includes,
the standard attribute set definition module defines a standard attribute set according to the requirement of a third-party platform;
the attribute mapping rule module corresponds the attributes in the original attribute set with the attributes in the standard attribute set according to the mapping rule in the standard attribute set definition;
and the standardized attribute set filling module is used for filling corresponding attribute values into the attributes in the standardized attribute set.
5. A method for analyzing and standardizing any binary equipment access is characterized by comprising the following steps:
s1, predefining rules of any binary equipment access analysis system; wherein the predefining comprises defining a message segmentation rule, defining an original attribute set and defining a standard attribute set; the definition of the message segmentation rule comprises byte order rule definition, message segmentation method definition and escape rule definition; the definition of the original attribute set comprises attribute analysis definition, attribute analysis sequence and reading condition definition; the standard attribute set definition comprises attribute mapping rule definition and attribute set completion condition definition;
s2, receiving the binary data stream sent by the accessed binary equipment, and segmenting and escaping the received binary data stream to obtain the original message data;
s3, analyzing the original message data, filling corresponding attribute values in predefined original attributes to obtain an original attribute set;
and S4, filling the attribute values mapped by the original attribute set into the predefined standard attribute set to form a standard attribute set.
6. The method for arbitrary binary device access parsing and standardization according to claim 5, wherein the step S1 includes the following steps:
s11, storing the predefined message segmentation rule in the message segmentation rule definition module;
s12, storing the predefined original attribute set in the original attribute definition module;
s13, storing the predefined standard attribute set in the standard attribute set definition module.
7. The method for any binary device access parsing and standardizing as claimed in claim 6, wherein the step S2 comprises the steps of:
s21, reading protocol data;
s22, judging whether the protocol message starts or ends, discarding the current byte if the protocol message does not start, returning to S21, if the protocol message ends, entering S23;
s23, segmenting the protocol data by using the message segmentation rule stored in the message segmentation rule definition module, entering the step S24 if the protocol data can be segmented, and returning to the step S21 if the protocol data cannot be segmented;
and S24, performing escaping on the data message forwarded by the data segmentation module through the escaping processing module to obtain the original message data.
8. The method for any binary device access parsing and standardizing as claimed in claim 6, wherein the step S3 comprises the steps of:
s31, according to the message ID of the original message data, obtaining the corresponding original attribute set definition through the original attribute definition module;
s32, traversing the attribute analysis definition in the original attribute set definition in sequence, creating an attribute reader according to the attribute analysis definition, and determining the reading length;
s33, judging whether the attribute analysis condition is satisfied, if so, reading the attribute value of the attribute, if not, returning to the step S32;
s34, judging whether the attribute value of the attribute needs to be converted, if so, converting the attribute value and then putting the converted attribute value into an original attribute set, and if not, directly putting the converted attribute value into the original attribute set;
s35, judging whether all the attributes in the original attribute set traverse, if yes, going to step S4, if not, returning to step S32.
9. The method for arbitrary binary device access parsing and standardizing as claimed in any one of claims 5-8, wherein said step S4 includes the steps of:
s41, traversing all attributes in the original attribute set;
s42, traversing all the defined standard attribute sets;
s43, assigning values to the attributes in the standard attribute set;
and S44, detecting whether the attribute of the standard attribute set is completely assigned, if so, ending the step, otherwise, returning to the step S2.
CN201810688524.2A 2018-06-28 2018-06-28 System and method for access analysis and standardization of any binary equipment Active CN108881251B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810688524.2A CN108881251B (en) 2018-06-28 2018-06-28 System and method for access analysis and standardization of any binary equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810688524.2A CN108881251B (en) 2018-06-28 2018-06-28 System and method for access analysis and standardization of any binary equipment

Publications (2)

Publication Number Publication Date
CN108881251A CN108881251A (en) 2018-11-23
CN108881251B true CN108881251B (en) 2020-02-21

Family

ID=64296510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810688524.2A Active CN108881251B (en) 2018-06-28 2018-06-28 System and method for access analysis and standardization of any binary equipment

Country Status (1)

Country Link
CN (1) CN108881251B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981676A (en) * 2019-04-08 2019-07-05 陈鹏 One kind being based on the customized Internet of Things information interacting method of binary system analysis protocol
CN110120945A (en) * 2019-04-23 2019-08-13 苏州凯迪泰医学科技有限公司 A kind of method of data structured encapsulation
CN110933146B (en) * 2019-11-14 2022-09-16 厦门网宿有限公司 Data conversion method and device and server
CN111010378B (en) * 2019-12-03 2022-02-01 百倍云(无锡)智能装备有限公司 Method for rapidly accessing various sensors and various protocols to cloud platform
CN112565191A (en) * 2020-09-16 2021-03-26 浙江简捷物联科技有限公司 Method and system for analyzing script dynamic protocol
CN112165465B (en) * 2020-09-16 2023-04-07 杭州安恒信息技术股份有限公司 Data processing method and device for outgoing third-party platform and electronic device
CN115801920A (en) * 2022-10-13 2023-03-14 深圳市正浩创新科技股份有限公司 Communication method, communication chip, electronic device, and computer-readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2045790A1 (en) * 2007-10-03 2009-04-08 Harris Corporation Keypad display unit
KR20100012163A (en) * 2008-07-28 2010-02-08 박병희 Monitor remote control unite and bracket combination method
CN106796640A (en) * 2014-09-26 2017-05-31 迈克菲股份有限公司 Classification malware detection and suppression
CN107251453A (en) * 2015-08-06 2017-10-13 华为技术有限公司 A kind of optical access device and multi-plexing light accessing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2045790A1 (en) * 2007-10-03 2009-04-08 Harris Corporation Keypad display unit
KR20100012163A (en) * 2008-07-28 2010-02-08 박병희 Monitor remote control unite and bracket combination method
CN106796640A (en) * 2014-09-26 2017-05-31 迈克菲股份有限公司 Classification malware detection and suppression
CN107251453A (en) * 2015-08-06 2017-10-13 华为技术有限公司 A kind of optical access device and multi-plexing light accessing system

Also Published As

Publication number Publication date
CN108881251A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108881251B (en) System and method for access analysis and standardization of any binary equipment
CN110933146B (en) Data conversion method and device and server
US10666718B2 (en) Dynamic data transport between enterprise and business computing systems
US20060058982A1 (en) Data relay device and data management system using the same
CN111010378B (en) Method for rapidly accessing various sensors and various protocols to cloud platform
CN113596017B (en) Protocol analysis method and device, soft gateway and storage medium
CN112822256A (en) Method and device for transmitting data stream of quotation file
CN110769002A (en) LabVIEW-based message analysis method, system, electronic device and medium
CN114282519A (en) CAN data analysis method and device
CN110912782A (en) Data acquisition method, device and storage medium
CN111813622B (en) Equipment monitoring method and device
CN112187525B (en) Device management method, device, system, device and storage medium
CN108429764B (en) Data transmission and analysis method based on private protocol
CN111078948A (en) Automobile diagnosis data analysis method and system and storage medium
CN116915875B (en) General method for analyzing modbus equipment by Internet of things and modbus system
CN113905107A (en) Method and device for acquiring point list data of industrial equipment and gateway
CN117093261A (en) Code fault tolerance processing method and device based on abstract syntax tree in construction
US20210168224A1 (en) Systems and methods for binary message transformation using custom descriptors
CN110674130A (en) Data transmission method
CN113746919B (en) Multi-message data acquisition method and system based on MQTT protocol
US11216424B2 (en) Dynamically rendering an application programming interface for internet of things applications
CN111711605B (en) Data protocol active analysis method for Internet of things platform
CN114374745A (en) Protocol format processing method and system
CN111597198A (en) Internet of things data query method for heterogeneous resource access and related equipment
CN114070863B (en) Data processing method and device, electronic equipment and 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