CN108280030A - A kind of distribution method of register address, system and relevant apparatus - Google Patents

A kind of distribution method of register address, system and relevant apparatus Download PDF

Info

Publication number
CN108280030A
CN108280030A CN201810030803.XA CN201810030803A CN108280030A CN 108280030 A CN108280030 A CN 108280030A CN 201810030803 A CN201810030803 A CN 201810030803A CN 108280030 A CN108280030 A CN 108280030A
Authority
CN
China
Prior art keywords
configuration information
register
equipment
tcp
address
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
CN201810030803.XA
Other languages
Chinese (zh)
Other versions
CN108280030B (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.)
XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Xiamen Kehua Hengsheng Co Ltd
Original Assignee
XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Xiamen Kehua Hengsheng 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 XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd, Xiamen Kehua Hengsheng Co Ltd filed Critical XIAMEN KECAN INFORMATION TECHNOLOGY Co Ltd
Priority to CN201810030803.XA priority Critical patent/CN108280030B/en
Publication of CN108280030A publication Critical patent/CN108280030A/en
Application granted granted Critical
Publication of CN108280030B publication Critical patent/CN108280030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

This application discloses a kind of distribution methods of register address, including:Obtain the configuration information of the variety classes equipment enabled;The initial address that each device data information is stored in TCP/ModBus registers is calculated by preset data information arrangement mode in configuration information successively;The TCP/ModBus register numbers occupied according to configuration information and each initial address generate configuration information table;According to the sequencing of TCP/ModBus register address information lists, the data information that configuration information table is restored again into various kinds of equipment is first stored in since first address, until all data informations are stored and finished.So that occupying network bandwidth smaller in data transmission procedure, server resource consumes less, data-handling efficiency higher.The application further simultaneously discloses a kind of distribution system of register address, equipment and computer readable storage medium, has above-mentioned advantageous effect.

Description

A kind of distribution method of register address, system and relevant apparatus
Technical field
This application involves TCP/ModBus area of agreement, more particularly to a kind of distribution method of register address, system, dress It sets and computer readable storage medium.
Background technology
Most of power-supply device monitoring collection devices on the market at present, mainly by TCP/ModBus agreements to monitoring management Server carries out data transmission.
TCP/ModBus agreements generally by the way of fixed register address, i.e., are deposited in the data information of equipment solid In fixed register, since a monitoring of tools host can monitor different types of equipment, each type equipment is supported simultaneously again More monitoring (such as a collector supports 2 uninterruptible power supplies of monitoring, 3 battery management hosts, 4 station power distribution cabinets).In this way, The data information of the collected equipment of collector putting in order in register list can be at cycle arrangement mode, until arriving down The equipment of kind new type.When managing main frame needs to read collector facility information, reading order is sent, the real-time of equipment is obtained Parameter.
The prior art formed based on TCP/ModBus agreements is had the following problems:Since TCP/ModBus agreements are primary only Continuous address register can be read, according to the mode for disposably all reading the data information in all registers, meeting The data information of a large amount of equipment in not enabled state is read together, not only occupied bandwidth, and consumes server resource;If The mode for taking the data information for only reading the equipment in enabling state every time, since these data informations are in register address It is arranged at interruption on information list, needs to send a plurality of polling order to go to read and obtain target data information.
To sum up, there are various defects in the different data information reading manner of above two in use, especially exist When the collector quantity of monitoring is more, system performance can be seriously reduced, practical effect is bad.
Therefore, how to overcome existing based on TCP/ModBus agreements progress device data information storage and reading aspect presence Every technological deficiency, provide and occupy that network bandwidth smaller, server resource consumption is less, data in a kind of data transmission procedure The higher register address distribution mechanism for the treatment of effeciency is those skilled in the art's urgent problem to be solved.
Invention content
The purpose of the application is to provide a kind of distribution method of register address, is based on TCP/ModBus agreements, only will In the data information deposit TCP/ModBus registers of equipment in the state of enabling, according to the continuous of TCP/ModBus agreements Position in TCP/ModBus registers should be stored in by reading principle dynamic the data information of variety classes equipment being calculated, removal The data information of invalid or in not enabled state equipment in original still deposit TCP/ModBus registers, occupies net Network bandwidth smaller, server resource consume less, data-handling efficiency higher.
The another object of the application is the provision of a kind of distribution method system, device and the computer of register address can Read storage medium.
To achieve the above object, the application provides a kind of distribution method of register address, is based on TCP/ModBus agreements, Including:
The configuration information record being stored in database is obtained, and is obtained in enabling shape according to the configuration information record The configuration information of the variety classes equipment of state;Wherein, the configuration information includes that the quantity of each equipment and data information occupy TCP/ModBus registers quantity;
The deposit of each device data information is calculated by preset data information arrangement mode in the configuration information successively Initial address in the TCP/ModBus registers;
The TCP/ModBus register numbers and each initial address occupied according to the configuration information generates and matches confidence Cease table;
The configuration information table is subjected to data successively from the first address in TCP/ModBus register address information lists Storage;
After the completion of the storage of the data of the configuration information table, the data information of all kinds equipment is matched into confidence by described Breath table is sequentially stored into the TCP/ModBus registers being in idle condition, until all data informations are stored and finished.
Optionally, each number of devices is calculated by preset data information arrangement mode in the configuration information successively it is believed that Breath is stored in the initial address in the TCP/ModBus registers, including:
When the equipment in the enabling state only has a kind of, starting is stored according to the register of unique class data information The TCP/ModBus register numbers that the address=first address+configuration information table occupies, are calculated unique class The register of data information stores initial address;
When the type of the equipment in the enabling state is there are when N classes, N >=2, and first kind equipment is corresponded to respectively to N class equipment, wherein the first kind equipment is corresponding with primary sources information and the first register occupies quantity, the N classes Equipment is corresponding with N classes data information and N registers occupy quantity;
Initial address=first address+configuration information table is stored according to the register of the primary sources information The register storage starting point of the first kind device data information is calculated in the TCP/ModBus register numbers of occupancy Location;
The register of register storage initial address=N-1 class data informations of the N class data informations is stored The quantity of beginning the+the N-1 of address class equipment × N-1 registers occupy quantity, and the deposit of the N class data informations is calculated Device stores initial address;
Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
Optionally, which further includes:
When the newly-increased equipment for being in the enabling state, more by the device category information and configuration information of newly added equipment The new configuration information record in the database, and send out and enable more new signal;
The generation operation that the configuration information table is re-executed according to the enabling more new signal, to be matched according to newly-generated Set the deposit operation that information table re-starts data information.
Optionally, which further includes:
Extraction obtains the data information deposit TCP/ModBus registers of each equipment from the configuration information table In initial address;
The data information inquiry mode of corresponding type equipment is set according to each initial address, is set with promoting targeted species The search efficiency of standby data information.
To achieve the above object, present invention also provides a kind of distribution systems of register address, are based on TCP/ModBus Agreement, the distribution system include:
Configuration information acquiring unit, for obtaining the configuration information record being stored in database, and according to the configuration Information records to obtain the configuration information of the variety classes equipment in enabling state;Wherein, the configuration information includes that each sets The quantity for the TCP/ModBus registers that standby quantity and data information occupy;
Initial address computing unit, for the configuration information to be calculated successively by preset data information arrangement mode Each device data information is stored in the initial address in the TCP/ModBus registers;
Configuration information table generation unit, TCP/ModBus register numbers for being occupied according to the configuration information and respectively The initial address generates configuration information table;
Configuration information table storage unit, for by the configuration information table from TCP/ModBus register address information lists In first address carry out data storage successively;
Data information storage unit is used for after the completion of the storage of the data of the configuration information table, by all kinds equipment Data information be sequentially stored by the configuration information table in the TCP/ModBus registers being in idle condition, until all institutes It states data information and stores and finish.
Optionally, the initial address computing unit includes:
Unique class enables device data information and originates storage address computation subunit, in the enabling state When equipment only has a kind of, match confidence according to register storage initial address=first address+described of unique class data information The TCP/ModBus register numbers that table occupies are ceased, the register storage starting point of unique class data information is calculated Location;
When the type of the equipment in the enabling state is there are when N classes, N >=2, and first kind equipment is corresponded to respectively to N class equipment, wherein the first kind equipment is corresponding with primary sources information and the first register occupies quantity, the N classes Equipment is corresponding with N classes data information and N registers occupy quantity;
The first kind enables device data information and originates storage address computation subunit, for according to the he first-class numbert it is believed that The TCP/ModBus register numbers that register storage initial address=first address+configuration information table of breath occupies, The register storage initial address of the first kind device data information is calculated;
N classes enable device data information and originate storage address computation subunit, for posting for the N class data informations Storage stores quantity × N- of register storage initial address the+the N-1 class equipment of initial address=N-1 class data informations 1 register occupies quantity, and the register storage initial address of the N class data informations is calculated;
Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
Optionally, which further includes:
Updating unit, being used for will be in the device category information of newly added equipment and configuration information update to the database Configuration information record, and send out and enable more new signal;
Computing unit is initialized, the generation for re-executing the configuration information table according to the enabling more new signal is grasped Make, to re-start the deposit operation of data information according to newly-generated configuration information table.
Optionally, which further includes:
Initial address extraction unit obtains the data information deposit of each equipment for being extracted from the configuration information table Initial address in the TCP/ModBus registers;
Polling mode setting unit, the data information for corresponding type equipment to be arranged according to each initial address are inquired Mode, to promote the search efficiency of targeted species device data information.
To achieve the above object, present invention also provides a kind of, and the register address distribution based on TCP/ModBus agreements fills It sets, which includes:
Memory, for storing computer program;
Processor realizes the distribution of the register address as described in the above when for executing the computer program The step of method.
To achieve the above object, described computer-readable to deposit present invention also provides a kind of computer readable storage medium It is stored with computer program on storage media, realizes when the computer program is executed by processor and is posted as described in the above The step of distribution method of storage address.
A kind of distribution method of register address provided herein, is based on TCP/ModBus agreements, and acquisition is stored in Configuration information record in database, and the variety classes equipment in enabling state is obtained according to the configuration information record Configuration information;The deposit of each device data information is calculated by preset data information arrangement mode in the configuration information successively Initial address in the TCP/ModBus registers;According to the configuration information occupy TCP/ModBus register numbers and Each initial address generates configuration information table;By the configuration information table from TCP/ModBus register address information lists First address carry out data storage successively;After the completion of the storage of the data of the configuration information table, by the number of all kinds equipment It is believed that breath is sequentially stored by the configuration information table in the TCP/ModBus registers being in idle condition, until all numbers It is believed that breath storage finishes.
Obviously, the data information of the equipment in the state of enabling is only stored in by technical solution provided herein In TCP/ModBus registers, variety classes equipment is calculated according to the continuous reading principle of TCP/ModBus agreements dynamic Data information should be stored in the position in TCP/ModBus registers, eliminated in original still deposit TCP/ModBus registers Invalid or in not enabled state equipment data information, occupy that network bandwidth smaller, server resource consumption is less, number According to treatment effeciency higher.The application additionally provides a kind of distribution method system, device and the computer of register address simultaneously can Storage medium is read, there is above-mentioned advantageous effect, details are not described herein.
Description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
A kind of flow chart of the distribution method for register address that Fig. 1 is provided by the embodiment of the present application;
A kind of various types of device data information in the distribution method for the register address that Fig. 2 is provided by the embodiment of the present application Register storage initial address calculation flow chart;
It is corresponded to when a kind of newly-increased enabling equipment in the distribution method for the register address that Fig. 3 is provided by the embodiment of the present application The flow chart of processing mode;
A kind of inquiry target equipment data letter in the distribution method for the register address that Fig. 4 is provided by the embodiment of the present application The flow chart of breath;
A kind of structure diagram of the distribution system for register address that Fig. 5 is provided by the embodiment of the present application;
Fig. 6 be under concrete instance legacy register address distribution with register provided herein distributively The contrast schematic diagram of location mode;
A kind of comparison that register address is redistributed in newly-increased enabling equipment that Fig. 7 is provided by the embodiment of the present application Schematic diagram;
Fig. 8 is the sequence diagram that monitoring host computer is communicated with monitoring server under a concrete instance;
Fig. 9 is the flow chart that monitoring collection device works under a concrete instance;
Figure 10 is the flow chart that monitoring server works under a concrete instance.
Specific implementation mode
The core of the application is to provide a kind of distribution method of register address, system, device and computer-readable storage Medium is based on TCP/ModBus agreements, only by the data information deposit TCP/ModBus deposits of the equipment in the state of enabling In device, the data information that variety classes equipment is calculated according to the continuous reading principle dynamic of TCP/ModBus agreements should be deposited Enter the position in TCP/ModBus registers, eliminates invalid in original still deposit TCP/ModBus registers or in not The data information of the equipment of enabling state occupies network bandwidth smaller, server resource consumes less, data-handling efficiency more It is high.
To keep the purpose, technical scheme and advantage of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, technical solutions in the embodiments of the present application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art The all other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Below in conjunction with Fig. 1, a kind of flow of the distribution method for register address that Fig. 1 is provided by the embodiment of the present application Figure.
It specifically includes following steps:
S101:The configuration information record being stored in database is obtained, and is obtained in enabling according to configuration information record The configuration information of the variety classes equipment of state;Wherein, configuration information includes that the quantity of each equipment and data information occupy The quantity of TCP/ModBus registers;
This step is intended to get the configuration information for recording and having all equipment under enabling state, and these are in The equipment of enabling state is possible to include multiple types, while updating obtained new configuration information every time and being typically stored in data In the configuration information record in library, i.e., the configuration information record includes the new configuration information generated after each configuration information is changed And historical data.Specifically, the entity that the data are in practical situations is a part for monitoring server.
Wherein, much information, including the quantity of device category number, each equipment, each equipment are stored in the configuration information Data information can specifically occupy how many a TCP/ModBus registers etc..
Specifically, the mode for how getting the configuration information is varied, such as address is read according to preset information It reads from destination address or other feasible means, herein and is not specifically limited, can be selected the most according to actual conditions Suitable scheme.
S102:The deposit of each device data information is calculated by preset data information arrangement mode in configuration information successively Initial address in TCP/ModBus registers;
On the basis of S101, this step is intended to be calculated according to the configuration information and preset data information arrangement mode Each device data information is stored in the initial address in TCP/ModBus registers, which is based on TCP/ All registers possessed under the monitoring server that ModBus agreements are established.
Due to the generally contiguous table row of the corresponding address information of these registers, with having accordingly generated TCP/ModBus registers Location information list, therefore this step purpose is:Search out the data information of each equipment specifically from TCP/ModBus registers The corresponding register in which address starts to be stored in the information list of location, i.e., in the deposit TCP/ModBus registers described in this step Initial address.
Why the initial address that is calculated in the data information deposit TCP/ModBus register of each equipment is needed, It is that the data information of equipment is deposited in these since the TCP/ModBus agreements are generally by the way of fixed register address In fixed register, when monitoring plurality of devices and each equipment has more again, the data information of these equipment is being deposited Device address information list put in order can cycle arrangement, until the deposit of the data information of one species equipment is finished, just into The storage of the next type device data information of row.
The initial address of the data information deposit of various types of equipment is calculated, it is on the one hand convenient in actual data information Deposit during according to, on the other hand can monitoring server from collector read target device data information according to The initial address gets target data information with maximal efficiency.
Wherein, due to there is fixed defined data information logging mode, which also answers It follows which to obtain, subsequent implementation regular meeting is described in detail.
S103:The TCP/ModBus register numbers occupied according to configuration information and each initial address generate configuration information Table;
On the basis of S102, this step be intended to the TCP/ModBus register numbers for occupying configuration information itself as One parameter initial address corresponding with the various types of device data information being calculated generates configuration information table together.
Why will know the occupied TCP/ModBus register numbers of the configuration information itself, and be taken for ease of management Business device knows the lower number of devices in enabling state of every monitoring collection device monitoring, it is also necessary to also deposit the configuration information together The most top for entering in TCP/ModBus registers, and being commonly stored in entire TCP/ModBus register address informations list Portion is obtained with facilitating.
S104:Configuration information table is subjected to data successively from the first address in TCP/ModBus register address information lists Storage;
On the basis of S103, this step is intended to configuration information table from TCP/ModBus register address information lists First address store successively, until configuration information table storage finish.Under normal conditions, which is 0x0000, according to continuous Principle be stored in one by one in corresponding TCP/ModBus registers.
S105:After the completion of the storage of the data of configuration information table, the data information of all kinds equipment is pressed into configuration information Table is sequentially stored into the TCP/ModBus registers being in idle condition, until all data informations are stored and finished.
S104 configuration information tables storage finish on the basis of, this step be intended to by the data information of all kinds equipment by Configuration information table is sequentially stored into the TCP/ModBus registers being in idle condition, until all data informations have been stored Finish.Under normal conditions, the TCP/ModBus registers for storing data are continuous on address, and the priority logging mode of data is answered Follow the arrangement of TCP/ModBus register address information lists.Since how many having been known according to configuration information in S102 Kind equipment, the enabling quantity of each equipment, and various device data information deposit TCP/ModBus deposits have been calculated accordingly Initial address in device, at this time only need to be adjacent with the data of the configuration information table on the basis of being stored in configuration information table Arrangement is stored in continuous TCP/ModBus registers.
Based on the above-mentioned technical proposal, the distribution method of a kind of register address provided by the embodiments of the present application is based on TCP/ The data information of equipment in the state of enabling is only stored in TCP/ModBus registers by ModBus agreements, according to The data information that variety classes equipment is calculated in the continuous reading principle dynamic of TCP/ModBus agreements should be stored in TCP/ Position in ModBus registers eliminated invalid in original still deposit TCP/ModBus registers or was in not enabled shape The data information of the equipment of state occupies network bandwidth smaller, server resource consumes less, data-handling efficiency higher.
It is a kind of various types of in the distribution method for the register address that Fig. 2 is provided by the embodiment of the present application below in conjunction with Fig. 2 The flow chart of the calculation of the register storage initial address of device data information.
The present embodiment is that each equipment deposit TCP/ModBus how is specifically calculated for S102 in a upper embodiment The specific restriction that initial address in register is made, other steps are substantially the same with a upper embodiment, same section Upper embodiment relevant portion is can be found in, details are not described herein.It specifically includes following steps:
S201:Judge the device category number in enabling state;
S202:When the equipment in the state of enabling only has a kind of;
S203:It is occupied according to register storage initial address=first address+configuration information table of unique class data information The register storage initial address of unique class data information is calculated in TCP/ModBus register numbers;
S202 and S203 be built upon S201 judging result be in enable state device category number only have it is a kind of On the basis of, therefore after having stored the occupied TCP/ModBus register numbers of configuration information table since first address, will obtain To the register storage address of the data information of unique a kind of equipment.
S204:When the type of the equipment in the state of enabling is there are when N classes, N >=2;
Wherein, this N class equipment is respectively first kind equipment to N class equipment, and first kind equipment is corresponding with primary sources Information and the first register occupy quantity, N class equipment is corresponding with N classes data information and N registers occupy quantity.It is described Which class data information indicates is the corresponding data information of such equipment, be the data letter for being different from other type equipment Breath, it is to need the TCP/ that occupies to store such device data information completely which described register, which accounts for quantify, ModBus register numbers.
S205:It is occupied according to register storage initial address=first address+configuration information table of primary sources information The register storage initial address of first kind device data information is calculated in TCP/ModBus register numbers;
S206:The register of register storage initial address=N-1 class data informations of N class data informations is stored The quantity of beginning the+the N-1 of address class equipment × N-1 registers occupy quantity, and the register that N class data informations are calculated is deposited Put initial address.
S204, S205 and S206 foundation are that the device category number in the state of enabling is more than 1 in the judging result of S201 Kind on the basis of, i.e. N ranging from >=2.Wherein, the register storage starting of the corresponding primary sources information of first kind equipment Address is consistent with the mode of S203, and difference lies in store to originate from the register of the corresponding secondary sources information of the second class equipment The calculation that address starts on the basis of a kind of all data informations of equipment store completion before being built upon, therefore uses The formula write exactly such as S206 is calculated.
Assume, there are three kinds of different classes of equipment, to illustrate using example most specifically below:
The equipment of these three classifications is respectively first kind equipment, the second class equipment and third class equipment, and the first kind is set Standby corresponding primary sources information and the first register occupancy quantity, the second class equipment correspond to secondary sources information and second and post Storage occupies quantity, third class equipment corresponds to third class data information and third register occupies quantity;
The TCP/ occupied according to register storage initial address=first address+configuration information table of primary sources information The register storage initial address of first kind device data information is calculated in ModBus register numbers;
The data of configuration information table first address in TCP/ModBus register address information lists is first first stored in correspond to Register in, and according to its occupancy TCP/ModBus register numbers, until deposit after just take turns to first kind equipment Data information storage.
The register of register storage initial address=primary sources information of secondary sources information stores starting point The register of the quantity of location+first kind equipment × first occupies quantity, and the register that secondary sources information is calculated is stored Beginning address;
Identical, the storage of primary sources information is also required to the data information of the first kind equipment of all quantity being stored in It finishes.
The register of register storage initial address=secondary sources information of third class data information stores starting point The register of the quantity of location the+the second class equipment × second occupies quantity, and the register that third class data information is calculated is stored Beginning address;Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
Below in conjunction with Fig. 3, a kind of increase newly is opened in the distribution method for the register address that Fig. 3 is provided by the embodiment of the present application With the flow chart of alignment processing mode when equipment.
The present embodiment be based on other embodiments to it is newly-increased enable equipment when a supplementary explanation carrying out, other steps with A upper embodiment is substantially the same, and same section can be found in an embodiment relevant portion, and details are not described herein.
S301:When the newly-increased equipment for being in enabling state, by the device category information and configuration information of newly added equipment The configuration information record being updated in database, and send out and enable more new signal;
S206:The generation operation that configuration information table is re-executed according to enabling more new signal, with according to newly-generated configuration Information table re-starts the deposit operation of data information;
Since provided data information logging mode is different from the prior art in the application, it will not be in not enabled state Equipment data information deposit TCP/ModBus registers in, therefore, occur it is newly-increased enable equipment when, it is necessary to according to New configuration information recalculates to obtain the initial address of new various types of device data information deposit TCP/ModBus registers, And the storage of data information is re-started accordingly.
Below in conjunction with Fig. 4, a kind of inquiry mesh in the distribution method for the register address that Fig. 4 is provided by the embodiment of the present application The flow chart of marking device data information.
The present embodiment is quick to the data information progress for how carrying out target device based on other embodiments, directive property is strong Carried out one supplementary explanation of inquiry, other steps are substantially the same with a upper embodiment, and same section can be found in a reality A relevant portion is applied, details are not described herein.
S401:From the data information deposit TCP/ModBus registers that extraction in configuration information table obtains each equipment Initial address;
S402:The data information inquiry mode of corresponding type equipment is set according to each initial address, to promote targeted species The search efficiency of device data information.
A kind of preferred data information polling mode is present embodiments provided, due to first incorporating configuration information table In the corresponding register of TCP/ModBus register address information list top address, and wherein contain various types of number of devices It is believed that the initial address of breath deposit TCP/ModBus registers, it is only necessary to know the type and quantity for wanting inquiry target device When label, the data information of target device can be obtained accurately, with peak efficiency.Certainly, specific inquiry mode and the back of the body The disposable mode or multiple mode that scape technology segment illustrates, can flexibly select most suitable mode according to actual conditions.
Based on the above-mentioned technical proposal, the distribution method of a kind of register address provided by the embodiments of the present application is based on TCP/ The data information of equipment in the state of enabling is only stored in TCP/ModBus registers by ModBus agreements, according to The data information that variety classes equipment is calculated in the continuous reading principle dynamic of TCP/ModBus agreements should be stored in TCP/ Position in ModBus registers eliminated invalid in original still deposit TCP/ModBus registers or was in not enabled shape The data information of the equipment of state occupies network bandwidth smaller, server resource consumes less, data-handling efficiency higher.
Because situation is complicated, it can not enumerate and be illustrated, those skilled in the art should be able to recognize according to the application The basic skills principle combination actual conditions of offer may exist many examples, in the case where not paying enough creative works, It should within the scope of protection of this application.
Refer to Fig. 5 below, a kind of structure of the distribution system for register address that Fig. 5 is provided by the embodiment of the present application Block diagram.
The system may include:
Configuration information acquiring unit 100, for obtaining the configuration information record being stored in database, and according to confidence Breath record obtains the configuration information of the variety classes equipment in enabling state;Wherein, configuration information includes the number of each equipment The quantity for the TCP/ModBus registers that amount and data information occupy;
Initial address computing unit 200, for configuration information to be calculated successively by preset data information arrangement mode Each device data information is stored in the initial address in TCP/ModBus registers;
Configuration information table generation unit 300, TCP/ModBus register numbers for being occupied according to configuration information and respectively Initial address generates configuration information table;
Configuration information table storage unit 400, for by configuration information table from TCP/ModBus register address information lists In first address carry out data storage successively;
Data information storage unit 500 is used for after the completion of the storage of the data of configuration information table, by all kinds equipment Data information is sequentially stored by configuration information table in the TCP/ModBus registers being in idle condition, until all data informations Storage finishes.
Wherein, initial address computing unit 200 includes:
Unique class enables device data information and originates storage address computation subunit, in the equipment in the state of enabling When only a kind of, occupied according to register storage initial address=first address+configuration information table of unique class data information The register storage initial address of unique class data information is calculated in TCP/ModBus register numbers;
When the type of the equipment in the state of enabling is there are when N classes, N >=2, and first kind equipment is corresponded to respectively to N classes Equipment, wherein first kind equipment is corresponding with primary sources information and the first register occupies quantity, N class equipment is corresponding with N classes data information and N registers occupy quantity;
The first kind enables device data information and originates storage address computation subunit, for according to primary sources information Register stores the TCP/ModBus register numbers that initial address=first address+configuration information table occupies, and is calculated first The register of class device data information stores initial address;
N classes enable device data information and originate storage address computation subunit, are used for the register of N class data informations Quantity × N-1 of register storage initial address the+the N-1 class equipment of storage initial address=N-1 class data informations is posted Storage occupies quantity, and the register storage initial address of N class data informations is calculated;
Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
Further, which can also include:
Updating unit is used for the configuration in the device category information and configuration information update to database of newly added equipment Information records, and sends out and enable more new signal;
Computing unit is initialized, the generation for re-executing configuration information table according to enabling more new signal operates, with root The deposit operation of data information is re-started according to newly-generated configuration information table.
And:Initial address extraction unit, for from configuration information table extraction obtain the data information of each equipment and deposit Enter the initial address in TCP/ModBus registers;
Polling mode setting unit, the data information issuer for corresponding type equipment to be arranged according to each initial address Formula, to promote the search efficiency of targeted species device data information.
The above each unit can be applied in one below specific concrete instance, reference can be made to Fig. 6 to Figure 10.
In monitoring collection device when powering on or device configuration information is changed, according to the configuration information being stored in database Record, the register address information list of dynamic initialization TCP/ModBus servers.Monitoring 2 is supported with a collector For UPS (uninterruptible power supply), 3 battery management hosts, 4 station power distribution cabinets, the register address of TCP/ModBus agreements is drawn It is divided into configuration information and device data information two parts.The main purpose of configuration information is to inform that management server has currently enabled Number of devices, and read the required register initial address of each facility information and data length, the configuration information packet of UPS Include number of devices (most-significant byte is holding equipment number, and least-significant byte is to enable number of devices), the initial address for reading UPS data informations, UPS The register number of data information.Battery management host, the configuration information of power distribution cabinet are similar with UPS, but each data information Initial address, register number are different.The register address of device data information follows following algorithm:
Present kind device data information initial address=upper type equipment initial address+upper type equipment enables number Amount × upper type device data information register quantity.
The initial address of the data information register of first equipment equally storage and configuration are in a register, it is assumed here that 0x0200 is the originating register of device data information.Therefore each information for having enabled equipment can be in TCP/ModBus registers It continuously sorts on address information list, compared with conventional TCP/ModBus address distributions, the invalid equipment information of not enabled will not It is embodied in register address information list, in addition monitoring server and network need not consume resource and handle these invalid numbers According to reference can be made to Fig. 6, Fig. 6 are legacy register address distribution and register provided herein under a concrete instance Distribute the contrast schematic diagram of address mode.
When configuration information changes, that is, when increasing newly or remove certain enabling equipment, collector will reinitialize address information List, reference can be made to Fig. 7, Fig. 7 by the embodiment of the present application provide it is newly-increased enable equipment when a kind of register address divide again The contrast schematic diagram matched.
The process of various kinds of equipment data information deposit TCP/ModBus registers provided in this embodiment is as follows, mistake Journey sequence diagram can be found in Fig. 8.
(1) monitoring collection device initializes system, applies for TCP/ModBus thread spaces;The configuration information of reading database;
(2) the current configuration information of equipment is stored in from address 0x0000 in TCP/ModBus registers, the public affairs of foundation Formula is:Present kind device data information initial address=upper type equipment initial address+upper type equipment enables quantity × upper type device data information register quantity, and the data information of various kinds of equipment is ranked sequentially successively in configuration information Later;
(3) monitoring server first frame TCP/ModBus information is the configuration information of reading monitoring collection, and according to configuration The poll pattern of information setting device information, after being provided with, data information is read in sending device message polling order;
(4) when monitoring server is to arbitrary monitoring collection device request data, first frame reads matching for the collector first Confidence ceases, and according to the configuration information of corresponding collector, initializes the data polling pattern of corresponding collector.Believe when collector is arranged When breath is changed, modification information is reported into monitoring server.
Meanwhile can obtain according to the above as Fig. 9 and Figure 10 provide respectively monitoring collection device work flow chart and The flow chart of monitoring server work.
According to the present embodiment, the communication information of each monitoring collection device can be made according to the practical different progress for enabling equipment Optimization dynamic adjusts, while monitoring server, when carrying out data acquisition, information inquiry mode dynamically changes therewith.Same In system, different collector configuration modes is presented as different communications protocol, each communications protocol is both for the collector The communication modes of optimization.Since after configuration information changes, monitoring collection device can be according to the TCP/ of configuration information update local ModBus register address information lists, and monitoring server is notified to re-read the configuration information of monitoring collection device, therefore supervise The information inquiry that server can be adjusted according to new configuration information to monitoring collection device is controlled to instruct.
Based on above-described embodiment, present invention also provides a kind of, and the register address distribution based on TCP/ModBus agreements fills It sets, may include memory and processor, wherein have computer program in the memory, which calls the memory In computer program when, the step of above-described embodiment is provided may be implemented.Certain register address distributor may be used also To include various necessary network interfaces, power supply and other parts etc..
Present invention also provides a kind of computer readable storage mediums, have computer program thereon, the computer program The step of above-described embodiment is provided may be implemented when being performed terminal or processor execution.The storage medium may include:U Disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), the various media that can store program code such as magnetic disc or CD.
Each embodiment is described by the way of progressive in specification, the highlights of each of the examples are with other realities Apply the difference of example, just to refer each other for identical similar portion between each embodiment.For device disclosed in embodiment Speech, since it is corresponded to the methods disclosed in the examples, so description is fairly simple, related place is referring to method part illustration .
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, depends on the specific application and design constraint of technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think to exceed scope of the present application.
Specific examples are used herein to illustrate the principle and implementation manner of the present application, and above example is said It is bright to be merely used to help understand the present processes and its core concept.It should be pointed out that for the ordinary skill of the art For personnel, under the premise of not departing from the application principle, can also to the application, some improvement and modification can also be carried out, these improvement It is also fallen into the application scope of the claims with modification.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that A little elements, but also include the other elements being not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or equipment including element.

Claims (10)

1. a kind of distribution method of register address is based on TCP/ModBus agreements, which is characterized in that including:
The configuration information record being stored in database is obtained, and is obtained in enabling state according to the configuration information record The configuration information of variety classes equipment;Wherein, the configuration information includes that the quantity of each equipment and data information occupy The quantity of TCP/ModBus registers;
The configuration information is calculated by preset data information arrangement mode described in the deposit of each device data information successively Initial address in TCP/ModBus registers;
The TCP/ModBus register numbers and each initial address occupied according to the configuration information generates configuration information table;
The configuration information table is subjected to data storage successively from the first address in TCP/ModBus register address information lists;
After the completion of the storage of the data of the configuration information table, the data information of all kinds equipment is pressed into the configuration information table It is sequentially stored into the TCP/ModBus registers being in idle condition, until all data informations are stored and finished.
2. distribution method according to claim 1, which is characterized in that the configuration information is arranged by preset data information The initial address that each device data information is stored in the TCP/ModBus registers is calculated in mode successively, including:
When the equipment in the enabling state only has a kind of, initial address is stored according to the register of unique class data information The TCP/ModBus register numbers that=first address+configuration information table occupies, are calculated unique class data The register of information stores initial address;
When the type of the equipment in the enabling state is there are when N classes, N >=2, and first kind equipment is corresponded to respectively to N classes Equipment, wherein the first kind equipment is corresponding with primary sources information and the first register occupies quantity, the N classes are set It is standby to be corresponding with N classes data information and N registers occupancy quantity;
It is occupied according to register storage initial address=first address+configuration information table of the primary sources information TCP/ModBus register numbers, be calculated the first kind device data information register storage initial address;
The register of register storage initial address=N-1 class data informations of the N class data informations stores starting point The quantity of location the+the N-1 class equipment × N-1 registers occupy quantity, and the register that the N class data informations are calculated is deposited Put initial address;
Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
3. distribution method according to claim 2, which is characterized in that further include:
When the newly-increased equipment for being in the enabling state, extremely by the device category information and configuration information update of newly added equipment Configuration information record in the database, and send out and enable more new signal;
The generation operation that the configuration information table is re-executed according to the enabling more new signal, to match confidence according to newly-generated Breath table re-starts the deposit operation of data information.
4. distribution method according to claim 3, which is characterized in that further include:
The data information that each equipment is obtained from extraction in the configuration information table is stored in the TCP/ModBus registers Initial address;
The data information inquiry mode of corresponding type equipment is set according to each initial address, to promote targeted species number of devices It is believed that the search efficiency of breath.
5. a kind of distribution system of register address is based on TCP/ModBus agreements, which is characterized in that including:
Configuration information acquiring unit, for obtaining the configuration information record being stored in database, and according to the configuration information Record obtains the configuration information of the variety classes equipment in enabling state;Wherein, the configuration information includes each equipment The quantity for the TCP/ModBus registers that quantity and data information occupy;
Initial address computing unit, for each to be calculated by preset data information arrangement mode in the configuration information successively Device data information is stored in the initial address in the TCP/ModBus registers;
Configuration information table generation unit, TCP/ModBus register numbers for being occupied according to the configuration information and each described Initial address generates configuration information table;
Configuration information table storage unit is used for the configuration information table from TCP/ModBus register address information lists First address carries out data storage successively;
Data information storage unit is used for after the completion of the storage of the data of the configuration information table, by the number of all kinds equipment It is believed that breath is sequentially stored by the configuration information table in the TCP/ModBus registers being in idle condition, until all numbers It is believed that breath storage finishes.
6. distribution system according to claim 5, which is characterized in that the initial address computing unit includes:
Unique class enables device data information and originates storage address computation subunit, in the equipment in the enabling state When only a kind of, initial address=first address+configuration information table is stored according to the register of unique class data information The register storage initial address of unique class data information is calculated in the TCP/ModBus register numbers of occupancy;
When the type of the equipment in the enabling state is there are when N classes, N >=2, and first kind equipment is corresponded to respectively to N classes Equipment, wherein the first kind equipment is corresponding with primary sources information and the first register occupies quantity, the N classes are set It is standby to be corresponding with N classes data information and N registers occupancy quantity;
The first kind enables device data information and originates storage address computation subunit, for according to the primary sources information Register stores the TCP/ModBus register numbers that initial address=first address+configuration information table occupies, and calculates Obtain the register storage initial address of the first kind device data information;
N classes enable device data information and originate storage address computation subunit, are used for the register of the N class data informations Quantity × N-1 of register storage initial address the+the N-1 class equipment of storage initial address=N-1 class data informations is posted Storage occupies quantity, and the register storage initial address of the N class data informations is calculated;
Wherein, all data informations are continuously stored in adjacent TCP/ModBus registers.
7. distribution system according to claim 6, which is characterized in that further include:
Updating unit is used for the configuration in the device category information of newly added equipment and configuration information update to the database Information records, and sends out and enable more new signal;
Computing unit is initialized, the generation for re-executing the configuration information table according to the enabling more new signal operates, To re-start the deposit operation of data information according to newly-generated configuration information table.
8. distribution system according to claim 7, which is characterized in that further include:
Initial address extraction unit is obtained for being extracted from the configuration information table described in the data information deposit of each equipment Initial address in TCP/ModBus registers;
Polling mode setting unit, the data information issuer for corresponding type equipment to be arranged according to each initial address Formula, to promote the search efficiency of targeted species device data information.
9. a kind of register address distributor based on TCP/ModBus agreements, which is characterized in that including:
Memory, for storing computer program;
Processor is realized when for executing the computer program such as Claims 1-4 any one of them register address The step of distribution method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes point such as Claims 1-4 any one of them register address when the computer program is executed by processor The step of method of completing the square.
CN201810030803.XA 2018-01-12 2018-01-12 Register address allocation method, system and related device Active CN108280030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810030803.XA CN108280030B (en) 2018-01-12 2018-01-12 Register address allocation method, system and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810030803.XA CN108280030B (en) 2018-01-12 2018-01-12 Register address allocation method, system and related device

Publications (2)

Publication Number Publication Date
CN108280030A true CN108280030A (en) 2018-07-13
CN108280030B CN108280030B (en) 2020-11-10

Family

ID=62803453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810030803.XA Active CN108280030B (en) 2018-01-12 2018-01-12 Register address allocation method, system and related device

Country Status (1)

Country Link
CN (1) CN108280030B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032523A (en) * 2019-03-29 2019-07-19 陕西柴油机重工有限公司 Register storage method of the diesel engine assembling test based on address bit dynamic definition
CN111800524A (en) * 2020-07-10 2020-10-20 河北科瑞达仪器科技股份有限公司 Method for analyzing original addresses of multi-channel data in Modbus message
CN114070732A (en) * 2021-11-17 2022-02-18 远景智能国际私人投资有限公司 Data processing method, device, equipment and medium based on Internet of things

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2077503A1 (en) * 1995-05-11 2009-07-08 Panasonic Corporation Interrupt control device of small hardware size which deals with much interrupt processing flexibility
CN101873257A (en) * 2010-06-04 2010-10-27 华为技术有限公司 Method and system for receiving messages
CN102638451A (en) * 2012-03-14 2012-08-15 江苏斯菲尔电气股份有限公司 Dynamic regrouping method for register list data of Modbus communication protocol
CN102820959A (en) * 2011-06-10 2012-12-12 哈尔滨工业大学 Method for performing large data volume communication between Modbus master station and Modbus slave station
CN104125169A (en) * 2013-04-26 2014-10-29 联发科技股份有限公司 Link list processing apparatus, link list processing method and related network switch
CN105527881A (en) * 2014-09-30 2016-04-27 上海安川电动机器有限公司 Command processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2077503A1 (en) * 1995-05-11 2009-07-08 Panasonic Corporation Interrupt control device of small hardware size which deals with much interrupt processing flexibility
CN101873257A (en) * 2010-06-04 2010-10-27 华为技术有限公司 Method and system for receiving messages
CN102820959A (en) * 2011-06-10 2012-12-12 哈尔滨工业大学 Method for performing large data volume communication between Modbus master station and Modbus slave station
CN102638451A (en) * 2012-03-14 2012-08-15 江苏斯菲尔电气股份有限公司 Dynamic regrouping method for register list data of Modbus communication protocol
CN104125169A (en) * 2013-04-26 2014-10-29 联发科技股份有限公司 Link list processing apparatus, link list processing method and related network switch
CN105527881A (en) * 2014-09-30 2016-04-27 上海安川电动机器有限公司 Command processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
费远鹏等: "基于Modbus 协议的交流采样测量系统的实现", 《微计算机信息》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032523A (en) * 2019-03-29 2019-07-19 陕西柴油机重工有限公司 Register storage method of the diesel engine assembling test based on address bit dynamic definition
CN111800524A (en) * 2020-07-10 2020-10-20 河北科瑞达仪器科技股份有限公司 Method for analyzing original addresses of multi-channel data in Modbus message
CN111800524B (en) * 2020-07-10 2022-10-14 河北科瑞达仪器科技股份有限公司 Method for analyzing original addresses of multi-channel data in Modbus message
CN114070732A (en) * 2021-11-17 2022-02-18 远景智能国际私人投资有限公司 Data processing method, device, equipment and medium based on Internet of things
CN114070732B (en) * 2021-11-17 2024-01-05 远景智能国际私人投资有限公司 Data processing method, device, equipment and medium based on Internet of things

Also Published As

Publication number Publication date
CN108280030B (en) 2020-11-10

Similar Documents

Publication Publication Date Title
CN108280030A (en) A kind of distribution method of register address, system and relevant apparatus
CN110138732A (en) Response method, device, equipment and the storage medium of access request
CN101676890B (en) Bus arbitration method for dynamically adjusting bandwidth allocation and arbitrator thereof
CN104536965B (en) A kind of data query display systems under the conditions of big data and method
CN102521909A (en) Queuing service processing method and system
CN108804039A (en) Adaptive data restore flow control method, device, electronic equipment and storage medium
CN104079614A (en) Method and system for orderly obtaining messages of distributed publishing subscription system
CN108762686A (en) Consistency verification of data flow control method, device, electronic equipment and storage medium
US20140156853A1 (en) Computer and resource retrieval method
CN104615684A (en) Mass data communication concurrent processing method and system
CN111666344B (en) Heterogeneous data synchronization method and device
CN109669915A (en) A kind of computer task management method, device and relevant device
CN106210163A (en) IP address-based localization method and device
CN108989399A (en) A kind of cluster common data querying method, system, device and readable storage medium storing program for executing
CN117294652A (en) Flow control method, server, electronic device, and computer-readable storage medium
CN106453557A (en) Two-time scale dynamic bidding and resource management algorithm for user in IaaS service
CN107612753A (en) Processing method, device and the radio reception device of wireless messages
CN101030884B (en) Method for scheduling independent resource in telecommunication network resource OSS system
JP7271742B2 (en) Method, apparatus, electronic device, storage medium, and program for intelligent scheduling of driving school lessons
CN109190946A (en) Business revenue data determination method, device, electronic equipment and storage medium
CN108762684A (en) Hot spot data migrates flow control method, device, electronic equipment and storage medium
CN101695081A (en) Trustworthy task scheduling method of network service
CN107800810A (en) A kind of Server remote control method and system
CN107526650A (en) A kind of TCAM error scannings and the method repaired
CN113347046A (en) Network access method and 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
CB02 Change of applicant information

Address after: 361000 Skirt Building, North Building, 65 Wanghai Road, Xiamen Software Park, Fujian Province

Applicant after: XIAMEN KECAN INFORMATION TECHNOLOGY CO., LTD.

Applicant after: Kehua Hengsheng Co., Ltd.

Address before: 361000 Skirt Building, North Building, 65 Wanghai Road, Xiamen Software Park, Fujian Province

Applicant before: XIAMEN KECAN INFORMATION TECHNOLOGY CO., LTD.

Applicant before: Xiamen Kehua Hengsheng Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant