Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Text truncating method, text uploading method, text truncating device, and text uploading device

A truncation device and text technology, applied in the computer field, can solve the problems of truncation of garbled characters, loss of uploaded text information, and increased server burden, and achieve the effect of reducing the burden.

Inactive Publication Date: 2016-08-24
LETV HLDG BEIJING CO LTD +1
View PDF5 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, when there are too many bytes of text locally, it will take more time to upload the text to the server, but the network may be unstable, especially for mobile terminals uploading via mobile network When uploading text, this kind of network instability will be more serious. If the upload is interrupted in the middle, it needs to be uploaded again, which will increase the burden on the server
[0003] A current solution is to truncate the local text into several smaller files and upload them separately. For example, the local file can be truncated into several smaller files by 5000 bytes, but Chinese characters occupy 2 bytes, and foreign characters Occupies 1 byte. If it is simply segmented every 5000 bytes, when Chinese characters occupy the 5000th and 5001th bytes, the truncation will produce garbled characters in this case, which will cause the uploaded text information to be lost

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Text truncating method, text uploading method, text truncating device, and text uploading device
  • Text truncating method, text uploading method, text truncating device, and text uploading device
  • Text truncating method, text uploading method, text truncating device, and text uploading device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0023] The embodiment of the present invention provides a text truncation method, such as figure 1 As shown, the method includes the following steps:

[0024] S11. Determine whether the number of bytes occupied by the text to be truncated is greater than the preset number of bytes to be truncated. When the number of bytes occupied by the text to be truncated is less than or equal to the number of bytes to be truncated, there is no need to truncate, and the truncation ends; When the number of bytes occupied by the truncated text is greater than the preset number of truncated bytes, go to step S12. Here, the text includes Chinese characters and foreign characters, wherein the Chinese characters occupy 2 bytes, and the foreign characters occupy 1 byte.

[0025] S12. Convert the text to be truncated into a byte array in the Chinese character coded characte...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a text truncating method, a text uploading method, a text truncating device, and a text uploading device, and relates to the technical field of computer. The text truncating method comprises the following steps: judging whether the number of bytes occupied by a text to be truncated is greater than a preset truncated byte number; when the number of bytes occupied by the text to be truncated is greater than the preset truncated byte number, converting the text to be truncated into a byte array in a Chinese ideogram coded character set; intercepting bytes, the number of which is one more than the preset truncated byte number, from the byte array; converting the intercepted byte array back to a text; and cutting out the last character of the text to get a truncated text. Thus, a text can be quickly and efficiently truncated into a plurality of small texts occupying characters, the number of which is equal to or slightly smaller than a preset truncated byte number, and no messy code is generated.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a text truncation and uploading method and device. Background technique [0002] In the Internet age, people are used to uploading the text edited locally to the server for backup to avoid text loss. However, when there are too many bytes of text locally, it will take more time to upload the text to the server, but the network may be unstable, especially for mobile terminals uploading via mobile network When uploading text, this network instability will be even more serious. If the upload is interrupted in the middle, it needs to be uploaded again, which will increase the burden on the server. [0003] A current solution is to truncate the local text into several smaller files and upload them separately. For example, the local file can be truncated into several smaller files by 5000 bytes, but Chinese characters occupy 2 bytes, and foreign characters Occupies 1 byte. If it is...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): H04L29/08
CPCH04L67/06H04L67/108H04L65/40
Inventor 李树鹏
Owner LETV HLDG BEIJING CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products