CN111866139A - Sensor message processing method and system based on Internet of things - Google Patents

Sensor message processing method and system based on Internet of things Download PDF

Info

Publication number
CN111866139A
CN111866139A CN202010704360.5A CN202010704360A CN111866139A CN 111866139 A CN111866139 A CN 111866139A CN 202010704360 A CN202010704360 A CN 202010704360A CN 111866139 A CN111866139 A CN 111866139A
Authority
CN
China
Prior art keywords
sensor
instruction set
sensor instruction
application server
product information
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.)
Withdrawn
Application number
CN202010704360.5A
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.)
Li Bingyong
Original Assignee
Li Bingyong
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 Li Bingyong filed Critical Li Bingyong
Priority to CN202010704360.5A priority Critical patent/CN111866139A/en
Publication of CN111866139A publication Critical patent/CN111866139A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • 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

Abstract

The invention belongs to the field of software, and provides a sensor message processing method and system based on the Internet of things, wherein the method comprises the following steps: the application server receives a first analysis script configuration request sent by a third-party application program, takes a first sink node with the largest quantity of the same sensor instructions as a second sink node, and sends a second analysis script configuration request to the second sink node; and the second sink node acquires different sensor instructions according to the second analysis script configuration request, acquires the analysis script corresponding to each different sensor instruction from a preset analysis script library, calls the analysis script corresponding to the second sensor instruction set, establishes a directory with the target product information as a name, stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as a name, and configures the analysis scripts corresponding to the target sensor node. The invention is beneficial to configuring the analysis script of the target sensor node.

Description

Sensor message processing method and system based on Internet of things
Technical Field
The invention relates to the field of software, in particular to a sensor message processing method and system based on the Internet of things.
Background
The sink node is mainly responsible for connection between a sensor network and an external network, the sink node is connected with a large number of sensor nodes, the sink node decodes sensor messages of the sensor nodes, and different sensor nodes have different analysis contents, so that analysis schemes with different characteristics need to be provided.
However, the existing sink node cannot provide the parsing script of the target sensor node, because the existing sink node provides the general parsing script for all sensor nodes, and the actual requirement of a certain target sensor node is not considered, so that the general parsing script is provided, and due to lack of pertinence, the parsing error is often caused. In addition, there are many sensor instructions of the target sensor node, and if a developer redevelops an analytic script once for each sensor instruction of each target sensor node, a large amount of manpower and material resources are undoubtedly increased, and meanwhile, the analytic script needs to be tested repeatedly, and the development progress is difficult to control. Therefore, how to configure the parsing script corresponding to the target sensor node is a problem to be solved.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide a method and a system for processing a sensor message based on the internet of things, so as to solve the problem of how to configure a parsing script corresponding to a target sensor node in the prior art.
In order to achieve the above and other related objects, the present invention provides a sensor message processing method based on the internet of things, which is applied to an application enabling platform of the internet of things, where the application enabling platform includes an application server and a plurality of sink nodes, and the method includes:
the application server receives a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
the application server identifies that the product information is the target product information and a sensor instruction set with a protocol type of a message queue telemetry transmission protocol is a first sensor instruction set, and acquires an instruction identifier corresponding to the first sensor instruction set;
The application server sends a query request to the sink node, and acquires a first sink node according to operation information returned by the sink node responding to the query request;
the application server respectively obtains instruction identifications corresponding to second sensor instruction sets stored in the first aggregation nodes, matches the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifications corresponding to the first sensor instruction sets, if the matching is successful, identifies that the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes comprise the instruction identifications corresponding to the first sensor instruction sets, and obtains the number of the successfully matched first aggregation nodes;
the application server judges whether the number of the first aggregation nodes which are successfully matched is greater than 1 after determining that the number of the first aggregation nodes which are successfully matched is not 0, determines that the first aggregation nodes which are successfully matched are second aggregation nodes if the number of the first aggregation nodes which are successfully matched is not greater than 1, checks whether the first two bytes of a second sensor instruction in a second sensor instruction set are the same as the first two bytes of a first sensor instruction in a first sensor instruction set if the number of the first aggregation nodes which are successfully matched is greater than 1, marks the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set are the same, and marks the second sensor instruction as different sensor instructions in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set and the first sensor instruction set are different, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
The application server sends a second analysis script configuration request to the second sink node, wherein the second analysis script configuration request carries the different sensor instructions, the instruction identification corresponding to the second sensor instruction set and the target product information;
the second sink node acquires the different sensor instructions according to the second analysis script configuration request, acquires an analysis script corresponding to each different sensor instruction from a preset analysis script library, calls an analysis script corresponding to a second sensor instruction set, establishes a directory with the target product information as a name, stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as the name, and configures the analysis scripts corresponding to the target sensor node.
Preferably, in the method, the identifying, by the application server, that the product information is the target product information and a sensor instruction set whose protocol type is a message queue telemetry transmission protocol is a first sensor instruction set, and acquiring an instruction identifier corresponding to the first sensor instruction set specifically includes:
The application server obtains a sensor instruction set corresponding to the message type from a message type library according to the message type to be analyzed, obtains product information and a protocol type corresponding to each sensor instruction set, judges whether the product information corresponding to each sensor instruction set is the target product information, simultaneously judges whether the protocol type corresponding to each sensor instruction set is the message queue telemetry transmission protocol, identifies that the sensor instruction set with the product information being the target product information and the protocol type being the message queue telemetry transmission protocol is a first sensor instruction set, and obtains an instruction identifier corresponding to the first sensor instruction set according to a preset mapping table of the sensor instruction set and the instruction identifier.
Preferably, in the method, the sending, by the application server, a query request to the sink node, and acquiring a first sink node according to operation information returned by the sink node in response to the query request specifically include:
the application server sends a query request to the sink node, wherein the query request is used for querying the current job parallel processing number of the sink node, the times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets;
The application server receives operation information returned by the sink node in response to the query request, wherein the operation information comprises the job parallel processing number of the sink node, the times that the Agent operation state is in an offline state in a working period and the number of stored second sensor instruction sets;
the application server generates a model according to a preset matching coefficient, the number of parallel processing of the operation of each sink node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, generates the matching coefficient of each sink node, and takes the sink nodes with the matching coefficients larger than the preset value as the first sink nodes.
Preferably, in the method, after the configuring the parsing script corresponding to the target sensor node, the method further includes:
and the second sink node returns a response message of the second analysis script configuration request to the application server, wherein the response message comprises the analysis script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores the corresponding relationship between the analysis script corresponding to the target sensor node and the hash value of the target product information.
Preferably, in the method, the message type includes at least one of the task message, the command alarm and the work order message.
To achieve the above and other related objects, the present invention also provides
A sensor message processing system based on the Internet of things is applied to an application enabling platform of the Internet of things, the application enabling platform comprises an application server and a plurality of sink nodes, and the application server comprises: the device comprises a receiving module, an identification module, a selection module, a matching module, a determination module and a sending module; the sink node comprises a parsing script configuration module;
the receiving module is used for the application server to receive a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
the identification module is used for identifying that the product information is the target product information and the sensor instruction set with the protocol type of the message queue telemetry transmission protocol is a first sensor instruction set by the application server, and acquiring an instruction identifier corresponding to the first sensor instruction set;
The selection module is used for the application server to send a query request to the sink node and obtain a first sink node according to the operation information returned by the sink node responding to the query request;
the matching module is configured to respectively obtain, by the application server, instruction identifiers corresponding to second sensor instruction sets stored in each first aggregation node, match the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifiers corresponding to the first sensor instruction sets, if matching is successful, identify that the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes include the instruction identifiers corresponding to the first sensor instruction sets, and obtain the number of the successfully matched first aggregation nodes;
the determining module is configured to, after determining that the number of the first aggregation nodes that are successfully matched is not 0, determine whether the number of the first aggregation nodes that are successfully matched is greater than 1, determine, if the number of the first aggregation nodes that are successfully matched is not greater than 1, that the first aggregation nodes that are successfully matched are second aggregation nodes, check, if the number of the first aggregation nodes that are successfully matched is greater than 1, whether first two bytes of a second sensor instruction in the second sensor instruction set are the same as first two bytes of a first sensor instruction in the first sensor instruction set, if the first two bytes are the same, mark, by the application server, the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set, and, if the first two bytes are different, mark, by the application server, the second sensor instruction as a different sensor instruction in the second sensor instruction set and the first sensor instruction set, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
The sending module is configured to send, by the application server, a second parsing script configuration request to the second sink node, where the second parsing script configuration request carries the different sensor instructions, the instruction identifiers corresponding to the second sensor instruction set, and the target product information;
the analysis script configuration module is used for the second sink node to obtain the different sensor instructions according to the second analysis script configuration request, obtain each analysis script corresponding to the different sensor instructions from a preset analysis script library, call the analysis script corresponding to the second sensor instruction set, establish a directory with the target product information as a name, store the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as a name, and configure the analysis scripts corresponding to the target sensor node.
Preferably, in the system, the identification module is specifically configured to:
the application server obtains a sensor instruction set corresponding to the message type from a message type library according to the message type to be analyzed, obtains product information and a protocol type corresponding to each sensor instruction set, judges whether the product information corresponding to each sensor instruction set is the target product information, simultaneously judges whether the protocol type corresponding to each sensor instruction set is the message queue telemetry transmission protocol, identifies that the sensor instruction set with the product information being the target product information and the protocol type being the message queue telemetry transmission protocol is a first sensor instruction set, and obtains an instruction identifier corresponding to the first sensor instruction set according to a preset mapping table of the sensor instruction set and the instruction identifier.
Preferably, in the system, the selecting module specifically includes:
the query unit is used for the application server to send a query request to the sink node, wherein the query request is used for querying the current job parallel processing quantity of the sink node, the times that the Agent running state in the working period is in the offline state and the quantity of the stored second sensor instruction sets;
a receiving unit, configured to receive, by the application server, operation information returned by the sink node in response to the query request, where the operation information includes a number of parallel processing of jobs of the sink node, a number of times that an Agent operation state in an operation period is an offline state, and a number of stored second sensor instruction sets;
the generating unit is used for generating a model according to a preset matching coefficient by the application server, the number of parallel processing of the operation of each aggregation node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, generating the matching coefficient of each aggregation node, and taking the aggregation node of which the matching coefficient is greater than the preset value as the first aggregation node.
Preferably, in the system, the sink node further includes:
and the response module is used for the second sink node to return a response message of the second analysis script configuration request to the application server, wherein the response message comprises the analysis script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores the corresponding relationship between the analysis script corresponding to the target sensor node and the hash value of the target product information.
Preferably, in the system, the message type includes at least one of the task message, a command alert, and a work order message.
As described above, the sensor message processing method and system based on the internet of things of the present invention have the following beneficial effects:
1. and the second aggregation node stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in a directory with the target product information as a name so as to configure the analysis scripts corresponding to the target sensor nodes, and the stored analysis scripts are fully utilized.
2. And taking the first sink node with the largest quantity of the same sensor instructions as a second sink node, so that when the second sink node configures the analysis script corresponding to the target sensor node, the number of the analysis scripts is minimum and the time for acquiring the analysis scripts is also minimum from a preset analysis script library, thereby improving the configuration rate of the analysis script corresponding to the target sensor node.
3. By configuring the analysis script corresponding to the target sensor node, the sensor information of the target sensor node can be analyzed, and the sensor node of which the product information is the target product information can also be analyzed, so that the utilization rate of the analysis script can be improved.
Drawings
Fig. 1 is a schematic diagram illustrating a sensor message processing method based on the internet of things according to the present invention.
Fig. 2 is a schematic diagram of the sensor message processing system based on the internet of things according to the invention.
Detailed Description
Referring to fig. 1, the present invention provides a sensor message processing method based on the internet of things, which is applied to an application enabling platform of the internet of things, where the application enabling platform includes an application server and a plurality of sink nodes, and the following details are described as follows:
s1, the application server receives a first analysis script configuration request sent by a third-party application program, the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
The application server is a preset server.
After receiving the first parsing script configuration request, the application server performs security authentication on the third-party application program, and then performs step S2.
S2, the application server identifies that the product information is the target product information and the protocol type is a sensor instruction set of a message queue telemetry transmission protocol as a first sensor instruction set, and acquires an instruction identifier corresponding to the first sensor instruction set;
the application server stores sensor instruction sets and product information and protocol types corresponding to the sensor instruction sets in advance.
Wherein the first set of sensor instructions comprises factory defined sensor instructions. The manufacturer can define the required instructions in the first sensor instruction set according to the requirements of the manufacturer.
S3, the application server sends a query request to the sink node, and acquires a first sink node according to the operation information returned by the sink node responding to the query request;
the method comprises the steps that the application server sends a query request to the sink node, and obtains a first sink node according to running information returned by the sink node responding to the query request, and specifically comprises the following steps:
The application server sends a query request to the sink node, wherein the query request is used for querying the current job parallel processing number of the sink node, the times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets;
the application server receives operation information returned by the sink node in response to the query request, wherein the operation information comprises the job parallel processing number of the sink node, the times that the Agent operation state is in an offline state in a working period and the number of stored second sensor instruction sets; the application server generates a model according to a preset matching coefficient, the number of parallel processing of the operation of each sink node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, generates the matching coefficient of each sink node, and takes the sink nodes of which the matching coefficients are greater than the preset value as first sink nodes;
it should be noted that: the matching coefficient generation model specifically comprises the following steps:
AN=α*(Nx/N1*P1+1/10NR*P2)+(1-α)*Ny/N2;
wherein AN is a matching coefficient of the nth sink node, Nx is a current job parallel processing quantity of the nth sink node, and N1 is a reference value corresponding to the current job parallel processing quantity of the sink node; NR is the number of times that the Agent running state of the sink node in the working period is in an off-line state, Ny is the number of the Nth stored second sensor instruction set, and N2 is a reference value corresponding to the stored second sensor instruction set; alpha is a proportional coefficient, 0 < alpha < 1, and 1-alpha is used for representing the proportion of the value of Ny/N2 in the matching coefficient; p1 is a preset first weight coefficient, and P2 is a preset second weight coefficient. And NR is the frequency of the aggregation node that the Agent running state in the working period is the off-line state, and the Agent running state represents the running state of the Agent. Wherein, 1/10 NRIs a system stability factor describing the system stability of the sink node during the operating time period, 1/10NRThe lower the operating period the more unstable the system, 1/10NRThe higher the system of the sink node during the working period is, the more stable the system of the sink node during the working period is, therefore, when the number of times that the Agent running state of the nth sink node during the working period is in the off-line state is zero, that is, NR is 0, the system stability coefficient 1/10NRThe value of (2) is the highest, and the system stability coefficient is 1 at this time, which indicates that the system stability of the sink node in the working period is good.
The plurality of first aggregation nodes are selected according to a preset selection number, and the preset selection number can be set by a user or a system, and is not limited herein.
The working time period may be set by the user or by the system, and is not limited herein. For example, set to 6 am to 12 am.
S4, the application server respectively obtains instruction identifiers corresponding to the second sensor instruction sets stored in each first aggregation node, matches the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifiers corresponding to the first sensor instruction sets, if matching is successful, identifies that the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes include the instruction identifiers corresponding to the first sensor instruction sets, and obtains the number of the successfully matched first aggregation nodes;
S5, after determining that the number of the first aggregation nodes which are successfully matched is not 0, the application server judges whether the number of the first aggregation nodes which are successfully matched is greater than 1, if the number of the first aggregation nodes which are successfully matched is not greater than 1, the first aggregation nodes which are successfully matched are determined to be second aggregation nodes, if the number of the first aggregation nodes which are successfully matched is greater than 1, whether two bytes before a second sensor instruction in the second sensor instruction set are the same as two bytes before the first sensor instruction in the first sensor instruction set is checked, if so, the second sensor instruction is marked as the same sensor instruction in the second sensor instruction set and the first sensor instruction set, and if not, the second sensor instruction is marked as different sensor instructions in the second sensor instruction set and the first sensor instruction set, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
after determining that the number of the successfully matched first aggregation nodes is not 0, the application server judges whether the number of the successfully matched first aggregation nodes is greater than 1;
If the number of the successfully matched first aggregation nodes is not more than 1, determining the successfully matched first aggregation nodes as second aggregation nodes;
if the number of the successfully matched first aggregation nodes is larger than 1, checking whether the first two bytes of a second sensor instruction in the second sensor instruction set are the same as the first two bytes of the first sensor instruction in the first sensor instruction set, if so, marking the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set, if not, marking the second sensor instruction as different sensor instructions in the second sensor instruction set and the first sensor instruction set, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first aggregation node with the largest number of the same sensor instructions as the second aggregation node.
The larger the number of the same sensor instructions in the second sensor instruction set and the first sensor instruction set is, the smaller the number of different sensor instructions is, so that the fewer analysis scripts corresponding to each different sensor instruction are acquired from a preset analysis script library by the subsequent second sink node, and due to the fact that the condition of downloading all the sensor instructions is avoided, the acquisition time can be effectively shortened, the code stream for transmitting the analysis scripts corresponding to the different sensor instructions can be reduced, and network resources can be effectively saved.
The analysis script library stores defined sensor instructions and analysis scripts corresponding to the defined sensor instructions. The parsing script may be provided by the manufacturer or downloaded via an open source database.
S6, the application server sends a second parsing script configuration request to the second sink node, where the second parsing script configuration request carries the different sensor instructions, the instruction identifiers corresponding to the second sensor instruction set, and the target product information;
and S7, the second sink node acquires the different sensor instructions according to the second analysis script configuration request, acquires the analysis script corresponding to each different sensor instruction from a preset analysis script library, calls the analysis script corresponding to a second sensor instruction set, establishes a directory with the target product information as a name, stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as a name, and configures the analysis scripts corresponding to the target sensor nodes.
It should be noted that: after S7, the method further includes:
S8, when receiving a sensor message of a first sensor node, a second sink node acquires product information of the first sensor node, if the product information of the first sensor node is target product information, calls an analysis script corresponding to the target sensor node to analyze the sensor message of the first sensor node, if the content of the sensor message of the first sensor node comprises a first event, sends the analyzed sensor message of the first sensor node to the first sensor node, and if the content of the sensor message of the first sensor node comprises a second event, returns the analyzed sensor message of the first sensor node to a third-party application program;
the first event and the second event may be user-defined, and for convenience of description, the following examples are given:
the first event is: EVENT _ TYPE _ MESSAGE _ DOWN = SensorMessage _ DOWN; the first event is used for describing that the event type is a sensor message issuing event;
the second event is: and the second EVENT is used for describing that the EVENT TYPE is a sensor MESSAGE reporting EVENT.
Further, after S8, the method further includes:
and S9, the second sink node returns a response message of the second parsing script configuration request to the application server, where the response message includes the parsing script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores a corresponding relationship between the parsing script corresponding to the target sensor node and the hash value of the target product information.
In the embodiment of the invention, when the second sink node configures the analysis script corresponding to the target sensor node, because the number of different sensor instructions of the second sink node is minimum, the number of the analysis scripts corresponding to the different sensor instructions obtained by the second sink node from the preset analysis script library is minimum, and the time for obtaining the analysis scripts is also minimum, so that the analysis feet corresponding to the target sensor node can be reduced
The code stream transmission can also improve the configuration rate of the analysis script corresponding to the target sensor node.
For convenience of explanation, the embodiment of the present invention describes an implementation flow of a sensor message processing method, which is detailed as follows:
The method comprises the steps that an application server receives a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, the target product information comprises a manufacturer ID and a product model of a target sensor node, and the message type comprises at least one of a task message, a command alarm and a work order message;
the application server acquires a sensor instruction set corresponding to the message type from a message type library according to the message type to be analyzed, acquires product information and a protocol type corresponding to each sensor instruction set, judges whether the product information corresponding to each sensor instruction set is the target product information, simultaneously judges whether the protocol type corresponding to each sensor instruction set is the message queue telemetry transmission protocol, identifies that the sensor instruction set with the product information being the target product information and the protocol type being the message queue telemetry transmission protocol is a first sensor instruction set, and acquires an instruction identifier corresponding to the first sensor instruction set according to a preset mapping table of the sensor instruction set and the instruction identifier;
The application server sends a query request to the sink node, wherein the query request is used for querying the current job parallel processing number of the sink node, the times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets;
the application server receives operation information returned by the sink node in response to the query request, wherein the operation information comprises the job parallel processing number of the sink node, the times that the Agent operation state is in an offline state in a working period and the number of stored second sensor instruction sets;
the application server generates a model according to a preset matching coefficient, the number of parallel processing of the operation of each sink node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, and generates the matching coefficient of each sink node, wherein the sink nodes with the matching coefficients larger than the preset value are used as the first sink nodes;
the application server respectively obtains instruction identifications corresponding to second sensor instruction sets stored in the first aggregation nodes, matches the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifications corresponding to the first sensor instruction sets, if the matching is successful, identifies that the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes comprise the instruction identifications corresponding to the first sensor instruction sets, and obtains the number of the successfully matched first aggregation nodes;
The application server judges whether the number of the first aggregation nodes which are successfully matched is greater than 1 after determining that the number of the first aggregation nodes which are successfully matched is not 0, determines that the first aggregation nodes which are successfully matched are second aggregation nodes if the number of the first aggregation nodes which are successfully matched is not greater than 1, checks whether the first two bytes of a second sensor instruction in a second sensor instruction set are the same as the first two bytes of a first sensor instruction in a first sensor instruction set if the number of the first aggregation nodes which are successfully matched is greater than 1, marks the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set are the same, and marks the second sensor instruction as different sensor instructions in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set and the first sensor instruction set are different, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
the application server sends a second analysis script configuration request to the second sink node, wherein the second analysis script configuration request carries the different sensor instructions, the instruction identification corresponding to the second sensor instruction set and the target product information;
The second sink node acquires the different sensor instructions according to the second analysis script configuration request, acquires an analysis script corresponding to each different sensor instruction from a preset analysis script library, calls an analysis script corresponding to a second sensor instruction set, establishes a directory with the target product information as a name, stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as the name, and configures the analysis scripts corresponding to the target sensor node;
and the second sink node returns a response message of the second analysis script configuration request to the application server, wherein the response message comprises the analysis script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores the corresponding relationship between the analysis script corresponding to the target sensor node and the hash value of the target product information.
Referring to fig. 2, the present invention provides a sensor message processing system based on the internet of things, which is detailed as follows:
a sensor message processing system based on the Internet of things is applied to an application enabling platform of the Internet of things, the application enabling platform comprises an application server and a plurality of sink nodes, and the application server comprises: the device comprises a receiving module, an identification module, a selection module, a matching module, a determination module and a sending module; the sink node comprises a parsing script configuration module;
The receiving module is used for the application server to receive a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
the identification module is used for identifying that the product information is the target product information and the sensor instruction set with the protocol type of the message queue telemetry transmission protocol is a first sensor instruction set by the application server, and acquiring an instruction identifier corresponding to the first sensor instruction set;
the selection module is used for the application server to send a query request to the sink node and obtain a first sink node according to the operation information returned by the sink node responding to the query request;
the matching module is configured to respectively obtain, by the application server, instruction identifiers corresponding to second sensor instruction sets stored in each first aggregation node, match the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifiers corresponding to the first sensor instruction sets, if matching is successful, identify that the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes include the instruction identifiers corresponding to the first sensor instruction sets, and obtain the number of the successfully matched first aggregation nodes;
The determining module is configured to, after determining that the number of the first aggregation nodes that are successfully matched is not 0, determine whether the number of the first aggregation nodes that are successfully matched is greater than 1, determine, if the number of the first aggregation nodes that are successfully matched is not greater than 1, that the first aggregation nodes that are successfully matched are second aggregation nodes, check, if the number of the first aggregation nodes that are successfully matched is greater than 1, whether first two bytes of a second sensor instruction in the second sensor instruction set are the same as first two bytes of a first sensor instruction in the first sensor instruction set, if the first two bytes are the same, mark, by the application server, the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set, and, if the first two bytes are different, mark, by the application server, the second sensor instruction as a different sensor instruction in the second sensor instruction set and the first sensor instruction set, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
The sending module is configured to send, by the application server, a second parsing script configuration request to the second sink node, where the second parsing script configuration request carries the different sensor instructions, the instruction identifiers corresponding to the second sensor instruction set, and the target product information;
the analysis script configuration module is used for the second sink node to obtain the different sensor instructions according to the second analysis script configuration request, obtain each analysis script corresponding to the different sensor instructions from a preset analysis script library, call the analysis script corresponding to the second sensor instruction set, establish a directory with the target product information as a name, store the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as a name, and configure the analysis scripts corresponding to the target sensor node.
In summary, in the present invention, when the second sink node configures the parsing script corresponding to the target sensor node, the number of the parsing scripts needs to be obtained from the preset parsing script library in a minimum, and the time required for obtaining the parsing scripts is also minimum, so that the configuration rate of the parsing script corresponding to the target sensor node can be increased. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A sensor message processing method based on the Internet of things is applied to an application enabling platform of the Internet of things, the application enabling platform comprises an application server and a plurality of sink nodes, and the method is characterized by comprising the following steps:
the application server receives a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
The application server identifies that the product information is the target product information and a sensor instruction set with a protocol type of a message queue telemetry transmission protocol is a first sensor instruction set, and acquires an instruction identifier corresponding to the first sensor instruction set;
the application server sends a query request to the sink node, and acquires a first sink node according to operation information returned by the sink node responding to the query request;
the application server respectively obtains instruction identifications corresponding to second sensor instruction sets stored in the first aggregation nodes, matches the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifications corresponding to the first sensor instruction sets, if the matching is successful, identifies that the instruction identifications corresponding to the second sensor instruction sets stored in the first aggregation nodes comprise the instruction identifications corresponding to the first sensor instruction sets, and obtains the number of the successfully matched first aggregation nodes;
the application server judges whether the number of the first aggregation nodes which are successfully matched is greater than 1 after determining that the number of the first aggregation nodes which are successfully matched is not 0, determines that the first aggregation nodes which are successfully matched are second aggregation nodes if the number of the first aggregation nodes which are successfully matched is not greater than 1, checks whether the first two bytes of a second sensor instruction in a second sensor instruction set are the same as the first two bytes of a first sensor instruction in a first sensor instruction set if the number of the first aggregation nodes which are successfully matched is greater than 1, marks the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set are the same, and marks the second sensor instruction as different sensor instructions in the second sensor instruction set and the first sensor instruction set if the first two bytes of the second sensor instruction set and the first sensor instruction set are different, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
The application server sends a second analysis script configuration request to the second sink node, wherein the second analysis script configuration request carries the different sensor instructions, the instruction identification corresponding to the second sensor instruction set and the target product information;
the second sink node acquires the different sensor instructions according to the second analysis script configuration request, acquires an analysis script corresponding to each different sensor instruction from a preset analysis script library, calls an analysis script corresponding to a second sensor instruction set, establishes a directory with the target product information as a name, stores the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as the name, and configures the analysis scripts corresponding to the target sensor node.
2. The method according to claim 1, wherein the application server identifies that the product information is the target product information and a sensor instruction set with a protocol type of a message queue telemetry transmission protocol is a first sensor instruction set, and obtains an instruction identifier corresponding to the first sensor instruction set, specifically:
The application server obtains a sensor instruction set corresponding to the message type from a message type library according to the message type to be analyzed, obtains product information and a protocol type corresponding to each sensor instruction set, judges whether the product information corresponding to each sensor instruction set is the target product information, simultaneously judges whether the protocol type corresponding to each sensor instruction set is the message queue telemetry transmission protocol, identifies that the sensor instruction set with the product information being the target product information and the protocol type being the message queue telemetry transmission protocol is a first sensor instruction set, and obtains an instruction identifier corresponding to the first sensor instruction set according to a preset mapping table of the sensor instruction set and the instruction identifier.
3. The method according to claim 1, wherein the application server sends an inquiry request to the sink node, and obtains a first sink node according to operation information returned by the sink node in response to the inquiry request, specifically:
the application server sends a query request to the sink node, wherein the query request is used for querying the current job parallel processing number of the sink node, the times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets;
The application server receives operation information returned by the sink node in response to the query request, wherein the operation information comprises the job parallel processing number of the sink node, the times that the Agent operation state is in an offline state in a working period and the number of stored second sensor instruction sets;
the application server generates a model according to a preset matching coefficient, the number of parallel processing of the operation of each sink node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, generates the matching coefficient of each sink node, and takes the sink nodes with the matching coefficients larger than the preset value as the first sink nodes.
4. The method of claim 1, wherein after configuring the parsing script corresponding to the target sensor node, the method further comprises:
and the second sink node returns a response message of the second analysis script configuration request to the application server, wherein the response message comprises the analysis script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores the corresponding relationship between the analysis script corresponding to the target sensor node and the hash value of the target product information.
5. The method of claim 1, wherein the message type comprises at least one of the task message, a command alert, and a work order message.
6. A sensor message processing system based on the Internet of things is applied to an application enabling platform of the Internet of things, the application enabling platform comprises an application server and a plurality of sink nodes, and the application server comprises: the device comprises a receiving module, an identification module, a selection module, a matching module, a determination module and a sending module; the sink node comprises a parsing script configuration module;
the receiving module is used for the application server to receive a first analysis script configuration request sent by a third-party application program, wherein the first analysis script configuration request carries a target protocol type, a message type to be analyzed and target product information, the target protocol type is a message queue telemetry transmission protocol, the message type to be analyzed is the message type of a sensor message to be analyzed, and the target product information comprises a manufacturer ID and a product model of a target sensor node;
the identification module is used for identifying that the product information is the target product information and the sensor instruction set with the protocol type of the message queue telemetry transmission protocol is a first sensor instruction set by the application server, and acquiring an instruction identifier corresponding to the first sensor instruction set;
The selection module is used for the application server to send a query request to the sink node and obtain a first sink node according to the operation information returned by the sink node responding to the query request;
the matching module is configured to respectively obtain, by the application server, instruction identifiers corresponding to second sensor instruction sets stored in each first aggregation node, match the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes with the instruction identifiers corresponding to the first sensor instruction sets, if matching is successful, identify that the instruction identifiers corresponding to the second sensor instruction sets stored in the first aggregation nodes include the instruction identifiers corresponding to the first sensor instruction sets, and obtain the number of the successfully matched first aggregation nodes;
the determining module is configured to, after determining that the number of the first aggregation nodes that are successfully matched is not 0, determine whether the number of the first aggregation nodes that are successfully matched is greater than 1, determine, if the number of the first aggregation nodes that are successfully matched is not greater than 1, that the first aggregation nodes that are successfully matched are second aggregation nodes, check, if the number of the first aggregation nodes that are successfully matched is greater than 1, whether first two bytes of a second sensor instruction in the second sensor instruction set are the same as first two bytes of a first sensor instruction in the first sensor instruction set, if the first two bytes are the same, mark, by the application server, the second sensor instruction as the same sensor instruction in the second sensor instruction set and the first sensor instruction set, and, if the first two bytes are different, mark, by the application server, the second sensor instruction as a different sensor instruction in the second sensor instruction set and the first sensor instruction set, acquiring the number of the same sensor instructions, sequencing the number of the same sensor instructions, and taking the first sink node with the largest number of the same sensor instructions as a second sink node;
The sending module is configured to send, by the application server, a second parsing script configuration request to the second sink node, where the second parsing script configuration request carries the different sensor instructions, the instruction identifiers corresponding to the second sensor instruction set, and the target product information;
the analysis script configuration module is used for the second sink node to obtain the different sensor instructions according to the second analysis script configuration request, obtain each analysis script corresponding to the different sensor instructions from a preset analysis script library, call the analysis script corresponding to the second sensor instruction set, establish a directory with the target product information as a name, store the analysis scripts corresponding to the different sensor instructions and the analysis scripts corresponding to the second sensor instruction set in the directory with the target product information as a name, and configure the analysis scripts corresponding to the target sensor node.
7. The system of claim 6, wherein the identification module is specifically configured to:
the application server obtains a sensor instruction set corresponding to the message type from a message type library according to the message type to be analyzed, obtains product information and a protocol type corresponding to each sensor instruction set, judges whether the product information corresponding to each sensor instruction set is the target product information, simultaneously judges whether the protocol type corresponding to each sensor instruction set is the message queue telemetry transmission protocol, identifies that the sensor instruction set with the product information being the target product information and the protocol type being the message queue telemetry transmission protocol is a first sensor instruction set, and obtains an instruction identifier corresponding to the first sensor instruction set according to a preset mapping table of the sensor instruction set and the instruction identifier.
8. The system according to claim 6, wherein the selecting module specifically includes:
the query unit is used for the application server to send a query request to the sink node, wherein the query request is used for querying the current job parallel processing quantity of the sink node, the times that the Agent running state in the working period is in the offline state and the quantity of the stored second sensor instruction sets;
a receiving unit, configured to receive, by the application server, operation information returned by the sink node in response to the query request, where the operation information includes a number of parallel processing of jobs of the sink node, a number of times that an Agent operation state in an operation period is an offline state, and a number of stored second sensor instruction sets;
the generating unit is used for generating a model according to a preset matching coefficient by the application server, the number of parallel processing of the operation of each aggregation node, the number of times that the Agent running state in the working period is in an offline state and the number of stored second sensor instruction sets, generating the matching coefficient of each aggregation node, and taking the aggregation node of which the matching coefficient is greater than the preset value as the first aggregation node.
9. The system of claim 6, wherein the sink node further comprises:
and the response module is used for the second sink node to return a response message of the second analysis script configuration request to the application server, wherein the response message comprises the analysis script corresponding to the target sensor node and the hash value of the target product information, so that the application server establishes and stores the corresponding relationship between the analysis script corresponding to the target sensor node and the hash value of the target product information.
10. The system of claim 6, wherein the message type comprises at least one of the task message, a command alert, and a work order message.
CN202010704360.5A 2020-07-21 2020-07-21 Sensor message processing method and system based on Internet of things Withdrawn CN111866139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010704360.5A CN111866139A (en) 2020-07-21 2020-07-21 Sensor message processing method and system based on Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010704360.5A CN111866139A (en) 2020-07-21 2020-07-21 Sensor message processing method and system based on Internet of things

Publications (1)

Publication Number Publication Date
CN111866139A true CN111866139A (en) 2020-10-30

Family

ID=73001575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010704360.5A Withdrawn CN111866139A (en) 2020-07-21 2020-07-21 Sensor message processing method and system based on Internet of things

Country Status (1)

Country Link
CN (1) CN111866139A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112688967A (en) * 2021-03-11 2021-04-20 武汉慧联无限科技有限公司 Internet of things data processing method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112688967A (en) * 2021-03-11 2021-04-20 武汉慧联无限科技有限公司 Internet of things data processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110347560B (en) Method, device, system, equipment and medium for prompting abnormity of big data product
CN112306881B (en) Analog data generation method, device, equipment and storage medium
US10169203B2 (en) Test simulation for software defined networking environments
US20050223101A1 (en) Computer-implemented method, system and program product for resolving prerequisites for native applications utilizing an open service gateway initiative ( OSGi) framework
CN112363775B (en) Method, system and storage medium for dynamically modifying microservice configuration information
CN108376078A (en) Upgrade method, device and the household appliance of equipment
CN111831191A (en) Workflow configuration method and device, computer equipment and storage medium
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN111309593A (en) JSON interface verification method, device and equipment and computer readable storage medium
CN110912782A (en) Data acquisition method, device and storage medium
CN114416075A (en) Service processing method and device
CN111866139A (en) Sensor message processing method and system based on Internet of things
CN113992348B (en) Monitoring method and system of all-in-one machine
CN109408376B (en) Configuration data generation method, device, equipment and storage medium
US10659289B2 (en) System and method for event processing order guarantee
CN108111496B (en) Method, device and system for exposing http service for dubbo distributed application
CN112256557B (en) Program regression testing method, device, system, computer equipment and storage medium
CN113419818A (en) Basic component deployment method, device, server and storage medium
CN112328470A (en) Automatic operation and maintenance testing method, device, equipment and storage medium
CN109274533B (en) Web service fault positioning device and method based on rule engine
CN113708957B (en) Configuration method, terminal device and medium for server BMC
CN111078571B (en) Test method for analog response, terminal equipment and computer readable storage medium
CN113032054B (en) Service execution method and device, storage medium and electronic device
CN112749164A (en) Data quality analysis method and device and electronic equipment
CN113518974A (en) System and method for finding and identifying computing nodes in a network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201030

WW01 Invention patent application withdrawn after publication