CN107239436B - A kind of data transfer device and device - Google Patents
A kind of data transfer device and device Download PDFInfo
- Publication number
- CN107239436B CN107239436B CN201710400261.6A CN201710400261A CN107239436B CN 107239436 B CN107239436 B CN 107239436B CN 201710400261 A CN201710400261 A CN 201710400261A CN 107239436 B CN107239436 B CN 107239436B
- Authority
- CN
- China
- Prior art keywords
- unit
- target
- string
- text information
- conversion
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
Abstract
The embodiment of the invention discloses a kind of data transfer device and devices, the described method includes: obtaining urtext information, and there are when at least one crucial unit string in detecting the urtext information, the selection target key unit string at least one described crucial unit string;According to preset conversion formula by the numerical value conversion to be converted in the target critical unit string be target value corresponding with target unit, and by the Conversion of measurement unit to be converted in the target critical unit string be the target unit, obtain the target critical unit string corresponding conversion key unit string;When all crucial unit strings are converted into corresponding conversion key unit string, converting text information corresponding with the urtext information is generated, and show the converting text information in preset display area.Using the present invention, to improve data conversion efficiency, and development efficiency can be improved to avoid cumbersome manual operation.
Description
Technical field
The present invention relates to Internet technical field more particularly to a kind of data transfer devices and device.
Background technique
In recent years, deepening continuously with development of Mobile Internet technology, preferably to provide more convenient and fast information for user
Service, research staff are being dedicated to developing always the small routine of connection user and service completely newly a kind of (for example, wechat little Cheng
Sequence), these wechat small routines can directly and mobile phone hardware carries out data interaction, for example, the gravity sensing and camera shooting of calling mobile phone
Function etc., with it is more convenient, rapidly enable camera services.But these small routines and mobile phone hardware carry out data interaction it
Before, can also it be related between relevant unit's size in some appointment codes in program (for example, CSS code or WCSS code)
Conversion, for example, it is desired to by screen pixels px (pixel, the basic coding of basic protochrome and its gray scale) Conversion of measurement unit be it is micro-
Believe rpx (responsice pixel, response screen pixel) unit in small routine.
In the prior art, to the px size that will be carried in code rpx size corresponding with Conversion of measurement unit and unit, then past
Toward need user in advance in one section of source code manual search to the px unit, and obtain corresponding with px unit px number
Value, and rpx numerical value corresponding with px numerical value is calculated by means of additional calculating instrument or by way of mental arithmetic, return this
Px numerical value is changed to rpx numerical value manually, and px unit is changed to rpx unit by the px unit position in source code.If
There are a large amount of px units in the source code, then pass through this manual amendment's conversion regime, it will bring ten to developer
Divide cumbersome operation, and quite time-consuming, causes data conversion efficiency low, affect development efficiency.
Summary of the invention
The embodiment of the present invention provides a kind of data transfer device and device, can be to avoid cumbersome manual operation, to improve
Data conversion efficiency, and improve development efficiency.
First aspect present invention provides a kind of data transfer device, comprising:
Urtext information is obtained, and there are at least one crucial unit characters in detecting the urtext information
When string, the selection target key unit string at least one described crucial unit string;
It is and target by the numerical value conversion to be converted in the target critical unit string according to preset conversion formula
The corresponding target value of unit, and be the target list by the Conversion of measurement unit to be converted in the target critical unit string
Position obtains the crucial unit string of the corresponding conversion of the target critical unit string;
When all crucial unit strings are converted into the crucial unit string of corresponding conversion, generation with it is described original
The corresponding converting text information of text information, and the converting text information is shown in preset display area.
Second aspect of the present invention provides a kind of data conversion device, comprising:
Text obtains module, for obtaining urtext information;
Module is detected and selected, for there are at least one crucial unit strings in detecting the urtext information
When, the selection target key unit string at least one described crucial unit string;
Conversion module is calculated, for will be to be converted in the target critical unit string according to preset conversion formula
Numerical value conversion is target value corresponding with target unit, and the unit to be converted in the target critical unit string is turned
It is changed to the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;
Display module is generated, for being converted into the crucial unit string of corresponding conversion when all crucial unit strings
When, converting text information corresponding with the urtext information is generated, and show the conversion text in preset display area
This information.
Third aspect present invention provides a kind of data conversion device, comprising: processor and memory;
The processor is connected with memory, wherein for storing program code, the processor is used for the memory
Said program code is called, to execute following operation:
Urtext information is obtained, and there are at least one crucial unit characters in detecting the urtext information
When string, the selection target key unit string at least one described crucial unit string;
It is and target by the numerical value conversion to be converted in the target critical unit string according to preset conversion formula
The corresponding target value of unit, and be the target list by the Conversion of measurement unit to be converted in the target critical unit string
Position obtains the crucial unit string of the corresponding conversion of the target critical unit string;
When all crucial unit strings are converted into the crucial unit string of corresponding conversion, generation with it is described original
The corresponding converting text information of text information, and the converting text information is shown in preset display area.
Fourth aspect of the embodiment of the present invention provides a kind of computer storage medium, and the computer storage medium is stored with
Computer program, the computer program include program instruction, and described program instruction executes the present invention when being executed by a processor
Method in embodiment in first aspect.
The embodiment of the present invention exists at least by obtaining urtext information, and in detecting the urtext information
When one crucial unit string, the selection target key unit string at least one described crucial unit string;Root
According to preset conversion formula by the numerical value conversion to be converted in the target critical unit string be it is corresponding with target unit
Target value, and be the target unit by the Conversion of measurement unit to be converted in the target critical unit string, it obtains described
The crucial unit string of the corresponding conversion of target critical unit string;When all crucial unit strings be converted into it is corresponding
When converting crucial unit string, converting text information corresponding with the urtext information is generated, and in preset display
Region shows the converting text information.It can be seen that the present invention may be implemented by detecting crucial unit string to target
The automatic conversion of crucial unit string, it is equally possible that all crucial unit strings in urtext information into
Row automatic conversion that is, in the conversion process of crucial unit string, is not necessarily to so that the Batch conversion to multiple data can be realized
User is replaced manually, so as to improve data conversion efficiency, and improves development efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of data transfer device provided in an embodiment of the present invention;
Fig. 2 a and Fig. 2 b are the display interface schematic diagrames before and after a kind of text conversion provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another data transfer device provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of text interface based on data conversion request provided in an embodiment of the present invention;
Fig. 5 is that the embodiment of the present invention provides a kind of schematic diagram of manual switching display interface;
Fig. 6 is a kind of structural schematic diagram of data conversion device provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram for detecting and selecting module provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram for calculating conversion module provided in an embodiment of the present invention;
Fig. 9 is the structural schematic diagram of another data conversion device provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
It referring to Figure 1, is a kind of flow diagram of data transfer device provided in an embodiment of the present invention.As shown in Figure 1,
The method may include:
S101 obtains urtext information, and there are at least one crucial lists in detecting the urtext information
When the character string of position, the selection target key unit string at least one described crucial unit string;
Specifically, compiling terminal obtains urtext information, and the urtext information can be one section of finger of user's input
Determine code, this section of appointment codes are often referred to CSS (Cascading Style Sheets, cascading style sheets) code or WCSS
(sample tabular form is laminated in WAP Cascading Style Sheet, Wireless Application Protocol) code, and it is described original detecting
There are when at least one crucial unit string in text information, the compiling terminal can be at least one described crucial unit word
Select a crucial unit string as target critical unit string in symbol string;
Wherein, compiling terminal may include that PC, tablet computer, laptop etc. have data compilation function
Terminal device;
Wherein, the crucial unit string can be the form of numerical value+px unit, or the shape for numerical value+rpx unit
Formula when that is, in checking the urtext information comprising px unit, by certain px unit and can be located at the px unit automatically
The numerical value of front is referred to as crucial unit string, and then can find out at least one crucial unit string;Similarly, exist
When checking in the urtext information comprising rpx unit, by certain rpx unit and it can be located at before the rpx unit automatically
Numerical value be referred to as crucial unit string, and then at least one crucial unit string can be found out;Optionally, the volume
Translating terminal also can receive the data conversion request for carrying unit (for example, px unit) to be converted, and be asked according to the data conversion
It asks and whether there is at least one crucial unit string corresponding with the unit to be converted in the detection urtext information,
If it exists, then can at least one described crucial unit string selection target key unit string;As it can be seen that the compiling
Terminal can unit to be converted described in automatic identification, the data conversion request that can also be sent according to user identifies that the urtext is believed
With the presence or absence of at least one crucial unit string corresponding with the unit to be converted in breath.Getting the urtext
It, can be using find first crucial unit string as target critical unit string after information.
Wherein, WCSS is CSS exclusive under WAP2.0, i.e. WCSS (WAP CSS) is that subset+some WAP of CSS2 are peculiar
Extension, it is therefore an objective to the style and layout of definition document for example have difference since different cell phone apparatus has the feature of multiplicity
The display screen of size, therefore WAP CSS can eliminate those functions of not being suitable for especially small equipment, and joined
The proprietary feature of WAP.In consideration of it, translator and compiler can define the display situation of entire Web application software in CSS document, and
It can according to circumstances be changed at any time and show situation, as long as that is, translator and compiler make once to change in CSS document, so that it may immediately by this
Secondary change is applied to have references to the display page of all websites of the CSS document in browser.
Wherein, the target critical unit string includes numerical value to be converted and unit to be converted, for example, with urtext
For the code { font-size:12px } for indicating font size in information, the 12px in the code is the target critical list
Position character string, it is list to be converted that the numerical value (12) in the target critical unit string, which is numerical value to be converted, unit (px),
Position.
Step S102, according to preset conversion formula by the numerical value conversion to be converted in the target critical unit string
It for target value corresponding with target unit, and is described by the Conversion of measurement unit to be converted in the target critical unit string
Target unit obtains the crucial unit string of the corresponding conversion of the target critical unit string;
Specifically, the urtext information is determined as text information to be processed by the compiling terminal, and will it is described to
Processing text information is added in unit array, and based on the target critical unit string by the institute in the unit array
It states text information to be processed and is divided into preamble text information, target critical unit string and postorder text information, and according to
Preset conversion formula by the numerical value conversion to be converted in the target critical unit string in the unit array be with
The corresponding target value of target unit, and be the target by the Conversion of measurement unit to be converted in the target critical unit string
Unit obtains the crucial unit string of the corresponding conversion of the target critical unit string, and further by the units
The conversion key unit string, the preamble text information and the postorder text information in group be determined as it is new to
Text information is handled, and searches next crucial unit string in the postorder text information, to be determined as new target
Crucial unit string, in order to continue based on the new target critical unit string to described in the unit array
New text information to be processed is divided and is converted;Until by all crucial unit strings in the urtext information
It is converted into the crucial unit string of corresponding conversion, then does not continue to that the content in the unit array is divided and turned
It changes, can further execute step S103;
Wherein, the preamble text information refer to target critical unit string described in the text information to be processed it
Preceding all character strings, the postorder text information refer to target critical unit string described in the text information to be processed
All character strings later.
Wherein, during carrying out crucial unit string conversion, the crucial unit string of every conversion one, the list
Text information to be processed in bit array is then updated once, i.e., every time only to target critical unit character carry out numerical value and
The conversion operation of unit, and the position coordinates without calculating and recording target critical unit string, are searched so as to improve
And transfer efficiency.In addition it is updated in the unit array with the obtained target value after conversion and the target unit
Numerical value to be converted and unit to be converted in the target critical unit character, to obtain and the target critical unit string
The crucial unit string of corresponding conversion, and by splice the preamble text information, conversion key unit string with
And the postorder text information, new text information to be processed can be obtained.Further, the institute in the unit array can be continued
It states and searches next crucial unit string in postorder text information, to be determined as new target critical unit string, thus
Further to the new text information to be processed according to the division and conversion regime progress to above-mentioned text information to be processed
It is further to divide and convert, new text information to be processed is such as divided into new preamble text information, new target critical
Unit string and new postorder text information, and new target critical unit string is converted into the crucial list of new conversion
Position character string.
Wherein, when the target unit is first object unit (for example, rpx unit), the conversion formula are as follows: (to
Transforming numerical * (750/ design original text width) * a)+first object unit;
When the target unit is the second target unit (for example, px unit), the conversion formula are as follows: (number to be converted
Value * (design original text width/750) * a) the+the second target unit;
Wherein, a is preset scale factor, which can be 2, can also be adjusted according to actual needs
It is whole.
For example, by taking preset scale factor a=2 as an example, when the target critical unit string found is 15px
When, the conversion formula will carry out conversion operation according to by the algorithm that px Conversion of measurement unit is rpx unit, i.e., the conversion at this time
Formula is (numerical value * (750/ design original text width) * 2 to be converted)+first object unit.At this point, the compiling terminal can be by character
Px is synchronized as the unit to be converted in the target critical unit string and is regard numerical value 15 as the target critical unit
Numerical value to be converted in character string can be into addition, when getting pre-set design original text width (for example, the 750px) of user
Input value of one step by numerical value 750 as the conversion formula, i.e., at this moment the compiling terminal can be according to the ratio of 1:2 by px
The corresponding numerical value conversion of unit is the corresponding numerical value of rpx unit (i.e. target unit is first object unit).Therefore, it can calculate
It is 15* (750/750) * 2=30 to target value corresponding with the target unit (rpx), is closed so that the target can be obtained
Key unit string is corresponding to convert crucial unit string as 30rpx.
Step S103 is generated when all crucial unit strings are converted into corresponding conversion key unit string
Converting text information corresponding with the urtext information, and the converting text information is shown in preset display area;
Specifically, when the compiling terminal detects the last one crucial unit string conversion in the unit array
When unit string crucial for corresponding conversion, it may be determined that all crucial unit strings in the urtext information are equal
The crucial unit string of corresponding conversion is converted to, can be further determined as all the elements in the unit array described
The corresponding converting text information of urtext information, and the converting text information is shown in preset display area;
It wherein, can be default after key unit strings all in the urtext information are carried out conversion process
Display area shown automatically according to default display format, can be in interface to be converted by three kinds of display format (formats
Change pattern, horizontally-arranged pattern and compression pattern) in default display of any one display format as the converting text information
Format is shown.Wherein, the converting text information under three kinds of display formats respectively corresponds different display interfaces, i.e.,
Content of text in the conversion text information in braces can be carried out branch by turning point of branch by the formatting styles
It has been shown that, this mode are easier to developer and interpret;The horizontally-arranged pattern will can include greatly in the conversion text information
All convergence is shown in a line to content of text in number, to reduce the capacity of converting text information;The compression pattern can incite somebody to action
After the conversion text information carries out set solid distribution line by line according to the display width of the display area, then carry out next line
Distribution, until all display is in the display area by the converting text information after the Batch conversion, to maximize
The capacity of ground reduction converting text information.
Further, by taking display format is formatting styles as an example, the compiling terminal can be by the urtext information
In all crucial unit strings be converted into corresponding conversion key unit string, and preset display area according to
The formatting styles show the converting text information.
It specifically, is aobvious before and after a kind of text conversion provided in an embodiment of the present invention please also refer to Fig. 2 a and Fig. 2 b
Show interface schematic diagram.Wherein, Fig. 2 a is the urtext information of one section of carrying unit (px unit) to be converted of user's input, and
The design original text width of user preset is 750px, the scale factor a=2 in preset conversion formula.Therefore, shown in Fig. 2 a
In display interface 100, the compiling terminal be can be detected in the urtext information there are at least one crucial unit string,
At least one i.e. described crucial unit string is in 10px and fifth line in the display interface 100 in fourth line
10px.Then, can turn using the two crucial unit strings as target critical unit string, and according to by px unit
Change the conversion formula of rpx unit into (such as: (numerical value * (750/750) * 2 to be converted)+first object unit;Wherein, number to be converted
Value is 10, and first object unit is rpx).Therefore, the compiling terminal can be further in the display interface 200 shown in Fig. 2 b
The converting text information after conversion is shown automatically according to the Show Styles (i.e. formatting styles), after specific conversion
Display situation can refer to conversion key unit string shown by the 9th row and the tenth row in display interface 200 shown in Fig. 2 b
20rpx。
It can be seen that the compiling terminal passes through first obtains urtext information, and detecting the urtext
There are when at least one crucial unit string in information, selection target is crucial at least one described crucial unit string
Unit string;Secondly, according to preset conversion formula by the numerical value conversion to be converted in the target critical unit string
It for target value corresponding with target unit, and is described by the Conversion of measurement unit to be converted in the target critical unit string
Target unit obtains the crucial unit string of the corresponding conversion of the target critical unit string;Then, when all crucial single
When position character string is converted into corresponding conversion key unit string, conversion text corresponding with the urtext information is generated
This information, and the converting text information is shown in preset display area.As it can be seen that the present invention is by detecting crucial unit character
String, may be implemented the automatic conversion to target critical unit string, it is equally possible that all in urtext information
Crucial unit string carries out automatic conversion, so that the Batch conversion to multiple data can be realized, i.e., in crucial unit string
Conversion process in, replaced manually without user, so as to improve data conversion efficiency, and improve development efficiency.
Further, Fig. 3 is referred to, is the process signal of another data transfer device provided in an embodiment of the present invention
Figure;As shown in figure 3, the method may include:
Step S301 obtains urtext information, and receives the data conversion request for carrying unit to be converted, and according to institute
It states data conversion request and obtains regular expression corresponding with the unit to be converted;
Wherein, the urtext information can be often referred to CSS for one section of appointment codes of user's input, this section of appointment codes
(Cascading Style Sheets, cascading style sheets) code or WCSS (WAP Cascading Style Sheet, wirelessly
Sample tabular form is laminated using communications protocol) code;
Wherein, WCSS is CSS exclusive under WAP2.0, i.e. WCSS is subset+distinctive extension of some WAP of CSS2, mesh
Be definition document style and layout, since different cell phone apparatus has the feature of multiplicity, for example have different size of aobvious
Display screen curtain, therefore WAP CSS can eliminate those functions of not being suitable for especially small equipment, and joined the special of some WAP
It is functional.In consideration of it, translator and compiler can define the display situation of entire Web application software in CSS document, and can root at any time
Change it according to situation and show situation, as long as that is, translator and compiler make once to change in CSS document, so that it may will specifically change answer immediately
For having references to the display page of all websites of the CSS document in browser;
Wherein, the data conversion request, which can be, clicks a switching button being located in interface to be converted by user
And the convert requests initiated, the button to be converted can turn rpx button for px or rpx turns px button.
It specifically, is a kind of text circle based on data conversion request provided in an embodiment of the present invention please also refer to Fig. 4
The schematic diagram in face.As shown in figure 4, in text interface, including two display interfaces, display interface 500 and interface to be converted
600, and the urtext information in the display interface 500 is that one section of source code that user inputs also is deposited at the same time
It is manually operated by user at another to determine target unit and control the interface to be converted 600 of display format, i.e. user can
To select corresponding operation to instruct according to actual needs in the interface 600 to be converted.For example, user, which can click px, turns rpx
Button, so that the compiling terminal receives the data conversion request for carrying unit to be converted, and according to the data conversion request
Obtain regular expression corresponding with the unit to be converted.Wherein, the regular expression can be used for judging the original text
Whether the to be converted unit is carried in this information;The unit to be converted can be px unit or rpx unit;The i.e. described canonical
Expression formula can search for the crucial unit string for carrying the px unit based on px unit in one section of urtext information.Similarly
Ground, if user clicks rpx and turns px button, regular expression corresponding with rpx then can be based on rpx unit in one section of urtext
Search carries the crucial unit string of the rpx unit in information.
Step S302, according to the regular expression, searched whether in the urtext information exist with it is described to
At least one corresponding crucial unit string of conversion unit;
Step S303, at least one crucial unit string corresponding with the unit to be converted if it exists, then described
Selection target key unit string at least one crucial unit string;
Wherein, the step S301- step S303 is a tool based on step S101 in embodiment corresponding to above-mentioned Fig. 1
Body embodiment.
The urtext information is determined as text information to be processed by step S304, and by the text envelope to be processed
Breath is added in unit array;
Step S305, based on the target critical unit string by the text envelope to be processed in the unit array
Breath is divided into preamble text information, target critical unit string and postorder text information;
Step S306, will be in the target critical unit string in the unit array according to preset conversion formula
Numerical value conversion to be converted be target value corresponding with target unit, and by the target critical unit string wait turn
Changing Conversion of measurement unit is the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;
Step S307, by the unit array the conversion key unit string, the preamble text information with
And the postorder text information is determined as new text information to be processed, and searches next pass in the postorder text information
Key unit string, to be determined as new target critical unit string, in order to continue based on the new target critical list
Position character string is divided and is converted to the new text information to be processed in the unit array;
Wherein, the compiling terminal is after executing the step S307, i.e., the next crucial unit character that will be found
String is determined as after new target critical unit string, can further repeat above-mentioned steps S305- step S307, until
It, can be further when the crucial unit string of the last one in the unit array is converted to corresponding conversion key unit string
Execute step S308.
Wherein, step S304- step S307 specific implementation can be found in embodiment corresponding to above-mentioned Fig. 1 to step
The description of S102 will be repeated no longer here.
Still by taking above-mentioned Fig. 4 as an example, the compiling terminal can be by the original text in display interface 500 involved in above-mentioned Fig. 4
For this information as text information to be processed, the text information to be processed is as follows:
".convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:10px;}h4{margin-bottom:20px}.alert-info{padding-left:0}";With
Afterwards, it is added to unit array, and the text information to be processed in unit array is divided, such as the units after dividing
Group are as follows:
[.convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:,10px,;H4 { margin-bottom:20px } .alert-info { padding-left:0 }],
So as to by the target critical unit string of " 10px " as the unit array in the text information to be processed, and by unit
Preamble text envelope of all text informations as the unit array in text information to be processed described in array before " 10px "
Breath, i.e., by all character strings before " 10px ":
".convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;Padding-left: " it is used as the preamble text information, and will be after " 10px " in the text information to be processed
Postorder text information of all text informations as the unit array, can be by all character strings after 10px ": ";}h4
{ margin-bottom:20px } .alert-info { padding-left:0 } " is used as the postorder text information.
Further, the compiling terminal can convert the target critical unit string " 10px " in the unit array
For the crucial unit string " 20rpx " of corresponding conversion, and by the conversion key unit string in the unit array
(20rpx), the preamble text information and the postorder text information are spliced into new text information to be processed;In consideration of it,
The new text information to be processed is as follows:
".convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:20rpx;}h4{margin-bottom:20px}.alert-info{padding-left:0}".
Wherein, the compiling terminal will further can find next crucial unit string in the postorder text information
" 20px ", and " 20px " is determined as to new target critical unit string, and based on the new target critical unit character
It goes here and there and the new text information to be processed is divided in the unit array, the unit array after division can are as follows:
[.convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:20rpx;H4 margin-bottom:, 20px .alert-info padding-left:
0}].Wherein, the unit array includes new preamble text information, new target critical unit string and new postorder
Text information.Wherein the new target critical unit string is " 20px ", and the new preamble text information is
Alphabet string before " 20px ", i.e., the described new preamble text information are as follows:
".convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:20rpx;}h4{margin-bottom:"
The new postorder text information is the alphabet string after " 20px ", i.e., the described new postorder text information
Are as follows: " .alert-info { padding-left:0 } ".The compiling terminal can be by new target critical unit string
" 20px " is converted to corresponding new conversion key unit string " 40rpx ", and will be described new in the unit array
Crucial unit string (40rpx), the new preamble text information and the new postorder text information is converted to be spliced into
Final text information to be processed;In consideration of it, the final text information to be processed is as follows:
".convert_option:after{content:'\20';display:block;height:0;clear:
both;}body{front-family:"front-family:\5FAE\8F6F\96C5\9ED1;";}u1{list-style:
none;padding-left:20rpx;}h4{margin-bottom:40rpx}.alert-info{padding-left:0}"
Due in the new postorder text information by there is no the crucial unit string for carrying unit px to be converted, institutes
It will be as the last one crucial unit string, then when detecting the list using new target critical unit string " 20px "
The last one crucial unit string (20px) in bit array is converted to the crucial unit string (40rpx) of corresponding conversion
When, converting text information corresponding with the urtext information can be obtained, the converting text information is described final
Text information to be processed.Wherein, the situation that is particularly shown of the converting text information can be found in implementation corresponding to following Fig. 5
Example.
It is saved since the unit array can play the role of a data, i.e., every conversion one crucial unit string,
The crucial unit string of the conversion can be saved in the unit array, so as to constantly in the unit array
Text information to be processed is updated processing, and then makes the compiling terminal without positioning the target critical unit string
Location information and without the location information for positioning next crucial unit string in the follow-up text information, therefore,
It can be further improved the transfer efficiency of data.And text information to be processed is saved by the unit array, it can make
Text information to be processed in treatment process will not be shown in the preset display area, only when in the unit array
The last one crucial unit string when being converted to the crucial unit string of corresponding conversion, just shown in preset display area
Show all the elements in the unit array, it is excessively chaotic to avoid display effect.
Step S308, when the last one crucial unit string in the unit array is converted to corresponding conversion key
When unit string, all the elements in the unit array are determined as the corresponding converting text of the urtext information and are believed
Breath, and the converting text information is shown in preset display area.
Specifically, when the last one crucial unit string in the unit array is converted to the crucial list of corresponding conversion
When the character string of position, the compiling terminal, which can determine, is converted into all crucial unit strings in the urtext information
The crucial unit string of corresponding conversion realizes the Batch conversion operation of unit to be converted, to produce and the original
The corresponding converting text information of beginning text information, and the converting text information is shown in preset display area.
Further, Fig. 5 is referred to, is that the embodiment of the present invention provides a kind of schematic diagram of manual switching display interface.Such as
Shown in Fig. 5, shown when the converting text information carries out multirow according to the text display format in display interface 700 shown in fig. 5
When showing, user can further change display effect manually, and selection is aobvious in the interface 600 to be converted mentioned by above-mentioned Fig. 4
Sample formula is horizontally-arranged pattern, and then can form the text display format in display interface 300 as shown in Figure 5, i.e., on display circle
In face 300, the converting text information will carry out operation of changing one's profession automatically by breakpoint of braces.Similarly, user can also be upper
It states and selects Show Styles to compress pattern in interface 600 to be converted mentioned by Fig. 4, and then display as shown in Figure 5 can be formed
Text display format in interface 400, i.e., in display interface 400, the converting text information will be with the aobvious of the display area
Show that width is that breakpoint carries out operation of changing one's profession automatically, at second row of further arranging after first row text is booked
Text information, until all display is in the display area by the converting text information, maximumlly to save institute
State the capacity of converting text information.In consideration of it, it is worth noting that, these three display formats (formatting styles, horizontally-arranged pattern and
Compression pattern) it can be realized on the display area between any two kinds of display formats according to the idsplay order received
Format conversion.
Optionally, if the compiling terminal does not use the unit array come when being saved, can also detect it is described
There are at least one crucial unit string in urtext information, the position coordinates of each crucial unit string of synchronous recording,
After each crucial unit string is all converted to the crucial unit string of corresponding conversion, it is successively based on the position
Each crucial unit string in the urtext information is updated to the crucial unit string of corresponding conversion by coordinate, or
Update can also be synchronized to each crucial unit string in the urtext information based on the position coordinates, with life
Described turn disposably all is shown at converting text information corresponding with the urtext information, and in preset display area
Change text information.
It can be seen that the compiling terminal passes through first obtains urtext information, and detecting the urtext
There are when at least one crucial unit string in information, selection target is crucial at least one described crucial unit string
Unit string;Secondly, according to preset conversion formula by the numerical value conversion to be converted in the target critical unit string
It for target value corresponding with target unit, and is described by the Conversion of measurement unit to be converted in the target critical unit string
Target unit obtains the crucial unit string of the corresponding conversion of the target critical unit string;Then, when all crucial single
When position character string is converted into corresponding conversion key unit string, conversion text corresponding with the urtext information is generated
This information, and the converting text information is shown in preset display area.As it can be seen that the present invention is by detecting crucial unit character
String, may be implemented the automatic conversion to target critical unit string, it is equally possible that all in urtext information
Crucial unit string carries out automatic conversion, so that the Batch conversion to multiple data can be realized, i.e., in crucial unit string
Conversion process in, replaced manually without user, so as to improve data conversion efficiency, and improve development efficiency.
Further, Fig. 6 is referred to, is a kind of structural schematic diagram of data conversion device provided in an embodiment of the present invention.
As shown in fig. 6, the data conversion device 1 can be applied to the compiling terminal in above-mentioned Fig. 1 corresponding embodiment, the data turn
Changing device 1 includes: that text obtains module 10, detects and selects module 20, calculates conversion module 30 and generates display module 40;
The text obtains module 10, for obtaining urtext information;
It is described to detect and select module 20, for there are at least one crucial units in detecting the urtext information
When character string, the selection target key unit string at least one described crucial unit string;
Wherein, the text, which obtains module 10, can be found in above-mentioned Fig. 1 institute with the specific implementation for detecting and selecting module 20
To the description of step S101 in corresponding embodiment, will no longer repeat here.
Further, Fig. 7 is referred to, is a kind of structural schematic diagram for detecting and selecting module provided in an embodiment of the present invention.
As shown in fig. 7, the module 20 that detects and selects includes: to receive acquiring unit 201, key character searching unit 202 and target word
Accord with selecting unit 203;
The reception acquiring unit 201, for receiving the data conversion request for carrying unit to be converted, and according to the number
Regular expression corresponding with the unit to be converted is obtained according to convert requests;
The key character searching unit 202, for being looked into the urtext information according to the regular expression
It looks for the presence or absence of at least one crucial unit string corresponding with the unit to be converted;
The target character selecting unit 203, at least one key corresponding with the unit to be converted if it exists
Unit string, then the selection target key unit string at least one described crucial unit string;
Wherein, the reception acquiring unit 201, the tool of key character searching unit 202 and target character selecting unit 203
Body implementation can be found in the description in embodiment corresponding to above-mentioned Fig. 3 to step S301- step S303, will no longer carry out here
It repeats.
The calculating conversion module 30, for will be in the target critical unit string according to preset conversion formula
Numerical value conversion to be converted is target value corresponding with target unit, and will be to be converted in the target critical unit string
Conversion of measurement unit is the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;
Further, Fig. 8 is referred to, is a kind of structural schematic diagram for calculating conversion module provided in an embodiment of the present invention.
As shown in figure 8, the calculating conversion module 30 includes: text information adding unit 301, text information division unit 302, target
Character conversion unit 303 determines searching unit 304;
The text information adding unit 301, for the urtext information to be determined as text information to be processed, and
The text information to be processed is added in unit array;
The text information division unit 302, for being based on the target critical unit string for the unit array
In the text information to be processed be divided into preamble text information, target critical unit string and postorder text information;
The target character converting unit 303, for will be described in the unit array according to preset conversion formula
Numerical value conversion to be converted in target critical unit string is target value corresponding with target unit, and the target is closed
Conversion of measurement unit to be converted in key unit string is the target unit, and it is corresponding to obtain the target critical unit string
Convert crucial unit string;
Specifically, the target character converting unit 303 is specifically used for obtaining preset design original text width, and will be described
Numerical value to be converted in the target critical unit string and the design original text width in unit array is as the conversion
The input value of formula, and target value corresponding with the target unit is exported by the conversion formula;
Wherein, when the target unit is first object unit, the conversion formula are as follows: (numerical value * (750/ to be converted
Design original text width) * a)+first object unit;
When the target unit is the second target unit, the conversion formula are as follows: ((design original text is wide by numerical value * to be converted
Degree/750) * a) the+the second target unit;
Wherein, a is preset scale factor
The determining searching unit 304, for by the conversion key unit string, described in the unit array
Preamble text information and the postorder text information are determined as new text information to be processed, and in the postorder text information
It is middle to search next crucial unit string, to be determined as new target critical unit string, and notify the text information
Division unit 302 and the target character converting unit 303 continue based on the new target critical unit string to described
The new text information to be processed in unit array is divided and is converted.
Wherein, the text information adding unit 301, text information division unit 302, target character converting unit 303,
Determine that the specific implementation of searching unit 304 can be found in embodiment corresponding to above-mentioned Fig. 3 to step S304- step S307's
Description, will no longer repeat here.
The generation display module 40, for being converted into the crucial unit of corresponding conversion when all crucial unit strings
When character string, corresponding with urtext information converting text information is generated, and described in showing in preset display area
Converting text information;
Specifically, the generation display module 40, specifically for when the last one crucial unit in the unit array
When character string is converted to corresponding conversion key unit string, all the elements in the unit array are determined as the original
The corresponding converting text information of beginning text information, and the converting text information is shown in preset display area;
Optionally, the display module 40 that generates can also be specifically used for receiving the idsplay order for carrying default display format,
And the idsplay order is responded, and converting text information corresponding with the urtext information is pressed in preset display area
It is shown according to the default display format;
Wherein, the default display format includes: formatting styles, horizontally-arranged pattern and compression pattern;The compression pattern
It is the display mode that the converting text information is split and shown line by line by the display width based on the display area
Wherein, the specific implementation for generating display module 40 can be found in embodiment corresponding to above-mentioned Fig. 1 to step
Description in embodiment corresponding to the description of rapid S103 and above-mentioned Fig. 3 to step S308, will no longer repeat here.
It can be seen that data conversion device 1 passes through first obtains urtext information, and detecting the urtext
There are when at least one crucial unit string in information, selection target is crucial at least one described crucial unit string
Unit string;Secondly, according to preset conversion formula by the numerical value conversion to be converted in the target critical unit string
It for target value corresponding with target unit, and is described by the Conversion of measurement unit to be converted in the target critical unit string
Target unit obtains the crucial unit string of the corresponding conversion of the target critical unit string;Then, when all crucial single
When position character string is converted into corresponding conversion key unit string, conversion text corresponding with the urtext information is generated
This information, and the converting text information is shown in preset display area.As it can be seen that the present invention is by detecting crucial unit character
String, may be implemented the automatic conversion to target critical unit string, it is equally possible that all in urtext information
Crucial unit string carries out automatic conversion, so that the Batch conversion to multiple data can be realized, i.e., in crucial unit string
Conversion process in, replaced manually without user, so as to improve data conversion efficiency, and improve development efficiency.
Further, Fig. 9 is referred to, is the structural representation of another data conversion device provided in an embodiment of the present invention
Figure.As shown in figure 9, the data conversion device 1000 can be applied to the compiling terminal in above-mentioned Fig. 1 corresponding embodiment, it is described
Data conversion device 1000 may include: processor 1001 and memory 1005, in addition, the data conversion device 1000 may be used also
To include: network interface 1004, user interface 1003 and at least one communication bus 1002.Wherein, communication bus 1002 is used for
Realize the connection communication between these components.Wherein, user interface 1003 may include display screen (Display), keyboard
(Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 is optional
May include standard wireline interface and wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory,
It is also possible to non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.Memory
1005 optionally can also be that at least one is located remotely from the storage device of aforementioned processor 1001.As shown in figure 9, as one kind
It may include operating system, network communication module, Subscriber Interface Module SIM in the memory 1005 of computer storage medium and set
Standby control application program.
In data conversion device 1000 shown in Fig. 9, network interface 1004 can provide network communication function;And user connects
Mouth 1003 is mainly used for providing the interface of input for user;And processor 1001 can be used for calling and store in memory 1005
Equipment controls application program, to realize:
Urtext information is obtained, and there are at least one crucial unit characters in detecting the urtext information
When string, the selection target key unit string at least one described crucial unit string;
It is and target by the numerical value conversion to be converted in the target critical unit string according to preset conversion formula
The corresponding target value of unit, and be the target list by the Conversion of measurement unit to be converted in the target critical unit string
Position obtains the crucial unit string of the corresponding conversion of the target critical unit string;
When all crucial unit strings are converted into the crucial unit string of corresponding conversion, generation with it is described original
The corresponding converting text information of text information, and the converting text information is shown in preset display area.
In one embodiment, the processor 1001 described closes the target according to preset conversion formula executing
Numerical value conversion to be converted in key unit string is target value corresponding with target unit, and by the target critical unit
Conversion of measurement unit to be converted in character string is the target unit, obtains the corresponding conversion of the target critical unit string and closes
When key unit string, following steps are specifically executed:
The urtext information is determined as text information to be processed, and the text information to be processed is added to list
In bit array;
The text information to be processed in the unit array is divided into based on the target critical unit string
Preamble text information, target critical unit string and postorder text information;
It will be to be converted in the target critical unit string in the unit array according to preset conversion formula
Numerical value conversion is target value corresponding with target unit, and the unit to be converted in the target critical unit string is turned
It is changed to the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;
By the conversion key unit string, the preamble text information and the postorder in the unit array
Text information is determined as new text information to be processed, and next crucial unit character is searched in the postorder text information
String, to be determined as new target critical unit string, in order to continue based on the new target critical unit string pair
The new text information to be processed in the unit array is divided and is converted.
In one embodiment, the processor 1001 execute it is described when all crucial unit strings are converted into pair
When the conversion key unit string answered, converting text information corresponding with the urtext information is generated, and preset
When display area shows the converting text information, following steps are specifically executed:
When the last one crucial unit string in the unit array is converted to the crucial unit character of corresponding conversion
When string, all the elements in the unit array are determined as the corresponding converting text information of the urtext information, and
Preset display area shows the converting text information.
In one embodiment, the processor 1001 execute it is described according to preset conversion formula by the units
When the numerical value conversion to be converted in the target critical unit string in group is target value corresponding with target unit, tool
Body executes following steps:
Obtain preset design original text width, and by the target critical unit string in the unit array to
Transforming numerical and the input value of the design original text width as the conversion formula, and by conversion formula output with it is described
The corresponding target value of target unit;
Wherein, when the target unit is first object unit, the conversion formula are as follows: (numerical value * (750/ to be converted
Design original text width) * a)+first object unit;
When the target unit is the second target unit, the conversion formula are as follows: ((design original text is wide by numerical value * to be converted
Degree/750) * a) the+the second target unit;
Wherein, a is preset scale factor.
In one embodiment, the processor 1001 described exists in detecting the urtext information executing
When at least one crucial unit string, the selection target key unit string at least one described crucial unit string
When, specifically execute following steps:
The data conversion request for carrying unit to be converted is received, and is obtained with described according to the data conversion request wait turn
Change the corresponding regular expression of unit;
According to the regular expression, search whether exist and the unit pair to be converted in the urtext information
The crucial unit string of at least one answered;
At least one crucial unit string corresponding with the unit to be converted if it exists, then at least one described pass
Selection target key unit string in key unit string.
In one embodiment, the processor 1001 described show that the conversion is literary in preset display area executing
When this information, following steps are specifically executed:
Receive the idsplay order for carrying default display format;
The idsplay order is responded, and will converting text corresponding with the urtext information in preset display area
Information is shown according to the default display format;
Wherein, the default display format includes: formatting styles, horizontally-arranged pattern and compression pattern;The compression pattern
It is the display mode that the converting text information is split and shown line by line by the display width based on the display area.
It can be seen that the data conversion device 1000 passes through first obtains urtext information, and described detecting
There are when at least one crucial unit string in urtext information, selected at least one described crucial unit string
Target critical unit string;Secondly, will be to be converted in the target critical unit string according to preset conversion formula
Numerical value conversion is target value corresponding with target unit, and the unit to be converted in the target critical unit string is turned
It is changed to the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;Then, work as institute
When thering is crucial unit string to be converted into corresponding conversion key unit string, generate corresponding with the urtext information
Converting text information, and show the converting text information in preset display area.As it can be seen that the present invention is crucial by detection
The automatic conversion to target critical unit string may be implemented in unit string, it is equally possible that urtext information
In all crucial unit strings carry out automatic conversions, so that the Batch conversion to multiple data can be realized, i.e., crucial single
In the conversion process of position character string, is replaced without user, so as to improve data conversion efficiency, and improved out manually
Send out efficiency.
In addition, it need to be noted that: the embodiment of the invention also provides a kind of computer storage medium, and the meter
Computer program performed by the data conversion device 1 being mentioned above, and the computer journey are stored in calculation machine storage medium
Sequence includes program instruction, when the processor executes described program instruction, is able to carry out the corresponding implementation of Fig. 1 above or Fig. 3
Therefore description in example to the data transfer device will be repeated no longer here.In addition, having to using same procedure
Beneficial effect description, is also no longer repeated.For undisclosed skill in computer storage medium embodiment according to the present invention
Art details please refers to the description of embodiment of the present invention method.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.
Claims (14)
1. a kind of data transfer device characterized by comprising
Urtext information is obtained, and there are at least one crucial unit strings in detecting the urtext information
When, the selection target key unit string at least one described crucial unit string;The target critical unit character
In unit array, the unit array includes the preamble text information marked off based on the urtext information, institute for displacement
State target critical unit string and postorder text information;
It is and target unit by the numerical value conversion to be converted in the target critical unit string according to preset conversion formula
Corresponding target value, and be the target unit by the Conversion of measurement unit to be converted in the target critical unit string, it obtains
To the crucial unit string of the corresponding conversion of the target critical unit string;The content update of the unit array is described
Preamble text information, the crucial unit string of the conversion and the postorder text information, in order to unit in the updated
Next crucial unit string is searched in the postorder text information in array, to be determined as new target critical unit word
Symbol string;The new target critical unit string is used to for the updated unit array being divided into the new target and closes
Key unit string, new preamble text information and new postorder text information;The content of the updated unit array
It will continue to be updated to the crucial unit string of new conversion, the new preamble text information and the new postorder subsequent
Text information;
When all crucial unit strings are converted into corresponding conversion key unit string, generate and the urtext
The corresponding converting text information of information, and the converting text information is shown in preset display area.
2. the method according to claim 1, wherein it is described according to preset conversion formula by the target critical
Numerical value conversion to be converted in unit string is target value corresponding with target unit, and by the target critical unit word
Conversion of measurement unit to be converted in symbol string is the target unit, and it is crucial to obtain the corresponding conversion of the target critical unit string
Unit string, comprising:
The urtext information is determined as text information to be processed, and the text information to be processed is added to units
In group;
The text information to be processed in the unit array is divided into preamble based on the target critical unit string
Text information, target critical unit string and postorder text information;
According to preset conversion formula by the numerical value to be converted in the target critical unit string in the unit array
Target value corresponding with the target unit is converted to, and the unit to be converted in the target critical unit string is turned
It is changed to the target unit, obtains the crucial unit string of the corresponding conversion of the target critical unit string;
By the conversion key unit string, the preamble text information and the postorder text in the unit array
Information is determined as new text information to be processed, and next crucial unit string is searched in the postorder text information,
To be determined as the new target critical unit string, in order to continue based on the new target critical unit string pair
The new text information to be processed in the unit array is divided and is converted.
3. according to the method described in claim 2, it is characterized in that, described when all crucial unit strings are converted into correspondence
Conversion key unit string when, generate corresponding with urtext information converting text information, and show preset
Show that region shows the converting text information, comprising:
When the last one crucial unit string in the unit array is converted to corresponding conversion key unit string,
All the elements in the unit array are determined as the corresponding converting text information of the urtext information, and preset
Display area shows the converting text information.
4. according to the method described in claim 2, it is characterized in that, it is described according to preset conversion formula by the unit array
In the target critical unit string in numerical value conversion to be converted be target value corresponding with target unit, comprising:
Preset design original text width is obtained, and will be to be converted in the target critical unit string in the unit array
The input value of numerical value and the design original text width as the conversion formula, and pass through conversion formula output and the target
The corresponding target value of unit;
Wherein, when the target unit is first object unit, the conversion formula are as follows: (numerical value * (750/ design to be converted
Original text width) * a)+first object unit;
When the target unit is the second target unit, the conversion formula are as follows: (numerical value * to be converted (design original text width/
750) * a) the+the second target unit;
Wherein, a is preset scale factor.
5. the method according to claim 1, wherein described exist extremely in detecting the urtext information
When a few crucial unit string, the selection target key unit string at least one described crucial unit string,
Include:
The data conversion request for carrying unit to be converted is received, and is obtained and the list to be converted according to the data conversion request
The corresponding regular expression in position;
According to the regular expression, search whether to exist in the urtext information corresponding with the unit to be converted
At least one crucial unit string;
At least one crucial unit string corresponding with the unit to be converted if it exists, then at least one described crucial list
Selection target key unit string in the character string of position.
6. the method according to claim 1, wherein described show the converting text in preset display area
Information, comprising:
Receive the idsplay order for carrying default display format;
The idsplay order is responded, and will converting text information corresponding with the urtext information in preset display area
It is shown according to the default display format;
Wherein, the default display format includes: formatting styles, horizontally-arranged pattern and compression pattern;The compression pattern is base
The display mode that the converting text information is split and shown line by line by the display width in the display area.
7. a kind of data conversion device characterized by comprising
Text obtains module, for obtaining urtext information;
Detect and select module, in detecting the urtext information there are when at least one crucial unit string,
The selection target key unit string at least one described crucial unit string;The target critical unit character displacement
In unit array, the unit array includes preamble text information, the mesh marked off based on the urtext information
Mark crucial unit string and postorder text information;
Calculate conversion module, for according to preset conversion formula by the numerical value to be converted in the target critical unit string
Target value corresponding with target unit is converted to, and is by the Conversion of measurement unit to be converted in the target critical unit string
The target unit obtains the crucial unit string of the corresponding conversion of the target critical unit string;The unit array
Content update be the preamble text information, the conversion key unit string and postorder text information, so as to
Next crucial unit string is searched in the postorder text information in unit array in the updated, it is new to be determined as
Target critical unit string;The new target critical unit string is used to divide the updated unit array
For the new target critical unit string, new preamble text information and new postorder text information;After the update
The content of unit array will continue to be updated to new conversion crucial unit string, the new preamble text information subsequent
And the new postorder text information;
Display module is generated, for when all crucial unit strings are converted into corresponding conversion key unit string,
Converting text information corresponding with the urtext information is generated, and shows the converting text letter in preset display area
Breath.
8. device according to claim 7, which is characterized in that the calculating conversion module, comprising:
Text information adding unit, for the urtext information to be determined as text information to be processed, and by described wait locate
Reason text information is added in unit array;
Text information division unit, for based on the target critical unit string by described in the unit array wait locate
Reason text information is divided into preamble text information, target critical unit string and postorder text information;
Target character converting unit, for according to preset conversion formula by the target critical unit in the unit array
Numerical value conversion to be converted in character string is target value corresponding with the target unit, and by the target critical unit word
Conversion of measurement unit to be converted in symbol string is the target unit, and it is crucial to obtain the corresponding conversion of the target critical unit string
Unit string;
Searching unit is determined, for by the conversion key unit string in the unit array, the preamble text envelope
Breath and the postorder text information are determined as new text information to be processed, and search in the postorder text information next
A key unit string, to be determined as the new target critical unit string, and it is single to notify that the text information divides
The first and described target character converting unit continues based on the new target critical unit string in the unit array
The new text information to be processed is divided and is converted.
9. device according to claim 8, which is characterized in that
The generation display module is converted to pair specifically for the last one crucial unit string in the unit array
When the conversion key unit string answered, it is corresponding that all the elements in the unit array are determined as the urtext information
Converting text information, and show the converting text information in preset display area.
10. device according to claim 8, which is characterized in that
The target character converting unit, is specifically used for obtaining preset design original text width, and by the institute in the unit array
The input value of numerical value to be converted and the design original text width as the conversion formula in target critical unit string is stated, and
Target value corresponding with the target unit is exported by the conversion formula;
Wherein, when the target unit is first object unit, the conversion formula are as follows: (numerical value * (750/ design to be converted
Original text width) * a)+first object unit;
When the target unit is the second target unit, the conversion formula are as follows: (numerical value * to be converted (design original text width/
750) * a) the+the second target unit;
Wherein, a is preset scale factor.
11. device according to claim 7, which is characterized in that described to detect and select module, comprising:
Acquiring unit is received, for receiving the data conversion request for carrying unit to be converted, and according to the data conversion request
Obtain regular expression corresponding with the unit to be converted;
Key character searching unit, for searching whether exist in the urtext information according to the regular expression
At least one crucial unit string corresponding with the unit to be converted;
Target character selecting unit is used at least one crucial unit string corresponding with the unit to be converted if it exists,
The then selection target key unit string at least one described crucial unit string.
12. device according to claim 7, which is characterized in that
The generation display module, the idsplay order of default display format is carried specifically for receiving, and is responded the display and referred to
Enable, and preset display area will converting text information corresponding with the urtext information according to the default display lattice
Formula is shown;
Wherein, the default display format includes: formatting styles, horizontally-arranged pattern and compression pattern;The compression pattern is base
The display mode that the converting text information is split and shown line by line by the display width in the display area.
13. a kind of data conversion device characterized by comprising processor and memory;
The processor is connected with memory, wherein the memory is for storing program code, and the processor is for calling
Said program code, to execute following operation:
Urtext information is obtained, and there are at least one crucial unit strings in detecting the urtext information
When, the selection target key unit string at least one described crucial unit string;The target critical unit character
In unit array, the unit array includes the preamble text information marked off based on the urtext information, institute for displacement
State target critical unit string and postorder text information;
It is and target unit by the numerical value conversion to be converted in the target critical unit string according to preset conversion formula
Corresponding target value, and be the target unit by the Conversion of measurement unit to be converted in the target critical unit string, it obtains
To the crucial unit string of the corresponding conversion of the target critical unit string;The content update of the unit array is described
Preamble text information, the crucial unit string of the conversion and the postorder text information, in order to unit in the updated
Next crucial unit string is searched in the postorder text information in array, to be determined as new target critical unit word
Symbol string;The new target critical unit string is used to for the updated unit array being divided into the new target and closes
Key unit string, new preamble text information and new postorder text information;The content of the updated unit array
It will continue to be updated to the crucial unit string of new conversion, the new preamble text information and the new postorder subsequent
Text information;
When all crucial unit strings are converted into corresponding conversion key unit string, generate and the urtext
The corresponding converting text information of information, and the converting text information is shown in preset display area.
14. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with computer program, described
Computer program includes program instruction, is executed when the processor executes described program instruction such as any one of claim 1-6
The method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710400261.6A CN107239436B (en) | 2017-05-31 | 2017-05-31 | A kind of data transfer device and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710400261.6A CN107239436B (en) | 2017-05-31 | 2017-05-31 | A kind of data transfer device and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107239436A CN107239436A (en) | 2017-10-10 |
CN107239436B true CN107239436B (en) | 2018-12-28 |
Family
ID=59985792
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710400261.6A Active CN107239436B (en) | 2017-05-31 | 2017-05-31 | A kind of data transfer device and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107239436B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111145840B (en) * | 2019-11-20 | 2021-05-11 | 天津同阳科技发展有限公司 | Method, device and equipment for automatically unifying units of gaseous pollutants and storage medium |
CN112860255A (en) * | 2021-02-08 | 2021-05-28 | 无线生活(杭州)信息科技有限公司 | Page adaptation method and device |
CN113220754A (en) * | 2021-05-21 | 2021-08-06 | 中国农业银行股份有限公司 | Method, device, equipment, storage medium and program product for processing report data |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101968784A (en) * | 2010-10-13 | 2011-02-09 | 无锡永中软件有限公司 | Digital format conversion method and device |
CN105893335B (en) * | 2016-03-30 | 2019-07-12 | 广州华多网络科技有限公司 | The method and apparatus of display text |
-
2017
- 2017-05-31 CN CN201710400261.6A patent/CN107239436B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107239436A (en) | 2017-10-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6487597B1 (en) | Personal digital assistant and information transmission apparatus for use with the personal digital assistant | |
CN110196953A (en) | A kind of application buries point methods, device, calculates equipment and system | |
CN107239436B (en) | A kind of data transfer device and device | |
CN109727298A (en) | Poster generation method, device, equipment and computer storage medium | |
CN110515951B (en) | BOM standardization method and system, electronic device and storage medium | |
CN101582030A (en) | Method and system for realizing dynamically adjusting displaying of toolbar button | |
CN108399072A (en) | Five application page update method and device | |
CN105549847B (en) | A kind of image display method and user terminal at playback of songs interface | |
CN111832449A (en) | Engineering drawing display method and related device | |
CN109710631A (en) | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code | |
CN110580189A (en) | method and device for generating front-end page, computer equipment and storage medium | |
CN102141868A (en) | Method for quickly operating information interaction page, input method system and browser plug-in | |
KR20140039517A (en) | Device and method implementing for particular function based on writing | |
JP2021197153A (en) | Method and apparatus for recognizing word slot, electronic apparatus, storage medium and computer program | |
US11531814B2 (en) | Method and device for generating modified statement | |
CN109597482B (en) | Automatic page turning method and device for electronic book, medium and electronic equipment | |
US20210397646A1 (en) | Method, electronic device, and storage medium for processing visual data of deep model | |
CN113779269A (en) | Power grid load data display method and device, electronic equipment and storage medium | |
CN113836877A (en) | Text labeling method, device, equipment and storage medium | |
CN109614592B (en) | Text processing method and device, storage medium and electronic equipment | |
CN115543324B (en) | Method, device, equipment and medium for generating interactive interface | |
CN113283231B (en) | Method for acquiring signature bit, setting system, signature system and storage medium | |
CN113238686B (en) | Document processing method and device and electronic equipment | |
CN114579759A (en) | Knowledge graph display method and device combining RPA and AI, terminal and storage medium | |
CN113778455A (en) | Code conversion method and device, electronic equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |