CN112565191A - Method and system for analyzing script dynamic protocol - Google Patents

Method and system for analyzing script dynamic protocol Download PDF

Info

Publication number
CN112565191A
CN112565191A CN202011226506.6A CN202011226506A CN112565191A CN 112565191 A CN112565191 A CN 112565191A CN 202011226506 A CN202011226506 A CN 202011226506A CN 112565191 A CN112565191 A CN 112565191A
Authority
CN
China
Prior art keywords
protocol
model
mapping
data
frame structure
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
Application number
CN202011226506.6A
Other languages
Chinese (zh)
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.)
Zhejiang Jianjie Iot Technology Co ltd
Original Assignee
Zhejiang Jianjie Iot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Jianjie Iot Technology Co ltd filed Critical Zhejiang Jianjie Iot Technology Co ltd
Publication of CN112565191A publication Critical patent/CN112565191A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y20/00Information sensed or collected by the things
    • G16Y20/10Information sensed or collected by the things relating to the environment, e.g. temperature; relating to location
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/10Detection; Monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • 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/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The application relates to a method and a system for analyzing a script dynamic protocol, wherein the method for analyzing the script dynamic protocol comprises the following steps: acquiring data acquired by a device sensor, and carrying out bit domain segmentation on the data; sending the original value of the data obtained after the bit domain segmentation to a frame structure of a protocol model, and mapping the data in the frame structure of the protocol model into parameters required by an object model by using a mapping expression through model mapping; acquiring control parameters of equipment added by a user in an object model, and mapping the control parameters into a corresponding frame structure of a protocol model by using a mapping expression through protocol mapping; and carrying out bit field splicing on the data in the protocol model frame structure, and returning and controlling the equipment sensor after protocol encapsulation. Through the application, various protocol devices in the Internet of things are connected in a complicated mode, high-frequency data acquisition, real-time data processing and low-delay feedback response are achieved, data processing efficiency is improved, the protocol devices can be connected in a flexible mode, and the use is more convenient.

Description

Method and system for analyzing script dynamic protocol
Technical Field
The application relates to the technical field of Internet of things, in particular to a method and a system for analyzing a script dynamic protocol.
Background
With the rapid development of the internet of things technology, more and more enterprises realize product upgrading and even enterprise transformation through the internet of things technology, so that the enterprises firmly occupy the leading position in a major trend. While valuable, the challenge is severe. The scene of the internet of things is unknown, various and complex, for example, in a park scene, hundreds of devices with different models and a plurality of complex cross-subsystem linkage requirements may be involved, and therefore, how to access the heterogeneous terminal devices more quickly and flexibly is a first problem in the development of the internet of things technology and related industries.
In the related technology, the gateway of the internet of things basically has no functions of edge calculation and data storage, only performs data transparent transmission, and cannot meet the requirements of the internet of things on high-frequency data acquisition, real-time data processing and low-delay feedback response.
At present, no effective solution is provided for the problems of high-frequency data acquisition, real-time data processing and low-delay feedback response required by the Internet of things and complicated access of various protocol devices in the related technology.
Disclosure of Invention
The embodiment of the application provides a method and a system for analyzing a script dynamic protocol, and at least solves the problems of high-frequency data acquisition, real-time data processing and low-delay feedback response required by the Internet of things in the related technology.
In a first aspect, an embodiment of the present application provides a method for analyzing a dynamic protocol of a script, which is applied to an internet of things gateway system, where the system includes: a protocol model, an object model and a device sensor;
acquiring data acquired by the equipment sensor, and carrying out bit domain segmentation on the data;
sending the original value of the data obtained after bit domain segmentation to a frame structure of the protocol model, and mapping the data in the frame structure of the protocol model into parameters required by the object model by using a mapping expression through model mapping;
acquiring control parameters of equipment added by a user in the object model, and mapping the control parameters into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping;
and performing bit domain splicing on the data in the protocol model frame structure, and returning and controlling the equipment sensor after protocol encapsulation.
In some of these embodiments, the model mapping comprises:
mapping the sensor data in the protocol model frame structure into the object model at 1: n.
In some of these embodiments, the protocol mapping comprises:
and mapping the control parameters in the object model into the corresponding frame structure of the protocol model according to the ratio of n to 1.
In some of these embodiments, establishing the object model comprises:
the object model defines a service identifier by which key names and parameters are obtained.
In some of these embodiments, the mapping expression comprises:
and performing mutual conversion calculation on the object model parameters and the data in the frame structure corresponding to the protocol model through a mathematical calculation expression.
In a second aspect, an embodiment of the present application provides a system for script dynamic protocol parsing, where the system includes: a protocol model, an object model and a device sensor;
the server acquires data acquired by the equipment sensor and performs bit domain segmentation on the data;
the server sends the original value of the data obtained after bit domain segmentation to a frame structure of the protocol model, and the data in the frame structure of the protocol model is mapped into parameters required by the object model by using a mapping expression through model mapping;
the server acquires control parameters of equipment added by a user in the object model, and maps the control parameters into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping;
and the server performs bit domain splicing on the data in the protocol model frame structure, and returns and controls the equipment sensor after protocol encapsulation.
In some of these embodiments, the model mapping comprises:
the server maps the sensor data in the protocol model frame structure into the object model at 1: n.
In some of these embodiments, the protocol mapping comprises:
the server maps the control parameters in the object model into the corresponding frame structure of the protocol model in an n:1 manner.
In some of these embodiments, establishing the object model comprises:
the object model defines a service identifier by which key names and parameters are obtained.
In some of these embodiments, the mapping expression comprises:
and mutually converting and calculating the object model parameters and the data in the frame structure corresponding to the protocol model through a mathematical calculation expression.
Compared with the related art, the method for analyzing the script dynamic protocol, provided by the embodiment of the application, acquires data acquired by an equipment sensor, and performs bit domain segmentation on the data; sending the original value of the data obtained after bit domain segmentation to a frame structure of the protocol model, mapping the data in the frame structure of the protocol model into parameters required by the object model by using a mapping expression through model mapping, and realizing uplink data acquisition; acquiring control parameters of equipment added by a user in the object model, and mapping the control parameters into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping; the data in the protocol model frame structure is subjected to bit domain splicing, and the data is returned and controlled after being packaged by the protocol, so that downlink equipment control is realized, the problems of complicated access of various protocol equipment in the Internet of things, high-frequency data acquisition, real-time data processing and low-delay feedback response are solved, the data processing efficiency is improved, the equipment of various protocols can be flexibly accessed, and the use is more convenient.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of an application environment of a method for script dynamic protocol parsing according to an embodiment of the present application;
FIG. 2 is a flow diagram of a method for script dynamic protocol parsing in accordance with an embodiment of the present application;
FIG. 3 is a schematic diagram of bit-field partitioning according to an embodiment of the present application;
fig. 4 is a frame structure diagram of an uplink protocol model according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an upstream protocol model interface according to an embodiment of the present application;
FIG. 6 is a schematic view of an object model interface according to an embodiment of the present application;
fig. 7 is a frame structure diagram of a downlink protocol model according to an embodiment of the present application;
FIG. 8 is a diagram illustrating a downlink protocol model interface according to an embodiment of the present application;
FIG. 9 is a schematic diagram of bit-field splicing according to an embodiment of the present application;
FIG. 10 is a schematic illustration of protocol model data 1: n mapping to an object model according to an embodiment of the application;
FIG. 11 is a schematic illustration of object model parameters n:1 mapped to a protocol model according to an embodiment of the present application;
FIG. 12 is a block diagram of a script dynamic protocol parsing system according to an embodiment of the present application;
fig. 13 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference herein to "a plurality" means greater than or equal to two. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The method for parsing a script dynamic protocol provided by the present application may be applied to an application environment shown in fig. 1, where fig. 1 is an application environment schematic diagram of a method for parsing a script dynamic protocol according to an embodiment of the present application, as shown in fig. 1, where a system of the application environment includes: the method comprises the following steps of (1) an object model 10, a protocol model 11 and a device sensor 12, and is specifically realized by the following steps: acquiring data acquired by an equipment sensor 12, carrying out bit domain segmentation on the data, sending an original value of the data acquired after the bit domain segmentation into a frame structure of a protocol model 11, mapping the data in the frame structure of the protocol model 11 into parameters required by an object model 10 by using a mapping expression through model mapping, and finishing uplink data acquisition; the method comprises the steps of obtaining control parameters of equipment added by a user in an object model 10, mapping the control parameters into a corresponding frame structure of a protocol model 11 by using a mapping expression through protocol mapping, performing bit domain splicing on data in the frame structure of the protocol model 11, returning and controlling an equipment sensor 12 after protocol encapsulation, and completing downlink equipment control.
The present embodiment provides a method for parsing a script dynamic protocol, and fig. 2 is a flowchart of a method for parsing a script dynamic protocol according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S201, acquiring data acquired by the device sensor 12, and performing Bit field segmentation on the data to acquire an original value of the data, where a Bit field (also called Bit field) is a data structure, and can compactly store the data in a Bit form and allow a programmer to operate on bits of the structure; the bit-domain division is to format the binary stream ASCII character string by division and change it into a new binary number by a bit-domain division function, fig. 3 is a schematic diagram of bit-domain division according to an embodiment of the present application, as shown in fig. 3, for example, there is a binary stream file (bin) as: '010302012 AD 59E' which is subjected to bit domain segmentation to become a1 ═ 1; a2 ═ 3; a3 ═ 2; a4 ═ 0x 012A; a 5-0 xD 59E. For a small weather station as an example, the present embodiment obtains data collected by the device sensor 12, such as temperature, humidity, illuminance, noise, PM2.5, and PM10 values, and performs bit domain division on the data to obtain original values of the data. The method of bit field cutting is adopted, so that the storage space can be saved, and the terminal equipment with various protocols can be flexibly accessed.
Step S202, sending the data original value obtained after the bit domain division to the frame structure of the protocol model 11, mapping the data in the frame structure of the protocol model 11 to the parameters required by the object model 10 by using the mapping expression through model mapping, wherein the protocol model 11 is used for establishing a communication path between the user station and the core network and specifying the wireless transmission address when transmitting a large data block in the network to realize the communication between the user transceiver and the base transceiver, the model is composed of a physical layer, an MAC layer and a service layer, the physical layer at the bottommost layer mainly relates to the aspects of frequency bandwidth, modulation mode, error correction technology, synchronization between the transceivers, data transmission rate, time division multiplexing structure and the like, and the MAC layer is mainly responsible for framing and transmitting the data. In addition, a frame is a protocol data unit of the data link layer, which includes three parts: a header, data and a trailer, wherein the header and trailer include necessary control information, such as synchronization information, address information, error control information, etc., and the data portion includes a data body, such as data collected by the device sensor 12. Optionally, the object model 10 is a data model that digitalizes an entity in a physical space and constructs the entity at a cloud, and in the internet of things, the object model 10 is defined to define product functions, where the product function types are classified into three types: the system comprises attributes, services and events, wherein the attributes are generally used for describing the running state of the device, such as the current ambient temperature read by an environment monitoring device, the services are capabilities or methods that the device can be called externally, input parameters and output parameters can be set, the events are events of the device in running, and generally comprise notification information needing to be sensed and processed externally, such as information of completion of a certain task, or the temperature of the device when a fault or an alarm occurs, and the like. In addition, the model mapping is to map the data in the frame structure of the protocol model 11 into the object model 10 by a mapping expression. Fig. 4 is a frame structure diagram of an uplink protocol model according to an embodiment of the present invention, fig. 4 is a diagram of an uplink protocol model interface according to an embodiment of the present invention, fig. 5 is a diagram of an object model interface according to an embodiment of the present invention, fig. 6 is a diagram of an object model interface according to an embodiment of the present invention, and as shown in fig. 6, by taking a small weather station as an example, original values of data obtained after being subjected to bit domain division are sent to a frame structure of a protocol model 11, and data in the frame structure of the protocol model 11, such as temperature, humidity, illuminance, noise, PM2.5, and PM10 values, are mapped to parameters required by the object model 10 by using a mapping expression, where the protocol model 11 in the embodiment is an uplink protocol model. Through visual thing model management equipment data, can standardize the output data of various agreement equipment to do local data circulation and linkage, it is more convenient to use.
Step S203, obtaining the control parameters of the devices added by the user in the object model 10, and mapping the control parameters into the corresponding frame structure of the protocol model 11 by using a mapping expression through protocol mapping, where the protocol mapping is to map the control parameters of the devices added by the user in the object model 10 into the corresponding frame structure of the protocol model 11 by using the mapping expression. Fig. 7 is a frame structure diagram of a downlink protocol model according to an embodiment of the present application, as shown in fig. 7, fig. 8 is a downlink protocol model interface diagram according to an embodiment of the present application, as shown in fig. 8, a small weather station is taken as an example, control parameters of a device added by a user in an object model 10 are obtained, and the control parameters are mapped into a corresponding frame structure of a protocol model 11 by using a mapping expression through protocol mapping, where the protocol model 11 in this embodiment is a downlink protocol model.
Step S204, performing bit domain splicing on data in a frame structure of the protocol model 11, and returning to and controlling the device sensor 12 after protocol encapsulation, where the bit domain splicing is to perform bit domain combination function splicing on a value to form a new binary file, and fig. 9 is a schematic diagram of bit domain splicing according to the embodiment of the present application, as shown in fig. 9, for example, a value a1 is 0x 01; a2 ═ 0x 03; a3 ═ 0x 0000; a4 ═ 0x 0001; a5 is 0x8833, and after being spliced by the bit domain combination function, a new binary file is formed as follows: '3000000018833'. Taking a small-sized weather station as an example, the embodiment performs bit domain splicing on data in a frame structure of the protocol model 11, and returns and controls the equipment sensors 12, such as a temperature sensor, a humidity sensor, an air particulate sensor, and the like, after the data is encapsulated by a protocol.
Through the steps S201 to S204, compared with the prior art, the gateway of the internet of things basically has no functions of edge calculation and data storage, and only performs data transparent transmission, which cannot meet the problems of high-frequency data acquisition, real-time data processing and low-delay feedback response required by the internet of things. In this embodiment, the centralized configuration management of the visual interface is performed on the device based on the object model, and the specific method is as follows: the method comprises the steps that a server acquires data acquired by an equipment sensor 12, bit domain segmentation is carried out on the data, an original value of the data acquired after the bit domain segmentation is sent to a frame structure of a protocol model 11, and the data in the frame structure of the protocol model 11 is mapped into parameters required by an object model 10 by using a mapping expression through model mapping to finish uplink data acquisition; the method comprises the steps of obtaining control parameters of equipment added by a user in an object model 10, mapping the control parameters into a corresponding frame structure of a protocol model 11 by using a mapping expression through protocol mapping, performing bit domain splicing on data in the frame structure of the protocol model 11, returning and controlling an equipment sensor 12 after protocol encapsulation, and completing downlink equipment control.
In some of these embodiments, the model mapping comprises: mapping the sensor data in the frame structure of the protocol model 11 to the object model 10 in a ratio of 1: n, where fig. 10 is a schematic diagram of mapping the protocol model data 1: n to the object model according to the embodiment of the present application, as shown in fig. 10, optionally, taking air conditioner control as an example, mapping the sensor data in the frame structure of the protocol model 11, such as the mode, the temperature and the actual temperature value, to the configuration parameters corresponding to the object model 10 in a ratio of 1: n.
In some of these embodiments, the protocol mapping includes: mapping the control parameters in the object model 10 to the corresponding frame structure of the protocol model 11 by n:1, where fig. 11 is a schematic diagram of mapping the object model parameters n:1 to the protocol model according to the embodiment of the present application, as shown in fig. 11, optionally, taking air conditioner control as an example, mapping the control parameters in the object model 10, such as mode, temperature, wind speed, and on-off state, to the corresponding frame structure of the protocol model 11 by n: 1.
In some of these embodiments, building object model 10 includes: the object model 10 defines a service identifier, and obtains a key name and parameters through the service identifier, optionally, the object model 10 defines a service, the identifier is Read _ Data, and has an input parameter, the identifier is number _ n, and in the downlink control, the parameters of the downlink parameter identifier come from the control parameters input when the user clicks the added equipment control; in the upstream response, the parameters of the upstream data identifier are read from the off-hook device, and the key name is derived from the definition of the identifier in the object model. The embodiment can effectively separate the protocol from the service and focus the protocol and the service respectively by establishing the object model, thereby improving the working efficiency of the server.
In some of these embodiments, the mapping expression comprises: the parameters of the object model 10 and the data in the frame structure corresponding to the protocol model 11 are mutually converted and calculated through a mathematical calculation expression, wherein the mathematical expression is flexible and changeable and can support function calculation and the like, for example, the original values of the data stored in the frame structure of the protocol model after bit domain division are x, y and z, and the parameters n and m required in the object model 10 are obtained through mathematical calculation such as n ═ x + y + z and m ═ x y z; or the user inputs the parameters n and m in the object model 10, and the parameters are converted into the data x, y and z in the corresponding frame structure of the protocol model 11 through mathematical operation. In this embodiment, a mapping expression is used to perform conversion calculation between a protocol data stream and parameters of the object model 10, so that the analysis of a device node protocol and the formatting of data are realized, and any device can be accessed and controlled.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The present embodiment further provides a system for analyzing a dynamic protocol of a script, where the system is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted here for brevity. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 12 is a block diagram of a script dynamic protocol parsing system according to an embodiment of the present application, and as shown in fig. 12, the system includes a data collection module 121, a model mapping module 122, a protocol mapping module 123, and a device control module 124.
The data acquisition module 121 is configured to acquire data acquired by the device sensor and perform bit domain segmentation on the acquired data; the model mapping module 122 is configured to send an original value of the data obtained after the bit domain segmentation to a frame structure of the protocol model, and map the data in the frame structure of the protocol model to parameters required by the object model by using a mapping expression through model mapping; the protocol mapping module 123 is configured to obtain a control parameter of a device added by a user in the object model, and map the control parameter into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping; and the equipment control module 124 is used for performing bit domain splicing on the data in the protocol model frame structure, and returning and controlling the equipment sensor after protocol encapsulation.
Through the system, the server in the data acquisition module 121 acquires the data acquired by the device sensor, performs bit domain segmentation on the data, and adopts a bit domain segmentation method, so that the storage space can be saved, and the terminal devices of various protocols can be flexibly accessed; the model mapping module 122 manages the device data through the visual object model, can standardize the output data of devices with various protocols, flexibly accesses the devices with various protocols, and is more convenient to use; the server in the protocol mapping module 123 obtains the control parameters of the devices added by the user in the object model, and maps the control parameters into the corresponding frame structure of the protocol model by using the mapping expression through protocol mapping; the device control module 124 performs bit domain splicing on data in the protocol model frame structure, and returns and controls the device sensor after protocol encapsulation. The whole system solves the problems of complicated access of various protocol devices in the Internet of things, high-frequency data acquisition, real-time data processing and low-delay feedback response, improves the data processing efficiency, can flexibly access the devices of various protocols, and is more convenient to use.
In some of these embodiments, model mapping in model mapping module 122 further includes: mapping the sensor data in the protocol model frame structure to the object model in a ratio of 1: n, optionally, taking air conditioner control as an example, mapping the sensor data in the protocol model frame structure, such as mode, temperature and actual temperature value, to the configuration parameters corresponding to the object model in a ratio of 1: n.
In some embodiments, the protocol mapping in the protocol mapping module 123 further includes: mapping the control parameters in the object model to the corresponding frame structure of the protocol model in a ratio of n:1, and optionally mapping the control parameters in the object model, such as mode, temperature, wind speed and on-off state, to the corresponding frame structure of the protocol model in a ratio of n:1, taking air conditioner control as an example.
In some of these embodiments, building the object model comprises: the object model defines a service identifier, the key name and the parameters are acquired through the service identifier, optionally, the object model defines a service, the identifier is Read _ Data, the identifier is provided with an input parameter, the identifier is number _ n, and in the downlink control, the parameters of the downlink parameter identifier come from control parameters input when a user clicks the added equipment for control; in the upstream response, the parameters of the upstream data identifier are read from the off-hook device, and the key name is derived from the definition of the identifier in the object model. The embodiment can effectively separate the protocol from the service and focus the protocol and the service respectively by establishing the object model, thereby improving the working efficiency of the server.
In some of these embodiments, the mapping expression comprises: performing interconversion calculation on object model parameters and data in a frame structure corresponding to the protocol model through a mathematical calculation expression, wherein the mathematical expression is flexible and changeable and can support function calculation and the like, for example, original values of the data stored in the frame structure of the protocol model after bit domain division are x, y and z, and parameters n and m required in the object model are obtained through mathematical calculation such as n ═ x + y + z and m ═ x ═ y + z; or the user inputs the parameters n and m in the object model 10, and the parameters are converted into the data x, y and z in the frame structure corresponding to the protocol model through mathematical operation. In this embodiment, a mapping expression is used to perform conversion calculation between a protocol data stream and an object model parameter, so that the analysis of a device node protocol and the formatting of data are realized, and any device can be accessed and controlled.
The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In addition, in combination with the method for analyzing the dynamic protocol of the script in the foregoing embodiment, an embodiment of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any of the methods of script dynamic protocol parsing in the above embodiments.
In one embodiment, fig. 13 is a schematic diagram of an internal structure of an electronic device according to an embodiment of the present application, and as shown in fig. 13, there is provided an electronic device, which may be a server, and an internal structure diagram of which may be as shown in fig. 13. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the electronic device is used for storing data. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of script dynamic protocol parsing.
Those skilled in the art will appreciate that the structure shown in fig. 13 is a block diagram of only a portion of the structure relevant to the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for analyzing a script dynamic protocol is applied to an Internet of things gateway system, and is characterized in that the system comprises: a protocol model, an object model and a device sensor;
acquiring data acquired by the equipment sensor, and carrying out bit domain segmentation on the data;
sending the original value of the data obtained after bit domain segmentation to a frame structure of the protocol model, and mapping the data in the frame structure of the protocol model into parameters required by the object model by using a mapping expression through model mapping;
acquiring control parameters of equipment added by a user in the object model, and mapping the control parameters into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping;
and performing bit domain splicing on the data in the protocol model frame structure, and returning and controlling the equipment sensor after protocol encapsulation.
2. The method of claim 1, wherein the model mapping comprises:
mapping the sensor data in the protocol model frame structure into the object model at 1: n.
3. The method of claim 1, wherein the protocol mapping comprises:
and mapping the control parameters in the object model into the corresponding frame structure of the protocol model according to the ratio of n to 1.
4. The method of claim 1, wherein building the object model comprises:
the object model defines a service identifier by which key names and parameters are obtained.
5. The method of claim 1, wherein the mapping expression comprises:
and performing mutual conversion calculation on the object model parameters and the data in the frame structure corresponding to the protocol model through a mathematical calculation expression.
6. A system for script dynamic protocol parsing, the system comprising: a protocol model, an object model and a device sensor;
the server acquires data acquired by the equipment sensor and performs bit domain segmentation on the data;
the server sends the original value of the data obtained after bit domain segmentation to a frame structure of the protocol model, and the data in the frame structure of the protocol model is mapped into parameters required by the object model by using a mapping expression through model mapping;
the server acquires control parameters of equipment added by a user in the object model, and maps the control parameters into a corresponding frame structure of the protocol model by using a mapping expression through protocol mapping;
and the server performs bit domain splicing on the data in the protocol model frame structure, and returns and controls the equipment sensor after protocol encapsulation.
7. The system of claim 1, wherein the model mapping comprises:
the server maps the sensor data in the protocol model frame structure into the object model at 1: n.
8. The system of claim 1, wherein the protocol mapping comprises:
the server maps the control parameters in the object model into the corresponding frame structure of the protocol model in an n:1 manner.
9. The system of claim 1, wherein building the object model comprises:
the object model defines a service identifier by which key names and parameters are obtained.
10. The system of claim 1, wherein the mapping expression comprises:
and the server carries out mutual conversion calculation on the object model parameters and the data in the frame structure corresponding to the protocol model through a mathematical calculation expression.
CN202011226506.6A 2020-09-16 2020-11-04 Method and system for analyzing script dynamic protocol Pending CN112565191A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020109746198 2020-09-16
CN202010974619 2020-09-16

Publications (1)

Publication Number Publication Date
CN112565191A true CN112565191A (en) 2021-03-26

Family

ID=75041735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011226506.6A Pending CN112565191A (en) 2020-09-16 2020-11-04 Method and system for analyzing script dynamic protocol

Country Status (1)

Country Link
CN (1) CN112565191A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020114326A1 (en) * 2001-02-16 2002-08-22 Rupaka Mahalingaiah Address mapping mechanism enabling multi-domain addressing in communication networks
US20040015609A1 (en) * 2002-07-18 2004-01-22 International Business Machines Corporation Method and system for conversion of message formats in a pervasive embedded network environment
CN105245445A (en) * 2015-09-08 2016-01-13 浙江风向标科技有限公司 Internet of things gateway
CN108810053A (en) * 2017-05-04 2018-11-13 株式会社日立制作所 Internet of things application processing method and internet of things application system
CN108881251A (en) * 2018-06-28 2018-11-23 广州大学 A kind of any binary device access parsing and standardized system and method
CN110661820A (en) * 2019-12-02 2020-01-07 武汉慧联无限科技有限公司 Internet of things data processing method and device, equipment and storage medium
CN110933146A (en) * 2019-11-14 2020-03-27 厦门网宿有限公司 Data conversion method and device and server
CN111585958A (en) * 2020-04-01 2020-08-25 西安电子科技大学 Self-adaptive access method and system for heterogeneous equipment of Internet of things platform

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020114326A1 (en) * 2001-02-16 2002-08-22 Rupaka Mahalingaiah Address mapping mechanism enabling multi-domain addressing in communication networks
US20040015609A1 (en) * 2002-07-18 2004-01-22 International Business Machines Corporation Method and system for conversion of message formats in a pervasive embedded network environment
CN105245445A (en) * 2015-09-08 2016-01-13 浙江风向标科技有限公司 Internet of things gateway
CN108810053A (en) * 2017-05-04 2018-11-13 株式会社日立制作所 Internet of things application processing method and internet of things application system
CN108881251A (en) * 2018-06-28 2018-11-23 广州大学 A kind of any binary device access parsing and standardized system and method
CN110933146A (en) * 2019-11-14 2020-03-27 厦门网宿有限公司 Data conversion method and device and server
CN110661820A (en) * 2019-12-02 2020-01-07 武汉慧联无限科技有限公司 Internet of things data processing method and device, equipment and storage medium
CN111585958A (en) * 2020-04-01 2020-08-25 西安电子科技大学 Self-adaptive access method and system for heterogeneous equipment of Internet of things platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈积明: "《物联网平台LINK PLATFORM 探索与实践》", 31 March 2020, 浙江大学出版社 *

Similar Documents

Publication Publication Date Title
CN110933146B (en) Data conversion method and device and server
CN111343020A (en) Unified management method and device for multi-protocol Internet of things equipment
CN107592367A (en) Resource share method, device and the computer-readable recording medium of home appliance
CN108353022B (en) Data message processing method, device and system
CN111880446A (en) Control instruction sending method and control instruction receiving method
CN108363588B (en) Method for realizing interaction between web and native function, electronic device and readable storage medium
CN108156210A (en) The acquisition methods and device of target resource
CN107146623B (en) Speech recognition method, device and system based on artificial intelligence
WO2021017849A1 (en) Method for implementing 5g user registration, network element apparatus, and storage medium
CN110995956B (en) Image transmission method and device based on LoRa, computer equipment and storage medium
CN112380428B (en) Cloud-edge coordinated edge computing method, system, electronic device and storage medium
CN107566233A (en) The resource share method and device of home appliance
CN104754608A (en) Method and system for monitoring performances of mobile terminal
CN104412566A (en) Methodes and nodes for handling an address of a resource
CN114500453B (en) Identification analysis method and device
CN116724545A (en) Method, device and system for transmitting data packet
CN112565191A (en) Method and system for analyzing script dynamic protocol
JP6951380B2 (en) Gateway device, communication method and program
CN107968798A (en) A kind of network management resources label acquisition method, cache synchronization method, apparatus and system
CN112118136B (en) Multi-cloud configuration conversion method and device, computer equipment and storage medium
CN110601892B (en) Main module access method, device and equipment based on object-oriented protocol
CN113452582A (en) Data transmission method, equipment, system and medium based on automatic analysis
CN103685377A (en) Web optimization and acceleration method and system
CN113641518A (en) Service calling method, device and storage medium
CN114830105A (en) Data reading method and terminal

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