CN112364214A - Numerical value grade-based character string sorting method and device, storage medium and terminal - Google Patents

Numerical value grade-based character string sorting method and device, storage medium and terminal Download PDF

Info

Publication number
CN112364214A
CN112364214A CN202011495607.3A CN202011495607A CN112364214A CN 112364214 A CN112364214 A CN 112364214A CN 202011495607 A CN202011495607 A CN 202011495607A CN 112364214 A CN112364214 A CN 112364214A
Authority
CN
China
Prior art keywords
character string
digital information
numerical value
character
sorting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011495607.3A
Other languages
Chinese (zh)
Inventor
陈胜源
张新展
朱雨萌
张宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XTX Technology Shenzhen Ltd
Original Assignee
XTX Technology Shenzhen 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 XTX Technology Shenzhen Ltd filed Critical XTX Technology Shenzhen Ltd
Priority to CN202011495607.3A priority Critical patent/CN112364214A/en
Publication of CN112364214A publication Critical patent/CN112364214A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a character string sorting method, a device, a storage medium and a terminal based on numerical value grades.A letter in a character string is removed, digital information in the character string is directly extracted, on the premise of keeping the data grade, a characteristic numerical value of the character string is synthesized according to the digital information in the character string, and sorting is carried out according to the size of the characteristic numerical value of the character string, so that a more reasonable sorting effect is achieved; in the technical scheme, the sorting can be performed directly according to the characteristic numerical values of the character strings, the sorting of each digit of the character strings does not need to be performed one by one, the operation is simple and convenient, and the scheme only sorts the digital information in the character strings without involving letters in the character strings, and is particularly suitable for operating the sorting of the character strings named as the purposes by numbers.

Description

Numerical value grade-based character string sorting method and device, storage medium and terminal
Technical Field
The invention relates to the technical field of character string sequencing, in particular to a numerical value grade-based character string sequencing method, a numerical value grade-based character string sequencing device, a storage medium and a terminal.
Background
The character string sorting can obviously improve the searching and using efficiency. However, the conventional string sorting is sorted by ASSCII from the leftmost side of the string, when the string named as the destination is operated, the sorting result does not conform to the habit of human eye recognition, for example, sorting is performed in an ascending order, the string tc1_10 is before tc1_1_1, and when the number of the strings is large, the conventional sorting method can make the sorting result more disordered and lose the meaning of sorting.
Therefore, the prior art still needs to be improved and developed.
Disclosure of Invention
The invention aims to provide a numerical value grade-based character string ordering method, a numerical value grade-based character string ordering device, a storage medium and a terminal, and aims to solve the problems that the existing character strings are ordered according to ASSCII, the ordering result is disordered, and the existing character strings are not suitable for operating the character string ordering with the number named as the purpose.
The technical scheme of the invention is as follows: a character string sorting method based on numerical value grades specifically comprises the following steps:
segmenting the character string and extracting the digital information in the character string;
calculating a characteristic numerical value of the character string according to the digital information in the character string, wherein the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
and sorting the character strings according to the characteristic numerical value of the character strings.
The method for sorting the character strings based on the numerical value grades, wherein the character strings are segmented and the digital information in the character strings is extracted, specifically comprises the following steps:
s 11: dividing the character string into letters and numbers,
s 12: eliminating letters in the character string and reserving digital information;
s 13: digital information in the character string is extracted.
The character string ordering method based on the numerical value grade is characterized in that the calculation formula of the characteristic numerical value is as follows:
Figure DEST_PATH_IMAGE001
wherein, A is a characteristic numerical value, N is a digit in a character string, N is the data grade of the digit, and S is a preset value corresponding to the data grade.
The character string ordering method based on the numerical value grade is characterized in that the numerical value obtained by multiplying the number in the current data grade by the preset value is required to be smaller than the numerical value obtained by multiplying the number in the previous data grade by the preset value, and the numerical value obtained by multiplying the number in the previous data grade by the preset value is not 0.
According to the character string sorting method based on the numerical value grades, the character strings are sorted from large to small or from small to large according to the characteristic numerical value of the character strings.
A numeric value rank-based character string sorting apparatus, comprising:
the character string extraction module is used for segmenting the character string and extracting the digital information in the character string;
the characteristic numerical value calculation module is used for calculating the characteristic numerical value of the character string according to the digital information in the character string, and the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
and the sorting module sorts the character strings according to the characteristic numerical values of the character strings.
The numeric value rank-based character string sorting device, wherein the character string extraction module comprises:
the character string segmentation module is used for segmenting the character string and dividing the character string into letters and numbers;
the digital information retaining module is used for removing letters in the character string and retaining digital information;
and the digital information extraction module is used for extracting the digital information in the character string.
The character string sorting device based on the numerical value grades is characterized in that the sorting module is a numerical value ascending sorting module or a numerical value descending sorting module.
A storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform any of the methods described above.
A terminal comprising a processor and a memory, the memory having stored therein a computer program, the processor being adapted to perform the method of any preceding claim by invoking the computer program stored in the memory.
The invention has the beneficial effects that: according to the method, the device, the storage medium and the terminal for sorting the character strings based on the numerical value grades, the letters in the character strings are removed, the digital information in the character strings is directly extracted, the characteristic numerical values of the character strings are synthesized according to the digital information in the character strings on the premise that the data grades are reserved, and sorting is carried out according to the sizes of the characteristic numerical values of the character strings, so that a more reasonable sorting effect is achieved; in the technical scheme, the sorting can be performed directly according to the characteristic numerical values of the character strings, the sorting of each digit of the character strings does not need to be performed one by one, the operation is simple and convenient, and the scheme only sorts the digital information in the character strings without involving letters in the character strings, and is particularly suitable for operating the sorting of the character strings named as the purposes by numbers.
Drawings
FIG. 1 is a flow chart of the steps of a numeric rank based string ordering method of the present invention.
FIG. 2 is a schematic diagram of a numerical-level-based character string sorting apparatus according to the present invention.
Fig. 3 is a schematic diagram of a terminal in the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, a method for sorting character strings based on numerical value grades specifically includes the following steps:
s1: segmenting the character string and extracting the digital information in the character string;
s2: calculating a characteristic numerical value of the character string according to the digital information in the character string, wherein the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
s3: and sorting the character strings according to the characteristic numerical value of the character strings.
In some specific embodiments, the S1 specifically includes the following processes:
s 11: dividing the character string into letters and numbers,
s 12: eliminating letters in the character string and reserving digital information;
s 13: digital information in the character string is extracted.
In some embodiments, in S2, the eigenvalue is calculated as follows:
Figure 662457DEST_PATH_IMAGE001
wherein, A is a characteristic numerical value, N is a digit in a character string, N is the data grade of the digit, and S is a preset value corresponding to the data grade.
In order to enable the characteristic numerical value to keep the data grade of the character string according to the sequence of the numerical information in the character string, the numerical value obtained by multiplying the number in the current data grade by the preset value needs to be smaller than the numerical value obtained by multiplying the number in the previous data grade by the preset value, and the numerical value obtained by multiplying the number in the previous data grade by the preset value is not 0.
In some embodiments, in S3, the character strings may be sorted from large to small or from small to large according to the eigenvalue size of the character strings.
In the prior art, a general sorting process is to sort each digit in a character string one by one (no matter whether numbers or letters are sorted one by one), and to sort the character string by comparing the size of each digit in the character string. However, the sorting method in the prior art is tedious and time-consuming to operate, and the mixed numbers and letters in the sorting are not suitable for operating the sorting of the character strings named as the purpose. In the technical scheme, the letters in the character string are removed, the digital information in the character string is directly extracted, the characteristic numerical values of the character string are synthesized according to the digital information in the character string on the premise of keeping the data grade, and the character string is sorted according to the size of the characteristic numerical values, so that a more reasonable sorting effect is achieved; in the technical scheme, the sorting can be performed directly according to the characteristic numerical values of the character strings, the sorting of each digit of the character strings does not need to be performed one by one, the operation is simple and convenient, and the scheme only sorts the digital information in the character strings without involving letters in the character strings, and is particularly suitable for operating the sorting of the character strings named as the purposes by numbers.
For example, for existing tc1_10, tc1_1_1, tc1_7_20, tc1_ a _15, and tc1_12_ d, five strings need to be sorted, where each is setThe preset values corresponding to the data levels are respectively
Figure DEST_PATH_IMAGE002
=0.3,
Figure DEST_PATH_IMAGE003
=0.02,
Figure DEST_PATH_IMAGE004
=0.001。
the characteristic value of tc1 — 10 is calculated as follows: 1 x 0.3+10 x 0.02= 0.5;
the characteristic value of tc1_1_1 is calculated as follows: 1 x 0.3+1 x 0.02+1 x 0.001= 0.321;
the characteristic value of tc1_7_20 is calculated as follows: 1 x 0.3+7 x 0.02+20 x 0.001= 0.42;
the characteristic value of tc1_ a _15 is calculated as follows: 1 x 0.3+ 0.02+15 x 0.001= 0.315;
the characteristic value of tc1 — 12_ d is calculated as follows: 1 × 0.3+12 × 0.02+0 × 0.001= 0.54.
Sorting the character strings according to the calculated characteristic numerical values of the character strings, wherein the sorting result is as follows: tc1_ a _ 15-tc 1_1_ 1-tc 1_7_ 20-tc 1_ 10-tc 1_12_ d.
As shown in fig. 2, a numeric value rank-based character string sorting apparatus includes:
a character string extraction module 101 for segmenting the character string and extracting the digital information in the character string;
the characteristic numerical value calculation module 102 is used for calculating the characteristic numerical value of the character string according to the digital information in the character string, and the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
and the sorting module 103 sorts the character strings according to the characteristic numerical value of the character strings.
Referring to fig. 3, an embodiment of the present invention further provides a terminal. As shown, the terminal 300 includes a processor 301 and a memory 302. The processor 301 is electrically connected to the memory 302. The processor 301 is a control center of the terminal 300, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by running or calling a computer program stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the terminal 300.
In this embodiment, the processor 301 in the terminal 300 loads instructions corresponding to one or more processes of the computer program into the memory 302 according to the following steps, and the processor 301 runs the computer program stored in the memory 302, so as to implement various functions: segmenting the character string and extracting the digital information in the character string; calculating a characteristic numerical value of the character string according to the digital information in the character string, wherein the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string; and sorting the character strings according to the characteristic numerical value of the character strings.
Memory 302 may be used to store computer programs and data. The memory 302 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 301 executes various functional applications and data processing by calling a computer program stored in the memory 302.
An embodiment of the present application provides a storage medium, and when being executed by a processor, the computer program performs a method in any optional implementation manner of the foregoing embodiment to implement the following functions: segmenting the character string and extracting the digital information in the character string; calculating a characteristic numerical value of the character string according to the digital information in the character string, wherein the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string; and sorting the character strings according to the characteristic numerical value of the character strings. The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A character string ordering method based on numerical value grades is characterized by comprising the following steps:
segmenting the character string and extracting the digital information in the character string;
calculating a characteristic numerical value of the character string according to the digital information in the character string, wherein the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
and sorting the character strings according to the characteristic numerical value of the character strings.
2. The method for sorting character strings based on numerical value grades according to claim 1, wherein the step of segmenting the character strings and extracting the numerical information in the character strings specifically comprises the following steps:
s 11: dividing the character string into letters and numbers,
s 12: eliminating letters in the character string and reserving digital information;
s 13: digital information in the character string is extracted.
3. The method of claim 1, wherein the eigenvalue is calculated as follows:
Figure DEST_PATH_IMAGE002A
wherein, A is a characteristic numerical value, N is a digit in a character string, N is the data grade of the digit, and S is a preset value corresponding to the data grade.
4. The method of claim 1 or 3, wherein the value obtained by multiplying the number in the current data level by the predetermined value is smaller than the value obtained by multiplying the number in the previous data level by the predetermined value, and the value obtained by multiplying the number in the previous data level by the predetermined value is not 0.
5. The method of claim 1, wherein the character strings are sorted from large to small or from small to large according to the eigenvalue size of the character strings.
6. A numeric-rank-based character string sorting apparatus comprising:
the character string extraction module is used for segmenting the character string and extracting the digital information in the character string;
the characteristic numerical value calculation module is used for calculating the characteristic numerical value of the character string according to the digital information in the character string, and the characteristic numerical value keeps the data grade of the character string according to the sequence of the digital information in the character string;
and the sorting module sorts the character strings according to the characteristic numerical values of the character strings.
7. The numerical-rank-based character string sorting device according to claim 6, wherein the character string extraction module includes:
the character string segmentation module is used for segmenting the character string and dividing the character string into letters and numbers;
the digital information retaining module is used for removing letters in the character string and retaining digital information;
and the digital information extraction module is used for extracting the digital information in the character string.
8. The numeric-rank-based string ranking device according to claim 6 wherein the ranking module is a numeric ascending ranking module or a numeric descending ranking module.
9. A storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the method of any one of claims 1 to 5.
10. A terminal, characterized in that it comprises a processor and a memory, in which a computer program is stored, the processor being adapted to carry out the method of any one of claims 1 to 5 by calling the computer program stored in the memory.
CN202011495607.3A 2020-12-17 2020-12-17 Numerical value grade-based character string sorting method and device, storage medium and terminal Pending CN112364214A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011495607.3A CN112364214A (en) 2020-12-17 2020-12-17 Numerical value grade-based character string sorting method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011495607.3A CN112364214A (en) 2020-12-17 2020-12-17 Numerical value grade-based character string sorting method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN112364214A true CN112364214A (en) 2021-02-12

Family

ID=74534507

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011495607.3A Pending CN112364214A (en) 2020-12-17 2020-12-17 Numerical value grade-based character string sorting method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN112364214A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751416A (en) * 2008-11-28 2010-06-23 中国科学院计算技术研究所 Method for ordering and seeking character strings
CN104615663A (en) * 2015-01-07 2015-05-13 小米科技有限责任公司 File sorting method and device and terminal
CN105933437A (en) * 2016-06-15 2016-09-07 乐视控股(北京)有限公司 Server recommending method and device
US20160357738A1 (en) * 2015-06-07 2016-12-08 Apple Inc. Apparatus, system and method for string disambiguation and entity ranking
CN107861949A (en) * 2017-11-22 2018-03-30 珠海市君天电子科技有限公司 Extracting method, device and the electronic equipment of text key word

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751416A (en) * 2008-11-28 2010-06-23 中国科学院计算技术研究所 Method for ordering and seeking character strings
CN104615663A (en) * 2015-01-07 2015-05-13 小米科技有限责任公司 File sorting method and device and terminal
US20160357738A1 (en) * 2015-06-07 2016-12-08 Apple Inc. Apparatus, system and method for string disambiguation and entity ranking
CN105933437A (en) * 2016-06-15 2016-09-07 乐视控股(北京)有限公司 Server recommending method and device
CN107861949A (en) * 2017-11-22 2018-03-30 珠海市君天电子科技有限公司 Extracting method, device and the electronic equipment of text key word

Similar Documents

Publication Publication Date Title
CN109582791B (en) Text risk identification method and device
CN104067567B (en) System and method for carrying out spam detection using character histogram
WO2021169173A1 (en) Data clustering storage method and apparatus, computer device, and storage medium
CN107844634A (en) Polynary universal model platform modeling method, electronic equipment and computer-readable recording medium
US20090044095A1 (en) Automatically populating and/or generating tables using data extracted from files
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN109918499A (en) A kind of file classification method, device, computer equipment and storage medium
CN112328657A (en) Feature derivation method, feature derivation device, computer equipment and medium
CN114444619B (en) Sample generation method, training method, data processing method and electronic device
CN112231416A (en) Knowledge graph ontology updating method and device, computer equipment and storage medium
CN111695337A (en) Method, device, equipment and medium for extracting professional terms in intelligent interview
CN115018588A (en) Product recommendation method and device, electronic equipment and readable storage medium
CN113435308B (en) Text multi-label classification method, device, equipment and storage medium
CN113505273B (en) Data sorting method, device, equipment and medium based on repeated data screening
CN111625567A (en) Data model matching method, device, computer system and readable storage medium
CN110413856A (en) Classification annotation method, apparatus, readable storage medium storing program for executing and equipment
CN113962199A (en) Text recognition method, text recognition device, text recognition equipment, storage medium and program product
CN113591881A (en) Intention recognition method and device based on model fusion, electronic equipment and medium
CN112364214A (en) Numerical value grade-based character string sorting method and device, storage medium and terminal
CN106716980A (en) Method for displaying view and terminal device
CN108170838B (en) Topic evolution visualization display method, application server and computer readable storage medium
CN102103604B (en) Method and device for determining core weight of term
CN114612065B (en) Associated equipment combination method, device, equipment and medium for process papermaking
CN115660817A (en) Classification model training method and device
CN104463627A (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 518000 Room 101, building 10, Dayun software Town, 8288 Longgang Avenue, he'ao community, Yuanshan street, Longgang District, Shenzhen City, Guangdong Province

Applicant after: XTX Technology Inc.

Address before: 518000 1st floor, building 10, Dayun software Town, 8288 Longgang Avenue, Henggang street, Longgang District, Shenzhen City, Guangdong Province

Applicant before: Paragon Technology (Shenzhen) Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210212

RJ01 Rejection of invention patent application after publication