CN105589881A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN105589881A
CN105589881A CN201410573710.3A CN201410573710A CN105589881A CN 105589881 A CN105589881 A CN 105589881A CN 201410573710 A CN201410573710 A CN 201410573710A CN 105589881 A CN105589881 A CN 105589881A
Authority
CN
China
Prior art keywords
data
static
office data
static office
shared drive
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410573710.3A
Other languages
Chinese (zh)
Other versions
CN105589881B (en
Inventor
杨耀华
许哲
郝春美
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Software Technologies Co Ltd
Original Assignee
Datang Software Technologies 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 Datang Software Technologies Co Ltd filed Critical Datang Software Technologies Co Ltd
Priority to CN201410573710.3A priority Critical patent/CN105589881B/en
Publication of CN105589881A publication Critical patent/CN105589881A/en
Application granted granted Critical
Publication of CN105589881B publication Critical patent/CN105589881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention provides a data processing method and device. The data processing method comprises the following steps: obtaining static office data required by business from a physical database, loading the static office data into a shared memory, exporting the static office data loaded into the shared memory to a temporary file, and importing the static office data into a file database through the temporary file to carry out first backup; when the static office data required by business in the physical database is determined to be updated, copying the static office data in the shared memory into the file database to carry out second backup, and obtaining and loading the updated static office data into the shared memory; and exporting the updated static office data which is loaded into the shared memory to the temporary file, and importing the updated static office data into the file database through the temporary file to update the static office data backed up by the first backup. The data processing method and device not only can lower the burden of a physical library but also can shorten the response processing time of a business process.

Description

A kind of data processing method and device
Technical field
The present invention relates to communication technical field, particularly relate to a kind of data processing method and device.
Background technology
In telecommunication service system, there is a large amount of static office datas, as districts and cities' information, subscriber phone number are returnedPossession information, these static office datas provide Data support for the call charge service of telecommunication service system.
At present, static office data is all stored in physical library for example in oracle database. And at call charge serviceIn the same time may have the business process that need to inquire about in a large number this type of static office data information, every responseOne time business process just need to conduct interviews to database, and obviously responding these business process needs frequentlyAccessing database.
Visible, existing this static office data is stored in physical library, obtains by inquiry physical libraryThe scheme of the required data of service request, can cause a large amount of I/O operations, the behaviour of physical library to physical libraryMake burden heavy, and length consuming time is processed in the response of business process.
Summary of the invention
The invention provides a kind of data processing method and device, to solve the scheme of existing data processingThe burden weight of the physical library of middle existence, and the problem of length consuming time is processed in the response of business process.
In order to address the above problem, the invention discloses a kind of data processing method, comprising: from relationship typeIn database and/or document data bank, obtain the static office data of service needed; By the described static office obtainingData are loaded in shared drive, the more described static office data being loaded in described shared drive is derivedTo temporary file, by described temporary file, described static office data is imported and in document data bank, carries out theOne backup; When determining the static office number of the described service needed in relevant database and/or document data bankWhile renewal according to generation, the described static office data in described shared drive is copied in document data bankRow second backs up, and obtains the static office data after renewal, and the described static office data after upgrading is loadedTo described shared drive, to preserve the described static office data before upgrading in described shared drive simultaneouslyWith the described static office data after renewal; Static office after renewal described in described shared drive will be loaded onData export to described temporary file, by described temporary file, the static office data after described renewal are ledEnter and in described document data bank, upgrade the described first static office data backing up.
Preferably, described in obtain the static office data step after renewal, comprising: when from described relationship type numberAccording in storehouse, obtain after renewal static office data time, by for reading described relational data database dataHeader file searches in described relevant database the static office data after upgrading, by after the renewal findingStatic office data imports described temporary file; When the static office obtaining from described document data bank after renewalWhen data, by described document data bank internal database instrument, the static office data after upgrading is looked intoLook for, obtain the static office data after renewal.
Preferably, described by searching described pass for the header file that reads described relational data database dataBe the static office data step after upgrading in type database, comprise: by the OTL in described header fileMethod is located the relevant database that need to search, to search after renewal from described relevant databaseStatic office data.
Preferably, described the described static office data obtaining is loaded on to step in shared drive, comprises:Judge whether to exist the shared drive having created; If exist, described in directly articulating, created share inDeposit, load described static office data according to setting rule; If do not exist, create by Shmaget functionBuild shared drive, all static class objects in newly-built shared drive described in the function creation of call entry,Described static office data is loaded in the static class object of establishment.
Preferably, load described static office data step according to setting rule, comprising: judgement has articulatedWhether the free memory space in described shared drive enough loads described static office data; If not, toThe shared memory space that operating system application is new, new shared memory space described in the function creation of call entryAll static class objects, the ground in described shared drive, from the end address of the data that loadedLocation starts to load described static office data, uses the free time in the former shared memory space of described shared driveStatic class object and the new static class object creating, load described static office data; If so, straightConnect and articulate described shared drive, in described shared drive, from the end address of the data that loadedAddress starts to load described static office data, so that described static office data is loaded in described shared driveIdle static class object in.
Preferably, described by upgrade after described static office data be loaded on described shared drive in stepAfterwards, also comprise: judge whether to exist business process to connect; If exist, after setting-up time, strongSystem converts the versions of data ID of described business process to new versions of data ID, with by described renewalAfter the shared drive district at static office data place provide data for described business process connects, wherein, instituteState versions of data ID and shared memory field exists corresponding relation.
In order to address the above problem, the invention also discloses a kind of data processing equipment, comprising: first obtainsDelivery piece, for obtaining the static office number of service needed from relevant database and/or document data bankAccording to; The first load-on module, for the described static office data obtaining is loaded on to shared drive, then willThe described static office data being loaded in described shared drive exports to temporary file, by described interim literary compositionPart imports described static office data in document data bank and carries out the first backup; More new module, for working as reallyThe static office data of determining the described service needed in relevant database and/or document data bank upgradesTime, by the described static office data in described shared drive be copied in document data bank, carry out second standbyPart, and obtain the static office data after renewal, the described static office data after upgrading is loaded on described commonEnjoy in internal memory, to preserve in described shared drive after the described static office data and renewal before upgrading simultaneouslyDescribed static office data; Backup module, for being loaded on described in described shared drive after upgradingStatic office data exports to described temporary file, by described temporary file by the static office after described renewalDescribed in data importing, in document data bank, upgrade the described first static office data backing up.
Preferably, when described more new module is obtained the static office number after renewal from described relevant databaseAccording to time, by searching described relevant database for the header file that reads described relational data database dataStatic office data after middle renewal, imports described interim literary composition by the static office data after the renewal findingPart; In the time that described more new module is obtained the static office data after renewal from described document data bank, pass throughDescribed document data bank internal database instrument is searched the static office data after upgrading, and obtains renewalAfter static office data.
Preferably, described more new module is by the header file for reading described relational data database dataWhile searching in described relevant database the static office data after upgrading, by the OTL in described header fileMethod is located the relevant database that need to search, to search after renewal from described relevant databaseStatic office data.
Preferably, described the first load-on module comprises: judge module, creates for judging whether to existShared drive; The first Executive Module, in the judged result of described judge module when existing, straightConnect the shared drive having created described in articulating, load described static office data according to setting rule; Second holdsRow module, in the judged result of described judge module when not existing, create by Shmaget functionBuild shared drive, all static class objects in newly-built shared drive described in the function creation of call entry,Described static office data is loaded in the static class object of establishment; Data derive module, for loadingDescribed static office data to described shared drive exports to temporary file, will by described temporary fileDescribed static office data imports in document data bank and carries out the first backup.
Compared with prior art, the present invention has the following advantages:
Data processing scheme provided by the invention, by the static office data of service needed from relevant databaseAnd/or be loaded on shared drive in document data bank, and the static state that backup traffic needs in document data bankOffice data. In the time that the static office data of service needed occurs to upgrade, the static office data after upgrading is loadedTo shared drive, the static office data after upgrading is backed up in document data bank. Visible, logicalCross data processing scheme provided by the invention, on the one hand, by relevant database and/or document data bank beThe static office data of the service needed in physical library is loaded in shared drive, and business process can be from sharingIn internal memory, obtain needed static office data, without access physical library, only have and upgrade in shared driveWhen static office data, just need to access physical library, therefore, can reduce the input and output of physical library is I/ONumber of operations, the burden of reduction physical library. On the other hand, by data processing scheme provided by the invention,Because business process directly obtains data from shared drive, and access shared drive is compared access physical libraryThe needed time is short, therefore, can shorten the response processing time of business process. Another aspect,By data processing scheme provided by the invention, in document data bank to being loaded on quiet in shared driveStatic office data after state office data and renewal backs up, in order in the time that shared drive goes wrong,Provide shared drive needed data.
Brief description of the drawings
Fig. 1 is according to the flow chart of steps of a kind of data processing method of the embodiment of the present invention one;
Fig. 2 is according to the flow chart of steps of a kind of data processing method of the embodiment of the present invention two;
Fig. 3 is according to the structured flowchart of a kind of data processing equipment of the embodiment of the present invention three;
Fig. 4 is according to the Organization Chart of a kind of data handling system of the embodiment of the present invention four;
Fig. 5 is the steps flow chart that the data handling system described in employing Fig. 4 is carried out static office data renewalFigure.
Detailed description of the invention
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with accompanying drawingThe present invention is further detailed explanation with detailed description of the invention.
Embodiment mono-
With reference to Fig. 1, show according to the steps flow chart of a kind of data processing method of the embodiment of the present invention oneFigure.
The step of the data processing method of the present embodiment comprises:
Step S102: the static office that obtains service needed from relevant database and/or document data bankData.
Data processing method in the present embodiment for example, applicable to multiple business system: telecommunication service systemSystem, and static office data is to provide the data of business support. Taking telecommunication service as example, static office dataThe data that meet telecommunication service, for example: the number that fixed network national distance and local telephony service are requiredAccording to, cellular network telephone and required data and satellite communication and the satellite mobile communication service of data serviceRequired data etc.
In the time obtaining static office data, need to extract according to business demand, for example: operation system onlyFixed network national distance and local telephony service are provided, are obtaining the static office data of service needed soTime, only need to extract fixed network national distance and the required static office data of local telephony service.
It should be noted that, in the time of actual realization, can be only obtain service needed from relevant databaseStatic office data, also can only obtain the static office data of service needed from document data bank, can also be fromRelevant database obtains the static office data of part, from document data bank obtain service needed, not from closingIt is the static office data extracting in type database. Concrete extraction scheme can be according to needed static office numberAccording to memory location set. Relevant database and document data bank in the present embodiment are physicsStorehouse.
Step S104: the static office data obtaining is loaded in shared drive.
Step S106: the static office data being loaded in shared drive is exported to temporary file, by facingTime file will be static office data import in document data bank and carry out the first backup.
Step S108: when determining the static state of the service needed in relevant database and/or document data bankWhen office data occurs to upgrade, the static office data in shared drive is copied into and in document data bank, carries out theTwo backups.
The first backup of the static office data of service needed can be in same file data with the second backupUnder the different files in storehouse, can be stored in respectively in two document data banks. For example: the first backup is depositedStorage in the first document data bank, the second back-up storage in the second document data bank, the first file dataStorehouse and the second document data bank are different databases.
Wherein, the first backup of static office data, in the time that shared drive goes wrong, can be shared driveStatic office data is provided, and after the static office data after renewal is loaded in shared drive, after renewalStatic office data can cover the first backup, now in the time that shared drive goes wrong, in sharingThe static office data providing after renewal is provided. Static office data before upgrading is by the office's number loading after upgradingThe second backup according to the static office data of front backup provides, visible, and first to back up be to provide for shared driveStatic office data after renewal, the second backup is to provide the static office data before renewal for shared drive.
Step S110: obtain the static office data after renewal, the static office data after upgrading is loaded on altogetherEnjoy in internal memory, to preserve the static office after static office data and the renewal before upgrading in shared drive simultaneouslyData.
Static office data after renewal can only obtain from relevant database also can be only from number of filesAccording to obtaining in storehouse, can also from two databases, obtain respectively a part and form the static office number after upgradingAccording to. In shared drive, preserve the static office data after static office data and the renewal before upgrading simultaneously, wherein,The business process that static office data before renewal is accessed for static office data reproducting periods provides Data support,And static office data after upgrading provides data for the business that static office data has upgraded rear accessSupport, ensured the uniformity of same process visit data.
Step S112: export to temporary file by being loaded on the static office data after renewal in shared drive,Standby by upgrading the first backup institute in the static office data importing document data bank after upgrading by temporary fileThe static office data of part.
The data processing method providing by the present embodiment, by the static office data of service needed from physical libraryIn be loaded on shared drive, and in document data bank backup traffic need static office data. Work as businessWhen the static office data needing occurs to upgrade, the static office data after upgrading is loaded on after shared drive,Static office data after upgrading is backed up in document data bank. Visible, by provided by the inventionData processing method, on the one hand, by the static office data of the service needed in physical library be loaded on share inIn depositing, business process can obtain needed static office data from shared drive, without access physicsStorehouse, just need to access physical library while only having the static office data upgrading in shared drive, therefore, can subtractFew burden that thereby I/O number of physical library is reduced to physical library. On the other hand, by the invention providesData processing method, because business process directly obtains data from shared drive, and access share inDeposit compare access the needed time of physical library short, therefore, can shorten the response processing of business processTime. Another aspect, by data processing method provided by the invention, in document data bank to loadStatic office data to the static office data in shared drive and after upgrading backs up, in order to when sharingWhen internal memory goes wrong, provide shared drive needed data.
Embodiment bis-
With reference to Fig. 2, show the flow chart of steps of a kind of data processing method of the embodiment of the present invention two.
The concrete steps of the data processing method of the present embodiment comprise:
Step S202: office data manager obtains business from relevant database and/or document data bankThe static office data needing.
Office data manager is selected from which according to the memory location of the needed static office data of businessIn database, obtain static office data.
When authorities' data management system obtains office data from relevant database, can be directly from relationship type numberAccording to the static office data that obtains service needed in storehouse, can also be by for reading relational data database dataHeader file search relationship type data in the static office data of the service needed of storing, by the static state findingOffice data imports temporary file, then from temporary file, obtains the static office data of service needed. For example:Office data manager can adopt Otlv4.h header file, uses OTL mode to read in relevant databaseData. Certainly, office data manager can also read relevant database by other header fileIn data, those skilled in the art can arrange header file according to the actual requirements, the application does not do thisConcrete restriction.
When authorities' data management system obtains the static office data of service needed from document data bank, by literary compositionEvent data storehouse internal database instrument is searched the static office data of service needed, needs to obtain businessThe static office data of wanting.
Step S204: office data manager judges whether to exist the shared drive having created; If exist,Perform step S206; If do not exist, directly perform step S208.
Office data manager, getting after the static office data of service needed, will get static office dataBe loaded in shared drive, before loading, need to judge whether to exist the shared drive having created.
Step S206: when authorities' data management system judgement exists the shared drive having created, directly hangConnect the shared drive having created, load static office data according to setting rule, then perform step S210.
In this step, if office data manager is not to load static office data first in shared drive,There is the shared drive having created in explanation just, now, can be articulated and be created by Shmat methodShared drive. Certainly, can also articulate the shared drive having created, the application by additive methodThis is not done to concrete restriction.
In the time of actual realization, a kind of preferably as follows according to the method for setting the static office data of rule loading:
Office data manager judges whether the free memory space in the shared drive having articulated enough loadsStatic office data.
When judging free memory insufficient space when loading static office data, new to operating system applicationShared memory space, all static class objects of the shared memory space that call entry function creation is new(entrance function can be provided by the dynamic base in system, as, based on the software design approach of architectureDynamic base be the entrance function that ABSD dynamic base provides), the number in shared drive, from having loadedAccording to end address after address start to load static office data, use the former shared drive sky of shared driveBetween in idle static class object and the new static class object creating, load static office data. . For example:Before the static office data of storage, in shared memory space, there are 5 static class objects, and idle static stateClass object only has two, but these two idle static class objects cannot load whole static office numbersAccording to. Now, need to, to the new shared memory space of operating system application, be assumed to be new shared drive skyBetween created equally 5 static class objects, so, loading when static office data, to shared driveIn space, in original two static class objects and in the new static class object creating, load static data.
In the time judging free memory space and enough load static office data, directly articulate shared drive,Address in shared drive, from the end address of the data that loaded starts to load static office data,Static office data is loaded in the idle static class object in shared drive.
It should be noted that, office data manager in the time loading static office data, no in shared driveThe address being confined to after the end address of the data that loaded starts to load static office data, this area skillArt personnel can select to start the address of loading according to the actual requirements, for example: can select from one newly-builtStatic class object start to load static office data, the application does not do concrete restriction to this.
Step S208: when authorities' data management system judgement does not exist the shared drive having created, pass throughShmaget function creation shared drive, all quiet in the newly-built shared drive of call entry function creationState class object, is loaded on static office data in the static class object of establishment, then performs step S210.
Wherein, entrance function can be the entrance function that ABSD dynamic base provides.
Step S210: office data manager exports to and faces being loaded on static office data in shared driveTime file, by temporary file will be static office data import in document data bank and carry out the first backup.
Step S212: when determining the static state of the service needed in relevant database and/or document data bankWhen office data occurs to upgrade, the static office data in shared drive is copied into and in document data bank, carries out theTwo backups.
In this step, load the static office data upgrading in shared drive before, be by shared driveIn static office data back up. In the time that shared drive goes wrong, can be directly from backup fileObtain static office data.
Step S214: office data manager obtains renewal from relevant database and/or document data bankAfter static office data.
While realization actually, preferably, office data manager is when obtain renewal from relevant databaseAfter static office data time, by the header file search relationship type number for reading relational data database dataAccording to the static office data after upgrading in storehouse, the static office data after the renewal finding is imported to interim literary compositionPart. Office data manager can pass through Otlv4.h header file, uses OTL method location to searchRelevant database, to search the static office data after renewal from relevant database. Certainly, also canTo locate the relevant database that need to search by other header file, from relevant database, look intoLook for the static office data after renewal.
It should be noted that to there is the ability of the method for realizing for OTL method those skilled in the art,Therefore do not repeat them here concrete implementation method.
While realization actually, preferably, office data manager is when obtaining after renewal from document data bankStatic office data time, by document data bank internal database instrument to upgrade after static office data enterRow is searched, and obtains the static office data after renewal.
It should be noted that, office data manager can also not pass through temporary file, directly from relationship type numberAccording to the static office data obtaining in storehouse after renewal.
Step S216: office data manager judges whether the free memory space in shared drive enough addsCarry the static office data after upgrading; If so, perform step S218; If not, perform step S220.
Step S218: the free memory insufficient space in authorities' data management system shared drive is to load moreWhen static office data after new, to the new shared memory space of operating system application, load after renewalStatic office data, execution step S222.
Concrete, office data manager altogether after the new shared memory space of operating system application, call intoAll static class objects of the shared memory space that mouth function creation is new, wherein, entrance function can be by beingDynamic base in system provides, in shared drive, from the end address of the static office data that loadedAddress starts to load the static office data after upgrading, the sky in the former shared memory space of use shared driveNot busy static class object and the new static class object creating load the static office data after upgrading.
It should be noted that, office data manager can also directly be loaded on the static office data after upgradingIn the new static class object creating, and be not loaded in original static class object of shared drive.
Step S220: the free memory space in authorities' data management system shared drive enough loads renewalAfter static office data time, directly articulate shared drive, to load the static office data after renewal, holdRow step S222.
Concrete, load the static office data after upgrading in shared drive time, in shared drive, fromAddress after the end address of the static office data having loaded starts to load the static office data after upgrading, withStatic office data after upgrading is loaded in the idle static class object in shared drive.
It should be noted that the static office data of office data manager after loading in shared drive is upgradedTime, the address being not limited to after the end address of the static office data having loaded starts to load after renewalStatic office data, those skilled in the art can select to start the address loading, example according to the actual requirementsAs: can select to load the static office data upgrading, the application couple from a newly-built static class objectThis does not do concrete restriction.
Step S222: office data manager is led being loaded on the static office data after renewal in shared driveGo out to temporary file, by temporary file, the static office data after upgrading is imported in document data bank and upgradedThe first static office data backing up.
It should be noted that, in the present embodiment, the static office data after upgrading is imported in document data bank moreThe new first static office data backing up, and in the time of actual realization, can also be by the static office after newIn another document data bank of data importing, and the static office data the first backup not being backed up carries out moreNewly. Different or be, even the static office data after upgrading is imported in identical file database, but alsoDo not upgrade the static office data that the first backup is backed up.
Step S224: office data manager judges whether to exist business process to connect; If exist, holdRow step S226; If do not exist, carry out setting program.
Wherein, when business process is connected to user's access service system, the access that operation system is user is builtVertical process connects. Wherein, business process connection comprises: versions of data ID. In shared drive, storeAlso there is dividing of version the memory field of static office data, and versions of data ID and shared memory field exist corresponding passSystem, the corresponding legacy data ID in shared drive district of the static office data before storage update, storage updateAfter the shared drive district corresponding redaction data ID of static office data.
Wherein, setting program is that latency services process connects, and in the time having business process to connect, directly adoptsThe shared drive district of the static office data after renewal provides Data support for business process connects.
Step S226: when authorities' data management system judgement exists business process to connect, after setting-up time,Force to convert business process versions of data ID to new versions of data ID, to pass through the static state after renewalThe shared drive district at office data place provides data for business process connects. In reality realizes, settingTime can be set according to the actual requirements by those skilled in the art, for example: can set renewal forAfter static office data be updated in shared drive 10 seconds and force afterwards to switch, can also set 15 forSecond, 20 seconds etc., the application does not do concrete restriction to this.
In shared drive, store the shared drive district pair of the static office data before upgrading and after upgradingAnswer different versions of data, same business process also has versions of data ID, that is to say so industryThe data that business process is obtained need to go to obtain in corresponding shared drive district according to versions of data ID, withEnsure the uniformity of the versions of data of same business process acquisition request.
And in the time that force handoff provides the shared drive district of data for business process, by business process data versionThis ID converts new versions of data ID to, and program just can be by by new versions of data ID couple like thisShared drive district corresponding to static office data that should be new, with being total to of the static office data place by after upgradingEnjoy memory field and provide data, the force handoff of finishing service process for business process connects.
After the shared drive district at the static office data place after business process switches to renewal, in sharingThe shared drive district that deposits middle static office data place is released, and makes for static office data renewal next timeWith.
The data processing method providing by the present embodiment, on the one hand, by the service needed in physical libraryStatic office data is loaded in shared drive, and business process can obtain needed quiet from shared driveState office data, without access physical library, just needs while only having the static office data upgrading in shared drive to visitAsk physical library, therefore, thereby can reduce the burden that I/O number of physical library is reduced to physical library. SeparatelyOn the one hand, by data processing method provided by the invention, because business process is directly from shared driveObtain data, and access shared drive compare access the needed time of physical library short, therefore, canShorten the response processing time of business process. Another aspect, by data processing method provided by the invention,In document data bank to be loaded on static office data in shared drive and upgrade after static office numberAccording to backing up, in order in the time that shared drive goes wrong, provide shared drive needed data. AgainOn the one hand, the data processing method providing by the present embodiment, in the time carrying out the switching of shared drive district, whenAfter waiting for a period of time while there is business process, standby service process is switched after without request of data again, protectsDemonstrate,prove the uniformity of same process visit data, realized in not affecting real time business processing and having supportedThe static state of service needed dynamically updates according to data.
Embodiment tri-
With reference to Fig. 3, show the structured flowchart of a kind of data processing equipment of the embodiment of the present invention three.
The data processing equipment of the present embodiment comprises: the first acquisition module 302, and for from relational dataIn storehouse and/or document data bank, obtain the static office data of service needed; The first load-on module 304, forThe static office data obtaining is loaded in shared drive, then by the static office number being loaded in shared driveAccording to exporting to temporary file, by temporary file, static office data is imported in document data bank and carries out firstBackup; More new module 306, for needing when the business of determining relevant database and/or document data bankWhen the static office data of wanting occurs to upgrade, the static office data in shared drive is copied into document data bankIn carry out the second backup, and obtain the static office data after renewal, the static office data after upgrading is loadedTo shared drive, with in shared drive simultaneously preserve upgrade before static office data and upgrade after quietState office data; Backup module 308, for leading the static office data being loaded on after shared drive upgradesGo out to temporary file, by temporary file, the static office data after upgrading is imported in document data bank and upgradedThe first static office data backing up.
Preferably, in the time that more new module 306 is obtained the static office data after renewal from relevant database,Quiet after header file search relationship type database by for reading relational data database data upgradesState office data, imports temporary file by the static office data after the renewal finding; When new module 306 moreObtain the static office data after renewal from document data bank time, by document data bank internal database workTool is searched the static office data after upgrading, and obtains the static office data after renewal.
Preferably, more new module 306 by searching for the header file that reads relational data database dataWhen static office data after upgrading in relevant database, the OTL method location by header file needsThe relevant database of searching, to search the static office data after renewal from relevant database.
On the basis of the data processing equipment providing at the present embodiment, can also carry out further this deviceOptimization, obtain more preferred data processing equipment, concrete optimal way is as follows:
Preferably, the first load-on module 304 comprises: judge module 3042, has existed for judging whetherThe shared drive creating; The first Executive Module 3044, in the judged result of judge module when existing,Directly articulate the shared drive having created, load static office data according to setting rule; The second Executive Module3046, in the judged result of judge module when not existing, share by Shmaget function creationInternal memory, all static class objects in the newly-built shared drive of call entry function creation, by static state office numberAccording to being loaded in the static class object of establishment; Data derive module 3048, for being loaded on shared driveIn static office data export to temporary file, by temporary file, static office data is imported to file dataIn storehouse, carry out the first backup.
Preferably, the first Executive Module 3044 comprises: memory headroom judge module 30442, and for judgementWhether the free memory space in the shared drive having articulated enough loads described static office data; New modelingPiece 30444, when being no in the judged result of memory headroom judge module 30442, to operating systemApply for new shared memory space, all static class of the shared memory space that call entry function creation is newObject, the address in shared drive, from the end address of the data that loaded starts to load static officeData, the idle static class object in the former shared memory space of use shared drive and new establishmentStatic class object, loads static office data; The direct knock-down module 30446 of internal memory, at memory headroomThe judged result of judge module 30442 when being, directly articulates shared drive, in shared drive, fromAddress after the end address of the data that loaded starts to load static office data, so that static office data is addedBe loaded onto in the idle static class object in shared drive.
Preferably, the data processing equipment in the present embodiment also comprises: process connection judgment module 310,For the static office data after upgrading being loaded on after shared drive in new module more, judge whether to existBusiness process connects; The first process switching module 312, for sentencing in process connection judgment module 310Disconnected result is when existing, and after setting-up time, pressure converts the versions of data ID of business process newly toVersions of data ID, taking the shared drive district at static office data place by after upgrading as business processConnect data are provided; Wherein, there is corresponding relation in versions of data ID and shared memory field.
The data processing equipment of the present embodiment is used for realizing the corresponding equipment of aforementioned multiple embodiment of the methodCross-version upgrade method, and there is the beneficial effect that corresponding method is implemented, do not repeat them here.
Embodiment tetra-
The data of the data processing equipment described in a kind of embodiment of comprising tri-are introduced in the present embodimentTreatment system, and this data handling system is carried out the idiographic flow of data processing.
As shown in Figure 4, the data handling system in the present embodiment comprises: Database database 402Relevant database is used for storing static office data, Sqlite disk file 404 be document data bank forStore static office data, office data manager 406 is that data processing equipment, shared drive 408 are for addingCarry static office data, Sqlite backup disk file 410 and business process 412.
Data handling system in Fig. 4 has two large basic functions: the static office data of service needed is loadedThe function dynamically updating to the function of shared drive and to static office data.
In the present embodiment, data handling system is loaded on the static office data of service needed in shared driveTime, office data manager is called for short DB database and Sqlite disk file and extracts industry from DatabaseThe static office data that business needs, is loaded on the static office data extracting in shared drive. Meanwhile, also willThe static office data obtaining is stored to Sqlite disk file and backs up, and completes quiet by service neededState office data is loaded on shared drive. In the time having business process to obtain data, directly from shared driveIn obtain data.
What foregoing was described is only the mistake that the static office data of service needed is loaded on to shared driveJourney, and because the static office data of service needed can upgrade, therefore also needs in shared driveStatic office data upgrades. As shown in Figure 4, in the time carrying out Data Update, office data manager needsFrom shared drive, extract the static office data having loaded, then static office data is backed up to Sqlite standbyPart disk file, and the loading of concrete static office data and dynamically update flow process and carry out with reference to Fig. 5Describe.
In the time of specific implementation, the loading of static office data and dynamically updating is all carried out by program,But, no matter be the loading of static office data or the renewal of static office data, all need to be from DB dataIn storehouse and Sqlite disk file, obtain static office data, when import static office from Sqlite disk fileWhen data, need to use Sqlite internal database instrument, concrete querying method is as follows:
CBSSqliteStmtstmtSelect;
if(stmtSelect.open(this->m_strSelectSqlite.c_str(),connSqlite)!=SQLITE_OK), wherein, m_strSelectSqlite is stsndard SQL query statement.
When import office data from DB database time, need to quote Otlv4.h header file, use OTLMode reading out data, concrete grammar is as follows:
otl_stream
otlSelect(OTL_READ_BUFFER_SIZE,m_strSelectSqlDB.c_str(),con)。
When get the static office data of the service needed that need to be loaded in shared drive by said methodTime, need the static office data getting to be loaded on shared drive. And if program is to move first,That is to say and do not have the shared drive having created, so now, need to use Shmget methodDo the establishment of shared drive, concrete grammar is: shmid=shmget (this-> base_shm_key,rounded_bytes+shm_table_offset,this->file_perms|IPC_CREAT|IPC_EXCL)。
If program is not to move first, be also that shared drive exists, before program only need articulateThe shared drive that office data memory management creates, is also the shared drive keyid configuring in configuration file,Need to use Shmat method shared drive to articulate, concrete grammar is: this-> base_addr=shmat(shmid,reinterpret_cast<char*>(this->base_addr),0)。
Program is creating or articulating after shared drive the ground of the static office data loading in shared driveBehind location, add the static office data obtaining, if shared memory space is inadequate, program can be to operating system ShenShared memory space that please be new. The entrance function that ABSD dynamic base provides is called in office data memory management meetingReg_data_fun creates static class objects all in shared drive, to load the static office number obtainingAccording to. Wherein, the provide access method of function of routine call ABSD dynamic base is as follows:
pStaticDataFunc=(STATIC_DATA_FUNC)dlsym(libinfo.lib_handle,
itr->second.lib_enterfunc.c_str());
Wherein, pStaticDataFunc is function pointer, in the method by determining by Dlsym methodPosition is to the entrance function of dynamic base, and wherein, Dlsym method is according to dynamic link library operation handle and symbolThe method of number address that return character is corresponding.
It should be noted that, shared drive piece number is unified is at present maximum 30, and every block size is 32M,In the time of actual realization, apply for shared memory space actual be application shared drive piece. When data are less with meetingThe piece number of actual needs is applied for, can not waste the shared drive of system. Note also that program ShenFirst shared drive piece is please controll block, is not counted in 30 shared drive pieces of restriction.
After in static office data is loaded on to shared drive, in the time that static office data occurs to upgrade, programCan call successively following methods:
CEventProc:load_Data2Shm(CMD_REQUEST_DATA&cmd_data)
Be that step S502:Dump backs up the static office data in original shared drive.
In this step, in the time having static office data requirement to be loaded in shared drive, first do current sharedStatic office data in internal memory backs up to obtain the static state of current all static office datas in shared driveClass. Wherein, Dump backup is in particular moment, by certain part of whole storage device or storage deviceContent record in another storage device, that is to say, back up in shared drive and store in this stepThere are all static class of static office data, the static office data of being stored to back up in shared drive.
In the present embodiment, the office data of storing in shared drive is old static office data A and old static officeData B. So, at the old static office data A+B file that backs up to disk of when backup, standby accordinglyThe disk file of part can be Sqlite backup disk file, certainly, and can also be by old static state in the time of backupOffice data A+B backs up to Sqlite disk file, in the application, selects standby old static office data A+BPart is exclusively used in the Sqlite disk file of the old office data of backup to another, i.e. Sqlite backup disk literary compositionPart.
It should be noted that, in the present embodiment owing to being need to be from DB database and Sqlite disk literary compositionIn part, obtain the static office data after renewal, quiet after the renewal that therefore need to read from DB databaseState data A reads the static data B after renewal from Sqlite disk file.
ret=down_shm_to_file(cont_addr_map,tmp_load_bak_pathfile)
Be step S504: load the static office data A after the renewal of reading from DB database, first addBeing downloaded to temporary disc file is in Temp disk file.
Aret=load_db_to_file(cmd_db2mem,tmp_work_pathfile)
Be step S506: in the static office data A after the renewal that temporary file is read is loaded into and sharesDeposit.
ret=load_file_to_shm(cmd_file2mem,0,from_file_cont_addr_map)
Be step S508: the static office data B coming from after the renewal of Sqlite disk file is loaded onShared drive.
It should be noted that, step S506 and step S508 can carry out simultaneously, can also first executeAfter step S508, perform step again S506.
ret=load_file_to_shm(cmd_file2mem,0,from_file_cont_addr_map)
It is step S510: the static office number after the static office data of the latest edition of shared drive is upgradedBe saved to temporary disc file according to A+B.
ret=down_shm_to_file(from_file_cont_addr_map,tmp_work_pathfile)
So far, completed the renewal operation of static office data.
Step S512: by the office data A+B after the renewal in temporary disc file at Sqlite disk literary compositionIn part, back up.
ret=update_shm_stc_version()
rename_file(tmp_load_bak_pathfile,load_bak_pathfile)
Finally, the disk file of backup, disk Temp file and Sqlite disk file are just changed intoFormula file. In the time that shared drive goes wrong, can provide shared drive old static office data A+B, andStatic office data A+B after renewal, obtains office data and do not affect business process.
In the present embodiment, program is after the static office data A+B being written into after renewal, if there is business processConnect, force handoff after loading successfully 10 seconds, then discharges old static office data A+B sharedShared memory space, provide next Data Update to use, but shared memory space after discharging can'tGive back operating system. So far, the static office data after renewal is from DB database and Sqlite magneticIn dish file, be loaded on shared drive, the static office data after all renewals has been saved to Sqlite simultaneouslyIn disk file.
Adopt the method for utilizing the static office data of shared drive store electricity communication service of the present embodiment design, the utmost pointLarge lifting business place in the time of new data more, can start again from pass from the free time of current shared internal memoryBe that type data base management system is that RDBMS is written into static office data, if the memory block of having applied for is inadequateWith, can apply for again new shared drive piece from operating system, but the maximum piece number of the shared drive that can apply forRestricted, if reached maximum constraints in other words operating system do not had free memory can for application,Can produce CORE.
What provide by the present embodiment utilizes shared drive store electricity communication service required static office dataMethod, is loaded on the static office data of service needed in shared drive, realizes concentrating of static office dataDeposit, for business process for example: the processes such as business diagnosis, wholesale price provide static office data. Business processCan directly from shared drive, obtain data, when having promoted greatly the speed of Business Processing, subtractLack the I/O expense to physical database. Meanwhile, the data handling system that the present embodiment provides, supportsSelf-timing loads and upgrades office data, in the time upgrading office data, by the static office data in physical databaseImport to Sqlite disk file, whole process is atomic transaction, also can carry out version control to data simultaneouslySystem, carries out registration management to process, ensures the uniformity of same process visit data. Visible the present embodimentThe data handling system providing is supported the dynamic of static office data in not affecting real time business processingUpgrade.
Each embodiment in this description all adopts the mode of going forward one by one to describe, and each embodiment stressesBe all and the difference of other embodiment, between each embodiment identical similar part mutually referring to. For device embodiment, because it is substantially similar to embodiment of the method, so the ratio of describingSimpler, relevant part is referring to the part explanation of embodiment of the method.
Above data processing method provided by the present invention and device are described in detail, herein shouldWith specific case principle of the present invention and embodiment are set forth, the explanation of above embodiment is onlyFor helping to understand method of the present invention and core concept thereof; Meanwhile, for the general technology of this areaPersonnel, according to thought of the present invention, all will change in specific embodiments and applications,In sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. a data processing method, is characterized in that, comprising:
From relevant database and/or document data bank, obtain the static office data of service needed;
The described static office data obtaining is loaded in shared drive, then will be loaded on described shared driveIn described static office data export to temporary file, by described temporary file by described static office dataImport in document data bank and carry out the first backup;
When determining the static office data of the described service needed in relevant database and/or document data bankWhile occurring to upgrade, the described static office data in described shared drive is copied in document data bank and is carried outThe second backup, and obtain the static office data after renewal, the described static office data after upgrading is loaded onIn described shared drive, with in described shared drive simultaneously preserve upgrade before described static office data andDescribed static office data after renewal;
Export to described interim literary composition by being loaded on the static office data after renewal described in described shared drivePart, imports the static office data after described renewal in described document data bank more by described temporary fileNew the described first static office data backing up.
2. method according to claim 1, is characterized in that, described in obtain the static state after renewalOffice data step, comprising:
When obtain the static office data after renewal from described relevant database time, by for readingState the header file of relational data database data and search the static office number after renewal in described relevant databaseAccording to, the static office data after the renewal finding is imported to described temporary file;
When obtain the static office data after renewal from described document data bank time, by described file dataStorehouse internal database instrument is searched the static office data after upgrading, and obtains the static office number after renewalAccording to.
3. method according to claim 2, is characterized in that, described by for described in readingThe header file of relational data database data is searched the static office data after renewal in described relevant databaseStep, comprising:
Locate the relevant database that need to search by the OTL method in described header file, with from instituteState and in relevant database, search the static office data after renewal.
4. method according to claim 1, is characterized in that, described by the described static state of obtainingOffice data is loaded on step in shared drive, comprising:
Judge whether to exist the shared drive having created;
If exist, the shared drive having created described in directly articulating, loads described quiet according to setting ruleState office data;
If do not exist, by Shmaget function creation shared drive, described in the function creation of call entryAll static class object in newly-built shared drive, is loaded on described static office data the static state of establishmentIn class object.
5. method according to claim 4, is characterized in that, described in loading according to setting ruleStatic office data step, comprising:
Whether the free memory space in the described shared drive that judgement has articulated enough loads described static stateOffice data;
If not, to the new shared memory space of operating system application, new described in the function creation of call entryAll static class objects of shared memory space, in described shared drive, from the data that loadedAddress after end address starts to load described static office data, uses in former the sharing of described shared driveDeposit idle static class object and the new static class object creating in space, load described static office numberAccording to;
If so, directly articulate described shared drive, the data in described shared drive, from having loadedEnd address after address start to load described static office data, so that described static office data is loaded onIn idle static class object in described shared drive.
6. method according to claim 1, is characterized in that, described by upgrade after described inStatic office data is loaded in described shared drive after step, also comprises:
Judge whether to exist business process to connect;
If exist,, after setting-up time, force the versions of data ID of described business process to convert toNew versions of data ID, with the shared drive district at the static office data place by after described renewal for instituteState business process connection data are provided, wherein, described versions of data ID exists corresponding with shared memory fieldRelation.
7. a data processing equipment, is characterized in that, comprising:
The first acquisition module, for obtaining service needed from relevant database and/or document data bankStatic office data;
The first load-on module, for the described static office data obtaining is loaded on to shared drive, then willThe described static office data being loaded in described shared drive exports to temporary file, by described interim literary compositionPart imports described static office data in document data bank and carries out the first backup;
More new module, for needing when the described business of determining relevant database and/or document data bankWhen the static office data of wanting occurs to upgrade, the described static office data in described shared drive is copied into literary compositionIn event data storehouse, carry out the second backup, and obtain the static office data after renewal, by upgrade after described quietState office data is loaded in described shared drive, to preserve the institute before upgrading in described shared drive simultaneouslyState the described static office data after static office data and renewal;
Backup module, for deriving being loaded on the static office data after renewal described in described shared driveTo described temporary file, by described temporary file, the static office data after described renewal is imported to described literary compositionIn event data storehouse, upgrade the described first static office data backing up.
8. device according to claim 7, is characterized in that:
In the time that described more new module is obtained the static office data after renewal from described relevant database, logicalCrossing header file for reading described relational data database data searches described relevant database and upgradesAfter static office data, the static office data after the renewal finding is imported to described temporary file;
In the time that described more new module is obtained the static office data after renewal from described document data bank, pass throughDescribed document data bank internal database instrument is searched the static office data after upgrading, and obtains renewalAfter static office data.
9. device according to claim 8, is characterized in that, described more new module is being passed through useSearch in described relevant database after upgrading in the header file that reads described relational data database dataWhen static office data, locate the relational data that need to search by the OTL method in described header fileStorehouse, to search the static office data after renewal from described relevant database.
10. device according to claim 7, is characterized in that, described the first load-on module comprises:
Judge module, for judging whether to exist the shared drive having created;
The first Executive Module, in the judged result of described judge module when existing, directly articulate instituteState the shared drive having created, load described static office data according to setting rule;
The second Executive Module, in the judged result of described judge module when not existing, pass throughShmaget function creation shared drive, all in newly-built shared drive described in the function creation of call entryStatic class object, described static office data is loaded in the static class object of establishment;
Data derive module, for the described static office data that is loaded on described shared drive is exported toTemporary file, is imported described static office data in document data bank and carries out first by described temporary fileBackup.
CN201410573710.3A 2014-10-23 2014-10-23 Data processing method and device Active CN105589881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410573710.3A CN105589881B (en) 2014-10-23 2014-10-23 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410573710.3A CN105589881B (en) 2014-10-23 2014-10-23 Data processing method and device

Publications (2)

Publication Number Publication Date
CN105589881A true CN105589881A (en) 2016-05-18
CN105589881B CN105589881B (en) 2020-01-24

Family

ID=55929467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410573710.3A Active CN105589881B (en) 2014-10-23 2014-10-23 Data processing method and device

Country Status (1)

Country Link
CN (1) CN105589881B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107465944A (en) * 2017-08-31 2017-12-12 江苏省公用信息有限公司 The gray scale delivery system and method for a kind of IPTV Content Management
CN108038171A (en) * 2017-12-07 2018-05-15 杭州电魂网络科技股份有限公司 Method for writing data, device and data server
CN108304461A (en) * 2017-12-26 2018-07-20 山东浪潮通软信息科技有限公司 A kind of method and device of data sharing
CN108958732A (en) * 2018-06-28 2018-12-07 上海恺英网络科技有限公司 A kind of data load method and equipment based on PHP
CN109756704A (en) * 2018-11-30 2019-05-14 安徽清新互联信息科技有限公司 A kind of inter-process communication methods and system of inserted audio-video monitoring system
CN110795508A (en) * 2019-11-04 2020-02-14 中国建设银行股份有限公司 Data copying method, device, equipment and storage medium
CN111200692A (en) * 2019-12-24 2020-05-26 广州市高科通信技术股份有限公司 Voice equipment, processing method, device and storage medium for network telephone
CN112256457A (en) * 2020-11-06 2021-01-22 开普云信息科技股份有限公司 Data loading acceleration method and device based on shared memory, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6941295B2 (en) * 1999-08-12 2005-09-06 International Business Machines Corporation Data access system
CN101126920A (en) * 2007-09-30 2008-02-20 浙江中控技术有限公司 Method and device implementing on-line upgrading of a fixed programme
CN101754156A (en) * 2008-12-05 2010-06-23 中国移动通信集团辽宁有限公司 Office data management method, device and charging system
CN101853288A (en) * 2010-05-19 2010-10-06 马晓普 Configurable full-text retrieval service system based on document real-time monitoring

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6941295B2 (en) * 1999-08-12 2005-09-06 International Business Machines Corporation Data access system
CN101126920A (en) * 2007-09-30 2008-02-20 浙江中控技术有限公司 Method and device implementing on-line upgrading of a fixed programme
CN101754156A (en) * 2008-12-05 2010-06-23 中国移动通信集团辽宁有限公司 Office data management method, device and charging system
CN101853288A (en) * 2010-05-19 2010-10-06 马晓普 Configurable full-text retrieval service system based on document real-time monitoring

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107465944A (en) * 2017-08-31 2017-12-12 江苏省公用信息有限公司 The gray scale delivery system and method for a kind of IPTV Content Management
CN108038171A (en) * 2017-12-07 2018-05-15 杭州电魂网络科技股份有限公司 Method for writing data, device and data server
CN108038171B (en) * 2017-12-07 2020-07-03 杭州电魂网络科技股份有限公司 Data writing method and device and data server
CN108304461A (en) * 2017-12-26 2018-07-20 山东浪潮通软信息科技有限公司 A kind of method and device of data sharing
CN108958732A (en) * 2018-06-28 2018-12-07 上海恺英网络科技有限公司 A kind of data load method and equipment based on PHP
CN109756704A (en) * 2018-11-30 2019-05-14 安徽清新互联信息科技有限公司 A kind of inter-process communication methods and system of inserted audio-video monitoring system
CN110795508A (en) * 2019-11-04 2020-02-14 中国建设银行股份有限公司 Data copying method, device, equipment and storage medium
CN111200692A (en) * 2019-12-24 2020-05-26 广州市高科通信技术股份有限公司 Voice equipment, processing method, device and storage medium for network telephone
CN111200692B (en) * 2019-12-24 2021-10-26 广州市高科通信技术股份有限公司 Voice equipment, processing method, device and storage medium for network telephone
CN112256457A (en) * 2020-11-06 2021-01-22 开普云信息科技股份有限公司 Data loading acceleration method and device based on shared memory, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN105589881B (en) 2020-01-24

Similar Documents

Publication Publication Date Title
CN105589881A (en) Data processing method and device
CN102542071B (en) Distributed data processing system and method
CN101876983B (en) Method for partitioning database and system thereof
CN104021145B (en) The method and apparatus that a kind of mixed service concurrently accesses
CN101986649B (en) Shared data center used in telecommunication industry billing system
CN109034988B (en) Accounting entry generation method and device
CN105488050B (en) A kind of more indexing means of database, apparatus and system
EP1696346A1 (en) File system represented inside a database
CN1848849B (en) Method and device for replicating modifications of a directory
CN107391629A (en) Data migration method, system, server and computer-readable storage medium between cluster
CN111881223B (en) Data management method, device, system and storage medium
CN104239377A (en) Platform-crossing data retrieval method and device
CN101765831A (en) Database contradiction solution method
CN108959538B (en) Full text retrieval system and method
US9304996B2 (en) Dynamic data access and storage
CN104050276A (en) Cache processing method and system of distributed database
CN101937474A (en) Mass data query method and device
CN108874903A (en) Method for reading data, device, computer equipment and computer readable storage medium
CN105164673A (en) Query integration across databases and file systems
CN103853714A (en) Data processing method and device
CN102156717A (en) Method and device for mapping entity object into database
CN1987864A (en) Method and system for access data base
CN104615637A (en) Data exchange method and data exchange intermediate device
US11106394B2 (en) Storing an entity as an object or a file in a hybrid storage system based on an accessing protocol
CN114357046A (en) Access method, device, system, server and storage medium of memory database

Legal Events

Date Code Title Description
C06 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