CN105354149A - Memory data search method and apparatus - Google Patents

Memory data search method and apparatus Download PDF

Info

Publication number
CN105354149A
CN105354149A CN201510844228.3A CN201510844228A CN105354149A CN 105354149 A CN105354149 A CN 105354149A CN 201510844228 A CN201510844228 A CN 201510844228A CN 105354149 A CN105354149 A CN 105354149A
Authority
CN
China
Prior art keywords
information table
field
record
source information
market
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
CN201510844228.3A
Other languages
Chinese (zh)
Other versions
CN105354149B (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.)
Jin Zheng Science And Technology Co Ltd Of Shenzhen
Original Assignee
Jin Zheng Science And Technology Co Ltd Of Shenzhen
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 Jin Zheng Science And Technology Co Ltd Of Shenzhen filed Critical Jin Zheng Science And Technology Co Ltd Of Shenzhen
Priority to CN201510844228.3A priority Critical patent/CN105354149B/en
Publication of CN105354149A publication Critical patent/CN105354149A/en
Application granted granted Critical
Publication of CN105354149B publication Critical patent/CN105354149B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a memory data search method. The method comprises the steps of adding an associated field in a source information table of the memory data, and storing associated information between the source information table and a target information table in the associated field; and searching the corresponding record of the target information table from the record in the source information table according to the associated field when the corresponding record in the target information table is searched from the record in the source information table. Compared with a one-by-one verification mode for the record in the target information table, the memory data search method provided by the invention has the search efficiency of the record greatly improved.

Description

A kind of internal storage data lookup method and device
Technical field
The invention belongs to data processing field, particularly relate to a kind of internal storage data lookup method and device.
Background technology
Constantly bring forth new ideas along with China's Securities industry and develop, business unfolding model and trading strategies increasingly sophisticated, the transaction of the high frequency of Foreign Epidemic and strategyization are concluded the business and are also started to rise at home and scale day by day expands.High frequency transaction and the treatment effeciency of strategyization transaction investor to securities broker company's order processing system propose requirements at the higher level, and existing transaction system is difficult to meet this requirement.Therefore, market needs urgently a very fast order executing system, if still adopt original physical database to be obviously the requirement that cannot reach such high level as backstage storage system.Because the response of physical database be all Millisecond other.So memory database just arises at the historic moment.
Memory database system in the market, often needs to find it showing be associated 1 in B record or many records from the record of Table A in use.Traditional way is all record positions first navigating to table B, the record then one by one in traversal list B, and whether verification meets and incidence relation with Table A, and this mode of searching comparatively bothers, and search efficiency is low.
Summary of the invention
The object of the present invention is to provide a kind of lookup method of internal storage data, with solve prior art carry out internal storage data search time, search and comparatively bother, the problem that search efficiency is low.
First aspect, embodiments provides a kind of lookup method of internal storage data, and described method comprises:
In the source information table of internal storage data, increase associate field, in described associate field, store the related information of source information table and target information table;
When record corresponding from the record search target information table in source information table, search the record in the target information table corresponding to the record in source information table according to described associate field.
In conjunction with first aspect, in the first possibility implementation of first aspect, described source information table is market information table, and described target information table is securities information table, and the described related information step storing source information table and target information table in described associate field comprises:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field.
In conjunction with first aspect, in the second possibility implementation of first aspect, described source information table is information table of holding position, and described target information is securities information table, and the described related information step storing source information table and target information table in described associate field comprises:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field, stock code field.
In conjunction with first aspect, in the third possibility implementation of first aspect, described method also comprises:
Whether the record in monitoring source information table changes;
When the record in source information table changes, according to the type of source information table, select corresponding field contents, upgrade described associate field.
In conjunction with in the third possibility implementation of first aspect, in the 4th kind of possibility implementation of first aspect, the described type according to source information table, select corresponding field contents, upgrade described associate field step and comprise:
When described source information table is market information table, selects the content of the market code field in market information table, upgrade the pointer in described associate field;
When described source information table for hold position information table time, the content of select to hold position market code field in information table, stock code field, upgrades the pointer in described associate field.
Second aspect, what embodiments provide a kind of internal storage data searches device, and described device comprises:
Associate field increases unit, for increasing associate field in the source information table of internal storage data, stores the related information of source information table and target information table in described associate field;
Record search unit, for when record corresponding from the record search target information table in source information table, searches the record in the target information table corresponding to the record in source information table according to described associate field.
In conjunction with second aspect, may in implementation in the first of second aspect, described source information table is market information table, and described target information table is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field.
In conjunction with second aspect, may in implementation at the second of second aspect, described source information table is information table of holding position, and described target information is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field, stock code field.
In conjunction with second aspect, in the third possibility implementation of second aspect, described device also comprises:
Whether record monitoring means, change for the record of monitoring in source information table;
Updating block, for when the record in source information table changes, according to the type of source information table, selects corresponding field contents, upgrades described associate field.
In conjunction with in the third possibility implementation of second aspect, in the 4th kind of possibility implementation of second aspect, described updating block comprises:
First upgrades subelement, for when described source information table is market information table, selects the content of the market code field in market information table, upgrades the pointer in described associate field;
Second upgrades subelement, for when described source information table for hold position information table time, selection is held position the content of market code field in information table, stock code field, upgrades the pointer in described associate field.
In the present invention, by increasing associate field in the source information table of internal storage data, the related information of source information table and target information table is stored in associate field, when searching the record in target information table according to source information table, field corresponding in target information table can be searched fast and effectively according to described associate field, the mode verified one by one with the record in target information table is compared, and improves the search efficiency of record greatly.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the internal storage data lookup method that first embodiment of the invention provides;
Fig. 2 is the realization flow figure of the lookup method of the internal storage data that second embodiment of the invention provides;
Fig. 3 is the structural representation searching device of the internal storage data that third embodiment of the invention provides.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The fundamental purpose of the embodiment of the present invention is the lookup method providing a kind of internal storage data, with make the present invention can solve internal storage data of the prior art search time, such as often need from the record of Table A in the upper layer application of Database Systems, him is found to show the one or more of records be associated in B, and traditional mode is, in table B, carry out the verification of recording one by one, this mode search efficiency is extremely low, affects the response speed of database.
In addition, although memory database in the market has a lot, the commercial timesten having oracle, the SolidDB of IBM, eXtremeDB etc., because it is expensive, add transaction system and build cost; Secondly, the memory database on market is as third party's assembly, and when a failure occurs, the technical service response of commercial memory database is very slow, obviously can not accept for securities exchange system; In addition, after prism door event, country to a strategic height, encourages government bodies to elevated information security, and the infrastructure service industry such as bank uses the software and hardware of local brands, and the memory database of these commercializations to be all external businessman belong to has.Therefore us are needed oneself on existing memory database basis, to improve data response speed further.Specifically be described below in conjunction with accompanying drawing.
Embodiment one:
Fig. 1 shows the realization flow of the lookup method of the internal storage data that first embodiment of the invention provides, and details are as follows:
In step S101, in the source information table of internal storage data, increase associate field, in described associate field, store the related information of source information table and target information table.
Concrete, the internal storage data described in the embodiment of the present invention, referring to the data based on carrying out in memory database reading and writing, described memory database, referring to database data being placed on direct control in internal memory.Internal memory is instructed relative to data in magnetic disk, and the reading and writing data speed of internal memory will exceed several order of magnitude, saves the data in internal memory the performance compared and greatly can improve application from disk access.
Described source information table, refers to that when carrying out record search, the form at the source record place of searching, such as needs, from the record a form A, to search the target record corresponding with recording a, so the table at source record a place, being source information table in form B.Accordingly, the table at target record place, is target information table.
Described associate field, namely the field for the record in source information table is associated with the record in target information table, different according to the type of source information table, described associate field can be pointer field, also can be array of pointers field, below according to the search procedure of the record of market information table common in securities exchange system, hold position information table and securities information, carry out concrete introduction:
As shown in the table is the simplified design table of market information table, comprises market code field, market name field, market category field at table, resets field, on the basis of existing design table, adds associate field.
Field name Market code Market name Market category Reset Associate field
Type char char[32] char char ref_arry
Wherein, store pointer in described associate field, described pointer points to the securities information in corresponding securities information table by market code field.This is because, find in actual moving process, mostly to search, associate field between market information table and securities information table is fixing, and this relation is predictable, such as, associating between market information table with securities information table is associated by this field of market code.So, when creating source information table, associate field generates the pointer pointing to securities information table corresponding record.
As shown in the table is the simplified apparatus table of securities information table:
Field name Market code Stock code Paper title Security type Reset
Field name char char[33] char[33] char char
So, pointed to the pointer of the record in securities information table by market information table, namely the adduction relationship of market information table reference securities information table can be expressed as: market information table (market code)---> securities information table (market code).
Similarly, in the simplified design table of the information table of holding position shown in following table, information table of holding position comprises code field of holding position, market name field, stock code field, resets field, on the basis of existing design table, adds associate field.
Field name To hold position code Market code Stock code Reset Associate field
Type int char char[33] char ref_one
Wherein, store pointer in described associate field, described pointer, by market code field and code field of holding position, points to the securities information in corresponding securities information table.This is because, find in actual moving process, mostly to search, the associate field of holding position between information table and securities information table is fixing, and this relation is predictable, such as, associating between information table with securities information table of holding position is associated by market code and this field of stock code.So, when creating source information table, associate field generates the pointer pointing to securities information table corresponding record, described pointer points to market code and the stock code of securities information table by the market code of information table of holding position and stock code, that is: information table of holding position (market code+stock code)---> securities information table (market code+stock code).
In step s 102, when record corresponding from the record search target information table in source information table, search the record in the target information table corresponding to the record in source information table according to described associate field.
According to associate field preset in step S101, according to described related information, when needing the record in source information table, when carrying out the searching of respective record in target information table, only need according to the pointer content in related information, point to the physical record in target information table, thus record corresponding in target information table can be found fast and effectively, improve the response efficiency of database.
The present invention by increasing associate field in the source information table of internal storage data, the related information of source information table and target information table is stored in associate field, when searching the record in target information table according to source information table, field corresponding in target information table can be searched fast and effectively according to described associate field, the mode verified one by one with the record in target information table is compared, and improves the search efficiency of record greatly.
Embodiment two:
Fig. 2 shows the realization flow of the lookup method of the internal storage data that second embodiment of the invention provides, and details are as follows:
In step s 201, in the source information table of internal storage data, increase associate field, in described associate field, store the related information of source information table and target information table.
In step S202, when record corresponding from the record search target information table in source information table, search the record in the target information table corresponding to the record in source information table according to described associate field.
Step S201-S202 is substantially identical with step S101-S102 in embodiment one, does not repeat at this.
In step S203, whether the record in monitoring source information table changes.
In step S204, when the record in source information table changes, according to the type of source information table, select corresponding field contents, upgrade described associate field.
Concrete, the record in the source information table described in the embodiment of the present invention changes, and comprises the operation such as deletion of the insertion of the record of source information table, the renewal of record and record.
When insertion one record in prime information table being detected, then need to judge whether the record inserted has adduction relationship with other target information table, if there is adduction relationship, then need to upgrade the pointer content in associate field, make it possible to according to pointer, search the record in the target information table pointed by the record after renewal.
When detect in source information table have modified one record time, then need to judge whether to have modified the content in the associate field in source information table, if have modified the content in associate field, then need to remove the content in original associate field, according to the create-rule of associate field, regenerate associate field.
When detecting that the record in source information table is deleted, then need to judge whether the record deleted has corresponding associate field, if had, delete corresponding associate field.
Wherein, according to the type of source information table described in the present invention, select corresponding field contents, upgrade described associate field step and comprise:
When described source information table is market information table, selects the content of the market code field in market information table, upgrade the pointer in described associate field;
When described source information table for hold position information table time, the content of select to hold position market code field in information table, stock code field, upgrades the pointer in described associate field.
The embodiment of the present invention at source information table in operation, when such as there is write operation, deletion action etc., by the real-time update to associate field, better realizes the present invention for the search efficiency recorded in target information table.
Embodiment three:
Fig. 3 shows the structural representation searching device of the internal storage data that third embodiment of the invention provides, and details are as follows:
Internal storage data described in the embodiment of the present invention search device, comprising:
Associate field increases unit 301, for increasing associate field in the source information table of internal storage data, stores the related information of source information table and target information table in described associate field;
Record search unit 302, for when record corresponding from the record search target information table in source information table, searches the record in the target information table corresponding to the record in source information table according to described associate field.
Preferably, described source information table is market information table, and described target information table is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field.
Preferably, described source information table is information table of holding position, and described target information is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field, stock code field.
Preferably, described device also comprises:
Whether record monitoring means, change for the record of monitoring in source information table;
Updating block, for when the record in source information table changes, according to the type of source information table, selects corresponding field contents, upgrades described associate field.
Preferably, described updating block comprises:
First upgrades subelement, for when described source information table is market information table, selects the content of the market code field in market information table, upgrades the pointer in described associate field;
Second upgrades subelement, for when described source information table for hold position information table time, selection is held position the content of market code field in information table, stock code field, upgrades the pointer in described associate field.
Internal storage data described in the embodiment of the present invention search device, corresponding with the lookup method of the internal storage data described in embodiment one, two, do not repeat at this.
In several embodiment provided by the present invention, should be understood that, disclosed apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. a lookup method for internal storage data, is characterized in that, described method comprises:
In the source information table of internal storage data, increase associate field, in described associate field, store the related information of source information table and target information table;
When record corresponding from the record search target information table in source information table, search the record in the target information table corresponding to the record in source information table according to described associate field.
2. method according to claim 1, it is characterized in that, described source information table is market information table, and described target information table is securities information table, and the described related information step storing source information table and target information table in described associate field comprises:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field.
3. method according to claim 1, it is characterized in that, described source information table is information table of holding position, and described target information is securities information table, and the described related information step storing source information table and target information table in described associate field comprises:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field, stock code field.
4. method according to claim 1, it is characterized in that, described method also comprises:
Whether the record in monitoring source information table changes;
When the record in source information table changes, according to the type of source information table, select corresponding field contents, upgrade described associate field.
5. method according to claim 4, is characterized in that, the described type according to source information table, selects corresponding field contents, upgrades described associate field step and comprise:
When described source information table is market information table, selects the content of the market code field in market information table, upgrade the pointer in described associate field;
When described source information table for hold position information table time, the content of select to hold position market code field in information table, stock code field, upgrades the pointer in described associate field.
6. internal storage data search a device, it is characterized in that, described device comprises:
Associate field increases unit, for increasing associate field in the source information table of internal storage data, stores the related information of source information table and target information table in described associate field;
Record search unit, for when record corresponding from the record search target information table in source information table, searches the record in the target information table corresponding to the record in source information table according to described associate field.
7. device according to claim 6, it is characterized in that, described source information table is market information table, and described target information table is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field.
8. device according to claim 6, it is characterized in that, described source information table is information table of holding position, and described target information is securities information table, described associate field increase unit specifically for:
In described associate field, store pointer, described pointer points to the securities information in corresponding securities information table by market code field, stock code field.
9. device according to claim 6, it is characterized in that, described device also comprises:
Whether record monitoring means, change for the record of monitoring in source information table;
Updating block, for when the record in source information table changes, according to the type of source information table, selects corresponding field contents, upgrades described associate field.
10. device according to claim 9, it is characterized in that, described updating block comprises:
First upgrades subelement, for when described source information table is market information table, selects the content of the market code field in market information table, upgrades the pointer in described associate field;
Second upgrades subelement, for when described source information table for hold position information table time, selection is held position the content of market code field in information table, stock code field, upgrades the pointer in described associate field.
CN201510844228.3A 2015-11-26 2015-11-26 A kind of internal storage data lookup method and device Active CN105354149B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510844228.3A CN105354149B (en) 2015-11-26 2015-11-26 A kind of internal storage data lookup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510844228.3A CN105354149B (en) 2015-11-26 2015-11-26 A kind of internal storage data lookup method and device

Publications (2)

Publication Number Publication Date
CN105354149A true CN105354149A (en) 2016-02-24
CN105354149B CN105354149B (en) 2018-09-11

Family

ID=55330123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510844228.3A Active CN105354149B (en) 2015-11-26 2015-11-26 A kind of internal storage data lookup method and device

Country Status (1)

Country Link
CN (1) CN105354149B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145574A (en) * 2017-05-05 2017-09-08 恒生电子股份有限公司 database data processing method, device and storage medium and electronic equipment
CN107346277A (en) * 2017-06-29 2017-11-14 东软集团股份有限公司 Date storage method and device
CN108920592A (en) * 2018-06-26 2018-11-30 杭州骑轻尘信息技术有限公司 Database field correlating method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184251A (en) * 2011-05-25 2011-09-14 盛趣信息技术(上海)有限公司 Data sheet synchronizing system and method
CN102867064A (en) * 2012-09-28 2013-01-09 用友软件股份有限公司 Associated field query device and associated field query method
CN103631967A (en) * 2013-12-18 2014-03-12 北京华环电子股份有限公司 Processing method and device for data table with autoincrement identification fields

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184251A (en) * 2011-05-25 2011-09-14 盛趣信息技术(上海)有限公司 Data sheet synchronizing system and method
CN102867064A (en) * 2012-09-28 2013-01-09 用友软件股份有限公司 Associated field query device and associated field query method
CN103631967A (en) * 2013-12-18 2014-03-12 北京华环电子股份有限公司 Processing method and device for data table with autoincrement identification fields

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李恒: "建立内存机制保证海量数据实时性系统的运行", 《科学技术与工程》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145574A (en) * 2017-05-05 2017-09-08 恒生电子股份有限公司 database data processing method, device and storage medium and electronic equipment
CN107346277A (en) * 2017-06-29 2017-11-14 东软集团股份有限公司 Date storage method and device
CN108920592A (en) * 2018-06-26 2018-11-30 杭州骑轻尘信息技术有限公司 Database field correlating method and device
CN108920592B (en) * 2018-06-26 2020-11-10 杭州一骑轻尘信息技术有限公司 Database field association method and device

Also Published As

Publication number Publication date
CN105354149B (en) 2018-09-11

Similar Documents

Publication Publication Date Title
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
CN104199750B (en) A kind of file access pattern method and device of Linux system
CN102930060B (en) A kind of method of database quick indexing and device
US10255235B2 (en) Database storage system based on jukebox and method using the system
CN101777017B (en) Rapid recovery method of continuous data protection system
CN103902623A (en) Method and system for accessing files on a storage system
CN102915278A (en) Data deduplication method
CN102779180A (en) Operation processing method of data storage system and data storage system
CN103617097B (en) File access pattern method and device
CN101504672A (en) Method and system for dynamically configuring physical data table
CN107111460A (en) Use the data de-duplication of block file
CN103544077A (en) Data processing method and device and shared memory device
CN101256561A (en) Method, apparatus and system for storing and accessing database data
CN104731896A (en) Data processing method and system
CN103973810A (en) Data processing method and device based on IP disk
CN103793666A (en) Data file protecting method and system
CN103034592A (en) Data processing method and device
CN104360914A (en) Incremental snapshot method and device
CN102959548B (en) Date storage method, lookup method and device
CN103577329A (en) Snapshot management method and device
CN104715041A (en) Database recovery method and system
CN102591790A (en) Method for implementing data storage snapshot based on solid state disk, and solid state disk
CN104424219A (en) Method and equipment of managing data documents
CN104239438A (en) File information storage method and file information read-write method based on separate storage
CN105354149A (en) Memory data search method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant