CN112532736A - Internet of things intelligent equipment data acquisition method based on Spring dependent injection - Google Patents

Internet of things intelligent equipment data acquisition method based on Spring dependent injection Download PDF

Info

Publication number
CN112532736A
CN112532736A CN202011415773.8A CN202011415773A CN112532736A CN 112532736 A CN112532736 A CN 112532736A CN 202011415773 A CN202011415773 A CN 202011415773A CN 112532736 A CN112532736 A CN 112532736A
Authority
CN
China
Prior art keywords
data acquisition
service
resolver
server
internet
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.)
Granted
Application number
CN202011415773.8A
Other languages
Chinese (zh)
Other versions
CN112532736B (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.)
Zhuhai Titans Technology Co ltd
Original Assignee
Zhuhai Ev Link New Energy Automobile 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 Zhuhai Ev Link New Energy Automobile Co ltd filed Critical Zhuhai Ev Link New Energy Automobile Co ltd
Priority to CN202011415773.8A priority Critical patent/CN112532736B/en
Publication of CN112532736A publication Critical patent/CN112532736A/en
Application granted granted Critical
Publication of CN112532736B publication Critical patent/CN112532736B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y40/00IoT characterised by the purpose of the information processing
    • G16Y40/10Detection; Monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The invention discloses a method for collecting data of an internet of things intelligent device based on Spring dependent injection. The invention provides a unified data acquisition interface aiming at all intelligent terminal equipment based on Java open-source high-concurrency non-blocking Socket frameworks such as Mina and Netty, and can clearly separate focus points based on a flexible and extensible event model; a highly customizable thread model; high performance, higher throughput, lower latency; and the resource consumption is reduced. By configuring the protocol point table, version, index and resolver bean object Id of the intelligent equipment terminal in the database, the problems of diversification of data acquisition requirements, diversification of equipment types and multi-version compatibility with equipment are solved on one hand, and the corresponding resolver is configured on the other hand, so that the resolver is called during dynamic running in a program, high cohesion and low coupling are achieved among all service components, and reusability and portability of a program module are greatly enhanced. The method is applied to the technical field of data acquisition of the intelligent equipment of the Internet of things.

Description

Internet of things intelligent equipment data acquisition method based on Spring dependent injection
Technical Field
The invention relates to a data acquisition method for intelligent equipment of the Internet of things, in particular to a data acquisition method for intelligent equipment of the Internet of things based on Spring-dependent injection.
Background
Along with thing networking monitor terminal equipment inserts quantity more and more, factors such as the diversified (brand, kind difference) demand that the collection demand constantly changes, version upgrade, version are compatible and access device, as data acquisition's collection service end, adopt following two kinds of modes to carry out data acquisition mostly:
1. the acquisition server needs to perform hard-coding customized maintenance for the constantly changing acquisition requirements, that is, a coding rule is set for each service, which cannot adapt to the constantly changing services.
2. In the implementation process of the collected business code program function, a series of bean objects need to be generated, and the specific function is implemented by operating the bean objects, so that the intrusiveness is strong.
The two methods have the following problems:
1. all the service logics are highly coupled together, and are not subjected to division and encapsulation of responsibility, all service processing functions are completed in the implementation class, and when the acquisition requirement changes, a public acquisition interface needs to be adjusted, so that the adaptability to the requirement is very poor.
2. The method realizes specific service functions by operating bean objects of different services, introduces complex dependency relationship, makes reference more rigid and complicated, and causes the logic of each service to be highly coupled together.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides the data acquisition method of the intelligent equipment of the internet of things based on Spring-dependent injection, the data acquisition method of the intelligent equipment of the internet of things based on the Spring-dependent injection can clearly separate the focus, the thread model which is highly customizable is high in performance, higher in throughput and lower in delay, the resource consumption can be reduced, high cohesion and low coupling are achieved among business service components, the reusability and the portability of a program module are greatly enhanced, and the decoupling among all layers of software is realized.
The technical scheme adopted by the invention is as follows: the intelligent terminal equipment is connected and communicated with the data acquisition server; the intelligent terminal equipment is used for initiating a connection request to the data acquisition server and sending data to be uploaded to the data acquisition server after the data acquisition server receives the connection request; the data acquisition server builds a server side of data acquisition service based on a Java open source high-concurrency non-blocking Socket framework, the data acquisition server is used for providing the data acquisition service, and the data acquisition service provided by the data acquisition server needs to perform the following steps in the data acquisition server:
step 1: configuring a protocol point table, a version, an index and a resolver bean object Id of the intelligent terminal equipment in a database of the data acquisition server; on one hand, the problems of diversified requirements of a data acquisition point table, diversified types of equipment and multi-version compatibility with the equipment are solved, and on the other hand, the corresponding parser is configured, so that the parser is called during dynamic operation in a program.
Step 2: defining IRpcService as a uniform interface class for data acquisition in the data acquisition server, and providing a unique abstract message processing handleRpc method;
and step 3: an IRpcService abstract interface resolver is realized in the data acquisition server, and a bean is issued through Spring @ Service annotation; notes can be directly written on the service implementation class for injection, so that the method is precise, short, high in readability, free of redundant codes and convenient to maintain, and is matched with the step 7 for Spring dependence injection;
and 4, step 4: starting Socket monitoring with a TCP/IP protocol at a server side of the data acquisition server;
and 5: the intelligent terminal equipment is accessed to a unified server side in a TCP/IP mode and sends a message;
step 6: the server side finds out a corresponding bean object Id, namely a resolver ServiceName name according to the index number of the message sent by the server side;
and 7: acquiring a Service interface of a Service state Class by a getBean (String name, Class < T > requiredType) method provided by an applicationContext through Spring dependent injection when the retrieved resolver ServiceName name is used, and realizing dynamic injection of bean during operation, namely dynamically determining a corresponding resolver realization Class; the Spring relies on the dynamic injection to call the service implementation class, and each service implements a uniform interface to process respective service logic, so that the application development can meet the processing requirements of various transactions according to the self acquisition requirements, the coupling degree among codes can be reduced, the class and the class are decoupled, and the expandability and the maintainability of the system are improved;
and 8: after the bean is dynamically determined, calling the uniform method name handleRpc of the interface protocol model,
and step 9: after the interfaces of different service types are called, the corresponding service state type analyzers realize the processing of respective acquisition requirements and carry out data persistence.
Furthermore, the intelligent terminal equipment comprises a direct current charging pile, an alternating current charging pile and an energy storage battery.
Further, the Java open-source high-concurrency non-blocking Socket framework comprises Mina and Netty.
The invention has the beneficial effects that: the invention has the following beneficial effects:
1. the invention provides a unified data acquisition interface aiming at all intelligent terminal equipment based on Java open-source high-concurrency non-blocking Socket frameworks such as Mina and Netty, and can clearly separate focus points based on a flexible and extensible event model; a highly customizable thread model; high performance, higher throughput, lower latency; and the resource consumption is reduced.
2. By configuring the protocol point table, version, index and resolver bean object Id of the intelligent equipment terminal in the database, the problems of diversification of data acquisition requirements, diversification of equipment types and multi-version compatibility with equipment are solved on one hand, and the corresponding resolver is configured on the other hand, so that the resolver is called during dynamic running in a program, high cohesion and low coupling are achieved among all service components, and reusability and portability of a program module are greatly enhanced.
3. The method provides a uniform acquisition service interface, dynamically calls service implementation classes through Spring dependence during operation, and realizes uniform interface processing of respective service logic by each service, so that application development can meet processing requirements of various transactions according to self acquisition requirements, coupling degree between components is reduced, and decoupling between software layers is realized.
Drawings
FIG. 1 is a schematic diagram of a communication between a terminal and a server of an intelligent device based on a TCP/IP protocol provided by the implementation of the present invention;
FIG. 2 is a flow chart illustrating a principle of Spring-dependent injection for data acquisition at a smart device terminal according to an embodiment of the present invention;
FIG. 3 is a diagram of dependency relationship between collection interface classes and the implementation classes of the service states provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
First, intelligent device terminal and server communication mode description
Fig. 1 is a schematic diagram of communication between an intelligent device terminal and an acquisition server based on a TCP/IP protocol according to an embodiment of the present invention, as shown in fig. 1, including:
101-103, intelligent equipment terminals;
104, a data acquisition server;
105-107 parts of a resolver;
specifically, 101-103 represent one or more internet of things intelligent devices (such as a direct current charging pile, an alternating current charging pile, an energy storage battery and the like);
104, an acquisition server based on Java open source high concurrency non-blocking Socket such as Mina and Netty;
105-107, a plurality of analyzers customized according to different requirements of the collected services are shown, and personalized requirement processing and data persistence of the services are realized.
Secondly, the Spring-dependent injection principle is as follows:
fig. 2 is a flow chart of a principle of Spring-dependent injection for acquiring data at an intelligent device terminal according to an embodiment of the present invention, including:
a terminal protocol model of the intelligent equipment is configured 201;
202, issuing a uniform interface class for data acquisition;
203, realizing a collected uniform interface type parser and issuing the parser into bean;
204, collecting a message of the monitoring equipment of the server;
205, the intelligent device terminal device sends a message;
206, searching the corresponding protocol model resolver according to the index number information of the message;
207, spring dependent injection of a corresponding protocol model parser;
208, calling a protocol model unified interface method;
209, different services are processed and persisted by different resolvers to realize respective acquisition requirements.
Specifically, in step 201, a protocol point table, a version, an index, a resolver bean object Id, and the like of an accessed internet of things intelligent device (such as a direct current charging pile, an alternating current charging pile, an energy storage battery, and the like) are configured in a database;
in step 202, issuing a unified processing interface class for data acquisition;
in step 203, customizing analyzer implementation classes related to each Service through a uniform acquisition and processing interface, and issuing beans through @ Service annotation of Spring, and when 206 calls are provided, directly injecting through annotations;
in step 204, the server starts Socket monitoring with TCP/IP protocol;
in step 205, messages are uploaded through the internet of things intelligent terminal device in a TCP/IP mode, and a unified server is accessed;
in step 206, according to the index number of the message sent, the database protocol model is retrieved 201, and the corresponding bean object Id, namely the name of the resolver ServiceName, is found out;
in step 207, according to the ServiceName name of the resolver retrieved in step 206, acquiring a Service interface of a Service state Class by a getteam (String name, Class < T > requiredType) method provided by ApplicationContext through Spring dependency injection, and implementing dynamic injection of a bean during running, that is, dynamically determining a corresponding resolver implementation Class;
in step 208, after the bean is dynamically determined by 207, calling a uniform method name handleRpc of the interface protocol model;
in step 209, after the interfaces of different service types are called by 208, the respective acquisition requirement processing and data persistence are realized by the corresponding service state type resolvers.
Fig. 3 is a diagram of implementation class dependency relationship between an acquisition interface class and each service state provided in the implementation of the present invention, and as shown in fig. 3, IRpcService is a unified interface class for data acquisition and provides a unique abstract message handling handleRpc method, and each service state class implements the interface and implements the handleRpc method of the @ Override parent class, thereby implementing a service table corresponding to data analysis and persistence of each service state. Different intelligent terminal devices or different service state data acquisition requirements are carried out to realize the IRpcService interface class and the abstract message processing handleRpc method, so that decoupling between all parts of service logic is achieved, processing requirements of various transactions are met, and reusability of a program is improved.
The collection service class is the core of real-time monitoring and data collection class, realizes the receiving and protocol analysis of communication uplink data of the intelligent equipment terminal, and provides a core service data source for the data display of the application system.
Service status class illustrates: the system comprises a battery information service class BmsInfoservice, a charger information service class ChargingInfoservice, a charging bill service class ElectroCicordinService, a charging module service class ChargerStatusService, an equipment state service class StakeStatusService, an equipment version service class StakeVersionService and the like;
battery information: collecting relevant information of the battery during charging, such as charging current, residual charging time, charging voltage, charging mode, charging start and end time, SOC before charging, current SOC, charging demand current, charging demand pressure and the like;
charger information: the A/B/C three-phase voltage, the temperature of the charging cabinet, the humidity of the charging cabinet and the like;
charging bills: charging start time, charging end time, charging port, charging duration, charging quantity and the like;
a charging module: module voltage, module current, module temperature, module status, etc.;
the equipment state: status information of the device, including charging, fault, offline, etc.;
device version: an execution unit, a monitoring unit, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (3)

1. A data acquisition method of an Internet of things intelligent device based on Spring dependent injection comprises an intelligent terminal device and a data acquisition server, wherein the intelligent terminal device is connected and communicated with the data acquisition server; the intelligent terminal equipment is used for initiating a connection request to the data acquisition server and sending data to be uploaded to the data acquisition server after the data acquisition server receives the connection request; the data acquisition server builds a server side of data acquisition service based on a Java open source high-concurrency non-blocking Socket framework, is used for providing data acquisition service, and is characterized in that: the data acquisition service provided by the data acquisition server needs to perform the following steps in the data acquisition server:
step 1: configuring a protocol point table, a version, an index and a resolver bean object Id of the intelligent terminal equipment in a database of the data acquisition server;
step 2: defining IRpcService as a uniform interface class for data acquisition in the data acquisition server, and providing a unique abstract message processing handleRpc method;
and step 3: an IRpcService abstract interface resolver is realized in the data acquisition server, and a bean is issued through Spring @ Service annotation;
and 4, step 4: starting Socket monitoring with a TCP/IP protocol at a server side of the data acquisition server;
and 5: the intelligent terminal equipment is accessed to a unified server side in a TCP/IP mode and sends a message;
step 6: the server side finds out a corresponding bean object Id, namely a resolver ServiceName name according to the index number of the message sent by the server side;
and 7: acquiring a Service interface of a Service state Class by a getBean (String name, Class < T > requiredType) method provided by an applicationContext through Spring dependent injection when the retrieved resolver ServiceName name is used, and realizing dynamic injection of bean during operation, namely dynamically determining a corresponding resolver realization Class;
and 8: after the bean is dynamically determined, calling the uniform method name handleRpc of the interface protocol model,
and step 9: after the interfaces of different service types are called, the corresponding service state type analyzers realize the processing of respective acquisition requirements and carry out data persistence.
2. The method for acquiring the data of the internet of things intelligent device based on Spring-dependent injection according to claim 1, wherein the method comprises the following steps: the intelligent terminal equipment comprises a direct current charging pile, an alternating current charging pile and an energy storage battery.
3. The method for acquiring the data of the internet of things intelligent device based on Spring-dependent injection according to claim 1, wherein the method comprises the following steps: the Java open-source high-concurrency non-blocking Socket framework comprises Mina and Netty.
CN202011415773.8A 2020-12-07 2020-12-07 Internet of things intelligent equipment data acquisition method based on Spring dependent injection Active CN112532736B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011415773.8A CN112532736B (en) 2020-12-07 2020-12-07 Internet of things intelligent equipment data acquisition method based on Spring dependent injection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011415773.8A CN112532736B (en) 2020-12-07 2020-12-07 Internet of things intelligent equipment data acquisition method based on Spring dependent injection

Publications (2)

Publication Number Publication Date
CN112532736A true CN112532736A (en) 2021-03-19
CN112532736B CN112532736B (en) 2022-12-06

Family

ID=74997122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011415773.8A Active CN112532736B (en) 2020-12-07 2020-12-07 Internet of things intelligent equipment data acquisition method based on Spring dependent injection

Country Status (1)

Country Link
CN (1) CN112532736B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150059242A1 (en) * 2013-08-29 2015-03-05 Mondi Products Ltd. Modular plant support poles
US20180074870A1 (en) * 2016-09-15 2018-03-15 Oracle International Corporation Graph generation for a distributed event processing system
CN108055350A (en) * 2017-12-29 2018-05-18 江苏徐工信息技术股份有限公司 A kind of Internet of Things data intelligent acquisition analysis method
CN108400992A (en) * 2018-03-06 2018-08-14 电信科学技术第五研究所有限公司 A kind of streaming traffic data protocol analysis software frame realization system and method
CN109408240A (en) * 2018-10-31 2019-03-01 四川长虹电器股份有限公司 Terminal device data collection system based on Netty frame
CN110769005A (en) * 2019-11-11 2020-02-07 交控科技股份有限公司 Multi-professional multi-system multi-protocol data acquisition method for rail transit
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150059242A1 (en) * 2013-08-29 2015-03-05 Mondi Products Ltd. Modular plant support poles
US20180074870A1 (en) * 2016-09-15 2018-03-15 Oracle International Corporation Graph generation for a distributed event processing system
CN108055350A (en) * 2017-12-29 2018-05-18 江苏徐工信息技术股份有限公司 A kind of Internet of Things data intelligent acquisition analysis method
CN108400992A (en) * 2018-03-06 2018-08-14 电信科学技术第五研究所有限公司 A kind of streaming traffic data protocol analysis software frame realization system and method
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN109408240A (en) * 2018-10-31 2019-03-01 四川长虹电器股份有限公司 Terminal device data collection system based on Netty frame
CN110769005A (en) * 2019-11-11 2020-02-07 交控科技股份有限公司 Multi-professional multi-system multi-protocol data acquisition method for rail transit

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
廖宁等: "基于SpringSide的可定制数据采集系统的设计与实现", 《计算机技术与发展》 *

Also Published As

Publication number Publication date
CN112532736B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
CN108683636B (en) Charging pile communication method and system
CN108280022A (en) Performance monitoring method and device
CN103079086A (en) Automatic testing system for set-top box
CN111399828B (en) Model-driven logic device modeling method and terminal
CN113890830A (en) IEC104 main station simulation system
CN105404995B (en) Plug-in type logistics data open platform construction method
CN105760272A (en) Monitoring background service customization method based on plug-in and system based on method
CN111061802A (en) Power data management processing method and device and storage medium
CN112532736B (en) Internet of things intelligent equipment data acquisition method based on Spring dependent injection
CN104202328A (en) GOOSE/SMV (generic object oriented substation event/sampled measured value) message subscribing method, GOOSE/SMV message subscribing configuration module and GOOSE/SMV message subscribing terminal
CN111506641B (en) Data management method, data acquisition platform, data management system and storage medium
CN113608952A (en) System fault processing method and system based on log construction support environment
CN103633736A (en) Online monitoring communication method from substation sub station to main station
CN103116521B (en) A kind of terminal information collection method and system
CN115858672A (en) Power terminal management method and device, electronic equipment and storage medium
CN115515026A (en) Ammeter data transmission system, method, device, equipment and medium
CN111724489B (en) General software system of ticket vending and checking machine
CN114390033A (en) Loop state patrol instrument acquisition system and method based on extensible communication protocol
CN113570347A (en) RPA operation and maintenance method for micro-service architecture system
CN112312376A (en) Method and system for remotely and interactively managing multifunctional electric meter
CN113347028B (en) Internet of things platform management system developed based on MQTT and RocktMQ
CN109062797A (en) The method and apparatus for generating information
CN115470770B (en) Electronic form template filling method and system
CN116668552A (en) Method and system for realizing data exchange protocol stack based on container technology
CN105721550B (en) A kind of fault-tolerant monitoring method of client and system

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231020

Address after: No. 128 Chuangxin Third Road, Tangjiawan Town, Zhuhai City, Guangdong Province, 519000

Patentee after: ZHUHAI TITANS TECHNOLOGY Co.,Ltd.

Address before: No.60, Shihua West Road, Zhuhai, Guangdong 519000

Patentee before: ZHUHAI EV-LINK NEW ENERGY AUTOMOBILE CO.,LTD.