CN103513991B - Method for establishing bi-directional mapping among sequences under condition of difference limitation - Google Patents
Method for establishing bi-directional mapping among sequences under condition of difference limitation Download PDFInfo
- Publication number
- CN103513991B CN103513991B CN201310492005.6A CN201310492005A CN103513991B CN 103513991 B CN103513991 B CN 103513991B CN 201310492005 A CN201310492005 A CN 201310492005A CN 103513991 B CN103513991 B CN 103513991B
- Authority
- CN
- China
- Prior art keywords
- data
- curx
- cury
- diff
- seqy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 12
- 238000013507 mapping Methods 0.000 title abstract description 34
- 230000000052 comparative effect Effects 0.000 claims 1
- 230000002457 bidirectional effect Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明涉及一种在差额限定条件下的在数列间建立双向映射的方法,它先将两组离散的数据各自按从小到大的顺序排列成两个数列,储存在两个比较模块内,通过数据项游标变量模块CurX、CurY,对其进行逐一指向并比较,如出现符合差额限定条件的两个分别处于两个数列中的数据,即建立双向映射关系并储存,最终实现对两个数列的双向映射关系的数据项进行统计,从而达到发掘两组数据的关联性和相似性的目的。
The present invention relates to a method for establishing a two-way mapping between number sequences under the condition of limited balance. It first arranges two sets of discrete data into two number sequences in order from small to large, and stores them in two comparison modules. The data item cursor variable modules CurX and CurY point to and compare them one by one. If there are two data in the two series that meet the limit conditions of the difference, a two-way mapping relationship is established and stored, and finally the two series are realized. The data items of the two-way mapping relationship are counted, so as to achieve the purpose of discovering the relevance and similarity of the two sets of data.
Description
技术领域technical field
本发明涉及一种软件技术,尤其是涉及一种通过对数列进行比较分析建立双向映射关系的方法。The invention relates to a software technology, in particular to a method for establishing a two-way mapping relationship by comparing and analyzing numbers.
背景技术Background technique
数列:按一定次序排列的一列数称为数列(sequence of number)。数列中的每一个数都叫做这个数列的数据项,简称项。。Sequence: A sequence of numbers arranged in a certain order is called a sequence of numbers. Each number in the sequence is called a data item of the sequence, or item for short. .
双向映射: 一种在两个数据项之间的双向的指向关系。本发明中的双向映射特指:(1)双向映射的两个数据项必须分属于两个不同的数列;(2)任何一个数据项已经成为某一个双向映射中的一项时,不得成为其他双向映射中的一项,即双向映射之间不得存在重合;(3)任何一个双向映射的前一项与后一项的两个数的差应该符合差额限定条件。Bidirectional mapping: A bidirectional pointing relationship between two data items. The bidirectional mapping in the present invention specifically refers to: (1) The two data items of the bidirectional mapping must belong to two different sequence; (2) When any data item has become an item in a certain bidirectional mapping, it must not become another One item in the two-way mapping, that is, there must be no overlap between the two-way mappings; (3) The difference between the two numbers of the previous item and the next item of any two-way mapping should meet the difference limit conditions.
差额限定条件:本条件包含两个值最小差额Min,最大差额Max,差额限定条件指双向映射中的前一项与后一项的两个数在数学上的差Diff,不得小于Min,同时不得大于Max,即应该满足以下数学条件:Min≤Diff≤Max。当然Min必须不大于Max,即满足Min≤Max。Difference limit condition: This condition includes the minimum difference Min and the maximum difference Max between two values. The difference limit condition refers to the mathematical difference Diff between the two numbers of the previous item and the next item in the two-way mapping, which must not be less than Min, and must not If it is greater than Max, the following mathematical condition should be satisfied: Min≤Diff≤Max. Of course, Min must not be greater than Max, that is, Min≤Max.
最多双向映射关系:在已经给定的两个数列(前一数列SeqA,后一数列SeqB),以及给定的差额限定条件后,力图能够建立最多的符合差额限定条件的双向映射关系。Maximum two-way mapping relationship: After two given numbers (the previous number sequence SeqA and the next number sequence SeqB) and the given difference limit conditions, try to establish the most two-way mapping relationships that meet the difference limit conditions.
在安防领域,技术人没往往需要了解多组数据之间的相似度、相关联度,以实现对这些数据的相似度的判断,但是,现有的数据往往是离散的,无序的,规律性非常弱的,很难去找出它们的规律,更不用说对各组数据之间的相似度、相关联度进行判断了。In the field of security, technicians often do not need to understand the similarity and correlation between multiple sets of data in order to realize the judgment of the similarity of these data. However, the existing data is often discrete, disordered, regular If the correlation is very weak, it is difficult to find out their rules, let alone judge the similarity and correlation between each set of data.
发明内容Contents of the invention
本发明主要是解决现有技术所存在的两组离散的数据之间很难找出它们之间的相互关系,无法判断它们相似度和关联度的问题,提供一种能够迅速判断两组据的相互映射关系,发掘它们的关联度、相似度的在差额限定条件下的在数列间建立双向映射的方法。The present invention mainly solves the problems existing in the prior art that it is difficult to find out the relationship between two sets of discrete data, and it is impossible to judge their similarity and correlation, and provides a method that can quickly judge two sets of data Mutual mapping relationship, a method of establishing a two-way mapping between sequence of numbers under the condition of difference limit to explore their correlation and similarity.
本发明的上述技术问题主要是通过下述技术方案得以解决的:一种在差额限定条件下的在数列间建立双向映射的方法,其特征在于它包括如下步骤:Above-mentioned technical problem of the present invention is mainly solved by following technical scheme: a kind of method of setting up two-way mapping between sequence of numbers under the condition of difference limitation, it is characterized in that it comprises the following steps:
ⅰ在计算机存储空间内存入两组数据,分别为SeqA、SeqB,并将SeqA、SeqB分别按从小到大的顺序排列在两个比较模块内,形成两个数列SeqX和SeqY,数列的每个数据项在比较模块内占用一个区位,存有数据项的区位称为有效区位;ⅰ Put two groups of data in the computer storage space, which are respectively SeqA and SeqB, and arrange SeqA and SeqB in two comparison modules according to the order from small to large, forming two sequence SeqX and SeqY, each data of sequence The item occupies a location in the comparison module, and the location where the data item is stored is called the effective location;
ⅱ建立两个数据项游标变量模块CurX、CurY,初始化CurX指向SeqX的最后一个有效区位获得相应的数据项,初始化CurY指向SeqY的最后一个有效区位获得相应的数据项;ⅱ Establish two data item cursor variable modules CurX, CurY, initialize CurX to point to the last valid location of SeqX to obtain the corresponding data item, initialize CurY to point to the last valid location of SeqY to obtain the corresponding data item;
ⅲ判别CurX、CurY所获得的两个数据项,获得CurX、CurY的两个数据项的差Diff,并设定CurX、CurY的差额限定条件为大于等于Min,且小于等于Max;ⅲ Discriminate the two data items obtained by CurX and CurY, obtain the difference Diff of the two data items of CurX and CurY, and set the difference limit condition of CurX and CurY to be greater than or equal to Min, and less than or equal to Max;
ⅳ根据Diff与差额限定条件的比较结果,进行分支处理并移动相应的游标,并在符合差额限定条件时建立双向映射关系MapResult,MapResult储存在结构变量模块ItemMap,ItemMap包含成员变量OffX、OffY,过程如下:ⅳAccording to the comparison result of Diff and the difference limit condition, perform branch processing and move the corresponding cursor, and establish a two-way mapping relationship MapResult when the difference limit condition is met. MapResult is stored in the structural variable module ItemMap. ItemMap includes member variables OffX and OffY. as follows:
a如果Diff符合差额限定条件,即Min ≤Diff≤Max,成员变量OffX的值为CurX,成员变量OffY的值为CurY的数据,并储存,然后将CurX、CurY两个游标变量模块的数据释放,SeqX、SeqY指向相应数列中前一个有效区位,再根据根据Diff与差额限定条件的比较;a If the Diff meets the difference limitation conditions, that is, Min ≤ Diff ≤ Max, the value of the member variable OffX is CurX, the value of the member variable OffY is the data of CurY, and store them, and then release the data of the two cursor variable modules CurX and CurY, SeqX and SeqY point to the previous effective location in the corresponding sequence, and then compare according to Diff and the difference limit condition;
b如果Diff > Max,将CurX的数据释放,SeqX指向相应数列中前一个有效区位,再根据根据Diff与差额限定条件的比较;b If Diff > Max, release the data of CurX, SeqX points to the previous effective location in the corresponding sequence, and then compare according to Diff and the difference limit condition;
c如果Diff < Min,将CurY的数据释放,SeqY指向相应数列中前一个有效区位,再根据Diff与差额限定条件的比较;c If Diff < Min, release the data of CurY, SeqY points to the previous effective location in the corresponding sequence, and then compare Diff with the difference limit condition;
d判别CurX、CurY所指向的区位是否已经超出SeqX、SeqY的第一个有效区位的界限,如果已经超出,结束循环,否则回到循环工作部分;d judge whether the location pointed to by CurX and CurY has exceeded the limit of the first effective location of SeqX and SeqY, if it has exceeded, end the loop, otherwise return to the loop work part;
ⅴ通过对成员变量OffX、OffY的统计,可得到双向映射关系的数量Cnt,汇总统计所有得到的双向映射关系,并与SeqX、SeqY两个数列进行比对,得到:SeqX数列中未能够得到匹配的数据项数量MissX,SeqY数列中未能够得到匹配的数据项数量MissY。ⅴThrough the statistics of the member variables OffX and OffY, the number Cnt of the two-way mapping relationship can be obtained, and all the obtained two-way mapping relationships can be summarized and compared with the two sequence of SeqX and SeqY, it can be obtained: no match can be obtained in the sequence of SeqX The number of data items MissX, and the number of matching data items MissY cannot be obtained in the SeqY array.
本发明的带来的有益效果是,解决了现有技术所存在的两组离散的数据之间很难找出它们之间的相互关系,无法判断它们相似度和关联度的问题,实现了一种能够迅速判断两组据的相互映射关系,发掘它们的关联度、相似度的在差额限定条件下的在数列间建立双向映射的方法。The beneficial effect of the present invention is that it solves the problem that it is difficult to find out the relationship between two sets of discrete data in the prior art, and it is impossible to judge their similarity and correlation. It is a method for establishing a two-way mapping between data series under the condition of difference limitation, which can quickly judge the mutual mapping relationship between two sets of data, and discover their correlation degree and similarity degree.
附图说明Description of drawings
图1是排序后的数列SeqX、SeqY示意图;Figure 1 is a schematic diagram of the sequence SeqX and SeqY after sorting;
图2是双向映射建立结果示意图;Fig. 2 is a schematic diagram of the establishment result of bidirectional mapping;
图3是本发明的工作原理图。Fig. 3 is a working principle diagram of the present invention.
具体实施方式detailed description
下面通过实施例,并结合附图,对本发明的技术方案作进一步具体的说明。The technical solutions of the present invention will be further specifically described below through the embodiments and in conjunction with the accompanying drawings.
实施例:如图3所示,本发明是一种在差额限定条件下的在数列间建立双向映射的方法,其特征在于它包括如下步骤:Embodiment: as shown in Figure 3, the present invention is a kind of method that sets up two-way mapping between sequence under the condition of difference limit, it is characterized in that it comprises the steps:
ⅰ在计算机存储空间内存入两组数据,分别为SeqA、SeqB,并将SeqA、SeqB分别按从小到大的顺序排列在两个比较模块内,形成两个数列SepX和SepY,数列的每个数据项在比较模块内占用一个区位,存有数据项的区位称为有效区位;ⅰ Put two groups of data in the computer storage space, which are respectively SeqA and SeqB, and arrange SeqA and SeqB in the two comparison modules in order from small to large, forming two series of numbers SepX and SepY, each data of the series The item occupies a location in the comparison module, and the location where the data item is stored is called the effective location;
ⅱ建立两个数据项游标变量模块CurX、CurY,初始化CurX指向SeqX的最后一个有效区位获得相应的数据项,初始化CurY指向SeqY的最后一个有效区位获得相应的数据项;ⅱ Establish two data item cursor variable modules CurX, CurY, initialize CurX to point to the last valid location of SeqX to obtain the corresponding data item, initialize CurY to point to the last valid location of SeqY to obtain the corresponding data item;
ⅲ判别CurX、CurY所获得的两个数据项,获得CurX、CurY的两个数据项的差Diff,并设定CurX、CurY的差额限定条件为大于等于Min,且小于等于Max;ⅲ Discriminate the two data items obtained by CurX and CurY, obtain the difference Diff of the two data items of CurX and CurY, and set the difference limit condition of CurX and CurY to be greater than or equal to Min, and less than or equal to Max;
ⅳ根据Diff与差额限定条件的比较结果,进行分支处理并移动相应的游标,并在符合差额限定条件时建立双向映射关系MapResult,MapResult储存在结构变量模块ItemMap,ItemMap包含成员变量OffX、OffY,过程如下:ⅳAccording to the comparison result of Diff and the difference limit condition, perform branch processing and move the corresponding cursor, and establish a two-way mapping relationship MapResult when the difference limit condition is met. MapResult is stored in the structural variable module ItemMap. ItemMap includes member variables OffX and OffY. as follows:
a如果Diff符合差额限定条件,即Min ≤Diff≤Max,成员变量OffX的值为CurX,成员变量OffY的值为CurY的数据,并储存,然后将CurX、CurY两个游标变量模块的数据释放,SeqX、SeqY指向相应数列中前一个有效区位,再根据根据Diff与差额限定条件的比较;a If the Diff meets the limit condition of the difference, that is, Min ≤ Diff ≤ Max, the value of the member variable OffX is CurX, the value of the member variable OffY is the data of CurY, and store them, and then release the data of the two cursor variable modules CurX and CurY, SeqX and SeqY point to the previous effective location in the corresponding sequence, and then compare according to Diff and the difference limit condition;
b如果Diff > Max,将CurX的数据释放,SeqX指向相应数列中前一个有效区位,再根据根据Diff与差额限定条件的比较;b If Diff > Max, release the data of CurX, SeqX points to the previous effective location in the corresponding sequence, and then compare according to Diff and the difference limit condition;
c如果Diff < Min,将CurY的数据释放,SeqY指向相应数列中前一个有效区位,再根据Diff与差额限定条件的比较;c If Diff < Min, release the data of CurY, SeqY points to the previous effective location in the corresponding sequence, and then compare Diff with the difference limit condition;
d判别CurX、CurY所指向的区位是否已经超出SeqX、SeqY的第一个有效区位的界限,如果已经超出,结束循环,否则回到循环工作部分;d judge whether the location pointed to by CurX and CurY has exceeded the limit of the first effective location of SeqX and SeqY, if it has exceeded, end the loop, otherwise return to the loop work part;
ⅴ通过对成员变量OffX、OffY的统计,可得到双向映射关系的数量Cnt,汇总统计所有得到的双向映射关系,并与SeqX、SeqY两个数列进行比对,得到:SeqX数列中未能够得到匹配的数据项数量MissX,SeqY数列中未能够得到匹配的数据项数量MissY。ⅴThrough the statistics of the member variables OffX and OffY, the number Cnt of the two-way mapping relationship can be obtained, and all the obtained two-way mapping relationships can be summarized and compared with the two sequence of SeqX and SeqY, it can be obtained: no match can be obtained in the sequence of SeqX The number of data items MissX, and the number of matching data items MissY cannot be obtained in the SeqY array.
如图1所示,如果,As shown in Figure 1, if,
SeqA包括如下数据项:33,30,33,39,55,50,45;SeqA includes the following data items: 33, 30, 33, 39, 55, 50, 45;
SeqA包括如下数据项:30,34,32,36,48,50,52。SeqA includes the following data items: 30, 34, 32, 36, 48, 50, 52.
其中Min为0,Max为4。Where Min is 0 and Max is 4.
将其排列后获得数列SeqX:30,33,33,39,45,50,55;Arrange them to get the sequence SeqX: 30, 33, 33, 39, 45, 50, 55;
SeqY:30,32,34,36,48,50,52。SeqY: 30, 32, 34, 36, 48, 50, 52.
如图2所示,as shown in picture 2,
建立双向映射后:SeqX的第2数据项与SeqY的第1数据项双向映射;After the bidirectional mapping is established: the second data item of SeqX and the first data item of SeqY are bidirectionally mapped;
SeqX的第3数据项与SeqY的第2数据项双向映射; Two-way mapping between the third data item of SeqX and the second data item of SeqY;
SeqX的第4数据项与SeqY的第4数据项双向映射; Two-way mapping between the fourth data item of SeqX and the fourth data item of SeqY;
SeqX的第6数据项与SeqY的第6数据项双向映射; Two-way mapping between the sixth data item of SeqX and the sixth data item of SeqY;
SeqX的第7数据项与SeqY的第7数据项双向映射。 The 7th data item of SeqX and the 7th data item of SeqY are bidirectionally mapped.
经统计:双向映射关系的数量Cnt为5;According to the statistics: the number Cnt of the two-way mapping relationship is 5;
SeqX数列中未能够得到匹配的数据项数量MissX为2; The number of data items that cannot be matched in the SeqX sequence MissX is 2;
SeqY数列中未能够得到匹配的数据项数量MissY为2。 The number of missing data items MissY in the SeqY array is 2.
因此,本发明实现了对两组数据之间相互映射关系的分析,人们可以因此判断这两组数据之间的关联度、相似度。Therefore, the present invention realizes the analysis of the mutual mapping relationship between the two sets of data, and people can therefore judge the degree of correlation and similarity between the two sets of data.
Claims (1)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310492005.6A CN103513991B (en) | 2013-10-17 | 2013-10-17 | Method for establishing bi-directional mapping among sequences under condition of difference limitation |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310492005.6A CN103513991B (en) | 2013-10-17 | 2013-10-17 | Method for establishing bi-directional mapping among sequences under condition of difference limitation |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN103513991A CN103513991A (en) | 2014-01-15 |
| CN103513991B true CN103513991B (en) | 2017-04-12 |
Family
ID=49896775
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310492005.6A Active CN103513991B (en) | 2013-10-17 | 2013-10-17 | Method for establishing bi-directional mapping among sequences under condition of difference limitation |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN103513991B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101076817A (en) * | 2004-04-27 | 2007-11-21 | 赫马纳股份有限公司 | System and method for automatic extracting and displaying previous nursing cost to aid forecasting health state in the future |
| CN101187927A (en) * | 2007-12-17 | 2008-05-28 | 电子科技大学 | An Intelligent Analysis Method for Parallel Cases in Criminal Cases |
| CN102866956A (en) * | 2012-09-14 | 2013-01-09 | 上海宝存信息科技有限公司 | System and method for data real-time tracking and storage based on solid-state storage medium |
-
2013
- 2013-10-17 CN CN201310492005.6A patent/CN103513991B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101076817A (en) * | 2004-04-27 | 2007-11-21 | 赫马纳股份有限公司 | System and method for automatic extracting and displaying previous nursing cost to aid forecasting health state in the future |
| CN101187927A (en) * | 2007-12-17 | 2008-05-28 | 电子科技大学 | An Intelligent Analysis Method for Parallel Cases in Criminal Cases |
| CN102866956A (en) * | 2012-09-14 | 2013-01-09 | 上海宝存信息科技有限公司 | System and method for data real-time tracking and storage based on solid-state storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103513991A (en) | 2014-01-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104035949B (en) | Similarity data retrieval method based on locality sensitive hashing (LASH) improved algorithm | |
| CN105630955B (en) | A kind of data acquisition system member management method of high-efficiency dynamic | |
| CN101404032B (en) | Video retrieval method and system based on contents | |
| CN104408163B (en) | A kind of data classification storage and device | |
| CN104679813B (en) | Data Holding Equipment, data storage method and data storage system | |
| TWI464604B (en) | Data clustering method and device, data processing apparatus and image processing apparatus | |
| CN103617163B (en) | Quick target association method based on cluster analysis | |
| CN102609487B (en) | Column-storage-oriented Hash joint method for indexes in barrels | |
| CN105809118A (en) | Three-dimensional object identifying method and apparatus | |
| US20220222233A1 (en) | Clustering of structured and semi-structured data | |
| CN102722554A (en) | Randomness weakening method of location-sensitive hash | |
| CN106469218B (en) | A bitmap-based Boolean expression storage and matching method and system | |
| CN106874788A (en) | A kind of method for secret protection in sensitive data issue | |
| CN105447135B (en) | Data search method and device | |
| WO2022153287A1 (en) | Clustering of structured and semi-structured data | |
| CN109948705A (en) | A Rare Class Detection Method and Device Based on K-Nearest Neighbor Graph | |
| Ahmed et al. | Implementation of early and late fusion methods for content-based image retrieval | |
| CN102902701A (en) | Information inquiry system and information inquiry method | |
| CN103513991B (en) | Method for establishing bi-directional mapping among sequences under condition of difference limitation | |
| CN116414822A (en) | Method and device for constructing seismic data index library, related equipment and index library | |
| CN105069084B (en) | A method of efficiently taking difference set towards mass data | |
| CN102456073A (en) | Partial maximum value query method | |
| US9753963B2 (en) | System and method for determining an index of an object in a sequence of objects | |
| CN110399528B (en) | Automatic cross-feature reasoning type target retrieval method | |
| CN106776598A (en) | A kind of information processing method and device |
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 | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address |
Address after: Zhejiang Zhongcai Building No. 68 Hangzhou 310051 Zhejiang province Binjiang District Tong Road 15 Patentee after: Dbappsecurity Co.,Ltd. Address before: Zhejiang Zhongcai Building No. 68 Binjiang District road Hangzhou City, Zhejiang Province, the 310051 and 15 Floor Patentee before: Dbappsecurity Co.,ltd. |
|
| CP02 | Change in the address of a patent holder | ||
| CP02 | Change in the address of a patent holder |
Address after: Zhejiang Zhongcai Building No. 68 Binjiang District road Hangzhou City, Zhejiang Province, the 310051 and 15 layer Patentee after: Dbappsecurity Co.,Ltd. Address before: Zhejiang Zhongcai Building No. 68 Hangzhou 310051 Zhejiang province Binjiang District Tong Road 15 Patentee before: Dbappsecurity Co.,Ltd. |
|
| EE01 | Entry into force of recordation of patent licensing contract | ||
| EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20140115 Assignee: Hangzhou Anheng Information Security Technology Co.,Ltd. Assignor: Dbappsecurity Co.,Ltd. Contract record no.: X2024980043370 Denomination of invention: A method for establishing bidirectional mapping between sequences under differential constraints Granted publication date: 20170412 License type: Common License Record date: 20241231 |