CN104391496A - Management method for industrial control system data memory - Google Patents
Management method for industrial control system data memory Download PDFInfo
- Publication number
- CN104391496A CN104391496A CN201410746644.5A CN201410746644A CN104391496A CN 104391496 A CN104391496 A CN 104391496A CN 201410746644 A CN201410746644 A CN 201410746644A CN 104391496 A CN104391496 A CN 104391496A
- Authority
- CN
- China
- Prior art keywords
- data
- free block
- internal memory
- memory
- distributed
- 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.)
- Pending
Links
- 238000007726 management method Methods 0.000 title claims abstract description 26
- 238000000034 method Methods 0.000 claims abstract description 20
- 230000008569 process Effects 0.000 claims description 10
- 238000012217 deletion Methods 0.000 claims description 5
- 230000037430 deletion Effects 0.000 claims description 5
- 238000011084 recovery Methods 0.000 claims description 5
- 230000008676 import Effects 0.000 claims description 3
- 230000008859 change Effects 0.000 claims description 2
- 230000004048 modification Effects 0.000 abstract description 16
- 238000012986 modification Methods 0.000 abstract description 16
- 230000006870 function Effects 0.000 abstract description 4
- 238000012544 monitoring process Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000004064 recycling Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Manufacturing & Machinery (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a management method for an industrial control system data memory. The control system generally comprises a configuration software and a controller, the configuration software generates the algorithm routine while the controller executes the program for realizing the control function. A number of data is defined for realizing the logic while the configuration software writes the algorithm routine, the algorithm result is stored in the data memory of the controller for operating and monitoring. The control system distributes the memory space with fixed size for the data and distributes the memory space in the data memory of the controller for the data to be processed according to the attribute (such as type, size and aligning request); the data information is recovered via memory or merged with the idle memory after deleted or amended; the memory management method for algorithm routine is amended online. The management method for the industrial control system data memory can effectively manage the control system data memory, and what's more important is that the method can satisfy the requirement of on-line modification algorithm routine for the control system.
Description
Technical field
The invention belongs to industrial automation control system technical field, more particularly, relate to a kind of management method of industrial control system data internal memory.
Background technology
In industrial automatic control, the control system be made up of configuration software and controller (also referred to as host computer and slave computer) is widely used in each control field: as dcs (DCS), Programmable Logic Controller (PLC) etc.Configuration software is responsible for generating algorithm program, and controller is responsible for executive routine and is realized controlling functions.When configuration software writes algorithm routine, need to define some data to realize its logic, and operation result is kept in the datarams of controller be used for monitoring.Because the data space in controller is limited, correct, efficient management data internal memory is prerequisite and the basis of control system stable operation; Simultaneously during online modification director demon, must ensure that the memory headroom of data and data in EMS memory are not arbitrarily changed, this is one of important prerequisite of online modification control system algorithm routine.
Summary of the invention
In view of this, the invention provides a kind of management method of industrial control system data internal memory, be used for the work such as distribution, recovery of control system datarams size, then on this basis, design a kind of data internal storage managing method, the internal memory having made it paired data use carries out safeguarding, reallocating, the internal memory do not re-used is reclaimed, the work such as merging, the two is in conjunction with the management of complete paired data internal memory, and this Memory Storage can meet the requirement of industrial control system online modification algorithm logic simultaneously.
In order to understand technical scheme of the present invention better, first several technical terms that the present invention will use are described as follows:
Control system: comprise the configuration software as host computer and the controller two large divisions as slave computer, configuration software is responsible for generating algorithm program, and controller is responsible for executive routine and is realized controlling functions.
The alignment thereof of data: refer to the byte number that different types of data defines;
Wherein, the alignment thereof of type of foundation data refers to the byte number that different types of data defines;
The alignment thereof of complex type data refers to the maximum number of byte defined in the member of its all type of foundation data.
Technical scheme of the present invention is achieved in that
A kind of management method of industrial control system data internal memory, it is characterized in that: the method allocates the memory headroom of fixed size in as the controller of slave computer in advance, internal memory free block is defined, by pending data according to its attribute storage allocation space in internal memory free block described in controller described allocating in advance in the memory headroom of fixed size.
Described management method also comprises further: when as host computer configuration software delete or change control device in data time, reclaim the memory headroom that these data used originally.
A management method for industrial control system data internal memory, is characterized in that, said method comprising the steps of:
(1) memory headroom of fixed size is allocated in the controller in advance, and define internal memory free block described allocating in advance in the memory headroom of fixed size, set up internal memory list of free blocks, described internal memory free block represents idle datarams, and the information of internal memory free block comprises start address and the length of free memory; Internal memory free block is in this application sometimes referred to as free block, and internal memory list of free blocks is sometimes referred to as list of free blocks;
(2) when host computer configuration software needs to compile for algorithm logic, first the datarams information of the algorithm routine be loaded in controller is read, and compare with the data of the configuration software as host computer, judge whether increase, modify or delete as the data in the configuration software of host computer;
(3) when the configuration software as host computer increase newly, have modified corresponding data time, enter step (4) to redistribute increasing newly and/or have modified data in the controller, and will increase, have modified corresponding Data import in configuration software newly in controller; When the configuration software as host computer deletes corresponding data, enter step (5), reclaim the memory headroom that corresponding data uses;
(4) descending sort is carried out according to the alignment thereof of pending data, be about to need to be loaded into all data used in the algorithm routine controller from the configuration software as host computer arrange according to alignment thereof order from big to small, then list of free blocks is traveled through, Memory Allocation is re-started to increasing newly and/or have modified data according to preferential principle internal memory free block being distributed to the large data of alignment thereof, wherein when the configuration software as host computer have modified corresponding data, also to enter step (5) after in the controller Memory Allocation being completed to the data that have modified and reclaim original the used memory headroom of the data before revising,
(5) namely the corresponding data in algorithm routine in controller is needed the Memory recycle that the data of deletion or amendment are original used, and the internal memory reclaimed and internal memory free block are merged.
The application also comprises following preferred version further:
In step (1), pre-assigned memory headroom in the controller, its original state is a monoblock internal memory free block, along with the distribution of datarams, this memory block can be divided into much little internal memory free block, the set of these free blocks, is defined as list of free blocks, is sorted by the internal memory free block in list according to start address order from small to large simultaneously.
In step (2), preferably include following content:
From controller, read the datarams information of the algorithm routine be loaded in controller, based on the data key words appointed, compare with as the data in the configuration software of host computer, wherein said key word is data name or data number:
If there are this data as in the configuration software of host computer, and in slave computer, do not have these data, then judge to have increased data message newly as the configuration software of host computer;
If identical with the data key words in the algorithm routine in corresponding controller as the data of the configuration software of host computer, but its attribute changes, then judge that the configuration software as host computer have modified data message;
If there are these data in controller algorithm program, and deleted in host computer configuration software, then judge that the configuration software as host computer deletes data message.
In step (4), preferably re-start Memory Allocation according to following steps to increasing newly and/or have modified data:
4.1 arrange needing all data used from the algorithm routine be loaded into as the configuration software of host computer controller according to alignment thereof order from big to small; One by one Memory Allocation is carried out to data in order, in following steps by data to be distributed maximum for alignment thereof referred to as data to be distributed;
4.2 travel through the internal memory free block in internal memory list of free blocks one by one, for each internal memory free block, enter step 4.3; If all internal memory free blocks all travel through and correctly do not complete distribution yet, then this data to be distributed distributes unsuccessfully, goes to step 4.6;
4.3 for a certain internal memory free block, judges that whether its start address is the integral multiple of the alignment thereof of data to be distributed, namely judges whether the start address of this internal memory free block meets the alignment requirements of data to be distributed;
If when the start address of 4.4 current memory free blocks is integral multiples of the alignment thereof of data to be distributed, think that this internal memory free block meets the alignment requirements of data to be distributed, then judge whether the length of internal memory free block is greater than the size of data to be distributed further: if be less than data to be distributed, then represent this Program too big to fit in memory data to be distributed represented by internal memory free block, then go to 4.2; If be greater than data to be distributed, then the memory address of data to be distributed is set to the start address of this internal memory free block, represents that data to be distributed uses length from this start address to be the internal memory of its size; Upgrade the information of internal memory free block, the start address of internal memory free block is revised as former start address-data to be distributed size, and the length of internal memory free block is revised as life size-data to be distributed size, and data to be distributed correctly completes distribution, goes to step 4.6 simultaneously; If amended internal memory free block length is 0, then represents in this internal memory free block there is no free space, it is deleted from internal memory list of free blocks;
If when the start address of 4.5 current memory free blocks is not the integral multiple of data to be distributed alignment thereof, need first to carry out alignment pre-service to internal memory free block, current memory free block is designated as M (M.offset, M.len), M.offset represents start address, and M.len represents length.Concrete: (1) gets the smallest positive integral times K of data to be distributed size, makes K be greater than current memory free block start address; (2) current memory free block M is divided into two parts, Part I is internal memory free block A, start address equals the start address of M, length is the length of the smallest positive integral times K-internal memory free block M of data to be distributed size, be designated as A (A.offset, A.len), wherein A.offset=M.offset, A.len=K-M.offset; Part II is internal memory free block B, and start address equals K, and length is the length of the length-internal memory free block A of internal memory free block M, is designated as B (B.offset, B.len), wherein B.offset=K, B.len=M.len-A.len.A is called the reserved free block of alignment, B is called residue free block;
After pre-service, the start address of residue free block meets the requirement of data to be distributed alignment thereof, carries out Memory Allocation according to the method for step 4.4; If correctly complete distribution, residue free block B be updated to B ' (B ' .offset, B ' .len), the wherein size of B ' .offset=B.offset-data to be distributed, the size of B ' .len=B.len-data to be distributed, deletes M from internal memory list of free blocks, and reserved for alignment free block A is joined in list of free blocks with the residue free block B ' completing distribution as new internal memory free block, if the length of B ' is 0, then only adds reserved free block A, go to step 4.6; Otherwise distribute unsuccessfully, go to step 4.2;
4.6 carry out Memory Allocation for next data, until all complete Memory Allocation to increasing newly and/or have modified data.
In step (5), specifically comprise following content:
5.1 obtain the memory information that in controller algorithm program, deletion or Update Table used originally, and by its record, as data to be recycled;
5.2 process the data message recorded in 5.1 one by one, are reclaimed by its memory headroom, and merge with internal memory free block:
The each internal memory free block of 5.3 traversal, find start address to be greater than the free block of the memory address of data to be recycled, this free block is defined as current memory free block, the free block in internal memory list of free blocks before current idle block is defined as last free block;
5.4 judge datarams reclaim after whether can and current idle block and last free block thereof carry out merging the position between last free block and current idle block, be the position of datarams to be recycled, the Rule of judgment that whether can merge is: whether the memory headroom of the rear last free block of recovery, data, current idle block be continuous together, free block is continuously thought and can be merged, if can merge, the information of amendment respective free block, if can not merge, creates new free block and is inserted in list of free blocks;
If 5.5 do not exist the situation that start address is greater than datarams address to be recycled, then defining last block free block is last free block, judges that whether itself and datarams be continuous, if continuously, merged by two free blocks; Otherwise datarams is joined list of free blocks end.
The invention has the beneficial effects as follows, provide a kind of EMS memory management process for industrial control system, be generally applicable to the control system of each industrial circle, and well meet the demand of system online modification algorithm routine.The EMS memory management process that the present invention proposes, have higher efficiency and not easily produce memory fragmentation, high degree ensure that stationarity and the security of system cloud gray model.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, be briefly described to the accompanying drawing used required in embodiment below.
Fig. 1 is the management method schematic flow sheet of a kind of industrial control system data internal memory provided by the invention;
The EMS memory management process schematic diagram meeting online modification algorithm routine that Fig. 2 provides for the embodiment of the present invention;
Fig. 3 is that datarams provided by the invention distributes schematic diagram;
Fig. 4 is that datarams provided by the invention reclaims schematic diagram;
Fig. 5 is datarams allocation process process flow diagram in the embodiment of the present invention;
Fig. 6 is datarams recycling process flow diagram in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only an embodiment of the present invention, instead of whole embodiments.
Refer to Fig. 1, it is the management method schematic flow sheet of a kind of industrial control system data internal memory provided by the invention.
Below to meet the industrial control system of IEC61131-3 standard, the memory management how realizing industrial control system is described, meets the requirement of online modification algorithm routine.
A kind of management method of industrial control system data internal memory comprises the following steps:
The data internal storage managing schematic diagram that the present invention meets online modification algorithm routine is consulted shown in Fig. 2.Be described in detail for this embodiment below.
Step 1: the datarams space of applying for fixed size in the controls, for the data used in allocation algorithm program, and is kept in the internal memory of its correspondence by the operation result of data, realizes logical operation and field control.The memory headroom of application is increased in internal memory list of free blocks as internal memory free block.
Step 2: when host computer configuration software needs to compile for algorithm logic, first the datarams information of the algorithm routine be loaded in controller is read, and compare with the data of the configuration software as host computer, judge whether there is situation about increasing, modifying or deleting as the data in the configuration software of host computer;
This step specific implementation is as follows:
From controller, read the datarams arrangement information running engineering, be referred to as key word with the name of data, compare with the data used in host computer algorithm routine, judge data situation, further:
(21) travel through all data in host computer procedure, judge for each data;
(22) whether these data are present in the program of controller operation, if exist, turn (23), otherwise these data are newly-increased data, indicate these data, need distribute new memory headroom and carry out initialization;
(23) carry out detailed comparison with the data in controller, comprise each attribute of data: type, size etc., the data simultaneously in sign controller are for compare state; If attribute is identical, turn (24), otherwise these data are the data of amendment, indicate these data, need distribute new memory headroom and carry out initialization, former memory headroom needs to reclaim simultaneously;
(24) to judge in controller whether data all complete to compare, do not compare data if exist, then these data are deleted in the program that host computer is new, belong to and delete data, need to reclaim its memory headroom.
Step 3: when the configuration software as host computer increase newly, have modified corresponding data time, redistribute increasing newly and/or have modified data in the controller, and will increase, have modified corresponding Data import in configuration software newly in controller, complete online modification algorithm logic function; When the configuration software as host computer deletes corresponding data, enter step 5, reclaim the memory headroom that corresponding data uses;
This step specific implementation is as follows:
(31) for data that are newly-increased, amendment, again for it redistributes new memory headroom, concrete allocation scheme is see the description in step (4);
(32) carry out the algorithm routine in online modification controller, now data that are newly-increased, amendment are successfully loaded in controller, and online modification successfully goes to (34), otherwise goes to (35);
(34), after online modification success, for the data of deleting, need to reclaim its space, the concrete stream of recovery is see the description in step (5).After recovery completes, the work of online modification algorithm routine correctly terminates;
(35) online modification failure, then controller returns to the state before revising algorithm, owing to not carrying out disturbance to used data in controller, therefore can again carry out checking and monitoring for operational data, high degree ensure that stability and the security of online modification.
Step 4: carry out datarams distribution for newly-increased and Update Table.
Datarams of the present invention is distributed schematic diagram and is consulted shown in Fig. 3.
In the present embodiment, the treatment scheme that datarams is distributed is as described in Figure 5, concrete:
(41) will all data used from the algorithm routine be loaded into as the configuration software of host computer controller be needed to arrange according to alignment thereof order from big to small; One by one Memory Allocation is carried out to data in order.The alignment of data mode that the control system algorithm routine of the present embodiment uses generally includes 1 byte-aligned, 2 byte-aligned and 4 byte-aligned, three kinds of modes; After pending data sorting, each data to be distributed of process one by one in order;
(42) according to the start offset of free block, travel through all free blocks in list of free blocks from small to large, enter (43) for each free block; If travel through all unsuccessful distribution of all free blocks, then this variable storage allocation failure to be allocated, goes to (46);
(43) for each internal memory free block, judge that whether its start address is the integral multiple of the alignment thereof of data to be distributed, namely judge whether the start address of this internal memory free block meets the alignment requirements of data to be distributed, go to when meeting (44), not meeting is go to (45);
(44) start address of current memory free block is the integral multiple of the alignment thereof of data to be distributed, then judge whether the length of internal memory free block is greater than the size of data to be distributed further, go to (441) if be less than, be greater than and go to (442);
(441) this Program too big to fit in memory data to be distributed represented by internal memory free block, then go to (42);
(442) be distributed in by data to be distributed in this internal memory free block, the address of these data is the start address of internal memory free block, takies the space that its type is corresponding.Upgrade the information of internal memory free block, the start address of internal memory free block is revised as former start address-data to be distributed size, the length of internal memory free block is revised as life size-data to be distributed size, and data to be distributed correctly completes distribution, goes to step (46).If amended internal memory free block length is 0, then represents in this internal memory free block there is no free space, it is deleted from internal memory list of free blocks.
(45) when the start address of current memory free block is not the integral multiple of data to be distributed alignment thereof, need first to carry out alignment pre-service to internal memory free block, current memory free block is divided into two parts, Part I is the reserved free block of alignment, start address equals the start address of current idle block, length be the smallest positive integral being greater than free block start address of data to be distributed size doubly-length of internal memory free block; Part II is for remaining free block, and start address equals the smallest positive integral being greater than free block start address of data to be distributed size doubly, and length is the length of the reserved free block of length-alignment of current memory free block.
After pre-service, residue free block is used for the Memory Allocation of data, and its start address meets the requirement of data to be distributed alignment thereof, carries out Memory Allocation according to the method in (44).Distribute and unsuccessfully then go to (42); If correctly complete distribution, upgrade the information of residue free block, the value of its start address and length is revised as and deducts data to be distributed size, former internal memory free block is deleted from list of free blocks, and reserved for alignment free block is joined in list of free blocks with the residue free block completing distribution as new internal memory free block, if the residue free block length completing distribution is 0, then only adds reserved free block, go to (46).
(46) each data of order-assigned, all data correctly exit after completing distribution, carry out miscue when distributing unsuccessfully.
Step 5: after completing the operation of control system algorithm routine online modification, data that are newly-increased and amendment have employed new datarams and have carried out computing, need the datarams data of deleting and revise originally used to reclaim.
Datarams of the present invention reclaims schematic diagram and consults shown in Fig. 4.Whether data reclaim one by one, and merge with free memory.
In the present embodiment, the treatment scheme that datarams reclaims is as described in Figure 6, concrete:
(51) memory information that acquisition is deleted and Update Table used originally, and be recorded as data to be recycled, turn (52)
(52) process the data message of record in (51) one by one, its memory headroom reclaimed, and merges with internal memory free block:
(53) each internal memory free block is traveled through, start address is found to be greater than the free block of the memory address of data to be recycled, this free block is defined as current memory free block, and the free block in internal memory list of free blocks before current idle block is defined as last free block;
(54) judge whether datarams can merge with current idle block and last free block thereof after reclaiming, and the position between last free block and current idle block, is the position of datarams to be recycled:
(541) if the internal memory of data to be recycled cannot merge with other free blocks, the start offset of the datarams namely reclaimed is not equal to the end skew of last piece of free block, and the end of datarams to be recycled skew is not equal to the start offset of current idle block, now creating new internal memory free block adds in list of free blocks, before being inserted into current idle block, go to (56);
(542) if merge with last free block in its list only, the start offset of the datarams namely reclaimed equals the end skew of last piece of free block just, and the end of datarams to be recycled skew is not equal to the start offset of current idle block, now the length of last free block is increased the length of this datarams, go to (56);
(543) if only with current idle merged block, the end skew of the datarams namely reclaimed equals the start offset of current idle block just, and the start offset of data to be recycled is not equal to the end skew of last free block in list, now the start offset of current idle block is revised as the start offset of data to be recycled, length is increased the length of datarams to be recycled, go to (56);
(544) if all can merge with last free block and current idle block, the end skew of the datarams namely reclaimed equals the start offset of current idle block just, and the start offset of data to be recycled equals the end skew of last free block in list just, now form large free block, the information of amendment current idle block, start offset is the start offset of last free block, length is three partial memory length sums, in list of free blocks, delete its last free block simultaneously, go to (56);
(55) situation that start address is greater than datarams address to be recycled if do not exist, then defining last block free block is last free block:
(551) if the internal memory of data to be recycled cannot merge with last free block, the start offset of the datarams namely reclaimed is not equal to the end skew of last free block, now creating new internal memory free block adds in list of free blocks, be inserted into free block class table end, go to (56);
(552) if can merge with last free block in its list, the start offset of the datarams namely reclaimed equals the end skew of last free block just, now the length of last free block is increased the length of this datarams, go to (56);
(56) memory information of amendment or deletion data reclaims successfully, correctly exits.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein when not departing from the spirit or scope of the embodiment of the present invention, can realize in other embodiments.Therefore, the embodiment of the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (7)
1. the management method of an industrial control system data internal memory, it is characterized in that: the method allocates the memory headroom of fixed size in as the controller of slave computer in advance, internal memory free block is defined, by pending data according to its attribute storage allocation space in internal memory free block described in controller described allocating in advance in the memory headroom of fixed size.
2. the management method of industrial control system data internal memory according to claim 1, is characterized in that:
When as host computer configuration software delete or change control device in data time, reclaim the memory headroom that these data used originally.
3. a management method for industrial control system data internal memory, is characterized in that, said method comprising the steps of:
(1) memory headroom of fixed size is allocated in the controller in advance, and define internal memory free block described allocating in advance in the memory headroom of fixed size, set up internal memory list of free blocks, described internal memory free block represents idle datarams, and the information of internal memory free block comprises start address and the length of free memory; Internal memory free block is in this application sometimes referred to as free block, and internal memory list of free blocks is sometimes referred to as list of free blocks;
(2) when host computer configuration software needs to compile for algorithm logic, first the datarams information of the algorithm routine be loaded in controller is read, and compare with the data of the configuration software as host computer, judge whether increase, modify or delete as the data in the configuration software of host computer;
(3) when the configuration software as host computer increase newly, have modified corresponding data time, enter step (4) to redistribute increasing newly and/or have modified data in the controller, and will increase, have modified corresponding Data import in configuration software newly in controller; When the configuration software as host computer deletes corresponding data, enter step (5), reclaim the memory headroom that corresponding data uses;
(4) descending sort is carried out according to the alignment thereof of pending data, be about to need to be loaded into all data used in the algorithm routine controller from the configuration software as host computer arrange according to alignment thereof order from big to small, then list of free blocks is traveled through, Memory Allocation is re-started to increasing newly and/or have modified data according to preferential principle internal memory free block being distributed to the large data of alignment thereof, wherein when the configuration software as host computer have modified corresponding data, also to enter step (5) after in the controller Memory Allocation being completed to the data that have modified and reclaim original the used memory headroom of the data before revising,
(5) namely the corresponding data in algorithm routine in controller is needed the Memory recycle that the data of deletion or amendment are original used, and the internal memory reclaimed and internal memory free block are merged.
4. the management method of industrial control system data internal memory according to claim 3, is characterized in that:
In step (1), pre-assigned memory headroom in the controller, its original state is a monoblock internal memory free block, along with the distribution of datarams, this memory block can be divided into much little internal memory free block, the set of these free blocks, is defined as list of free blocks.
5. the management method of industrial control system data internal memory according to claim 3, is characterized in that:
In step (2), preferably include following content:
From controller, read the datarams information of the algorithm routine be loaded in controller, based on the data key words appointed, compare with as the data in the configuration software of host computer, wherein said key word is data name or data number:
If there are this data as in the configuration software of host computer, and in slave computer, do not have these data, then judge to have increased data message newly as the configuration software of host computer;
If identical with the data key words in the algorithm routine in corresponding controller as the data of the configuration software of host computer, but its attribute changes, then judge that the configuration software as host computer have modified data message;
If there are these data in controller algorithm program, and deleted in host computer configuration software, then judge that the configuration software as host computer deletes data message.
6. the management method of industrial control system data internal memory according to claim 3, is characterized in that:
In step (4), preferably re-start Memory Allocation according to following steps to increasing newly and/or have modified data:
4.1 arrange needing all data used from the algorithm routine be loaded into as the configuration software of host computer controller according to alignment thereof order from big to small; One by one Memory Allocation is carried out to data in order, in following steps by data to be distributed maximum for alignment thereof referred to as data to be distributed;
4.2 travel through the internal memory free block in internal memory list of free blocks one by one, for each internal memory free block, enter step 4.3; If all internal memory free blocks all travel through and correctly do not complete distribution yet, then this data to be distributed distributes unsuccessfully, goes to step 4.6;
4.3 for a certain internal memory free block, judges that whether its start address is the integral multiple of the alignment thereof of data to be distributed, namely judges whether the start address of this internal memory free block meets the alignment requirements of data to be distributed;
If when the start address of 4.4 current memory free blocks is integral multiples of the alignment thereof of data to be distributed, think that this internal memory free block meets the alignment requirements of data to be distributed, then judge whether the length of internal memory free block is greater than the size of data to be distributed further: if be less than data to be distributed, then represent this Program too big to fit in memory data to be distributed represented by internal memory free block, then go to 4.2; If be greater than data to be distributed, then the memory address of data to be distributed is set to the start address of this internal memory free block, represents that data to be distributed uses length from this start address to be the internal memory of its size; Upgrade the information of internal memory free block, the start address of internal memory free block is revised as former start address-data to be distributed size, and the length of internal memory free block is revised as life size-data to be distributed size, and data to be distributed correctly completes distribution, goes to step 4.6 simultaneously; If amended internal memory free block length is 0, then represents in this internal memory free block there is no free space, it is deleted from internal memory list of free blocks;
If when the start address of 4.5 current memory free blocks is not the integral multiple of data to be distributed alignment thereof, need first to carry out alignment pre-service to internal memory free block, current memory free block is designated as M (M.offset, M.len), M.offset represents start address, M.len represents length, get the smallest positive integral times K of data to be distributed size, K is made to be greater than current memory free block start address, current memory free block M is divided into two parts, Part I is internal memory free block A, start address equals the start address of M, length is the length of the smallest positive integral times K-internal memory free block M of data to be distributed size, be designated as A (A.offset, A.len), wherein A.offset=M.offset, A.len=K-M.offset, Part II is internal memory free block B, start address equals K, length is the length of the length-internal memory free block A of internal memory free block M, be designated as B (B.offset, B.len), wherein B.offset=K, B.len=M.len-A.len, A is called the reserved free block of alignment, B is called residue free block,
After pre-service, the start address of residue free block meets the requirement of data to be distributed alignment thereof, carries out Memory Allocation according to the method for step 4.4; If correctly complete distribution, residue free block B be updated to B ' (B ' .offset, B ' .len), the wherein size of B ' .offset=B.offset-data to be distributed, the size of B ' .len=B.len-data to be distributed, deletes M from internal memory list of free blocks, and reserved for alignment free block A is joined in list of free blocks with the residue free block B ' completing distribution as new internal memory free block, if the length of B ' is 0, then only adds reserved free block A, go to step 4.6; Otherwise distribute unsuccessfully, go to step 4.2;
4.6 carry out Memory Allocation for next data, until all complete Memory Allocation to increasing newly and/or have modified data.
7. the management method of industrial control system data internal memory according to claim 3, is characterized in that:
In step (5), specifically comprise following content:
5.1 obtain the memory information that in controller algorithm program, deletion or Update Table used originally, and by its record, as data to be recycled;
5.2 process the data message recorded in 5.1 one by one, are reclaimed by its memory headroom, and merge with internal memory free block:
The each internal memory free block of 5.3 traversal, find start address to be greater than the free block of the memory address of data to be recycled, this free block is defined as current memory free block, the free block in internal memory list of free blocks before current idle block is defined as last free block;
5.4 judge datarams reclaim after whether can and current idle block and last free block thereof carry out merging the position between last free block and current idle block, be the position of datarams to be recycled, the Rule of judgment that whether can merge is: whether the memory headroom of the rear last free block of recovery, data, current idle block be continuous together, free block is continuously thought and can be merged, if can merge, the information of amendment respective free block, if can not merge, creates new free block and is inserted in list of free blocks;
If 5.5 do not exist the situation that start address is greater than datarams address to be recycled, then defining last block free block is last free block, judges that whether itself and datarams be continuous, if continuously, merged by two free blocks; Otherwise datarams is joined list of free blocks end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410746644.5A CN104391496A (en) | 2014-12-09 | 2014-12-09 | Management method for industrial control system data memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410746644.5A CN104391496A (en) | 2014-12-09 | 2014-12-09 | Management method for industrial control system data memory |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104391496A true CN104391496A (en) | 2015-03-04 |
Family
ID=52609413
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410746644.5A Pending CN104391496A (en) | 2014-12-09 | 2014-12-09 | Management method for industrial control system data memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104391496A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354661A (en) * | 2016-09-13 | 2017-01-25 | 郑州云海信息技术有限公司 | Internal storage distribution method and device for storage software |
CN108536609A (en) * | 2017-03-02 | 2018-09-14 | 迈普通信技术股份有限公司 | Memory fragmentation manages system and method |
CN109801659A (en) * | 2017-11-16 | 2019-05-24 | 国际商业机器公司 | The activation management of DRAM memory bank |
CN110442074A (en) * | 2018-05-03 | 2019-11-12 | Ls产电株式会社 | The processing unit of programmable logic controller program |
CN110532198A (en) * | 2019-09-09 | 2019-12-03 | 成都西山居互动娱乐科技有限公司 | A kind of method and device of memory allocation |
CN110555118A (en) * | 2018-03-28 | 2019-12-10 | 武汉斗鱼网络科技有限公司 | Method and device for loading picture |
CN111783172A (en) * | 2020-06-23 | 2020-10-16 | 北京北方华创微电子装备有限公司 | Semiconductor process execution method and semiconductor process equipment |
CN112506547A (en) * | 2020-12-16 | 2021-03-16 | 杭州和利时自动化有限公司 | Configuration data downloading method, device, equipment and readable storage medium |
CN112612425A (en) * | 2020-12-30 | 2021-04-06 | 北京北方华创微电子装备有限公司 | Data read-write method and control device of semiconductor processing equipment |
CN113791596A (en) * | 2021-11-15 | 2021-12-14 | 西安热工研究院有限公司 | Memory hour mean value calculation method, system, equipment and medium based on dynamic application |
-
2014
- 2014-12-09 CN CN201410746644.5A patent/CN104391496A/en active Pending
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354661A (en) * | 2016-09-13 | 2017-01-25 | 郑州云海信息技术有限公司 | Internal storage distribution method and device for storage software |
CN108536609B (en) * | 2017-03-02 | 2022-02-22 | 迈普通信技术股份有限公司 | Memory fragment management system and method |
CN108536609A (en) * | 2017-03-02 | 2018-09-14 | 迈普通信技术股份有限公司 | Memory fragmentation manages system and method |
CN109801659A (en) * | 2017-11-16 | 2019-05-24 | 国际商业机器公司 | The activation management of DRAM memory bank |
CN109801659B (en) * | 2017-11-16 | 2023-04-14 | 国际商业机器公司 | DRAM bank activation management |
CN110555118A (en) * | 2018-03-28 | 2019-12-10 | 武汉斗鱼网络科技有限公司 | Method and device for loading picture |
CN110555118B (en) * | 2018-03-28 | 2022-08-16 | 武汉斗鱼网络科技有限公司 | Method and device for loading picture |
CN110442074A (en) * | 2018-05-03 | 2019-11-12 | Ls产电株式会社 | The processing unit of programmable logic controller program |
CN110442074B (en) * | 2018-05-03 | 2022-07-22 | Ls产电株式会社 | Processing device for programmable logic controller program |
CN110532198A (en) * | 2019-09-09 | 2019-12-03 | 成都西山居互动娱乐科技有限公司 | A kind of method and device of memory allocation |
CN110532198B (en) * | 2019-09-09 | 2023-08-08 | 成都西山居互动娱乐科技有限公司 | Storage space allocation method and device |
CN111783172A (en) * | 2020-06-23 | 2020-10-16 | 北京北方华创微电子装备有限公司 | Semiconductor process execution method and semiconductor process equipment |
CN112506547A (en) * | 2020-12-16 | 2021-03-16 | 杭州和利时自动化有限公司 | Configuration data downloading method, device, equipment and readable storage medium |
CN112612425B (en) * | 2020-12-30 | 2021-08-13 | 北京北方华创微电子装备有限公司 | Data read-write method and control device of semiconductor processing equipment |
CN112612425A (en) * | 2020-12-30 | 2021-04-06 | 北京北方华创微电子装备有限公司 | Data read-write method and control device of semiconductor processing equipment |
CN113791596A (en) * | 2021-11-15 | 2021-12-14 | 西安热工研究院有限公司 | Memory hour mean value calculation method, system, equipment and medium based on dynamic application |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104391496A (en) | Management method for industrial control system data memory | |
CN103984582A (en) | Method and device for hot updating | |
CN102110121A (en) | Method and system for processing data | |
US20100161085A1 (en) | Peripheral device of programmable controller, method of variable substitution, and computer program product thereof | |
TW201909046A (en) | a microprocessor containing a model of the enterprise | |
CN102147743A (en) | Method for accelerating startup of embedded system application program | |
CN102243595B (en) | Method for updating Java Card system component based on memory management unit (MMU) framework | |
CN105260270A (en) | Flash storage space dynamic recovery method and device | |
US20170083549A1 (en) | Tracing garbage collector for search trees under multi-version concurrency control | |
CN103154950A (en) | Repeated data deleting method and device | |
CN105224361A (en) | A kind of method and system that sqlite3 type embedded database is upgraded | |
CN103761159A (en) | Method and system for processing incremental snapshot | |
CN104461685A (en) | Virtual machine processing method and virtual computer system | |
CN110413309A (en) | A kind of item code branch management method and system based on gitlab | |
WO2021218142A1 (en) | Data migration method and apparatus, and electronic device and computer readable storage medium | |
CN104519072A (en) | Authority control method and device | |
CN108509284A (en) | A kind of tree shaped model task management system applied to functional expression programming | |
CN103716416A (en) | IP configuration method and apparatus under cloud computing platform | |
CN106569863A (en) | Android app resource updating and repairing method based on resource and code modularization | |
CN105573774A (en) | Application parameter managing and configuring method | |
KR102526147B1 (en) | Monitoring apparatus in elctric power system | |
CN102694878A (en) | Sectional ID (Identity) distributing method | |
CN108108392B (en) | Commodity data management method, commodity data management device, computer equipment and storage medium | |
Terwilliger et al. | Worry-free database upgrades: automated model-driven evolution of schemas and complex mappings | |
CN111163060B (en) | Application group-based forwarding method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150304 |