CN107807931A - The method and system of Template Information management - Google Patents
The method and system of Template Information management Download PDFInfo
- Publication number
- CN107807931A CN107807931A CN201610812601.1A CN201610812601A CN107807931A CN 107807931 A CN107807931 A CN 107807931A CN 201610812601 A CN201610812601 A CN 201610812601A CN 107807931 A CN107807931 A CN 107807931A
- Authority
- CN
- China
- Prior art keywords
- template
- change
- internal memory
- server
- servers
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of method and system of Template Information management, can in Template Information content more than big, query demand in the case of, there is provided efficient inquiry service;And support in distributed type assemblies deployment, simultaneously operating and concurrent problem after template change;The data source of query template can also intelligently be switched according to internal memory performance.This method includes:Template in database is initialised in internal memory by each server in distributed type assemblies, for template query and/or change;When there is template change request, server is changed according to the template change request got to the corresponding template in internal memory, and the template after change is preserved to database;Then the template after the change is sent to other servers in distributed type assemblies using cluster communication component, other servers in distributed type assemblies change according to the template after the change to the corresponding template in internal memory, to realize other servers in the template synchronous after the change to distributed type assemblies.
Description
Technical field
The present invention relates to computer technology and software field, more particularly to a kind of method and system of Template Information management.
Background technology
With the continuous development of Clustering, providing Template Information service using the mode of distributed type assemblies becomes increasingly
Extensively.By taking invoice field as an example, current area in all parts of the country can all issue rolling value-added tax common invoice, but the hair in each area
Ticket template is not quite similar, and the receipt printer quantity and model that each area uses in addition are numerous, and this results in each model in various regions
Printer be required for single set be adapted to invoice template, could certified invoice printing accurate and effective.Therefore opened in invoice
In the business procedure of tool, invoice template service is disposed using distributed type assemblies, to provide the side of efficient acquisition invoice template
Formula.
Some difficult points existing for Template Manager at present, it is specific as follows:
1st, Template Information content is larger.By taking invoice as an example, a Template Information generally comprise this region invoice layout,
Issue content, invoice number, impress;
2nd, query demand amount is big.When having a large amount of concurrent invocations, query performance can drastically decline;
3rd, when Template Information needs change, it is understood that there may be the situation that Template Information concurrently changes;
Other machines information on services is asynchronous when the 4th, changing template.
In the prior art, distributed type assemblies deployment administrative template is typically that template is stored in into Redis cachings or distribution
In the server memory of formula cluster.But either template is stored in Redis cachings and is also stored in internal memory by use, all can not be complete
Solve the above problems entirely:
According to the mode for caching template storage Redis, can solve the problems, such as to change template synchronous, but due to template
The information content may be larger, and when a large amount of concurrent invocations, performance can drastically decline;If Template Information is stored in internal memory
In, can solve the problems, such as a large amount of concurrent invocation hydraulic performance declines, but in the case of can not solving distributed deployment, change information after template
Nonsynchronous problem.In addition, template is stored in internal memory, when access times arrival is a certain amount of, systematic function can be by shadow
Ring, now without corresponding degradation schemes, whole Template Service can be caused unavailable.
Therefore, under distributed type assemblies deployment, how template of the modification wherein on a server, other machines are being ensured
Also can accurate, rapid synchronization template information while, it is ensured that in the case where frequently causing hydraulic performance decline using internal memory, still may be used
The inquiry service of High Availabitity is provided, is current urgent problem to be solved.
The content of the invention
In view of this, the present invention provides a kind of method and system of Template Information management, can it is big in Template Information content,
In the case that query demand is more, there is provided efficient template query service;And support in distributed type assemblies deployment, after template change
Simultaneously operating and concurrent problem;The data source of query template can also intelligently be switched according to internal memory performance.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method of Template Information management.
A kind of method of Template Information management of the present invention includes:Each server in distributed type assemblies is by database
Template is initialised in internal memory, for template query and/or change;When there is template change request, server is according to getting
Template change request the corresponding template in internal memory is changed, and the template after change is preserved to database;Then it is sharp
The template after the change is sent to other servers in distributed type assemblies with cluster communication component, in distributed type assemblies
Other servers change according to the template after the change to the corresponding template in internal memory, to realize after the change
Other servers in template synchronous to distributed type assemblies.
Alternatively, methods described also includes:Server is according to the template change request got to the respective mode in internal memory
After plate is changed, change lock mark is added into caching, the title for the template that the change lock mark includes changing,
Timestamp and the server number for needing synchronization.
Alternatively, after server changes according to the template change request got to the corresponding template in internal memory,
Change lock mark is added into caching also to be included:If corresponding template in server memory occurs concurrently to change, to caching
After middle addition change lock mark, the caching holding time stabs change lock mark the latest.
Alternatively, methods described also includes:Template change timestamp is included in template after the change;Distributed type assemblies
In other servers receive the template after the change after, obtain change lock mark, then by the template after the change
Template change timestamp with change lock mark timestamp contrasted, if unanimously, in internal memory corresponding template progress
Change, is not otherwise processed;And other each servers in distributed type assemblies, the template pair after according to the change
After corresponding template in internal memory is changed, synchronous server number will be needed to subtract one, subtracted when needing synchronous server number
When being zero, change lock mark is removed in the lump.
Alternatively, methods described also includes:When there is template query demand, server is sentenced according to the inquiry request received
Marked in disconnected caching with the presence or absence of the change lock related to template to be checked, if in the presence of obtaining template from database, otherwise
Template is obtained from internal memory.
Alternatively, methods described also includes:The internal memory service condition of each server in monitoring distributed cluster, works as internal memory
When service condition exceedes predetermined threshold value, then template is obtained from database according to template query demand, when internal memory service condition not
During more than predetermined threshold value, then template is obtained from internal memory according to template query demand.
To achieve the above object, according to another aspect of the present invention, there is provided a kind of system of Template Information management.
A kind of system of Template Information management of the present invention includes:Each server and database in distributed type assemblies,
Wherein:Template in database is initialised in internal memory by each server in distributed type assemblies, for template query and/or change
More;When there is template change request, server becomes according to the template change request got to the corresponding template in internal memory
More, and by the template after change preserve to database;Then using cluster communication component by the template after the change send to
Other servers in distributed type assemblies, other servers in distributed type assemblies are according to the template after the change in internal memory
Corresponding template changed, to realize other servers in the template synchronous after the change to distributed type assemblies.
Alternatively, the system also includes:Cache module;Server is according to the template change request got in internal memory
Corresponding template changed after, into cache module add change lock mark, it is described change lock mark include changing
The title of template, timestamp and need synchronous server number.
Alternatively, the cache module is additionally operable to:If corresponding template in server memory occurs concurrently to change, to
After change lock mark is added in cache module, the change lock mark of cache module holding time stamp the latest.
Alternatively, the system is additionally operable to:Template change timestamp is included in template after the change;Distributed type assemblies
In other servers receive the template after the change after, obtain change lock mark, then by the template after the change
Template change timestamp with change lock mark timestamp contrasted, if unanimously, in internal memory corresponding template progress
Change, is not otherwise processed;And other each servers in distributed type assemblies, the template pair after according to the change
After corresponding template in internal memory is changed, synchronous server number will be needed to subtract one, subtracted when needing synchronous server number
When being zero, change lock mark is removed in the lump.
Alternatively, the system is additionally operable to:When there is template query demand, server is sentenced according to the inquiry request received
With the presence or absence of the change lock mark related to template to be checked in disconnected cache module, if in the presence of, template is obtained from database,
Otherwise template is obtained from internal memory.
Alternatively, the system is additionally operable to:The internal memory service condition of each server in monitoring distributed cluster, works as internal memory
When service condition exceedes predetermined threshold value, then template is obtained from database according to template query demand, when internal memory service condition not
During more than predetermined threshold value, then template is obtained from internal memory according to template query demand.
Technique according to the invention scheme, by the way that the template in database is initialised in internal memory, so as to provide
A large amount of concurrent inquiry services;Communicated by using cluster communication component, so as to promptly and accurately change template
Information be sent to other and need synchronous server, efficiently complete simultaneously operating;By the way that the template after change is preserved to number
According to storehouse, the process of template synchronous thereby may be ensured that, the data in database can use;By the way that the template in internal memory is being changed into it
Afterwards, change lock mark is added into caching, so as on the one hand ensure in the synchronizing process of change template, during external inquiry
The data source of inquiry is the valid data in database, on the other hand can ensure that other servers in cluster accurately obtain mould
The synchronous information of plate, to complete simultaneously operating;In addition, mark is locked by the change in caching holding time stamp the latest, so as to
It can ensure when the situation that template concurrently changes be present, the synchronous information of distributed type assemblies is same information, avoids data same
Step goes wrong;By monitoring the occupancy situation of internal memory, so as to the data source of the switching template query of intelligence, ensure distribution
Formula cluster does not collapse because server memory service condition exceedes threshold value.
Brief description of the drawings
Accompanying drawing is used to more fully understand the present invention, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of the method for Template Information management according to embodiments of the present invention;
Fig. 2 be Template Information management according to embodiments of the present invention method in by the template synchronous after change to distribution
The schematic diagram of the main flow of other servers in cluster;
Fig. 3 is the schematic diagram of the major part of the system of Template Information management according to embodiments of the present invention.
Embodiment
The one exemplary embodiment of the present invention is explained below in conjunction with accompanying drawing, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
Arrive, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
Sample, for clarity and conciseness, the description to known function and structure is eliminated in following description.
The conceptual design of the Template Information management of the embodiment of the present invention is as follows:Various types of templates are using stored memory
Mode, so as to provide the service of efficient query template information;Based on group communication component, solves the mould under distributed type assemblies deployment
Plate synchronizing information problem so that the template of any server in change cluster, you can fast and accurately that newest template is same
Walk to other servers under cluster;Based on caching technology such as Redis change lock mechanism, solve concurrently to change asking for template
Topic;And using change lock mark, before Template Information synchronously completes, inquiry data source switching at runtime to database ensures
Inquiry gained Template Information is consistent, accurate;Monitor the internal memory service condition of current server, if current memory using more,
Then intelligently by data source from internal memory to switch data storehouse, the availability of distributed type assemblies is improved.
Fig. 1 is the schematic diagram of the key step of the method for Template Information management according to embodiments of the present invention.
As shown in figure 1, the method for the Template Information management of the embodiment of the present invention includes:
Step S11:Template in database is initialised in internal memory by each server in distributed type assemblies, for template
Inquiry and/or change;
Step S12:When there is template change request, server is according to the template change request got to the phase in internal memory
Answer template to be changed, and the template after change is preserved to database;
Step S13:Then the template after the change is sent to its in distributed type assemblies using cluster communication component
His server, other servers in distributed type assemblies become according to the template after the change to the corresponding template in internal memory
More, to realize other servers in the template synchronous after the change to distributed type assemblies.
In addition, the method for the Template Information management of the embodiment of the present invention also includes:Server becomes according to the template got
More ask after being changed to the corresponding template in internal memory, change lock mark, the change lock mark bag are added into caching
Include title, timestamp and the server number for needing synchronization of the template changed.
It is wherein, concurrent that change lock mark is added into caching if the template in server memory occurs concurrently to change,
But caching holding time stamp shows the change lock mark of time the latest.
In addition, change after template in comprising template change timestamp.When other servers in distributed type assemblies receive
After template after to the change, the change lock mark in caching is obtained first, then by the template of the template after the change
The timestamp of change timestamp and change lock mark is contrasted, no if unanimously, being changed to the corresponding template in internal memory
Do not process then.Other each servers in distributed type assemblies, the template after according to the change is to the phase in internal memory
Answer after template changed, synchronous server number will be needed to subtract one, when needing synchronous server number to be kept to zero, namely
After last server completes synchronization, synchronous server number will needed to subtract for the moment, removing change lock mark in the lump.
Foregoing caching holding time stamp shows the change lock mark of time the latest, exactly in order in distributed type assemblies
Server according to template modification information carry out template synchronous, so as to prevent the generation of template synchronous inaccuracy phenomenon.
During the template synchronous Template Information after according to change, if there is query demand, external inquiry is such as received
Request, now, in order to ensure that the template data inquired is accurate newest template data, then inquiry data source should be switched to
Database, without template data should be obtained from internal memory again.Therefore, when there is template query demand, server is according to receiving
Inquiry request judge to mark with the presence or absence of related to template to be checked change lock in caching, if in the presence of from database
Template is obtained, template is otherwise obtained from internal memory.
In addition, during distributed type assemblies improve template query service, in order to ensure that distributed type assemblies effectively operate, this
In inventive embodiments, in addition to timing or the sporadically internal memory service condition of each server in monitoring distributed cluster.When
When internal memory service condition exceedes predetermined threshold value, then template is obtained from database according to template query demand, when internal memory uses feelings
When condition is no more than predetermined threshold value, then template is obtained from internal memory according to template query demand.
Fig. 2 be Template Information management according to embodiments of the present invention method in by the template synchronous after change to distribution
The schematic diagram of the main flow of other servers in cluster.
Below by taking invoice template as an example, detailed process introduction is carried out to the method for Template Information management with reference to Fig. 1 and Fig. 2.
Certainly, the present invention can also solve the stationary problem of other information under distributed deployment, be not limited only to invoice template.
First, in the embodiment of the present invention, during in order to ensure that the template in a server memory changes, promptly and accurately
Other servers sent information under distributed type assemblies, it is necessary to which every server is connected to by cluster communication component
Same group's name:Such as can be INVOICE_TEMPLATE_JGROUPS.Now, under this distributed type assemblies, every
Server can serve as client, send information to other with the server under groups, to ensure between each server
Mutual communication, without safeguarding the extra machine as service end.
The JGroups that the cluster communication component of the embodiment of the present invention uses, JGroups are that a pure java to increase income writes
Reliable cluster communication instrument.It is a reliable multicast communication tool set.Its mode of operation, which is based on ip multicast, (to be needed
Bright, here it is not always necessary that can also be realized using IP Multicast, JGroups using TCP), but can be can
By being extended on property and group member management.A kind of flexible design in its structure, there is provided association of flexibly compatible various protocols
Stack is discussed, there is different reliability requirements for each product.This protocol stack can allow user to define reliability index and property
Can index.JGroups can be used for creating a group, and the member in this group can give other members to send message.
In addition, in order to reduce the pressure to database access, each server is by the mould in database in distributed type assemblies
Plate information aggregate, such as can be each region in Template_List, the invoice template information initializing of each printer model
Into internal memory, for inquiring about and changing.And after changing every time, invoice template in database all can be correspondingly changed, ensure
Database is arrived in newest invoice template information landing.
For example, each Template Information in Template_List is:TEMP_A_20150606121212、TEMP_
B_20150606121212 etc., wherein, TEMP_A_20150606121212 be a-quadrant Template Information, TEMP_B_
20150606121212 be the Template Information of B area.The layout of each Template Information including the region invoice, issue content,
Invoice number, impress.
During invoice issuing system operation, if one of template TEMP_A_20150606121212 information
Change (such as can be one or more) in increasing newly, change and deleting is needed, is to occur in the cluster due to changing operation
A certain server, it is therefore desirable in the internal memory for other servers that the invoice template after change is synchronized under cluster, ensure
The template content obtained during the Template Information of external inquiry a-quadrant is completely the same.
As shown in Fig. 2 S_1 servers receive the change to a-quadrant invoice template TEMP_A_20150606121212 first
More operation requests, after change operation is carried out to a-quadrant invoice template, change Template Information deposit database (is protected first
Card database can use), then deposit becomes in caching (such as one kind in can be, but not limited to be Redis, Memcache etc.)
More lock mark (such as can be REDIS_LOCK_TEMP_A_20160606121212_3), each server can be read by caching
Change lock mark is taken, change is locked in mark is comprising content:The title of the template changed, change operation time of origin stamp with
And need synchronous server number.Change lock tagging mechanism in caching can ensure with the value in a caching, while can only have
One successfully modified, ensures that each server needs synchronous server number to subtract change lock mark after performing simultaneously operating
One, and treat that Servers-all synchronously after the completion of execution, removes change lock mark.
The invoice template (timestamp for including template change in Template Information) of amended a-quadrant passes through cluster communication group
The sendMessage methods of part, send to other servers under group INVOICE_TEMPLATE_JGROUPS:S_2、S_3
Deng.
Other servers under group INVOICE_TEMPLATE_JGROUPS:S_2, S_3 etc., pass through cluster communication component
Receive methods receive the Template Information of the amended a-quadrant sended over.By taking S_2 server syncs as an example, S_2
Server obtains the change lock mark of correlation from caching first, and the template lock of a-quadrant is labeled as REDIS_LOCK_TEMP_A_
20160606121212_3, and work as the timestamp authenticated in change lock mark and the amended template being currently received
When the timestamp of template change is consistent, then override with the Template Information of the amended a-quadrant received in current server
A-quadrant Template Information in depositing.So far the template synchronous renewal of current S_2 servers is completed, and will be needed in change lock mark same
The number of the server of step subtracts one:REDIS_LOCK_TEMP_A_20160606121212_2.To the last a server is same
Step is completed, and removes change lock mark.
In the embodiment of the present invention, if situation about concurrently changing occurs for the invoice template of a-quadrant, it can only be stored in caching
The change lock mark of the last time change of this template:Such as REDIS_LOCK_TEMP_A_20160606121212_3, REDIS_
LOCK_TEMP_A_20160606121313_3, concurrently change twice, then the lock mark of a storage time stamp the latest:REDIS_
LOCK_TEMP_A_20160606121313_3.If S_2 servers first receive the change of TEMP_A_20160606121212 templates
More information, and found when inquiring about the change of invoice template of a-quadrant and locking mark, the template change timestamp received, which is less than, to be become
Timestamp in more lock mark, then do not perform template synchronous, neglect this change, wait newest change template;If S_2
Server first receives TEMP_A_20160606121313 template modification informations, and according to the invoice template of the a-quadrant inquired
Change lock mark, it is found that both timestamps are consistent, then update internal memory in a-quadrant Template Information, and will change lock mark
In the number of the synchronous server of needs subtract one:REDIS_LOCK_TEMP_A_20160606121313_2.To the last one
Platform server is performed and synchronously completed, and removes this lock mark.
When the request for the invoice template for having external inquiry a-quadrant, server first obtains the invoice mould of the a-quadrant in caching
The change lock mark of plate, the change if there is the invoice template of a-quadrant lock mark, illustrate now may to carry out template same
Step renewal, then degrading data source, that is, inquire about database, ensures the Template Information that inquires to be newest, and Servers-all
Query Result is consistent;Mark is locked if there is no the change of the invoice template of a-quadrant, then shows that the invoice template of a-quadrant has no
Change operation, audit memory has been newest invoice template.This is to utilize change lock mark, switching at runtime data
Source.
In addition, in the embodiment of the present invention, in order to improve the availability of distributed Template Service cluster, current point of poll monitoring
The internal memory service condition of the server of cloth cluster, such as utilization rate, if monitoring memory usage reaches predetermined threshold value, such as
K is set to, then intelligence switching inquiry data source to database;If memory usage is reduced to below K, data source switches back into interior
Deposit.
The method of Template Information management according to embodiments of the present invention can be seen that by the way that the template in database is initial
Change into internal memory, so as to provide a large amount of concurrent inquiry services;Communicated by using cluster communication component, so as to
Synchronous server is needed so that the information that template changes accurately is sent into other in time, efficiently completes simultaneously operating;Pass through
Template after change is preserved to database, thereby may be ensured that the process of template synchronous, the data in database can use;Pass through
After by the template change in internal memory, change lock mark is added into caching, so as on the one hand ensure in change template
Synchronizing process in, the data source inquired about during external inquiry is the valid data in database, on the other hand can ensure cluster
In other servers accurately obtain the information of template synchronous, to complete simultaneously operating;In addition, by a caching holding time
The change lock mark of stamp the latest, thereby may be ensured that when the situation that template concurrently changes be present, the synchronous letter of distributed type assemblies
Cease for same information, avoid data syn-chronization from going wrong;By monitoring the occupancy situation of internal memory, so as to the switching mould of intelligence
The data source of plate inquiry, ensure that distributed type assemblies do not collapse because server memory service condition exceedes threshold value.
Fig. 3 is the schematic diagram of the major part of the system of Template Information management according to embodiments of the present invention.
As shown in figure 3, the system 30 of the Template Information management of the embodiment of the present invention includes:Each service in distributed type assemblies
Device 301 and database 302, wherein:
Template in database 302 is initialised in internal memory by each server 301 in distributed type assemblies, so that template is looked into
Ask and/or change;
When there is template change request, server enters according to the template change request got to the corresponding template in internal memory
Row change, and the template after change is preserved to database 302;
Then the template after the change is sent to other servers in distributed type assemblies using cluster communication component,
Other servers in distributed type assemblies change according to the template after the change to the corresponding template in internal memory, to realize
By other servers in the template synchronous after the change to distributed type assemblies.
The system 30 may also include:Cache module (not shown);Server please according to the template change got
Ask after being changed to the corresponding template in internal memory, change lock mark, the change lock mark bag are added into cache module
Include title, timestamp and the server number for needing synchronization of the template changed.
Cache module is additionally operable to:If the corresponding template in server memory occurs concurrently to change, into cache module
After adding change lock mark, the change lock mark of cache module holding time stamp the latest.
In addition, system 30 is additionally operable to:Template change timestamp is included in template after the change;In distributed type assemblies
After other servers receive the template after the change, change lock mark is obtained, then by the mould of the template after the change
The timestamp that plate changes timestamp and change lock mark is contrasted, if unanimously, being changed to the corresponding template in internal memory,
Otherwise do not process;And other each servers in distributed type assemblies, the template after according to the change is to internal memory
In corresponding template changed after, synchronous server number will be needed to subtract one, zero is kept to when needing synchronous server number
When, change lock mark is removed in the lump.
System 30 can be additionally used in:When there is template query demand, server judges caching according to the inquiry request received
With the presence or absence of the change lock mark related to template to be checked in module, if in the presence of, template is obtained from database 302, it is no
Template is then obtained from internal memory.
In addition, system 30 can be additionally used in:The internal memory service condition of each server 301 in monitoring distributed cluster, when interior
When depositing service condition and exceeding predetermined threshold value, then template is obtained from database according to template query demand, when internal memory service condition
During no more than predetermined threshold value, then template is obtained from internal memory according to template query demand.
The internal memory service condition of each server in monitoring distributed cluster, when internal memory service condition exceedes predetermined threshold value
When, then template is obtained from database 302 according to template query demand, when internal memory service condition is no more than predetermined threshold value, then
Template is obtained from internal memory according to template query demand.
From the above, it can be seen that by the way that the template in database is initialised in internal memory, it is big so as to provide
Measure concurrent inquiry service;Communicated by using cluster communication component, so as to promptly and accurately by template change
Information, which is sent to other, needs synchronous server, efficiently completes simultaneously operating;By the way that the template after change is preserved to data
Storehouse, thereby may be ensured that the process of template synchronous, and the data in database can use;By the way that the template in internal memory is being changed into it
Afterwards, change lock mark is added into caching, so as on the one hand ensure in the synchronizing process of change template, during external inquiry
The data source of inquiry is the valid data in database, on the other hand can ensure that other servers in cluster accurately obtain mould
The synchronous information of plate, to complete simultaneously operating;In addition, mark is locked by the change in caching holding time stamp the latest, so as to
It can ensure when the situation that template concurrently changes be present, the synchronous information of distributed type assemblies is same information, avoids data same
Step goes wrong;By monitoring the occupancy situation of internal memory, so as to the data source of the switching template query of intelligence, ensure distribution
Formula cluster does not collapse because server memory service condition exceedes threshold value.
Above-mentioned embodiment, does not form limiting the scope of the invention.Those skilled in the art should be bright
It is white, depending on design requirement and other factors, various modifications, combination, sub-portfolio and replacement can occur.It is any
Modifications, equivalent substitutions and improvements made within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.
Claims (12)
- A kind of 1. method of Template Information management, it is characterised in that including:Template in database is initialised in internal memory by each server in distributed type assemblies, for template query and/or change More;When there is template change request, server becomes according to the template change request got to the corresponding template in internal memory More, and by the template after change preserve to database;Then the template after the change is sent to other servers in distributed type assemblies, distribution using cluster communication component Other servers in formula cluster change according to the template after the change to the corresponding template in internal memory, to realize institute State other servers in template synchronous to the distributed type assemblies after change.
- 2. according to the method for claim 1, it is characterised in that methods described also includes:After server changes according to the template change request got to the corresponding template in internal memory, added into caching Change lock mark, it is described to change the title for locking the template that mark includes changing, timestamp and need synchronous server individual Number.
- 3. according to the method for claim 2, it is characterised in that server is according to the template change request got to internal memory In corresponding template changed after, into caching add change lock mark also include:If the corresponding template in server memory occurs concurrently to change, after change lock mark is added into caching, caching is only The change lock mark of holding time stamp the latest.
- 4. according to the method for claim 2, it is characterised in that methods described also includes:Template change timestamp is included in template after the change;After other servers in distributed type assemblies receive the template after the change, change lock mark is obtained, then by institute The timestamp for stating the template change timestamp and change lock mark of the template after change is contrasted, if unanimously, in internal memory Corresponding template changed, otherwise do not process;AndOther each servers in distributed type assemblies, the template after according to the change are entered to the corresponding template in internal memory After row change, synchronous server number will be needed to subtract one, when needing synchronous server number to be kept to zero, remove change in the lump Lock mark.
- 5. according to the method for claim 2, it is characterised in that methods described also includes:When there is template query demand, server judges to whether there is and mould to be checked in caching according to the inquiry request received The related change lock mark of plate, if in the presence of obtaining template from database, template is otherwise obtained from internal memory.
- 6. according to the method for claim 1, it is characterised in that methods described also includes:The internal memory service condition of each server in monitoring distributed cluster, when internal memory service condition exceedes predetermined threshold value, then Template is obtained from database according to template query demand, when internal memory service condition is no more than predetermined threshold value, then according to template Query demand obtains template from internal memory.
- A kind of 7. system of Template Information management, it is characterised in that including:Each server and data in distributed type assemblies Storehouse, wherein:Template in database is initialised in internal memory by each server in distributed type assemblies, for template query and/or change More;When there is template change request, server becomes according to the template change request got to the corresponding template in internal memory More, and by the template after change preserve to database;Then the template after the change is sent to other servers in distributed type assemblies, distribution using cluster communication component Other servers in formula cluster change according to the template after the change to the corresponding template in internal memory, to realize institute State other servers in template synchronous to the distributed type assemblies after change.
- 8. system according to claim 7, it is characterised in that the system also includes:Cache module;After server changes according to the template change request got to the corresponding template in internal memory, into cache module Add change lock to mark, the change lock mark includes title, timestamp and the service for needing synchronization of the template changed Device number.
- 9. system according to claim 8, it is characterised in that the cache module is additionally operable to:If the corresponding template in server memory occurs concurrently to change, after change lock mark is added into cache module, delay The change lock mark of storing module holding time stamp the latest.
- 10. system according to claim 8, it is characterised in that the system is additionally operable to:Template change timestamp is included in template after the change;After other servers in distributed type assemblies receive the template after the change, change lock mark is obtained, then by institute The timestamp for stating the template change timestamp and change lock mark of the template after change is contrasted, if unanimously, in internal memory Corresponding template changed, otherwise do not process;AndOther each servers in distributed type assemblies, the template after according to the change are entered to the corresponding template in internal memory After row change, synchronous server number will be needed to subtract one, when needing synchronous server number to be kept to zero, remove change in the lump Lock mark.
- 11. system according to claim 8, it is characterised in that the system is additionally operable to:When there is template query demand, server according to the inquiry request received judge in cache module whether there is with it is to be checked The related change lock mark of template is ask, if in the presence of obtaining template from database, template is otherwise obtained from internal memory.
- 12. system according to claim 7, it is characterised in that the system is additionally operable to:The internal memory service condition of each server in monitoring distributed cluster, when internal memory service condition exceedes predetermined threshold value, then Template is obtained from database according to template query demand, when internal memory service condition is no more than predetermined threshold value, then according to template Query demand obtains template from internal memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610812601.1A CN107807931B (en) | 2016-09-09 | 2016-09-09 | Method and system for template information management |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610812601.1A CN107807931B (en) | 2016-09-09 | 2016-09-09 | Method and system for template information management |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107807931A true CN107807931A (en) | 2018-03-16 |
CN107807931B CN107807931B (en) | 2020-09-01 |
Family
ID=61576261
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610812601.1A Active CN107807931B (en) | 2016-09-09 | 2016-09-09 | Method and system for template information management |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107807931B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108595502A (en) * | 2018-03-19 | 2018-09-28 | 网宿科技股份有限公司 | Assess the method, apparatus and computer readable storage medium of database service performance |
CN111126025A (en) * | 2019-12-11 | 2020-05-08 | 航天信息股份有限公司 | Electronic document format file template management method and system |
CN112118298A (en) * | 2020-09-03 | 2020-12-22 | 杭州海康威视数字技术股份有限公司 | Configuration management method and device for distributed service |
CN113760871A (en) * | 2020-08-17 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Template synchronization method and device |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030088536A1 (en) * | 2001-04-09 | 2003-05-08 | Afshin Behnia | Platform within an organization for providing knowledge management and decision support services |
CN101540700A (en) * | 2009-04-10 | 2009-09-23 | 成都市华为赛门铁克科技有限公司 | Configuration linkage method, system, terminal and network equipment management server |
CN102096596A (en) * | 2010-11-29 | 2011-06-15 | 华中科技大学 | Cloud computing service Cache system based on internal memory template of virtual machine |
CN102880475A (en) * | 2012-10-23 | 2013-01-16 | 上海普元信息技术股份有限公司 | Real-time event handling system and method based on cloud computing in computer software system |
CN104092777A (en) * | 2014-07-29 | 2014-10-08 | 深圳市富途网络科技有限公司 | Method and system for synchronously storing layout setting of clients in server |
CN104158905A (en) * | 2014-08-28 | 2014-11-19 | 北京京东尚科信息技术有限公司 | Creation method of web containers |
CN104202440A (en) * | 2014-09-02 | 2014-12-10 | 腾讯科技(深圳)有限公司 | Method for identifying terminal, server and system |
CN105096172A (en) * | 2015-06-12 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Electronic invoice generating and processing method and system based on e-commerce platform |
CN105487859A (en) * | 2015-11-25 | 2016-04-13 | 北京工业大学 | Template based WEB deployment method for big data components |
CN105933136A (en) * | 2015-11-30 | 2016-09-07 | 中国银联股份有限公司 | Resource scheduling method and system |
-
2016
- 2016-09-09 CN CN201610812601.1A patent/CN107807931B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030088536A1 (en) * | 2001-04-09 | 2003-05-08 | Afshin Behnia | Platform within an organization for providing knowledge management and decision support services |
CN101540700A (en) * | 2009-04-10 | 2009-09-23 | 成都市华为赛门铁克科技有限公司 | Configuration linkage method, system, terminal and network equipment management server |
CN102096596A (en) * | 2010-11-29 | 2011-06-15 | 华中科技大学 | Cloud computing service Cache system based on internal memory template of virtual machine |
CN102880475A (en) * | 2012-10-23 | 2013-01-16 | 上海普元信息技术股份有限公司 | Real-time event handling system and method based on cloud computing in computer software system |
CN104092777A (en) * | 2014-07-29 | 2014-10-08 | 深圳市富途网络科技有限公司 | Method and system for synchronously storing layout setting of clients in server |
CN104158905A (en) * | 2014-08-28 | 2014-11-19 | 北京京东尚科信息技术有限公司 | Creation method of web containers |
CN104202440A (en) * | 2014-09-02 | 2014-12-10 | 腾讯科技(深圳)有限公司 | Method for identifying terminal, server and system |
CN105096172A (en) * | 2015-06-12 | 2015-11-25 | 北京京东尚科信息技术有限公司 | Electronic invoice generating and processing method and system based on e-commerce platform |
CN105487859A (en) * | 2015-11-25 | 2016-04-13 | 北京工业大学 | Template based WEB deployment method for big data components |
CN105933136A (en) * | 2015-11-30 | 2016-09-07 | 中国银联股份有限公司 | Resource scheduling method and system |
Non-Patent Citations (1)
Title |
---|
王晓珺: "H银行国际贸易供应链前端系统批准发票融资交易模块的设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108595502A (en) * | 2018-03-19 | 2018-09-28 | 网宿科技股份有限公司 | Assess the method, apparatus and computer readable storage medium of database service performance |
CN111126025A (en) * | 2019-12-11 | 2020-05-08 | 航天信息股份有限公司 | Electronic document format file template management method and system |
CN111126025B (en) * | 2019-12-11 | 2024-08-09 | 航天信息股份有限公司 | Electronic certificate format file template management method and system |
CN113760871A (en) * | 2020-08-17 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Template synchronization method and device |
CN113760871B (en) * | 2020-08-17 | 2024-04-16 | 北京沃东天骏信息技术有限公司 | Template synchronization method and device |
CN112118298A (en) * | 2020-09-03 | 2020-12-22 | 杭州海康威视数字技术股份有限公司 | Configuration management method and device for distributed service |
Also Published As
Publication number | Publication date |
---|---|
CN107807931B (en) | 2020-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107528816B (en) | Processing method, management system and server of ID in distributed database | |
CN107807931A (en) | The method and system of Template Information management | |
AU2009252121B2 (en) | Method and apparatus for managing tokens for digital rights management | |
EP2214372B1 (en) | Method and apparatus for tracking device management data changes | |
CN101751415A (en) | Metadata service system metadata synchronized method and writing server updating method | |
CN112039970B (en) | Distributed business lock service method, server, system and storage medium | |
JP6405255B2 (en) | COMMUNICATION SYSTEM, QUEUE MANAGEMENT SERVER, AND COMMUNICATION METHOD | |
CN113420029B (en) | Global ID generation method, device, equipment and medium for distributed system | |
CN111404730B (en) | State synchronization method and device of virtual router, electronic equipment and storage medium | |
CN104657841A (en) | Express item delivery method, delivery processing method, express cabinet terminal and service system | |
CN115150410B (en) | Multi-cluster access method and system | |
CN107870982A (en) | Data processing method, system and computer-readable recording medium | |
CN108076081A (en) | Method, device and system for synchronizing service data | |
CN108540513A (en) | Ask the determination method and device of Replay Attack | |
CN102316117A (en) | Resource processing method and device | |
CN113965434A (en) | API gateway routing implementation method under cross-machine-room scene | |
CN101605301A (en) | A kind of group system and request message distribution method that carries out the multinode transaction | |
CN107967265B (en) | File access method, data server and file access system | |
CN110019529A (en) | Management method, system and the relevant device of back end | |
CN106973106A (en) | A kind of method for obtaining session information, apparatus and system | |
CN116150273A (en) | Data processing method, device, computer equipment and storage medium | |
CN104717262A (en) | Enterprise address book downloading method and system | |
CN110351612B (en) | ONU equipment automatic registration method with simple maintenance work in PON | |
CN101753336A (en) | System for managing synchronous refreshing of topological data in computer network | |
CN106559471B (en) | Method and device for processing and managing accelerated resources |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |