CN109491666B - Internet of things protocol self-programming method based on artificial intelligence - Google Patents

Internet of things protocol self-programming method based on artificial intelligence Download PDF

Info

Publication number
CN109491666B
CN109491666B CN201811357593.1A CN201811357593A CN109491666B CN 109491666 B CN109491666 B CN 109491666B CN 201811357593 A CN201811357593 A CN 201811357593A CN 109491666 B CN109491666 B CN 109491666B
Authority
CN
China
Prior art keywords
protocol
equipment
artificial intelligence
self
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811357593.1A
Other languages
Chinese (zh)
Other versions
CN109491666A (en
Inventor
宛田宾
李权威
袁泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhi Cloud Chain Technology Suzhou Co ltd
Original Assignee
Huazhi Cloud Chain Technology Suzhou 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 Huazhi Cloud Chain Technology Suzhou Co ltd filed Critical Huazhi Cloud Chain Technology Suzhou Co ltd
Priority to CN201811357593.1A priority Critical patent/CN109491666B/en
Publication of CN109491666A publication Critical patent/CN109491666A/en
Application granted granted Critical
Publication of CN109491666B publication Critical patent/CN109491666B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/425Lexical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides an artificial intelligence-based Internet of things protocol self-programming method, which utilizes an AI technology to realize automatic generation and automatic test of equipment protocol codes and finally establishes communication connection. The invention trains and analyzes the protocol interface of the application layer of the equipment by using an artificial intelligence technology, generates a core protocol code based on a standard program architecture, quickly establishes equipment connection and realizes the plug and play of equipment interconnection.

Description

Internet of things protocol self-programming method based on artificial intelligence
Technical Field
The invention relates to an internet learning method, in particular to an internet of things protocol self-programming method based on artificial intelligence, and belongs to the technical field of internet of things in the discrete processing manufacturing industry.
Background
In the discrete processing manufacturing industry, the communication protocols of processing devices produced by different manufacturers are different, and the communication protocols are difficult to unify for various reasons. This presents an obstacle for manufacturing enterprises to implement the interconnection of intelligent plants. The traditional interconnection mode usually adopts a customized development mode, the development period is long, the framework is difficult to unify, and the deployment time is long and the maintenance cost is high.
Disclosure of Invention
Aiming at the technical problems, the invention provides an artificial intelligence-based Internet of things protocol self-programming method, which realizes automatic generation and automatic test of equipment protocol codes by using AI technology, and finally establishes communication connection to realize plug and play of equipment interconnection.
The technical scheme for solving the technical problems is as follows: the method for self-programming the Internet of things protocol based on artificial intelligence is provided, and comprises the following steps:
establishing physical connection between an embedded industrial computer and equipment, wherein the embedded industrial computer is called AILINK for short;
secondly, the user searches the protocol type for the module, identifies the protocol version of the equipment through connection attempt, establishes initial connection and acquires relevant static information of the equipment;
performing protocol matching in an application program interface program library of the equipment, and searching for a matched equipment driver; if the matched device driver cannot be found, prompting the user that a corresponding driver needs to be added into the interface library;
fourthly, lexical analysis is conducted on the driver, and an interface function 'syntax tree' is generated;
fifthly, clustering analysis is carried out on function names, input variables and output variables in the generated interface function grammar tree through a convolution algorithm based on polynomial fitting or a clustering algorithm based on division to generate an interface function cluster map, and semantic and clustering probability binding is carried out on leaves in the grammar tree at present to generate a semantic tree;
automatically generating a standard interface function code copy based on the semantic tree; the main work is to encapsulate a nonstandard interface into a standardized interface function so as to be convenient for calling a protocol generator in the embedded industrial computer;
performing recursive optimization on the interface function code copy through a probability gradient descent algorithm optimization strategy;
if the most probable protocol interface function of the recursive optimization is confirmed, bringing the matched semantics into the step sixteenth and sixteenth, and updating the semantic tree; after the semantic tree is updated, selecting an interface function code copy with the maximum probability at the moment, and executing step-quietness;
the self-supporting character is characterized in that the self-supporting character is obtained by inserting a successfully matched code copy into a specified position in a template according to an existing interface program template, compiling a program by running a compiling tool chain, storing a compiling result into the specified position in an embedded industrial computer, and displaying the completion degree of the program for matching a protocol interface;
the overall test of the device protocol automatically generates the protocol adaptation performance, and the autonomous generation of the device protocol is completed.
In a further limited technical scheme of the invention, in the method for self-programming the internet of things protocol based on artificial intelligence, in the step (2), the user marks the equipment brand for the module, so as to accelerate the identification speed.
In the method for self-programming of the internet of things protocol based on artificial intelligence, the recursive optimization in the step (7) selects the interface function with the highest probability in the semantic tree to perform communication test, firstly, if the obtained characteristic value is matched with the preset semantic, the code copy is confirmed, and the confirmation algorithm is based on the training sample and mainly comes from the working condition and the feedback characteristic value under the constraint condition; and (5) if the acquired characteristic value is not matched with the preset semantics, judging that the semantic recognition in the step (6) fails, calling manual intervention, carrying out manual processing on the code copy, and adding a training sample.
In the method for self-programming of internet of things protocol based on artificial intelligence, the training sample is feature extraction of relevant parameters in the equipment and is used for confirming whether semantics of the obtained data are correct or not.
In the method for self-programming of internet of things protocol based on artificial intelligence, the embedded industrial computer is a hardware carrier for software operation and supports RJ45 and RS232 connection interfaces.
Further, in the method for self-programming of internet of things protocol based on artificial intelligence, the leaves of the syntax tree in the step (4) are calculated by using a convolution algorithm, and the similarity calculation and the frequency calculation are performed.
The invention has the beneficial effects that: the invention trains and analyzes the protocol interface of the application layer of the equipment by using an artificial intelligence technology, generates a core protocol code based on a standard program architecture, quickly establishes equipment connection and realizes the plug and play of equipment interconnection.
Drawings
FIG. 1 is an overall data flow diagram of the present invention.
FIG. 2 is a standalone topology of the present invention.
FIG. 3 is a diagram illustrating syntax tree generation according to the present embodiment.
Fig. 4 is a diagram illustrating an example of semantic clustering analysis according to this embodiment.
Fig. 5 is a schematic diagram of the recursive optimization process of the present embodiment.
Fig. 6 is a schematic diagram of an autonomous switching process of the semantic-based learning model according to the present embodiment.
Fig. 7 is a schematic diagram of a neural network structure according to the present embodiment.
Detailed Description
Example 1
The embodiment provides an internet of things protocol self-programming method based on artificial intelligence, which comprises the following steps:
establishing physical connection between an embedded industrial computer AILINK and equipment;
secondly, the user marks brands for the equipment modules, and the brands are used for accelerating the identification speed; a user searches a protocol type for a module, identifies a device protocol version through connection attempt, establishes initial connection and acquires related static information of the device;
performing protocol matching in an application program interface program library of the equipment, and searching for a matched equipment driver; if the matched device driver cannot be found, prompting the user that a corresponding driver needs to be added into the interface library;
fourthly, lexical analysis is conducted on the driver, and an interface function 'syntax tree' is generated;
fifthly, clustering analysis is carried out on function names, input variables and output variables in the generated interface function grammar tree through a convolution algorithm based on polynomial fitting or a clustering algorithm based on division to generate an interface function cluster map, and semantic and clustering probability binding is carried out on leaves in the grammar tree at present to generate a semantic tree;
automatically generating a standard interface function code copy based on the semantic tree; the main work is to encapsulate a nonstandard interface into a standardized interface function so as to be convenient for calling a protocol generator in the embedded industrial computer;
performing recursive optimization on the interface function code copy through a probability gradient descent algorithm optimization strategy; selecting an interface function with the maximum probability from a semantic tree for communication test by recursive optimization, and confirming the code copy if the acquired characteristic value is matched with preset semantics; if the acquired characteristic value is not matched with the preset semantics, judging that the semantic recognition in the step (6) fails, calling manual intervention, carrying out manual processing on the case, and adding a training sample;
if the most probable protocol interface function of the recursive optimization is confirmed, bringing the matched semantics into the step sixteenth and sixteenth, and updating the semantic tree; after the semantic tree is updated, selecting an interface function code copy with the maximum probability at the moment, and executing step-quietness;
the self-supporting character is characterized in that the self-supporting character is obtained by inserting a successfully matched code copy into a specified position in a template according to an existing interface program template, compiling a program by running a compiling tool chain, storing a compiling result into the specified position in an embedded industrial computer, and displaying the completion degree of the program for matching a protocol interface;
the overall test of the device protocol automatically generates the protocol adaptation performance, and the autonomous generation of the device protocol is completed.
In the implementation of this embodiment, as shown in fig. 1, the third party API interface file library in the figure is provided for the device manufacturer, and different device manufacturers have different files and different protocols used. The adapter template is a section of software code based on a standard framework of embedded industrial computer AILINK communication software, and after the program is produced and compiled, the adapter template is a device driving program for the device, and after the device driving program is loaded into the framework, data exchange can be carried out with the device. The training sample is the feature extraction of relevant parameters in the equipment and is used for confirming whether the semantics of the obtained data are correct. As shown in FIG. 2, the protocols in the figure are different according to different equipment systems, and the coverage range of the protocols is OPC UA/DA, Modbus TCP/RTU, TCP/IP, Profibbus and the like. In fig. 1, the user first completes the device system type marking, and the software system can automatically search the corresponding protocol in the initial state and determine the type of the protocol. The AILINK is a hardware carrier for software operation, which supports two physical connection interfaces of RJ45 and RS 232. The syntax tree generated in this embodiment generates an abstract syntax tree through a lexical method and a syntax analyzer, as shown in fig. 3, this technique is a commonly used technique in a compiling technique, different regular expressions are set according to different analysis target requirements, and the objective herein is to divide functions and parameters.
The leaves in the syntax tree in the embodiment adopt a convolution algorithm to calculate the similarity and frequency;
Figure DEST_PATH_IMAGE001
(1)
where is the digitized fit function to the grammatical phrase.
Figure DEST_PATH_IMAGE002
(2)
Is the ascii value of the ith character in the phrase.
Fitting the vectors by a polynomial of degree 3, see formula (3):
Figure DEST_PATH_IMAGE003
(3)
wherein
Figure DEST_PATH_IMAGE004
Is a polynomial coefficient, M is an order, and after fitting, we obtain
Figure DEST_PATH_IMAGE005
Figure DEST_PATH_IMAGE006
The convolution kernel is a labeled semantic phrase template, and the functionalization process is the same as the formula (2) and the formula (3). Through the process, the semantic classification of each phrase in the grammar tree can be obtained, and the hit frequency is recorded.
The recursive optimization process of this embodiment mainly completes self-validation of the code, as shown in fig. 5, where max(s) refers to selecting the function with the highest similarity in the semantic tree for automatic testing, and the core part of this process is a validation algorithm and a training sample library related to validation. The basic principle of the confirmation algorithm is as follows: and calling the regularized function to obtain a return value, and sending the return value into a three-layer neural network for confidence confirmation. As shown in fig. 6, the learning model is a semantic-based autonomous switching process, and a neural network weight configuration file and an activation function are selected from a training model library by semantic pre-judgment. After loading, the return value is sent to the BP network for confirmation. And if the semantic similarity fails, selecting a model with suboptimal semantic similarity for loading training. The return values are a set of vectors that vary over time as input vectors to the ANN. In the present embodiment, the three-layer BP network model is divided into different models such as a rotation speed, a warning, a state, a coordinate, a cycle period, and the like, as shown in fig. 7, and is automatically set by the mechanism in fig. 6. And the output layer sends the returned feature vectors to the ANN, and if the obtained output classification is consistent with the semantic classification, the function is confirmed.
The technical scheme of the embodiment realizes the whole process from equipment protocol guidance, protocol semantic analysis, code autonomous generation to automatic testing. The data is classified and confirmed through an artificial neural network technology, so that the reliability of the whole mechanism is enhanced.
In addition to the above embodiments, the present invention may have other embodiments. All technical solutions formed by adopting equivalent substitutions or equivalent transformations fall within the protection scope of the claims of the present invention.

Claims (6)

1. An Internet of things protocol self-programming method based on artificial intelligence is characterized by comprising the following steps:
establishing physical connection between an embedded industrial computer and equipment;
marking the type of the equipment by the user, identifying the type and the version of the equipment protocol through connection attempt, establishing initial connection, and acquiring relevant static information of the equipment;
performing protocol matching in an application program interface program library of the equipment, and searching for a matched equipment driver; if the matched device driver cannot be found, prompting the user that a corresponding driver needs to be added into the interface library;
fourthly, lexical analysis is conducted on the driver, and an interface function 'syntax tree' is generated;
fifthly, clustering analysis is carried out on function names, input variables and output variables in the generated interface function grammar tree through a convolution algorithm based on polynomial fitting to generate an interface function cluster map, and semantics and clustering probability binding are carried out on leaves in the grammar tree at present to generate a semantic tree;
automatically generating a standard interface function code copy based on the semantic tree; packaging the nonstandard interface into a standardized interface function so as to facilitate the calling of a protocol generator in the embedded industrial computer;
performing recursive optimization on the interface function code copy through a probability gradient descent algorithm optimization strategy;
if the most probable protocol interface function of the recursive optimization is confirmed, bringing the matched semantics into the step sixteenth and sixteenth, and updating the semantic tree; after the semantic tree is updated, selecting an interface function code copy with the maximum probability at the moment, and executing step-quietness;
the self-supporting character is characterized in that the self-supporting character is obtained by inserting a successfully matched code copy into a specified position in a template according to an existing interface program template, compiling a program by running a compiling tool chain, storing a compiling result into the specified position in an embedded industrial computer, and displaying the completion degree of the program for matching a protocol interface;
the overall test of the device protocol automatically generates the protocol adaptation performance, and the autonomous generation of the device protocol is completed.
2. The artificial intelligence based internet of things protocol self-programming method as claimed in claim 1, wherein: and (3) marking the equipment brand for the module by the user in the step (2).
3. The artificial intelligence based internet of things protocol self-programming method as claimed in claim 1, wherein: the recursive optimization in the step (7) selects an interface function with the maximum probability in the semantic tree for communication test, and if the acquired characteristic value is matched with the preset semantic, the code copy is confirmed; and (5) if the acquired characteristic value is not matched with the preset semantics, judging that the semantic recognition in the step (6) fails, calling manual intervention, carrying out manual processing on the code copy, and adding a training sample.
4. The artificial intelligence based internet of things protocol self-programming method as claimed in claim 3, wherein: the training sample is the feature extraction of relevant parameters in the equipment and is used for confirming whether the semantics of the obtained data are correct or not.
5. The artificial intelligence based internet of things protocol self-programming method as claimed in claim 1, wherein: the embedded industrial computer is a hardware carrier for software operation and supports RJ45 and RS232 connection interfaces.
6. The artificial intelligence based internet of things protocol self-programming method as claimed in claim 1, wherein: and (4) performing calculation similarity calculation and frequency calculation on leaves of the grammar tree in the step (4) by adopting a convolution algorithm.
CN201811357593.1A 2018-11-15 2018-11-15 Internet of things protocol self-programming method based on artificial intelligence Active CN109491666B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811357593.1A CN109491666B (en) 2018-11-15 2018-11-15 Internet of things protocol self-programming method based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811357593.1A CN109491666B (en) 2018-11-15 2018-11-15 Internet of things protocol self-programming method based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN109491666A CN109491666A (en) 2019-03-19
CN109491666B true CN109491666B (en) 2021-04-27

Family

ID=65694903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811357593.1A Active CN109491666B (en) 2018-11-15 2018-11-15 Internet of things protocol self-programming method based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN109491666B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111835724B (en) * 2020-06-11 2022-08-26 广州天源信息科技股份有限公司 Protocol conflict matching method, system, storage medium and computer equipment
CN117688319B (en) * 2023-11-10 2024-05-07 山东恒云信息科技有限公司 Method for analyzing database structure by using AI

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7152027B2 (en) * 1998-02-17 2006-12-19 National Instruments Corporation Reconfigurable test system
US6721736B1 (en) * 2000-11-15 2004-04-13 Hewlett-Packard Development Company, L.P. Methods, computer system, and computer program product for configuring a meta search engine
US6928464B2 (en) * 2001-04-30 2005-08-09 Microsoft Corporation Systems and methods for unified remote control access
ES2471415T3 (en) * 2006-07-24 2014-06-26 Agfa Healthcare Procedure to establish a data connection between medical devices and a computer system
CN106569947A (en) * 2016-11-01 2017-04-19 北京大学(天津滨海)新代信息技术研究院 Method and tool for extracting API (Application Program Interface) use example from unit test code

Also Published As

Publication number Publication date
CN109491666A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109491666B (en) Internet of things protocol self-programming method based on artificial intelligence
CN104834537A (en) Data processing method, server and client
WO2008089470A1 (en) Integrated speech recognition and semantic classification
CN111883122B (en) Speech recognition method and device, storage medium and electronic equipment
CN112069801A (en) Sentence backbone extraction method, equipment and readable storage medium based on dependency syntax
CN106228974A (en) Control method based on speech recognition, Apparatus and system
KR100835290B1 (en) System and method for classifying document
EP4086893B1 (en) Natural language understanding method and device, vehicle and medium
CN107398912B (en) Domestic robot user behavior statistical system
CN116756047B (en) Software development method and system of vehicle controller based on GPT
CN113312268A (en) Intelligent contract code similarity detection method
CN113741886A (en) Statement level program repairing method and system based on graph
CN111581968A (en) Training method, recognition method, system, device and medium for spoken language understanding model
CN116107834A (en) Log abnormality detection method, device, equipment and storage medium
CN116502140B (en) Encryption algorithm identification method and device based on similarity of control flow graphs
CN108717576A (en) Tool management system based on speech recognition
WO2023154392A1 (en) Conversation graph navigation with language model
CN113971032B (en) Full-process automatic deployment method and system of machine learning model for code generation
CN113297348B (en) Correction method for speech recognition of Chinese text
CN108595618A (en) A kind of big data platform automatically generating keynote speech
CN112668342B (en) Remote supervision relation extraction noise reduction system based on twin network
CN113377962B (en) Intelligent process simulation method based on image recognition and natural language processing
CN111695587B (en) Vehicle brand and model identification method and device
JP6458183B1 (en) Automatic voice response system and program in motor sports
CN112466307B (en) Voice replying method and device, storage medium and electronic device

Legal Events

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