Summary of the invention
Compression method, device, medium and the electronics for being designed to provide a kind of multiple selection items list of the embodiment of the present invention
Equipment, so overcome user's operation difficulty in the related technology big at least to a certain extent and be put in storage one for being easy to report an error or
Multiple problems.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention
Practice and acquistion.
According to a first aspect of the embodiments of the present invention, a kind of data joining method is provided, comprising:
Obtain multiple selection items form information, wherein multiple selection items form information includes: the character information and project of project
Selection result;
The first sequence is carried out to the project in multiple selection items form information according to the character information of project, determines that project is arranged
Sequence table;
The second sequence is carried out according to selection result of the ranking of projects in entry sorting list to project, determines item
Mesh selection result sequencing information;
Selection result sequencing information is compressed, compression result obtained after compression is exported.
In one embodiment of the invention, the above-mentioned character information according to project is to the item in multiple selection items form information
Mesh carries out the first sequence, determines that entry sorting list includes:
The character information of project is ranked up according to preset character string sorting rule, determines entry sorting list.
In one embodiment of the invention, choosing of the above-mentioned ranking of projects according in entry sorting list to project
Before selecting the second sequence of result progress, method further include:
Multiple selection items list is detected;
When the selection result for detecting option in multiple selection items list is selected, with 1 identification options of binary digit
Selection result;
When the selection result for detecting option in multiple selection items list is non-selected, with 0 identification options of binary digit
Selection result.
In one embodiment of the invention, choosing of the above-mentioned ranking of projects according in entry sorting list to project
It selects result and carries out the second sequence, determine that the selection result sequencing information of project includes:
Projects of entry sorting list are traversed, determine the selection result of projects;
It is ranked up according to binary digit of the ranking of projects in entry sorting list to projects selection result,
Determine the binary digit selection result sequencing information of project.
In one embodiment of the invention, it is above-mentioned to selection result sequencing information carry out compression include:
The selection result sequencing information carry out sequence fractionation that binary digit identifies is obtained according to preset fractionation rule
Obtain each split result;
Hexadecimal conversion is carried out according to fractionation sequence to each split result, obtains the selection knot of hexadecimal digit mark
Fruit sequencing information;
The selection result sequencing information that hexadecimal digit identifies is determined as compression result.
According to a second aspect of the embodiments of the present invention, a kind of compression set of multiple selection items list is provided, comprising:
Module is obtained, for obtaining multiple selection items form information, wherein multiple selection items form information includes: the word of project
Accord with the selection result of information and project;
First sorting module carries out first to the project in multiple selection items form information for the character information according to project
Sequence, determines entry sorting list;
Second sorting module, for being carried out according to selection result of the ranking of projects in entry sorting list to project
Second sequence, determines items selection sort result information;
Compression module exports compression result obtained after compression for compressing to selection result sequencing information.
In one embodiment of the invention, above-mentioned first sorting module is specifically used for:
The character information of project is ranked up according to preset character string sorting rule, determines entry sorting list.
In one embodiment of the invention, further includes:
Mark module, for being detected to multiple selection items list;When the selection for detecting option in multiple selection items list
When being as a result selected, with the selection result of 1 identification options of binary digit;When the choosing for detecting option in multiple selection items list
Select result be it is non-selected when, with the selection result of 0 identification options of binary digit.
In one embodiment of the invention, above-mentioned second sorting module is specifically used for:
Projects of entry sorting list are traversed, determine the selection result of projects;
It is ranked up according to binary digit of the ranking of projects in entry sorting list to projects selection result,
Determine the binary digit selection result sequencing information of project.
In one embodiment of the invention, above-mentioned compression module is specifically used for:
The selection result sequencing information carry out sequence fractionation that binary digit identifies is obtained according to preset fractionation rule
Obtain each split result;Hexadecimal conversion is carried out according to fractionation sequence to each split result, obtains hexadecimal digit mark
Selection result sequencing information;The selection result sequencing information that hexadecimal digit identifies is determined as compression result.
According to a third aspect of the embodiments of the present invention, a kind of computer-readable medium is provided, computer is stored thereon with
Program realizes the compression side such as the multiple selection items list of first aspect in above-described embodiment when above procedure is executed by processor
Method.
According to a fourth aspect of the embodiments of the present invention, a kind of electronic equipment is provided, comprising: one or more processors;
Storage device, for storing one or more programs, when one or more programs are executed by one or more processors, so that
One or more processors realize the compression method such as the multiple selection items list of first aspect in above-described embodiment.
Technical solution provided in an embodiment of the present invention can include the following benefits:
The embodiment of the invention provides compression method, device, medium and the electronic equipment of a kind of multiple selection items list, packets
It includes: obtaining multiple selection items form information, wherein multiple selection items form information includes: the character information of project and the selection of project
As a result;The first sequence is carried out to the project in multiple selection items form information according to the character information of project, determines entry sorting
List;The second sequence is carried out according to selection result of the ranking of projects in entry sorting list to project, determines project
Selection result sequencing information;Selection result sequencing information is compressed, compression result obtained after compression is exported.This hair
The technical solution of bright embodiment can utilize the attribute information of plug-in unit itself, compress, mention to the character of multiple selection items list
The warehouse-in efficiency of a large amount of multiple selection items lists has been risen, and has reduced the probability that storage reports an error.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the present invention will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
Fig. 1 diagrammatically illustrates the compression method flow chart of multiple selection items list according to an embodiment of the invention.
Shown in referring to Fig.1, the compression method of multiple selection items list according to an embodiment of the invention, including walk as follows
It is rapid:
In step s 110, multiple selection items form information is obtained.
In one embodiment of the invention, above-mentioned multiple selection items form information includes: the character information and project of project
Selection result.
In one embodiment of the invention, multi-thread project form information can be the multiselect menu of down-drawable, it includes
There are the title of each project and the selection result of the project, in background service, the title of above-mentioned each project can pass through
Character string (letter and or number combinatorics on words) is indicated, and project chooses result and 0 and 1 can respectively indicate item by number
The selection result that mesh is non-selected and project is selected.
In the step s 120, first row is carried out to the project in multiple selection items form information according to the character information of project
Sequence determines entry sorting list.
In one embodiment of the invention, the character information of project is arranged according to preset character string sorting rule
Sequence determines entry sorting list.
In one embodiment of the invention, the character information of project is arranged according to preset character string sorting rule
Sequence is to arrange project character string by letter and numerical order forward direction, the purpose is to guarantee that its relative position is fixed, will not be occurred
Change provides safeguard for subsequent compression and decompression algorithm, if destination locations may be random ordering without sequence,
It also cannot be by it by fixed position encoded and compression, so entry sorting is necessary.
In one embodiment of the invention, preset character string sorting rule can be Unicode character string sorting rule
Then.
In step s 130, second is carried out according to selection result of the ranking of projects in entry sorting list to project
Sequence, determines items selection sort result information.
In one embodiment of the invention, according to the ranking of projects in entry sorting list to the selection knot of project
Before fruit carries out the second sequence, multiple selection items list is detected;When the selection knot for detecting option in multiple selection items list
When fruit is selected, with the selection result of 1 identification options of binary digit;When the selection for detecting option in multiple selection items list
When being as a result non-selected, with the selection result of 0 identification options of binary digit.
In one embodiment of the invention, projects of entry sorting list are traversed, determines projects
Selection result;It is arranged according to binary digit of the ranking of projects in entry sorting list to projects selection result
Sequence determines the binary digit selection result sequencing information of project.
In one embodiment of the invention, the method for carrying out the second sequence to the selection result of project is relative to multiselect
Dropdown control come using, the purpose is to selection complete control content after, return to call end carry out in-stockroom operation, in fact
It now can be get method, specifically, by the option for monitoring selection control, its internal generation after user has selected the option
Code attribute can be marked as 1 (code=1), and not selected code attribute default label is 0 (code=0), when user is complete
After portion selects, calls get method to loop through all options, check that its value is arranged in order by its code attribute and return
It returns, obtains tactic selection result sequencing information (such as: 10101010), then compressing to the selection result sequencing information
Equal subsequent operations, return to and call end.
In step S140, selection result sequencing information is compressed, compression result obtained after compression is exported.
In one embodiment of the invention, according to preset fractionation rule, to the selection result of binary digit mark
Sequencing information carry out sequence fractionation, obtains each split result;Hexadecimal conversion is carried out according to fractionation sequence to each split result,
Obtain the selection result sequencing information of hexadecimal digit mark;The selection result sequencing information that hexadecimal digit is identified is true
It is set to compression result.
In one embodiment of the invention, the selection result sequencing information that binary digit identifies is converted into two first
Secondly binary integer is converted into the selection result sequencing information of hexadecimal digit mark, finally by the integer of system
It is put in storage by calling value method that the selection result sequencing information that the hexadecimal digit identifies is returned to server.
In one embodiment of the invention, hexadecimal is commonly utilized in computer field, this is because by 4 bits
(Bit) it is less difficult that individual 16 binary digits are converted into, wherein 1 byte can be expressed as 2 continuous 16 binary digits,
Every four progress for the selection result sequencing information that binary digit can be identified are separately shown, for example, binary digit mark
When the selection result sequencing information of knowledge is 1110011011001100,1110,0110,1100,1,100 four can be split into
A unit, if each unit can be replaced with a character by hexadecimal representation, character representation was equivalent to it originally
1/4, compression ratio 75% may be implemented for long character string boil down to short character strings being put in storage based on this, reduce due to
The probability that storage character string is too long and storage is caused to report an error, specific algorithm realization may is that
Since decimal point, two sides are by " four one section " segmentation to the left and right, wherein benefit 0 is carried out less than four, then,
Each section of tetrad just corresponds to a hexadecimal number, and binary system turns hexadecimal transformational relation are as follows:
0000–0;
0001–1;
0010–2;
0011–3;
0100–4;
0101–5;
0110–6;
0111–7;
1000–8;
1001–9;
1010–A;
1011–B;
1100–C;
1101–D;
1110–E;
1111–F;
In one embodiment of the invention, the shaping character array that an initialize array length is 16 may is that
0000,0001,0010,0011,0100,0101,0110,0111,1000,1001,1010,1011,1100,1101,1110,
1111}。
In one embodiment of the invention, the string of binary characters " 101101 " given for one, firstly, by two into
Every four Character segmentations are one group in character string processed, and less than being filled up with 0 for four characters, above-mentioned character string carries out from right to left
Quaternate counting, only has 0 and 1 two character when to second group, fills up, fill up to it using 0 by first group: 1101
Afterwards the result is that: 0010, matched according to above-mentioned corresponding transformational relation, available hexadecimal sequencing information: 2D.
It is 16 that Fig. 2, which diagrammatically illustrates multiple selection items list according to an embodiment of the invention by Binary Conversion,
The schematic diagram of system.
Referring to shown in Fig. 2, multiple selection items list includes 16 projects, wherein selected project is 9, non-selected
Project be 7, according to sequence from top to bottom can obtain the multiple selection items list binary digit mark selection knot
Fruit: 1110011011001100,4 groupings are carried out from right to left and are obtained: 1110,0110,1100,1100;According to above-mentioned correspondence
Transformational relation matched, available hexadecimal sequencing information: E6CC, for the compression result, by normal flow
The character length of each value value is 2, when non-original value 01,02,03,06,07,08,09 (20 character), compressing and converting
It is afterwards E6CC (4 character), compression ratio (4)/20=20%;In the full choosing of test -1 01,02,03,04,05,06,07,08,
When 09,10,11,12,13,14,15 (45 character), compression ratio is 4/45 about 8.99%;It is 1 in character length, options
Mesh is less than 4, compression ratio 400%;Compression ratio is 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 when selecting entirely
When (38 character), compression ratio 4/38=10.52%;Therefore, in the case where working as multiple selection items list, pull-up values value length is too long,
Or its choose project it is excessive when be applicable in its compression storage, when choose value it is less it is contemplated that close compress.
In one embodiment of the invention, to compressed hexadecimal digit mark selection result sequencing information into
Row reduction can use set method, specifically, calling the selection result sequencing information of hexadecimal digit mark using control
After (such as AA), it can be reduced to the coding of binary system (such as 10101010) form, then it is pressed to the position of control project
It sets and is selected, be 11011 as crossed the binary coding after restoring, then it can be pressed 1 labeled as selected, 0 label by set method
For non-selected mark carry out sequence mark, with also selection result of the original subscriber on multiple selection items list, on which is
The inverse process of get method is stated, the selection result sequencing information that particular content is referred to above-mentioned binary digit mark is converted to
The related content of the selection result sequencing information of hexadecimal digit mark, which is not described herein again.
The device of the invention embodiment introduced below can be used for executing the compression of the above-mentioned multiple selection items list of the present invention
Method.
Fig. 3 diagrammatically illustrates the block diagram of the compression set of multiple selection items list according to an embodiment of the invention.
Referring to shown in Fig. 3, the compression set 300 of multiple selection items list according to an embodiment of the invention, comprising:
Module 301 is obtained, for obtaining multiple selection items form information, wherein multiple selection items form information includes: project
The selection result of character information and project;
First sorting module 302 carries out the project in multiple selection items form information for the character information according to project
First sequence, determines entry sorting list;
Second sorting module 303, for the selection result according to the ranking of projects in entry sorting list to project
The second sequence is carried out, determines items selection sort result information;
Compression module 304, it is for being compressed to selection result sequencing information, compression result obtained after compression is defeated
Out.
In one embodiment of the invention, above-mentioned first sorting module 302 is specifically used for:
The character information of project is ranked up according to preset character string sorting rule, determines entry sorting list.
In one embodiment of the invention, further includes:
Mark module 305, for being detected to multiple selection items list;When the choosing for detecting option in multiple selection items list
Selecting result is when selected, with the selection result of 1 identification options of binary digit;When detecting option in multiple selection items list
When selection result is non-selected, with the selection result of 0 identification options of binary digit.
In one embodiment of the invention, above-mentioned second sorting module 303 is specifically used for:
Projects of entry sorting list are traversed, determine the selection result of projects;
It is ranked up according to binary digit of the ranking of projects in entry sorting list to projects selection result,
Determine the binary digit selection result sequencing information of project.
In one embodiment of the invention, above-mentioned compression module 304 is specifically used for:
The selection result sequencing information carry out sequence fractionation that binary digit identifies is obtained according to preset fractionation rule
Obtain each split result;Hexadecimal conversion is carried out according to fractionation sequence to each split result, obtains hexadecimal digit mark
Selection result sequencing information;The selection result sequencing information that hexadecimal digit identifies is determined as compression result.
Due to each functional module of the compression set of the multiple selection items list of example embodiments of the present invention and above-mentioned the
The step of example embodiment of the compression method of the multiple selection items list of one side, is corresponding, therefore for apparatus of the present invention embodiment
In undisclosed details, please refer to the compression method of the multiple selection items list of the above-mentioned first aspect of the present invention.
Below with reference to Fig. 4, it illustrates the computer systems 400 for the electronic equipment for being suitable for being used to realize the embodiment of the present invention
Structural schematic diagram.The computer system 400 of electronic equipment shown in Fig. 4 is only an example, should not be to the embodiment of the present invention
Function and use scope bring any restrictions.
As shown in figure 4, computer system 400 includes central processing unit (CPU) 401, it can be read-only according to being stored in
Program in memory (ROM) 402 or be loaded into the program in random access storage device (RAM) 403 from storage section 408 and
Execute various movements appropriate and processing.In RAM 403, it is also stored with various programs and data needed for system operatio.CPU
401, ROM 402 and RAM 403 is connected with each other by bus 404.Input/output (I/O) interface 405 is also connected to bus
404。
I/O interface 405 is connected to lower component: the importation 406 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 407 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 408 including hard disk etc.;
And the communications portion 409 of the network interface card including LAN card, modem etc..Communications portion 409 via such as because
The network of spy's net executes communication process.Driver 410 is also connected to I/O interface 405 as needed.Detachable media 411, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 410, in order to read from thereon
Computer program be mounted into storage section 408 as needed.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 409, and/or from detachable media
411 are mounted.When the computer program is executed by central processing unit (CPU) 401, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs
When standby execution, so that the electronic equipment realizes the compression method such as the multiple selection items list in above-described embodiment.
For example, above-mentioned electronic equipment may be implemented as shown in Figure 1: step S110 obtains multiple selection items list letter
Breath;Step S120 carries out the first sequence to the project in multiple selection items form information according to the character information of project, determines item
Mesh sorted lists;Step 130, second row is carried out according to selection result of the ranking of projects in entry sorting list to project
Sequence determines items selection sort result information;Step 140, selection result sequencing information is compressed, will be obtained after compression
The compression result output obtained.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description
Member, but this division is not enforceable.In fact, embodiment according to the present invention, it is above-described two or more
Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould
The feature and function of block or unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention
Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.