CN112532736B - 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
CN112532736B
CN112532736B CN202011415773.8A CN202011415773A CN112532736B CN 112532736 B CN112532736 B CN 112532736B CN 202011415773 A CN202011415773 A CN 202011415773A CN 112532736 B CN112532736 B CN 112532736B
Authority
CN
China
Prior art keywords
data acquisition
service
server
resolver
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.)
Active
Application number
CN202011415773.8A
Other languages
Chinese (zh)
Other versions
CN112532736A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

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 an 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. When the application program based on the spring framework is applied, a series of bean objects need to be generated in the implementation process of the collected business code program function, and the specific function is implemented by operating the bean objects, so that the invasiveness is too 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 the 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 can be customized, the performance is high, the throughput is higher, the delay is lower, the resource consumption can be reduced, the high cohesion and low coupling are achieved among all 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.
And 2, step: defining an IRpcService as a uniform interface class for data acquisition in the data acquisition server, and providing a unique abstract message handling handle Rpc 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 by 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 classes, and each service implements a unified 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 classes 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 resolvers realize the processing of respective acquisition requirements and the 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 collection service interface based on the unification is provided, the Spring is depended to inject dynamic calling service realization classes during the operation period, and the business realization unification interface is used for processing respective business logic, so that the application development can meet the processing requirements of various affairs according to the self collection requirement, the coupling degree among the components is reduced, and the decoupling among all layers of software 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.
1. 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, as shown in fig. 1, including:
101-103, intelligent equipment terminal;
104, a data acquisition server;
105-107, a resolver;
specifically, 101 to 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 represent various analyzers customized according to different requirements of the collected service, and realize personalized requirement processing and data persistence of the service.
2. The Spring-dependent infusion principle is as follows:
fig. 2 is a flowchart of a principle of Spring-dependent injection for acquiring data at an intelligent device terminal according to an embodiment of the present invention, including:
201, configuring a terminal protocol model of the intelligent device;
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 a corresponding protocol model analyzer according to the index number information of the sent message;
207, spring dependent injection of the 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, realizes the receiving of communication uplink data with the intelligent equipment terminal, analyzes the protocol and provides a core service data source for the data display of an 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 ElectroCicordidService, 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: the charging starting time, the charging ending time, the charging port, the charging duration, the 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 intended to be illustrative of the preferred embodiment of the present invention and should not be taken as limiting the invention, but rather, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the 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 frame, is used for providing the 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: according to the retrieved name of the resolver ServiceName, through Spring dependent injection and by an applicationContext, a getBean (String name, class < T > requiredType) method is provided to obtain a Service interface of a Service state Class, and dynamic injection of beans during running is realized, namely a corresponding resolver realization Class is dynamically determined;
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 Internet of things intelligent device data acquisition method based on Spring-dependent injection according to claim 1, characterized in that: 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 CN112532736A (en) 2021-03-19
CN112532736B true 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015027318A1 (en) * 2013-08-29 2015-03-05 Mondi Products Ltd. Modular plant support poles
US11977549B2 (en) * 2016-09-15 2024-05-07 Oracle International Corporation Clustering event processing engines

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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的可定制数据采集系统的设计与实现;廖宁等;《计算机技术与发展》;20091010(第10期);全文 *

Also Published As

Publication number Publication date
CN112532736A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN109788004B (en) Analysis method and system for automatically adapting national standard custom protocol of new energy automobile
CN108683636B (en) Charging pile communication method and system
CN104156275B (en) A kind of method and apparatus of Android platform abnormality processing
CN111917772B (en) Adaptive charging pile communication protocol method and device
CN112532736B (en) Internet of things intelligent equipment data acquisition method based on Spring dependent injection
CN117453280B (en) Code topology and service topology generation method, device, equipment and medium
CN109189440A (en) A kind of ECG monitor upgrade method, device and storage medium based on Internet of Things
CN108512943A (en) Embedded device data store system based on message queue and store method
CN111199464B (en) Processing system of collection data, processing method, device and medium of collection data
CN112422564A (en) Protocol testing method, device, storage medium and electronic device
CN107592359A (en) A kind of service end response method, device and medium based on RPC agreements
CN110061893B (en) Fault information acquisition method, server and storage medium
CN113806195B (en) Data processing method, device, equipment, system and storage medium
CN111724489B (en) General software system of ticket vending and checking machine
CN109189448B (en) 61850 protocol-based method for online upgrading of relay protection device program
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
CN115470770B (en) Electronic form template filling method and system
CN116668552A (en) Method and system for realizing data exchange protocol stack based on container technology
CN109062797A (en) The method and apparatus for generating information
CN117312104B (en) Visual link tracking method and system based on airport production operation system
CN114217931B (en) Application program management method and intelligent repair system for user terminal
CN111865930B (en) Method for automatically extracting character protocols of uninterruptible power supply
CN201011719Y (en) IPMI message monitoring system on ATCA platform
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

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.

TR01 Transfer of patent right