CN109299076A - Method, device and equipment for generating primary key of data acquisition point in redundant database - Google Patents

Method, device and equipment for generating primary key of data acquisition point in redundant database Download PDF

Info

Publication number
CN109299076A
CN109299076A CN201811346916.7A CN201811346916A CN109299076A CN 109299076 A CN109299076 A CN 109299076A CN 201811346916 A CN201811346916 A CN 201811346916A CN 109299076 A CN109299076 A CN 109299076A
Authority
CN
China
Prior art keywords
major key
data collection
point
collection point
target
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
Application number
CN201811346916.7A
Other languages
Chinese (zh)
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 South Power Grid International Co ltd
Original Assignee
China South Power Grid International 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 South Power Grid International Co ltd filed Critical China South Power Grid International Co ltd
Priority to CN201811346916.7A priority Critical patent/CN109299076A/en
Publication of CN109299076A publication Critical patent/CN109299076A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention discloses a method for generating a primary key of a data acquisition point in a redundant database, which comprises the following steps: when a data acquisition point recording request is received, acquiring a point main key maximum value corresponding to the selected main key generation mode; adding a preset value to the maximum value of the point primary key to obtain a target point primary key value corresponding to the target data acquisition point; and recording the target data acquisition points into the primary library and the preset standby library by taking the target point primary key value as a mark. By applying the technical scheme provided by the embodiment of the invention, the point primary key values of all data acquisition points recorded in the same database are ensured to be different, and the primary key consistency of the same data acquisition point in the primary and standby databases can be effectively ensured by synchronizing the same target data acquisition point and the target point primary key value thereof from the primary database to the standby database, thereby eliminating the potential safety hazard in the management of the power system. The invention also discloses a device, equipment and a storage medium for generating the primary key of the data acquisition point in the redundant database, and has corresponding technical effects.

Description

Major key generation method, device and the equipment of data collection point in redundant database
Technical field
The present invention relates to electric power project engineering fields, more particularly to a kind of major key of data collection point in redundant database Generation method, device, equipment and computer readable storage medium.
Background technique
The design of relevant database has to comply with second normal form, i.e., each record in table all must be with the master of the table Key is completely dependent on relationship namely each record and can uniquely be distinguished by major key.It is acquired with data and monitors control For system SCADA processed, towards monitored object be electromechanical equipment, every equipment needs a unique device id to mark Note, an equipment include one or more data collection points, both may be the digital quantity point for indicating switch division, it is also possible to table Show speed, temperature, electric current analog quantity point, each data collection point needs a unique point Major key to mark.
If only consider only have a database server system, can there are many kinds of database key generate Strategy is available, generates major key most commonly by from the mode for increasing major key, passes through the increment of database itself Increment attribute or sequence sequence object automatically generate major key, can also carry out max+1 operation by broker program Generate major key.Record in and energy unique identification data library unrelated with business.External system batch can be well solved to import The problem of major key is generated when data.
In practical applications, in order to improve the reliability of application system, two or more database servers can be passed through Redundancy Design provides service jointly.The usual thinking of Redundancy Design is M+N, i.e., one shared M+N node, M node provides normal Rule service, N number of node is as spare.Consider database redundancy in the case where, primary key generation strategies in addition to search efficiency, Except ease of use etc. requires, emphasis is also wanted to consider how to guarantee that the major key of identical data collection point in active and standby library is consistent Property, it avoids conflicting, otherwise will cause security risk to the management of electric system.
In conclusion how to efficiently solve the major key of identical data collection point in active and standby library there are inconsistent, lead Key conflict, so that the management of electric system has security risk, being that current those skilled in the art are urgently to be solved is asked Topic.
Summary of the invention
The object of the present invention is to provide a kind of major key generation method of data collection point in redundant database, this method can be with Identical data collection point major key consistency in active and standby library is effectively ensured, avoids in active and standby library there are major key conflict, eliminates Security risk existing for power system management;It is a further object of the present invention to provide data collection points in a kind of redundant database Major key generating means, equipment and computer readable storage medium.
In order to solve the above technical problems, the invention provides the following technical scheme:
The major key generation method of data collection point in a kind of redundant database, is applied to distribution network system, comprising:
When receiving data collection point record request, obtains selected major key and generate corresponding major key maximum value of mode;
Preset value is added to obtain the corresponding target point Major key in target data collection point described major key maximum value;
It is label with the target point Major key, master library and preset standby library is recorded in the target data collection point In.
In a kind of specific embodiment of the invention, obtains selected major key and generates corresponding major key maximum value of mode, Include:
Obtain the point major key maximum value generated under major key mode in trigger.
In a kind of specific embodiment of the invention, it is maximum to obtain the point major key generated under major key mode in trigger Value, comprising:
Search the corresponding target device in the target data collection point;
Obtain the point major key maximum value of each data collection point in the target device.
In a kind of specific embodiment of the invention, adds preset value to obtain target data described major key maximum value and adopt The corresponding target point Major key of collection point, comprising:
Database sum is added to obtain the corresponding target point Major key in target data collection point described major key maximum value;Its In, the database sum is that the number of the master library adds the number in the standby library to obtain.
In a kind of specific embodiment of the invention, further includes:
When the master library failure, target is searched from each standby library according to preset rules for library;
The target is set as new master library for library.
In a kind of specific embodiment of the invention, the database sum is 10 or 100, in the master library to described Target data collection point records successfully and there are under the premise of the standby library record failure, further includes:
When needing to summarize whole target data collection points, the low level phase of the target point Major key is chosen The same target data collection point acquires point set as target data;Wherein, the digit of the low level is that the database is total Several digits subtract 1.
In a kind of specific embodiment of the invention, further includes:
The identical redundancy object data collection point of target point Major key described in the collection of the target data collection point is rejected.
The major key generating means of data collection point in a kind of redundant database, are applied to distribution network system, comprising:
Major key obtains module, for obtaining selected major key and generating mode when receiving data collection point record request Corresponding major key maximum value;
Major key computing module, it is corresponding for adding preset value to obtain target data collection point described major key maximum value Target point Major key;
Data collection point logging modle, for being label with the target point Major key, by the target data collection point It is recorded in master library and preset standby library.
The major key generating device of data collection point in a kind of redundant database, is applied to distribution network system, comprising:
Memory, for storing computer program;
Processor realizes the master of data collection point in redundant database as previously described when for executing the computer program The step of key generation method.
A kind of computer readable storage medium is applied to distribution network system, stores on the computer readable storage medium There is computer program, the computer program realizes data collection point in redundant database as previously described when being executed by processor The step of major key generation method.
Using the major key generation method of data collection point in redundant database provided by the embodiment of the present invention, applied to matching Network system obtains the point master under the major key generation mode currently selected when system receives data collection point record request Key maximum value, according to the Major key for recording data collection point twice adjacent under pre-set currently selected major key generation mode Difference adds preset value to obtain the corresponding target point Major key in target data collection point using the point major key maximum value got, with Target point Major key is label, and target data collection point is recorded in master library and preset standby library.It is adjacent twice by setting The difference for recording the Major key of data collection point, guarantees the point Major key of each data collection point recorded in the same database Difference can be effective by being synchronized to same target data collection point and its target point Major key jointly from master library in standby library Guarantee identical data collection point major key consistency in active and standby library, avoids in active and standby library there are major key conflict, eliminate electric power Security risk existing for system administration.
Correspondingly, the embodiment of the invention also provides the major key generation methods with data collection point in above-mentioned redundant database Major key generating means, equipment and the computer readable storage medium of data collection point in corresponding redundant database have upper Technical effect is stated, details are not described herein.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is a kind of implementing procedure of the major key generation method of data collection point in redundant database in the embodiment of the present invention Figure;
Fig. 2 is that the another of the major key generation method of data collection point implements stream in redundant database in the embodiment of the present invention Cheng Tu;
Fig. 3 is a kind of structural frames of the major key generating means of data collection point in redundant database in the embodiment of the present invention Figure;
Fig. 4 is a kind of structural frames of the major key generating device of data collection point in redundant database in the embodiment of the present invention Figure.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, with reference to the accompanying drawings and detailed description The present invention is described in further detail.Obviously, described embodiments are only a part of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Embodiment one:
It is one kind of the major key generation method of data collection point in redundant database in the embodiment of the present invention referring to Fig. 1, Fig. 1 Implementation flow chart is applied to distribution network system, and this method may comprise steps of:
S101: it when receiving data collection point record request, obtains selected major key and generates corresponding major key of mode most Big value.
It, can be to responsible calculating major key when the electric network data acquisition device in distribution network system collects data collection point Broker program send data collection point record request, data collection point record request may include to the target that records of needs The pre-selected major key of data collection point generates mode, and the broker program for being responsible for calculating major key can generate mould according to selected major key Formula calculates the corresponding major key maximum value under the major key generation mode.
Whether major key generates mode can be according to major key be generated in trigger, and it is to trigger that major key, which is generated mode division, Major key is generated in device and non-generates major key in trigger, naturally it is also possible to according to practical application scene demand, using others Mode division rule generates mode to major key and divides, and it is not limited in the embodiment of the present invention.
S102: preset value is added to obtain the corresponding target point Major key in target data collection point a major key maximum value.
Mode is generated for each major key, the difference of the adjacent Major key for recording data collection point twice can be preset respectively Value.After getting selected major key and generating corresponding major key maximum value of mode, can use this major key maximum value add it is pre- If value obtains the corresponding target point Major key in the target data collection point for currently needing to record.
Preset value is usually set to positive integer, is more convenient in this case based on the target point Major key pair being calculated Target data collection point is inquired.And it considers master library temporary fault, and just occurs before the failure primary active and standby In the target point Major key synchronizing process of library, master library runs succeeded, one of them or several standby libraries execute the extreme case to fail, Under this extreme case, if preset value is to be set as 1, the point major key maximum value in the standby library of failure is executed than failure master library Point major key maximum value it is small by 1, if by chance select execute failure standby library take over failure master library, using execute failure standby library as newly Master library can be based on running succeeded when being recorded by new master library to target data collection point next time than other last time The value of standby library midpoint major key maximum value small 1 calculates the corresponding target point Major key in this target data collection point, since other are standby Existing target point Major key in normal former master library has been restored in library, then marks new number of targets with the target point Major key According to collection point, it will result in the identical situation of the corresponding target point Major key in the adjacent collection point of target data twice, that is, generate master Key assignments conflict.It therefore, can be integer greater than 1 by default settings to prevent the phenomenon that Major key conflicts, it such as can be with Be the sum of database by default settings, accordingly even when the point major key maximum value in existing master library is smaller, will not generate and its He for library collision target point Major key.
S103: it is label with target point Major key, target data collection point is recorded in master library and preset standby library.
It can be mark with target point Major key after the corresponding target point Major key in target data collection point is calculated Note, target data collection point is recorded in master library and preset standby library, so that target data collection point is in master library It is identical with corresponding target point Major key in standby library, it can to guarantee same in the master library of entire distribution system and each standby library Only one Major key of target data collection point exists, and the Major key has uniqueness, avoids active and standby library with " fissure " Mode respectively carries out Major key calculating, so that it is the high reliablity of this Major key generating mode, high-efficient, and in entire major key During generating algorithm is realized, there is no the characteristics exclusive using certain relevant database, so that the Major key generates Mode has universality, and versatility is high.
During active and standby library target point Major key record, runs succeeded even if there is master library, there is standby library and execute mistake The case where losing also returns to application program and runs succeeded, when being recorded to new target data collection point next time, each standby library In the target point Major key of the new target data collection point still keep identical as in master library, can change data collision in this way is Shortage of data ensure that high availability and asynchronous.
Using the major key generation method of data collection point in redundant database provided by the embodiment of the present invention, applied to matching Network system obtains the point master under the major key generation mode currently selected when system receives data collection point record request Key maximum value, according to the Major key for recording data collection point twice adjacent under pre-set currently selected major key generation mode Difference adds preset value to obtain the corresponding target point Major key in target data collection point using the point major key maximum value got, with Target point Major key is label, and target data collection point is recorded in master library and preset standby library.It is adjacent twice by setting The difference for recording the Major key of data collection point, guarantees the point Major key of each data collection point recorded in the same database Difference can be effective by being synchronized to same target data collection point and its target point Major key jointly from master library in standby library Guarantee identical data collection point major key consistency in active and standby library, avoids in active and standby library there are major key conflict, eliminate electric power Security risk existing for system administration.
It should be noted that based on the above embodiment one, the embodiment of the invention also provides be correspondingly improved scheme.Rear Involved in continuous embodiment with can mutually be referred between same steps or corresponding steps in above-described embodiment one, corresponding beneficial effect Can also be cross-referenced, it is no longer repeated one by one in improvement embodiment below.
In a kind of specific embodiment of the invention, obtains selected major key and generates corresponding major key maximum value of mode, It may comprise steps of:
Obtain the point major key maximum value generated under major key mode in trigger.
In more complicated relational database structure, to simplify application logic, database manipulation atom is ensured Property, the Major key of target data collection point can be calculated in trigger.It, can be with when receiving data collection point record request Obtain the point major key maximum value generated under major key mode in trigger.
In a kind of specific embodiment of the invention, it is maximum to obtain the point major key generated under major key mode in trigger Value, comprising:
Search the corresponding target device in target data collection point;
Obtain the point major key maximum value of each data collection point in target device.
In data acquisition with supervisor control, which includes several electromechanical equipments, includes multiple under each equipment Data collection point, can be set the corresponding equipment Major key of each equipment, and by the data type of each data collection point with Equipment Major key is associated.The setting up procedure of equipment Major key may include obtaining master library when receiving equipment addition request In equipment major key maximum value, using equipment major key maximum value add it is preset it is adjacent twice add equipment difference obtain mesh The corresponding target device Major key of marking device is label with target device Major key, and master library is recorded in target device and is preset Standby library in.It, can be according to pair of target data collection point and equipment Major key when receiving data collection point record request It should be related to and search corresponding target device, and obtain the point major key in corresponding Major key of each data collection point of target device most Big value.
The mode of major key is generated in trigger, can specifically use high-low-position strategy, and target data collection point is corresponding A high position for target point Major key directly inheritance point target device Major key, low level use data collection point under same equipment suitable from increasing The mode of serial number sets low level such as two, and target device Major key is indicated with dev_id, and data collection point increases certainly under same equipment Serial number indicates that target point Major key is indicated with pnt_id with pnt_order, and the calculation of target point Major key can pass through Following formula is calculated:
Pnt_id=dev_id*100+pnt_order.
In such a case, it is possible to data collision mistake is strictly limited within the same equipment, based on inside this library Data carry out operation, error diffusion can be effectively prevented, avoid fissure.Because the collection point quantity under an equipment is pole Its is limited, in case of data collision mistake, can then re-create the methods of equipment by sweep equipment completely It is remedied, can also achieve the effect that effectively controlling later data repairs difficulty.
Embodiment two:
Referring to fig. 2, Fig. 2 be in the embodiment of the present invention in redundant database the major key generation method of data collection point it is another Kind implementation flow chart, is applied to distribution network system, and this method may comprise steps of:
S201: it when receiving data collection point record request, obtains selected major key and generates corresponding major key of mode most Big value.
S202: database sum is added to obtain the corresponding target point Major key in target data collection point a major key maximum value.
Wherein, database sum is that the number of master library adds the number in standby library to obtain.
Database sum can be set by the difference of the adjacent Major key for recording data collection point twice, when getting After selecting major key to generate corresponding major key maximum value of mode, database sum can be added to obtain number of targets a major key maximum value According to the corresponding target point Major key in collection point.Database sum is that the number of master library adds the number in standby library to obtain, because existing In the case where redundant database, database sum is the arbitrary integer more than or equal to 2, therefore can be avoided the occurrence of in embodiment one Conflict under extreme case improves reliability.
In a kind of specific embodiment of the invention, this method may also comprise the following steps::
When master library failure, target is searched from each standby library according to preset rules for library;
Target is set as new master library for library.
The longtime running of database, can be preparatory such as the case where unstable networks it is possible that the case where temporary fault When current master library failure is set, for taking over the standby library of failure master library, it is automatic to be reached into active and standby library as new master library for library for this The effect of switching such as can be and select the smallest standby library of CPU load as new master library from standby library, be also possible to from standby library It selects the smallest standby library database accession number DBID as new master library, specifically this is not done using which kind of regular embodiment of the present invention It limits.When master library failure, target can be searched from each standby library according to preset rules for library, target is set as new for library Master library takes over the record that failure master library carries out data collection point using new master library, guarantees the smooth execution of record operation.
In a kind of specific embodiment of the invention, database sum is 10 or 100, is acquired in master library to target data Under the premise of point records successfully and there is standby library record failure, this method may also comprise the following steps::
When needing to summarize target complete data collection point, the identical target of low level of target point Major key is chosen Data collection point acquires point set as target data;Wherein, the digit of low level is that the digit of database sum subtracts 1.
Based on the above embodiment, database sum can be set to 10 or 100, in this case, when needs are to whole When target data collection point is summarized, the identical target data collection point of low level of target point Major key can be chosen as mesh Data collection point collection is marked, when N takes 10, the digit of low level is 1, only by last identical number of targets of target point Major key It selects to come according to collection point, so that it may constitute target data acquisition point set.When N takes 100, the digit of low level is 2, only by target Last two identical target data collection points of point Major key, which select, to be come, so that it may constitute target data acquisition point set.? In this case, so that it may which each target data collection point for guaranteeing that target data collection point is concentrated is based on the same database What library was recorded, be that the major key generated is stamped with database accession number to introduce database accession number in major key generating algorithm Label, indicates that current target point Major key is generated in which master library, the integrality of the data got can be improved.
In a kind of specific embodiment of the invention, this method may also comprise the following steps::
The identical redundancy object data collection point of target point Major key is concentrated to reject target data collection point.
Based on the above embodiment, the target data acquisition point set being made of the identical target data collection point of low level is got Later, target data collection point identical compared with multiple target point Major key may be had by being concentrated due to target data collection point, because This can concentrate target data collection point the identical redundancy object data collection point of target point Major key to reject, so that number of targets The data concentrated according to collection point are more succinct, facilitate the subsequent research to each target data collection point.
S203: it is label with target point Major key, target data collection point is recorded in master library and preset standby library.
Corresponding to above method embodiment, the embodiment of the invention also provides data collection points in a kind of redundant database Major key generating means, be applied to distribution network system, the major key of data collection point generates dress in redundant database described below Reference can be corresponded to each other with the major key generation method of data collection point in above-described redundant database by setting.
Referring to Fig. 3, Fig. 3 is the major key generating means of data collection point in redundant database a kind of in the embodiment of the present invention Structural block diagram, the apparatus may include:
Major key obtains module 31, for obtaining selected major key and generating mould when receiving data collection point record request Corresponding major key maximum value of formula;
Major key computing module 32 adds preset value to obtain the corresponding mesh in target data collection point for that will put major key maximum value Punctuate Major key;
Target data collection point is recorded for being label with target point Major key for data collection point logging modle 33 In master library and preset standby library.
Using the major key generating means of data collection point in redundant database provided by the embodiment of the present invention, applied to matching Network system obtains the point master under the major key generation mode currently selected when system receives data collection point record request Key maximum value, according to the Major key for recording data collection point twice adjacent under pre-set currently selected major key generation mode Difference adds preset value to obtain the corresponding target point Major key in target data collection point using the point major key maximum value got, with Target point Major key is label, and target data collection point is recorded in master library and preset standby library.It is adjacent twice by setting The difference for recording the Major key of data collection point, guarantees the point major key of each data collection point of the record in the same database Value is different, can be effective by being synchronized to same target data collection point and its target Major key jointly from master library in standby library Guarantee identical data collection point major key consistency in active and standby library, avoids in active and standby library there are major key conflict, eliminate electric power Security risk existing for system administration.
In a kind of specific embodiment of the invention, it is specially to obtain to generate in trigger that Major key, which obtains module 31, The module of point major key maximum value under major key mode.
In a kind of specific embodiment of the invention, Major key obtains module 31, comprising:
Equipment searches submodule, for searching the corresponding target device in target data collection point;
Major key acquisition submodule, for obtaining the point major key maximum value of each data collection point in target device.
In a kind of specific embodiment of the invention, Major key computing module 32 is specially that will put major key maximum value addend The module of the corresponding target point Major key in target data collection point is obtained according to library sum;Wherein, database sum is master library number Standby library number is added to obtain.
In a kind of specific embodiment of the invention, which can also include:
Standby library lookup module, for searching target from each standby library according to preset rules for library when master library failure;
Master library setting module, for target to be set as new master library for library.
In a kind of specific embodiment of the invention, database sum is 10 or 100, which can also include:
Point set chooses module, for before master library records target data collection point successfully and there is standby library record failure It puts, when needing to summarize target complete data collection point, chooses the identical number of targets of low level of target point Major key Point set is acquired as target data according to collection point;Wherein, the digit of low level is that the digit of database sum subtracts 1.
In a kind of specific embodiment of the invention, which can also include:
Data collection point rejects module, for the identical redundancy object of target point Major key to be concentrated in target data collection point Data collection point is rejected.
Corresponding to above method embodiment, referring to fig. 4, Fig. 4 is that data are adopted in redundant database provided by the present invention The schematic diagram for collecting the major key generating device of point, is applied to distribution network system, which may include:
Memory 41, for storing computer program;
Processor 42 can realize following steps when for executing the computer program of the above-mentioned storage of memory 41:
When receiving data collection point record request, obtains selected major key and generate corresponding major key maximum value of mode; Preset value is added to obtain the corresponding target point Major key in target data collection point a major key maximum value;It is mark with target point Major key Note, target data collection point is recorded in master library and preset standby library.
Above method embodiment is please referred to for the introduction of equipment provided by the invention, this will not be repeated here by the present invention.
Corresponding to above method embodiment, the present invention also provides a kind of computer readable storage mediums, are applied to distribution Net system is stored with computer program on computer readable storage medium, can realize such as when computer program is executed by processor Lower step:
When receiving data collection point record request, obtains selected major key and generate corresponding major key maximum value of mode; Preset value is added to obtain the corresponding target point Major key in target data collection point a major key maximum value;It is mark with target point Major key Note, target data collection point is recorded in master library and preset standby library.
The computer readable storage medium may include: USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. is various to deposit Store up the medium of program code.
Above method embodiment is please referred to for the introduction of computer readable storage medium provided by the invention, the present invention exists This is not repeated them here.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with it is other The difference of embodiment, same or similar part may refer to each other between each embodiment.For being filled disclosed in embodiment It sets, for equipment and computer readable storage medium, since it is corresponded to the methods disclosed in the examples, so the comparison of description Simply, reference may be made to the description of the method.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
Used herein a specific example illustrates the principle and implementation of the invention, and above embodiments are said It is bright to be merely used to help understand technical solution of the present invention and its core concept.It should be pointed out that for the common of the art , without departing from the principle of the present invention, can be with several improvements and modifications are made to the present invention for technical staff, these Improvement and modification are also fallen within the protection scope of the claims of the present invention.

Claims (10)

1. the major key generation method of data collection point in a kind of redundant database, which is characterized in that be applied to distribution network system, packet It includes:
When receiving data collection point record request, obtains selected major key and generate corresponding major key maximum value of mode;
Preset value is added to obtain the corresponding target point Major key in target data collection point described major key maximum value;
It is label with the target point Major key, the target data collection point is recorded in master library and preset standby library.
2. the major key generation method of data collection point in redundant database according to claim 1, which is characterized in that obtain Selected major key generates corresponding major key maximum value of mode, comprising:
Obtain the point major key maximum value generated under major key mode in trigger.
3. the major key generation method of data collection point in redundant database according to claim 2, which is characterized in that obtain The point major key maximum value under major key mode is generated in trigger, comprising:
Search the corresponding target device in the target data collection point;
Obtain the point major key maximum value of each data collection point in the target device.
4. the major key generation method of data collection point, feature in redundant database according to any one of claims 1 to 3 It is, adds preset value to obtain the corresponding target point Major key in target data collection point described major key maximum value, comprising:
Database sum is added to obtain the corresponding target point Major key in target data collection point described major key maximum value;Wherein, The database sum is that the number of the master library adds the number in the standby library to obtain.
5. the major key generation method of data collection point in redundant database according to claim 4, which is characterized in that also wrap It includes:
When the master library failure, target is searched from each standby library according to preset rules for library;
The target is set as new master library for library.
6. the major key generation method of data collection point in redundant database according to claim 5, which is characterized in that described Database sum is 10 or 100, records successfully in the master library to the target data collection point and there are the standby libraries to record Under the premise of failure, further includes:
When needing to summarize whole target data collection points, the low level for choosing the target point Major key is identical The target data collection point acquires point set as target data;Wherein, the digit of the low level is the database sum Digit subtracts 1.
7. the major key generation method of data collection point in redundant database according to claim 6, which is characterized in that also wrap It includes:
The identical redundancy object data collection point of target point Major key described in the collection of the target data collection point is rejected.
8. the major key generating means of data collection point in a kind of redundant database, which is characterized in that be applied to distribution network system, packet It includes:
Major key obtains module, for when receiving data collection point record request, it is corresponding that the selected major key of acquisition generates mode Point major key maximum value;
Major key computing module, for adding preset value to obtain the corresponding target in target data collection point described major key maximum value Point Major key;
Data collection point logging modle records the target data collection point for being label with the target point Major key Into master library and preset standby library.
9. the major key generating device of data collection point in a kind of redundant database, which is characterized in that be applied to distribution network system, packet It includes:
Memory, for storing computer program;
Processor is realized when for executing the computer program and is counted in redundant database as described in any one of claim 1 to 7 According to collection point major key generation method the step of.
10. a kind of computer readable storage medium, which is characterized in that be applied to distribution network system, the computer-readable storage It is stored with computer program on medium, realizes when the computer program is executed by processor such as any one of claim 1 to 7 institute The step of stating the major key generation method of data collection point in redundant database.
CN201811346916.7A 2018-11-13 2018-11-13 Method, device and equipment for generating primary key of data acquisition point in redundant database Pending CN109299076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811346916.7A CN109299076A (en) 2018-11-13 2018-11-13 Method, device and equipment for generating primary key of data acquisition point in redundant database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811346916.7A CN109299076A (en) 2018-11-13 2018-11-13 Method, device and equipment for generating primary key of data acquisition point in redundant database

Publications (1)

Publication Number Publication Date
CN109299076A true CN109299076A (en) 2019-02-01

Family

ID=65145719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811346916.7A Pending CN109299076A (en) 2018-11-13 2018-11-13 Method, device and equipment for generating primary key of data acquisition point in redundant database

Country Status (1)

Country Link
CN (1) CN109299076A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309980A (en) * 2013-06-14 2013-09-18 中国传媒大学 Method, device and system for processing performance data
CN104021132A (en) * 2013-12-08 2014-09-03 郑州正信科技发展股份有限公司 Method and system for verification of consistency of backup data of host database and backup database
CN107133285A (en) * 2017-04-18 2017-09-05 北京北信源软件股份有限公司 A kind of distributed major key generation method and device
CN107247734A (en) * 2017-05-05 2017-10-13 上海斐讯数据通信技术有限公司 A kind of distributed data base major key generation method and system
CN108319679A (en) * 2018-01-30 2018-07-24 杭州迪普科技股份有限公司 A kind of generation method and device of major key

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309980A (en) * 2013-06-14 2013-09-18 中国传媒大学 Method, device and system for processing performance data
CN104021132A (en) * 2013-12-08 2014-09-03 郑州正信科技发展股份有限公司 Method and system for verification of consistency of backup data of host database and backup database
CN107133285A (en) * 2017-04-18 2017-09-05 北京北信源软件股份有限公司 A kind of distributed major key generation method and device
CN107247734A (en) * 2017-05-05 2017-10-13 上海斐讯数据通信技术有限公司 A kind of distributed data base major key generation method and system
CN108319679A (en) * 2018-01-30 2018-07-24 杭州迪普科技股份有限公司 A kind of generation method and device of major key

Similar Documents

Publication Publication Date Title
US10740308B2 (en) Key_Value data storage system
CN109117275B (en) Account checking method and device based on data slicing, computer equipment and storage medium
CN108287660B (en) Data storage method and device
CN109064345A (en) Message treatment method, system and computer readable storage medium
CN111262726B (en) Configuration information updating method and device and computer readable storage medium
CN108038005A (en) Shared resource access method, client, server-side, system based on zookeeper
CN108322222A (en) A method of it generates and using distributed unique ID
CN107203532A (en) Construction method, the implementation method of search and the device of directory system
CN110908590A (en) Distributed storage method and system for transformer substation data
CN104793981B (en) A kind of online snapshot management method and device of cluster virtual machine
CN106873918A (en) Storage method to set up and device in a kind of virtualization system
CN111897643A (en) Thread pool configuration system, method, device and storage medium
CN113835823A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
CN112598529B (en) Data processing method and device, computer readable storage medium and electronic equipment
CN109862097A (en) ID generation method and device
CN109299076A (en) Method, device and equipment for generating primary key of data acquisition point in redundant database
CN109213701A (en) Control method, system, equipment and the storage medium of the peripheral hardware of shared I O board
CN117349291A (en) Database primary key short ID generation method, electronic equipment and medium
CN111008095A (en) State snapshot generation and recovery method facing edge cloud
CN112622687B (en) Battery replacement control method and device for charging cabinet
CN113254271B (en) Data sequence recovery method, device, equipment and storage medium
CN108829709A (en) Distributed database management method, apparatus, storage medium and processor
CN108418857A (en) A kind of Zookeeper group systems and attaching method thereof and device
CN109327520B (en) Method and device for establishing connection between terminal and server node
CN110935168A (en) Distributed ID generation method, device and equipment for global uniform architecture

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190201