CN103631610B - A kind of parameter loading method and system - Google Patents

A kind of parameter loading method and system Download PDF

Info

Publication number
CN103631610B
CN103631610B CN201210301990.3A CN201210301990A CN103631610B CN 103631610 B CN103631610 B CN 103631610B CN 201210301990 A CN201210301990 A CN 201210301990A CN 103631610 B CN103631610 B CN 103631610B
Authority
CN
China
Prior art keywords
parameter
flag bit
amendment
token
data base
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210301990.3A
Other languages
Chinese (zh)
Other versions
CN103631610A (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201210301990.3A priority Critical patent/CN103631610B/en
Publication of CN103631610A publication Critical patent/CN103631610A/en
Application granted granted Critical
Publication of CN103631610B publication Critical patent/CN103631610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of parameter loading method and system.This parameter loading method is included in data base and arranges parameter renewal flag bit and token status flag bit, the state of the parameter during wherein parameter updates flag bit identification database, and described state includes that parameter is unchanged and parameter changes;Parameter updates flag bit, and to be initialized as identification parameter unchanged and token state flag bit is initialized as 1;Amendment parameter;And loading parameters.Utilize the present invention, it is possible to achieve the loading of parameter.

Description

A kind of parameter loading method and system
Technical field
The present invention relates to data processing field, particularly relate to a kind of parameter loading method and system.
Background technology
The existing technology realizing multi-process loading identical parameters includes:
(1) multi-process attachment shared section key
Supplemental characteristic is written to shared section key, and multiple processes are in operation when needing parameter and directly read shared drive data, and other processes being responsible for amendment supplemental characteristic directly revise memory field.Shortcoming is, application developer needs to design the PV operation of reliable mutual exclusion, but read-write and the reduction of operational efficiency and deadlock risk can be caused, the process of amendment parameter also to consider to solve by the problem of internal storage data how persistence when persistence, and institute is difficult to ensure in read-write data syn-chronization effect in this way.
(2) multi-process each loads stack area
Whether carry out identification parameter by certain mode bit to change and need to load, after outside amendment process revise supplemental characteristic and change flag position, the loading of flag bit laggard line parameter is each read in multi-process.Shortcoming is, it is impossible to ensure that multi-process loading parameters is consistent, and this mechanism also results in loses certain amendment request in the case of external progress frequently revises parameter.
Summary of the invention
In view of this, the present invention provides a kind of parameter loading method and system, is used for realizing parameter and loads.
The present invention provides a kind of parameter loading method, and described method includes:
Arranging parameter in data base and update flag bit and token status flag bit, the state of the parameter during wherein parameter updates flag bit identification database, described state includes that parameter is unchanged and parameter changes;
Parameter updates flag bit, and to be initialized as identification parameter unchanged and token state flag bit is initialized as 1;
Amendment parameter;And
Loading parameters;
Wherein said amendment parameter includes:
A1 the first process sends parameter modification request;
A2 determines described parameter renewal flag bit, and whether identification parameter is unchanged, if YES, then performs step A3, otherwise forbids amendment;
A3 the first process revises the parameter in described data base;
Described parameter renewal flag bit is set to identification parameter and changes by A4;
Described loading parameters includes:
B1 the second process sends loading parameters request
B2 determines quantity n of the process sending loading parameters request and sets the operation numbering of process;
B3 determines that whether identification parameter changes described parameter renewal flag bit, if YES, then performs step B4, otherwise forbids loading parameters;
It is unchanged that described parameter renewal flag bit is set to identification parameter by B4;
Parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit by B5;
B6 determines that described token flag bit, whether equal to n, if YES, is then set to 1, otherwise adds 1 by described token flag bit and return step B5 by described token flag bit.
Preferably, in the parameter loading method of the present invention, step B4 includes:
Described parameter renewal flag bit is set to identification parameter unchanged;And
Described amendment parameter.
The present invention provides a kind of parameter loading system, described system includes data base, parameter load-on module, parameter adapting module, the first process and the second process, data base is wherein provided with parameter and updates flag bit and token status flag bit, the state of the parameter during wherein parameter updates flag bit identification database, described state includes that parameter is unchanged and parameter changes, wherein parameter updates the initial value of flag bit is that identification parameter is unchanged and token status flag bit initial value is 1, wherein
First process sends parameter modification and asks to parameter adapting module;
Parameter adapting module determines described parameter renewal flag bit, and whether identification parameter is unchanged, if YES, then returns and allows amendment response to the first process, otherwise return and forbid that amendment response is to the first process;
First process parameter when receiving return and allowing amendment response, in the parameter adapting module described data base of amendment;
Described parameter renewal flag bit is set to identification parameter after amendment parameter completes and changes by parameter adapting module;
Second process sends loading parameters and asks to parameter load-on module;
Parameter load-on module is configured to:
Quantity n determining the process sending loading parameters request the operation numbering setting process;
Determine whether identification parameter changes described parameter renewal flag bit,
If YES, then described parameter renewal flag bit is set to identification parameter unchanged;
Parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit;And
Determine that whether described token flag bit is equal to n, if YES, then described token flag bit is set to 1, otherwise repeat and described token flag bit is added 1 and the parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit until described token flag bit is equal to n
Otherwise return and forbid loading response to the second process.
Preferably, in the parameter loading system of the present invention, wherein parameter adapting module sent before amendment data base and revises message and complete to send afterwards amendment completion message to parameter load-on module to parameter load-on module and amendment data base;Described parameter load-on module receives when the parameter in data base is loaded onto its storehouse running numbering the second process consistent with described token flag bit and revises message, then suspend parameter and load until receiving amendment completion message.
Utilize parameter loading method and the system of the present invention, it is possible to achieve parameter loads.For multiple processes, the same parameter list data in real-time change are realized a kind of effective mechanism and the method loaded with equal state data.This mechanism guarantees to exist under the scene that other processes outside carry out real time modifying to these parameter list data while parameter list data are accomplished to approximate concurrently loading by multiple processes, all reading processes all energy success loading parameters table data are to internal memory, can ensure that each take turns loading after the parameter memory of each process the most completely the same, be also not result in that external progress is revised the request of this table and lost.
Accompanying drawing explanation
Fig. 1 is the indicative flowchart of the parameter loading method according to the present invention;
Fig. 2 is the indicative flowchart of the amendment parameter step in Fig. 1;
Fig. 3 is the indicative flowchart of the loading parameters step in Fig. 1;
Fig. 4 is another indicative flowchart of the loading parameters step in Fig. 1;And
Fig. 5 is the schematic diagram of the parameter loading system according to the present invention.
Detailed description of the invention
Describing the preferred embodiments of the present invention in detail below in conjunction with accompanying drawing, the most identical reference number represents identical element.
Fig. 1 is the indicative flowchart of the parameter loading method according to the present invention.As described in Figure 1, in step 101, arranging parameter and update flag bit change_st and token status flag bit token_st in data base, parameter updates the state of flag bit change_st parameter in identification database.During change_st=0, represent that parameter is unchanged, change_st=1, represent that parameter changes.Should be appreciated that the setting of the value of change_st is merely illustrative.
In step 102, initialize change_st=0 and token_st=1;
In step 103, revise parameter.
In step 104, loading parameters.
Fig. 2 is the indicative flowchart of the amendment parameter step in Fig. 1.As in figure 2 it is shown, in step 201, receive parameter modification request.In step 202, determine that change_st, whether equal to 0, if YES, then in step 203, revises the parameter in data base, otherwise in step 204, forbid revising the parameter in data base.
Afterwards, in step 205, change_st is set to 1.
Fig. 3 is the indicative flowchart of the loading parameters step in Fig. 1.As it is shown on figure 3, in step 301, receive parameter load request.In step 302, determine quantity n of the process sending loading parameters request.In step 303, set the operation numbering of process.In step 304, determine that whether change_st is equal to 1.If YES, then in step 305, change_st is set to 0.Otherwise, in step 306, the parameter in loading of databases is forbidden.
In step 307, the parameter in data base is loaded onto its storehouse running numbering second process consistent with token flag bit.In step 308, determine that token_st, whether equal to n, if YES, then performs step 310, otherwise performs step 309.
In step 309, token_st is added 1, return step 307 afterwards.
In step 310, token_st is set to 1.
Fig. 4 is another indicative flowchart of the loading parameters step in Fig. 1.Compared with Fig. 3, difference is, there is step 103 in step 306 and 307.
In the transients that previous round parameter loads, if new Parameters variation request is initiated again, the first parameter in amendment data base, so that it is guaranteed that be loaded onto process stacks by new parameter.
Fig. 5 is the schematic diagram of the parameter loading system according to the present invention.As shown in Figure 5, described system includes data base 1, parameter load-on module 2, parameter adapting module the 3, first process 4 and the second process 51-5n, wherein being provided with parameter in data base and update flag bit change_st and token status flag bit token_st, parameter updates the state of flag bit change_st parameter in identification database.During change_st=0, represent that parameter is unchanged, change_st=1.
First process 41 sends parameter modification and asks to parameter adapting module 3.Parameter adapting module 3 determines whether change_st is 0, if YES, then returns and allows amendment response to the first process 41, otherwise return and forbid revising response to the first process 41.
First process 41 receive return allow amendment response time, the parameter in parameter adapting module 3 revises described data base;
Change_st is set to 1 after amendment parameter completes by parameter adapting module 3.
Second process 51-5n sends loading parameters and asks to parameter load-on module 2;
Parameter load-on module 2 is configured to:
Quantity n determining the process sending loading parameters request the operation numbering setting process;
Determine whether change_st is equal to 1,
If YES, then change_st is set to 0;
Parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit;And
Determine that whether token_st is equal to n, if YES, then token_st is set to 1, otherwise repeat and token_st is added 1 and the parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit until token_st is equal to n, otherwise return and forbid loading response to the second process.
Preferably, parameter adapting module 3 sent before amendment data base and revises message and complete to send afterwards amendment completion message to parameter load-on module 2 to parameter load-on module 2 and amendment data base;
If described parameter load-on module 3 receives when the parameter in data base is loaded onto its storehouse running numbering the second process consistent with described token flag bit and revises message, then suspend parameter and load until receiving amendment completion message.
In view of these are instructed, those of ordinary skill in the art will readily occur to other embodiments of the invention, combine and revise.Therefore, when combining described above and accompanying drawing reads, the present invention is only defined by the claims.

Claims (4)

1. a parameter loading method, it is characterised in that described method includes:
Arranging parameter in data base and update flag bit and token status flag bit, the state of the parameter during wherein parameter updates flag bit identification database, described state includes that parameter is unchanged and parameter changes;
Parameter updates flag bit, and to be initialized as identification parameter unchanged and token state flag bit is initialized as 1;
Amendment parameter;And
Loading parameters;
Wherein said amendment parameter includes:
A1 the first process sends parameter modification request;
A2 determines described parameter renewal flag bit, and whether identification parameter is unchanged, if YES, then performs step A3, otherwise forbids amendment;
A3 the first process revises the parameter in described data base;
Described parameter renewal flag bit is set to identification parameter and changes by A4;
Described loading parameters includes:
B1 the second process sends loading parameters request;
B2 determines quantity n of the process sending loading parameters request and sets the operation numbering of process;
B3 determines that whether identification parameter changes described parameter renewal flag bit, if YES, then performs step B4, otherwise forbids loading parameters;
It is unchanged that described parameter renewal flag bit is set to identification parameter by B4;
Parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit by B5;
B6 determines that described token flag bit, whether equal to n, if YES, is then set to 1, otherwise adds 1 by described token flag bit and return step B5 by described token flag bit.
2. parameter loading method as claimed in claim 1, it is characterised in that step B4 includes:
Described parameter renewal flag bit is set to identification parameter unchanged;And
Described amendment parameter.
3. a parameter loading system, it is characterized in that, described system includes data base, parameter load-on module, parameter adapting module, the first process and the second process, data base is wherein provided with parameter and updates flag bit and token status flag bit, the state of the parameter during wherein parameter updates flag bit identification database, described state includes that parameter is unchanged and parameter changes, and wherein parameter updates the initial value of flag bit is that identification parameter is unchanged and token status flag bit initial value is 1, wherein
First process sends parameter modification and asks to parameter adapting module;
Parameter adapting module determines described parameter renewal flag bit, and whether identification parameter is unchanged, if YES, then returns and allows amendment response to the first process, otherwise return and forbid that amendment response is to the first process;
First process parameter when receiving return and allowing amendment response, in the parameter adapting module described data base of amendment;
Described parameter renewal flag bit is set to identification parameter after amendment parameter completes and changes by parameter adapting module;
Second process sends loading parameters and asks to parameter load-on module;
Parameter load-on module is configured to:
Quantity n determining the process sending loading parameters request the operation numbering setting process;
Determine whether identification parameter changes described parameter renewal flag bit,
If YES, then described parameter renewal flag bit is set to identification parameter unchanged;
Parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit;And
Determine that whether described token flag bit is equal to n, if YES, then described token flag bit is set to 1, otherwise repeat and described token flag bit is added 1 and the parameter in data base is loaded onto its storehouse running numbering second process consistent with described token flag bit until described token flag bit is equal to n
Otherwise return and forbid loading response to the second process.
4. parameter loading system as claimed in claim 3, it is characterised in that wherein parameter adapting module sent before amendment data base and revises message and complete to send amendment completion message afterwards to parameter load-on module to parameter load-on module and amendment data base;
Described parameter load-on module receives when the parameter in data base is loaded onto its storehouse running numbering the second process consistent with described token flag bit and revises message, then suspend parameter and load until receiving amendment completion message.
CN201210301990.3A 2012-08-23 2012-08-23 A kind of parameter loading method and system Active CN103631610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210301990.3A CN103631610B (en) 2012-08-23 2012-08-23 A kind of parameter loading method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210301990.3A CN103631610B (en) 2012-08-23 2012-08-23 A kind of parameter loading method and system

Publications (2)

Publication Number Publication Date
CN103631610A CN103631610A (en) 2014-03-12
CN103631610B true CN103631610B (en) 2016-12-21

Family

ID=50212708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210301990.3A Active CN103631610B (en) 2012-08-23 2012-08-23 A kind of parameter loading method and system

Country Status (1)

Country Link
CN (1) CN103631610B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573774B (en) * 2014-11-05 2019-04-05 中国银联股份有限公司 Application Parameters management and configuration method
CN105930178B (en) * 2015-11-12 2018-12-28 中国银联股份有限公司 A kind of configurable dynamic state of parameters stowage and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141306A (en) * 2007-10-19 2008-03-12 杭州华三通信技术有限公司 Equipment parameter loading method and apparatus
CN101582908A (en) * 2009-06-30 2009-11-18 杭州华三通信技术有限公司 Parameter configuration method and equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141306A (en) * 2007-10-19 2008-03-12 杭州华三通信技术有限公司 Equipment parameter loading method and apparatus
CN101582908A (en) * 2009-06-30 2009-11-18 杭州华三通信技术有限公司 Parameter configuration method and equipment

Also Published As

Publication number Publication date
CN103631610A (en) 2014-03-12

Similar Documents

Publication Publication Date Title
CN102508716B (en) Task control device and task control method
CN103262030B (en) Via dynamic aggregation operation fast and the concurrent priority query of linearization
CN106874031B (en) Method and device for starting system program of terminal equipment
CN102033790B (en) Method and device for upgrading embedded-type system BOOTROM
CN102662740B (en) Asymmetric multi-core system and realization method thereof
KR101736944B1 (en) Fail safe refresh of data stored in nand memory device
US20150006794A1 (en) Apparatus and method for controlling multi-way nand flashes by using input-output pins
CN102750191A (en) Method for initiating a refresh operation in a solid-state nonvolatile memory device
CN104246727B (en) Data handling system and the method for operating data processing system
CN104484456A (en) Multi-threading parallel-based rapid loading method for SQLite database
CN103777972A (en) System based on field-programmable gate array, configuration method and upgrading method
CN103150125A (en) Method for prolonging service life of power-down protection date buffer memory and smart card
CN103324503A (en) Data programming system and method
CN103677654A (en) Method and electronic equipment for storing data
CN102722432A (en) Method and apparatus for tracing memory access
CN102637461B (en) Start method supporting bad block flash memory scanning
CN104866577A (en) Data processing method and apparatus based on embedded database
US20120221773A1 (en) Nonvolatile semiconductor memory device
CN103631610B (en) A kind of parameter loading method and system
CN102609282A (en) Execution method for NAND flash curing codes
CN110443529A (en) Resource regulating method, device, equipment and computer readable storage medium
US20140025870A1 (en) Computer reprogramming method, data storage medium and motor vehicle computer
CN102937923A (en) Method for automatically storing state of user interface
US20100131698A1 (en) Memory sharing method for flash driver
CN102623066A (en) Saving and acquisition method for solidification code parameter table

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant